Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFmpeg: what does the "global_header" flag do?

According to the description, it places global headers in extradata instead of every keyframe.

But what's the actual purpose? Is it useful e.g. for streaming?

I guess that the resulting video file will be marginally shorter, but more prone to corruption (no redundancy = file unplayable if main header corrupted or only partially downloaded)?

Or maybe it somehow improves decoding a little bit? As headers are truly global and cannot change from keyframe to keyframe?

Thanks!

like image 663
Leszek Pachura Avatar asked Jun 21 '17 11:06

Leszek Pachura


1 Answers

By extradata FFmpeg means out-of-band, as opposed to in-band. The behavior of the flag is format specific. This is useful for headers that are not expected to change because it reduces the overhead.

Example: for H.264 in MP4 the SPS and PPS are stored in the avcC atom. For the same H.264 stream in let's say MPEG-TS the sequences are repeated in the bitstream.

like image 148
aergistal Avatar answered Oct 17 '22 10:10

aergistal