From 9aed7383bd22b470c1b556d0d968af44df62e322 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 31 Jul 2025 21:12:55 -0300 Subject: [PATCH] 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 --- libavformat/movenc.c | 4 ++++ 1 file changed, 4 insertions(+) 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) {