| 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 | |
| | 44 | The 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 | {{{ |
| | 47 | ffmpeg -i input.file -c:v libx264 -c:a mp2 \ |
| | 48 | -f tee "output.mkv|[f=mpegts]udp://10.0.1.255:1234/" |
| | 49 | }}} |
| | 50 | |
| | 51 | The 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 | |
| | 55 | Older 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. |