[FFmpeg-user] Mulitple output files from one -map?
Jonathan Viney
jonathan.viney at gmail.com
Thu Aug 27 01:58:38 CEST 2015
>> Is that the best way to do this or can -map be used somehow? Would the
>> split filter potentially be doing extra frame copies unnecessarily?
>> I'm using current ffmpeg head.
>
> No, that's not the best way. Don't worry about the frame copies - it's
> the encodes that gobble up your CPU.
>
> You're looking for the "tee" muxer:
> https://www.ffmpeg.org/ffmpeg-formats.html#tee
>
> "The tee muxer can be used to write the same data to several files or
> any other kind of muxer. It can be used, for example, to both stream
> a video to the network and save it to disk at the same time.
>
> It is different from specifying several outputs to the ffmpeg
> command-line tool because the audio and video data will be encoded
> only once with the tee muxer; encoding can be a very expensive
> process."
>
> ffmpeg -i input1.mkv -i input2.mkv -filter_complex
> "myfilter[output1][output2]" -map "[output1]" -f null /dev/null -map
> "[output2]" -y -f tee "high.mp4|medium.mp4|low.mp4"
>
>
> (I think you now need to add "-c:v foo -c:a bar", as it seems that
> using the tee muxer requires you to explicitly map input streams, and
> to explicitly give encoding options, as ffmpeg can't determine
> defaults.)
Thanks Moritz. The tee muxer looks interesting, but doesn't allow you
specify different encoding options for each output (eg: different
quality or bitrate) - correct?
I think in that case I may need to stick with the split filter so each
output can be customised.
Thanks,
-Jonathan.
More information about the ffmpeg-user
mailing list