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>