Leszek Pachura
Leszek Pachura

Reputation: 589

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!

Upvotes: 10

Views: 7370

Answers (1)

aergistal
aergistal

Reputation: 31209

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.

Upvotes: 8

Related Questions