FFmpeg: Set AV_CODEC_FLAG_GLOBAL_HEADER when required by muxer


Some encoders (e.g. libsvtav1) only emit extradata, such as the AV1
sequence header, when AV_CODEC_FLAG_GLOBAL_HEADER is set on the codec
context. Without it, extradata stays empty, and muxers that need it
upfront to build codec-private data (e.g. Matroska/WebM for AV1) can
fail or write corrupt files while packets are silently dropped.

Set the flag whenever the output format declares AVFMT_GLOBALHEADER,
matching what the ffmpeg CLI itself does in ffmpeg_mux_init.c.

Pick-to: 6.12
Change-Id: Id534d7fa1b667b84c2a3156a25de1e498e32d304
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
commit7f411dfa3c0769e4dd9ecd52a23377dbba3b2633
parent03a1d1368ffe963c78a37bad8944c7eab5836253
authorTim Blechmann <tim.blechmann@qt.io>
committerTim Blechmann <tim.blechmann@qt.io>
commit timeTue, 8 Sep 2026 11:15:37 +0000