Log in

View Full Version : Concatenating 2 passes in FFmpeg : OS dependency


Klagar
14th October 2010, 17:49
Hi !

Just a quick question because at the moment I don't have the material to test it out myself...

I learned that it is possible, in FFmpeg, to run many encodings in a single command line. Example taken from this site (http://forums.creativecow.net/readpost/291/70) :
ffmpeg -i fluid8.mov -y out1.mp4 && ffmpeg -i fluid8.mov -y out2.avi && ffmpeg -i fluid8.mov -y out3.flv && ffmpeg -i fluid8.mov -y out4.mov

So the "&&" separator does that. Now my question is : will it work the same on any OS, or is it a Windows-only syntax ?

Regards.

nm
14th October 2010, 18:12
"&&" is the same on Unix/Linux. The following command is only run when the previous command ends successfully (returns a zero exit code). If you want all the commands to run one after another regardless of their exit status, use "&" with cmd.exe and ";" on Unix/Linux (where "&" would make the previous command run in background).

Klagar
14th October 2010, 18:50
Great ! Thanks a lot ! :)

Reimar
14th October 2010, 20:57
"&&" is the same on Unix/Linux. The following command is only run when the previous command ends successfully (returns a zero exit code). If you want all the commands to run one after another regardless of their exit status, use "&" with cmd.exe and ";" on Unix/Linux (where "&" would make the previous command run in background).

I feel pedantic: it only depends on the shell, not the OS. So if you want to make sure you have the same behaviour, use e.g. bash (e.g. from MinGW or Cygwin) on Windows. Even the Powershell seems to use ";" to separate commands, however the & seems to be misused for something else (though possibly only at a start of a command).