A Batch File to Process Multiple FFmpeg Commands

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
raywood
Posts: 11
Joined: 20 Jan 2020 20:28

A Batch File to Process Multiple FFmpeg Commands

#1 Post by raywood » 15 Jun 2021 17:22

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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: A Batch File to Process Multiple FFmpeg Commands

#2 Post by Squashman » 15 Jun 2021 22:32

Your code as posted will run only one at a time in a batch file.

Post Reply