Changes between Version 13 and Version 14 of EncodingForStreamingSites
- Timestamp:
- Oct 29, 2020, 5:16:10 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EncodingForStreamingSites
v13 v14 142 142 You can use the [https://ffmpeg.org/ffmpeg-formats.html#tee-1 tee muxer] to efficiently stream to multiple sites and save a local copy if desired. Using tee will allow you to encode only once and send the same data to multiple outputs. Using the `onfail` option will allow the other streams to continue if one fails. 143 143 144 Note: Since ffmpeg has a 'different relationship' with each rtmp server, the long-term headers need to be "out of band" at the container level inthe "extradata". This is achieved with the global_header flag which very likely will be necessary based upon your encoding options as documented below. 145 144 146 {{{ 145 $ ffmpeg -i input -map 0 -c:v libx264 -c:a aac -b:v 1000k -maxrate 1000k -bufsize 2000k -g 50 -f tee \147 $ ffmpeg -i input -map 0 -c:v libx264 -c:a aac -b:v 1000k -maxrate 1000k -bufsize 2000k -g 50 -flags +global_header -f tee \ 146 148 "[f=flv:onfail=ignore]rtmp://facebook|[f=flv:onfail=ignore]rtmp://youtube|local_file.mkv" 147 149 }}} … … 149 151 Some encoders may need different options depending on the output format; the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified. The main example is the '''global_header''' flag. 150 152 {{{ 151 $ ffmpeg -i input -map 0 -flags +global_header -c:v libx264 -c:a aac -b:v 1000k -maxrate 1000k -bufsize 2000k -g 50 -f tee \153 $ ffmpeg -i input -map 0 -flags +global_header -c:v libx264 -c:a aac -b:v 1000k -maxrate 1000k -bufsize 2000k -g 50 -flags +global_header -f tee \ 152 154 "[f=flv:onfail=ignore]rtmp://facebook|[f=flv:onfail=ignore]rtmp://youtube|local_file.mkv" 153 155 }}}
