Changes between Version 13 and Version 14 of EncodingForStreamingSites


Ignore:
Timestamp:
Oct 29, 2020, 7:16:10 AM (5 months ago)
Author:
kristopolous
Comment:

updating the multiple -f tee rtmp examples with the disclaimer about extradata headers with the +global_header flag.

Legend:

Unmodified
Added
Removed
Modified
  • EncodingForStreamingSites

    v13 v14  
    142142You 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.
    143143
     144Note: 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
    144146{{{
    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 \
    146148"[f=flv:onfail=ignore]rtmp://facebook|[f=flv:onfail=ignore]rtmp://youtube|local_file.mkv"
    147149}}}
     
    149151Some 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.
    150152{{{
    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 \
    152154"[f=flv:onfail=ignore]rtmp://facebook|[f=flv:onfail=ignore]rtmp://youtube|local_file.mkv"
    153155}}}