Sky Moon
Sky Moon

Reputation: 21

how to combine several video random any one to create 1 new video? using ffmpeg?

how to combine several video random any one to create 1 new video? for example, I have 10 videos: 01.mp4; 02.mp4 ... 10.mp4 I want to combine random 5 of them to create 1 video example: (01.mp4+ 03.mp4+ 04.mp4+ 06.mp4 + 08.mp4) = 1 new video

(02.mp4+ 04.mp4+ 05.mp4+ 06.mp4 + 09.mp4) = 1 new video

Similar: random combination of 50 videos of 1000 videos to create 1 new video?

Upvotes: 0

Views: 1373

Answers (1)

Gyan
Gyan

Reputation: 92938

First, create a text file with list of videos

file '02.mp4'
file '04.mp4'
file '05.mp4'
file '08.mp4'

If the files have the same properties, run

ffmpeg -f concat -i list.txt -c copy new.mp4

If not,

ffmpeg -f concat -i list.txt -r 30 -vf scale=W:H,setsar=1 -ac 2 -ar 48k new.mp4

Upvotes: 1

Related Questions