Page 1 of 1

A Batch File to Process Multiple FFmpeg Commands

Posted: 15 Jun 2021 17:22
by raywood
I have a batch file that contains multiple FFmpeg commands, like these:

Code: Select all

ffmpeg -i input.mpg -ss 00:00:00 -to 00:01:29 -c:v copy -c:a copy output1.mp4
ffmpeg -i input.mpg -ss 00:01:29 -to 00:02:43 -c:v copy -c:a copy output2.mp4
I would like to run these commands one at a time, not proceeding with the next one until the previous one finishes.

It seems like && should suffice for that, but there are too many of these commands to put them all on one line.

I have tried using start /w and call to run one ffmpeg command, but for some reason this triggers a seemingly endless cascade of new windows, each apparently trying to run one part of the ffmpeg command.

If I run just one ffmpeg command at a time, manually, they work OK. I guess I could add something like && pause after each ffmpeg command, but then I'd have to sit there for many hours while all these ffmpeg commands ran.

Re: A Batch File to Process Multiple FFmpeg Commands

Posted: 15 Jun 2021 22:32
by Squashman
Your code as posted will run only one at a time in a batch file.