[FFmpeg-devel] [RFC] lavf/tee per-output stream selection

Stefano Sabatini stefasab at gmail.com
Wed Jul 17 21:30:11 CEST 2013


I need to be be able to send different streams to different tee
outputs- In other words I need to select which streams should be
routed to each tee output, while right now it is possible to specify
the streams just once, and they will be the same for every output.

This allows to create outputs with different streams, while avoiding
duplicated encoding and the need to run different processes
communicating through pipes.

A possible design would involve a syntax like this:
ffmpeg -i INPUT -c:v libx264 -c:a libvo-aacenc -tee_select "v|a" -f tee "out-v.ts|out-a.ts|out-av.ts"

This would select the streams for each output, the non-matching
streams won't be added to the corresponding output, and the
corresponding packets will be ignored. This requires some somehow
complex changes to the tee logic, but won't affect the rest of the

At some point it would be nice to make possible to select streams on
the base of their metadata (e.g. to select only streams in a certain
language) using stream selection, but I can devise a simple syntax,
not involving demonic escaping issues.

Comments are welcome, especially from the maintainer of the tee
virtual muxer.
FFmpeg = Fanciful and Fiendish Minimalistic Patchable Exciting Game

More information about the ffmpeg-devel mailing list