Hi everybody,
I was wondering this day, how to combine audio and video file to multiple outputs formats using FFMPEG.
I’ve searched a long on Google with no results, so I thought by myself and have found the solution, it’s very simple to use.
All you have to do is add outputs to your convert command, and it’s done.
By example, let’s try to convert wav and webm input into mp4, we’ll proceed as this:
ffmpeg -i input.webm -i input.wav -map 0:0 -map 1:0 output.mp4
Good, now when it comes to add multiple outputs, it is not more difficult, we only have to add new outputs at the suit.
By example, let’s try to add “avi and ogg” formats.
This is the result
ffmpeg -i input.webm -i input.wav -map 0:0 -map 1:0 output.mp4 output.ogg output.avi
Perfect !
But some formats will need specific codecs in order to work, like “FLV”.
To make it work you only have to specify the corresponding codecs before the output, like this.
ffmpeg -i input.webm -i input.wav -map 0:0 -map 1:0 output.mp4 output.ogg output.avi -c:a libmp3lame -ar 44100 -c:v libx264 output.flv
And for linux users
ffmpeg -i input.webm -i input.wav -map 0:0 -map 1:0 -strict experimental output.ogg -strict experimental output.mp4 -c:a libmp3lame -ar 44100 -c:v libx264 -strict experimental output.flv
Congratulations, the job is done, you’re a hero.
Hope it will help you.