[FFmpeg-devel] [PATCH] movenc: Try to extract extradata from the first H264/HEVC packet, if none is set
James Almer
jamrial at gmail.com
Wed May 20 00:29:18 EEST 2020
On 5/19/2020 5:57 PM, Martin Storsjö wrote:
> Some encoders don't provide split out extradata directly on init (or
> at all). In particular, the MediaFoundation encoder wrapper doesn't
> always (depending on the actual encoder device) - this is the case for
> Qualcomm's HEVC encoder on SD835, and also on some QSV H264 encoders).
>
> This only works for cases where the moov hasn't already been written
> (e.g. when not writing fragmented mp4 with empty_moov, unless using
> the delay_moov option).
> ---
> libavformat/avc.c | 41 ++++++++++++++++++++++++++++++++++
> libavformat/avc.h | 3 +++
> libavformat/hevc.c | 52 ++++++++++++++++++++++++++++++++++++--------
> libavformat/hevc.h | 16 ++++++++++++++
> libavformat/movenc.c | 11 ++++++++++
> 5 files changed, 114 insertions(+), 9 deletions(-)
Wouldn't copying the first packet into trk->vos_data, like it's done
with dnxhd, truehd and ac3 in ff_mov_write_packet(), work for these
codecs as well?
See
https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/movenc.c;h=32e81092687439c8b91e918bb614654a5c6670d8;hb=HEAD#l5585
More information about the ffmpeg-devel
mailing list