]> git.sesse.net Git - ffmpeg/commit
movenc: Use first H264/HEVC frame as extradata, if it is missing
authorMartin Storsjö <martin@martin.st>
Fri, 8 May 2020 11:21:32 +0000 (14:21 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 20 May 2020 19:55:00 +0000 (22:55 +0300)
commit9f891d0b4b584bc061808bfab35ffe9810d3bc77
treee0b0fb505b2b2e6ff9c69c7fc2b0cc09607b436e
parentcd0771c38c06ef397466123c6c85521835f98bfd
movenc: Use first H264/HEVC frame as extradata, if it is missing

Sticking a full frame in the extradata works, as the code for writing
the avcC/hvcC extracts the relevant parameter set NAL units - provided
that they actually exist in the frame.

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).

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc.c