How many instances of FFmpeg commands can I run in parallel?

In answering the original question, as to why some of the jobs stop, ffmpeg on the command line is interactive. It's constantly reading input on the command line. In order for you to run all of them in the background you should change this:

ffmpeg -i input.mp4 -t 60 -f mp4 /mnt/a.mp4 > /dev/null 2>&1 &

to this:

ffmpeg -i input.mp4 -t 60 -f mp4 /mnt/a.mp4 </dev/null > /dev/null 2>&1 &

the addition of </dev/null tells ffmpeg to not look for input, and all of your jobs should run in the background.


Just a thought on your command: a much easier way of hammering the machine with a single command is concatenating everything into a single line:

ffmpeg -i input.mp4 -t 60 -f mp4 /mnt/a.mp4 \
 -f mp4 /mnt/b.mp4 \
 -f mp4 /mnt/c.mp4 \
 -f mp4 /mnt/d.mp4 \
 -f mp4 /mnt/e.mp4 \
 -f mp4 /mnt/f.mp4 \
 -f mp4 /mnt/g.mp4 \
 -f mp4  /mnt/h.mp4 > /dev/null 2>&1

You might want to add (depending on your ffmpeg version) a flag to tell the server to use all available processors

-threads 0

For reference: http://ffmpeg.org/trac/ffmpeg/wiki/Creating%20multiple%20outputs