Changes between Version 8 and Version 9 of Creating multiple outputs


Ignore:
Timestamp:
Feb 10, 2013, 1:26:38 AM (3 years ago)
Author:
evilsoup
Comment:

tee psuedo-muxer

Legend:

Unmodified
Added
Removed
Modified
  • Creating multiple outputs

    v8 v9  
    4040But, what if you want to have duplicate outputs of your encoding? For example, when you are streaming a live audio/video and want to save a duplicate of that stream into the file at the same time.  You don't want to encode twice, that wastes cpu. 
    4141 
    42 FFmpeg can also do this, using 2 piped processes, where the first process is used to encode the stream(s) and second process is used to duplicate that to several outputs. 
     42== Tee psuedo-muxer == 
     43 
     44The tee psuedo-muxer was added to ffmpeg on 2013-02-03, and allows you to duplicate the output to multiple files, on a single instance of ffmpeg. 
     45 
     46{{{ 
     47ffmpeg -i input.file -c:v libx264 -c:a mp2 \ 
     48-f tee "output.mkv|[f=mpegts]udp://10.0.1.255:1234/" 
     49}}} 
     50 
     51The above outputs an MKV file, and a UDP stream. Streams are separated by the `|` symbol. Options can be applied to an individual output: `[f=mpegts]` is equivalent to `-f mpegts` in a normal ffmpeg command-line. Multiple options can be separated with a `:`, which means that any `:` have to be escaped (so use `\:`). 
     52 
     53== Piped processes == 
     54 
     55Older versions of ffmpeg can also do this, using 2 piped processes, where the first process is used to encode the stream(s) and second process is used to duplicate that to several outputs. 
    4356{{{ 
    4457ffmpeg -i input1 -i input2 -acodec .. -vcodec .. -f mpegts - | \