aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2025-07-31 21:12:55 -0300
committerkierank <kieran@kunhya.com>2025-08-01 14:53:17 +0000
commit9aed7383bd22b470c1b556d0d968af44df62e322 (patch)
tree970c73b7331b8f8de63a392ab115e43a51946068
parentab73bd94a385f7cfcf0caaa1c5a534903ecacbb3 (diff)
downloadffmpeg-9aed7383bd22b470c1b556d0d968af44df62e322.tar.gz
avformat/movenc: look for the Intra profile flag before assuming a stream is AVC-Intra
Fixes issue #20018. Note that Codec Descriptors are not written for all these ai** codec tags, and no considerations were ever made to ensure parameter sets are present in muxed packets. Their usage may result in unplayable files if parameter sets are only available in extradata (Default behavior for x264 encoding when combined with this muxer). Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/movenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 743d360ace..4cb91b0bbd 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1879,6 +1879,10 @@ static int mov_get_h264_codec_tag(AVFormatContext *s, MOVTrack *track)
if (!tag)
tag = MKTAG('a', 'v', 'c', 'i'); //fallback tag
+ if (track->par->profile == AV_PROFILE_UNKNOWN ||
+ !(track->par->profile & AV_PROFILE_H264_INTRA))
+ return tag;
+
if (track->par->format == AV_PIX_FMT_YUV420P10) {
if (track->par->width == 960 && track->par->height == 720) {
if (!interlaced) {