]> git.sesse.net Git - ffmpeg/commit
movenc: Fix conversion of the first frame for extradata-less H264/HEVC
authorMartin Storsjö <martin@martin.st>
Thu, 21 May 2020 11:00:14 +0000 (14:00 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 22 May 2020 18:01:44 +0000 (21:01 +0300)
commit1aec1fbcc5952e1c2f9820e032ad2e5f9bf1a670
tree23973bf0cdaadc643650b59af2ff7cda9b39a29d
parent1f7c8d319b72df1bb01b459e9cb40662c061f7df
movenc: Fix conversion of the first frame for extradata-less H264/HEVC

Move the copying of the frame to vos_data further up in the function,
so that when writing the actual frame data for the first frame, it's
clear that the stream really is in annex b format, for the cases where
we create extradata from the first frame.

Alternatively - we could invert the checks for bitstream format. If
extradata is missing, we can't pretend that the bitstream is in
mp4 form, because we can't even know the NAL unit length prefix size
in that case.

Also avoid creating extradata for AVC intra. If the track tag is
an AVC intra tag, don't copy the frame into vos_data - this matches
other existing cases of how vos_data and TAG_IS_AVCI interact in
other places.

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