0

While split video using in ffmpeg in batch mode has many answers for linux users, I found this or or this useful. There are many others. One syntax may be

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 300 -f segment output%03d.mp4

In this example the video would split into 5 minute chunks in linux). But I cannot use them since in windows, %0 picks up the filename (the batchfile name containing the script). Is there anyway I can use this in windows with some modification? I want to use the script inside the batch file so that I can pass filename as argument like this...

ffmpeg -i %1 -c copy -map 0 -segment_time 300 -f segment output%03d.mp4

Currently I have settled with the following...

ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 output1.avi

ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:30:00 -t 00:30:00 output2.avi

`

Stat-R
  • 1,380

1 Answers1

0

Got the answer from this post. Just had to escape %03d with another % and thus getting

ffmpeg -i %1 -c copy -map 0 -segment_time 300 -f segment '%1~na%%03d'

Stat-R
  • 1,380