[FFmpeg-user] A query on mpegts and global headers

Gyan Doshi ffmpeg at gyani.pro
Sun Aug 30 18:11:12 EEST 2020



On 30-08-2020 06:52 pm, Dennis Mungai wrote:
> Hello there,
>
> With mpegts output, should global headers be used or not, set via -fflags
> +global_header?

No.

> And if there are exceptions to that, based on the codec type wrapped in
> mpegts, when should global headers be used for mpegts?

Global header is for formats that store codec parameters out of band 
i.e. in container metadata. Enabling the flag tells the encoder to store 
parameters in AVStream->extradata from where it is used by muxers of 
such formats. Additionally, the flag also suppresses periodic 
announcement of these parameters within the stream (in-band).

MPEG-TS has no global header since it is meant for use as a 'continuous' 
transport stream. to which clients may start listening at an arbitrary 
point. So periodic parameter set transmission is required.

When generating an output for use by a single muxer, the muxer has a 
flag which will be conveyed to the encoder automatically, so the user 
doesn't have to set anything. However in case of the tee muxer, which 
sends data to multiple muxers, some of which require global headers, the 
flag has to be manually set and periodic parameter sets reinserted using 
dump_extra for muxers such as mpegts.

Regards,
Gyan


More information about the ffmpeg-user mailing list