Commit f26091151c for ffmpeg
commit f26091151c157664e20356a11dd28c314fa6475e
Author: Romain Beauxis <romain.beauxis@gmail.com>
Date: Mon Nov 16 20:41:24 2026 -0600
avformat/codecstring: accept the hev1 sample entry for HEVC
ISO/IEC 14496-15 gives hev1 the same codecs parameter as hvc1, under its
own name. The string was already built from the codec tag, but only for
hvc1: a stream tagged hev1 got no string.
diff --git a/libavformat/codecstring.c b/libavformat/codecstring.c
index 70609d9a23..9d2fca8432 100644
--- a/libavformat/codecstring.c
+++ b/libavformat/codecstring.c
@@ -169,7 +169,8 @@ int ff_make_codec_str(void *logctx, const AVCodecParameters *par,
}
data++;
}
- if (par->codec_tag == MKTAG('h','v','c','1') &&
+ if ((par->codec_tag == MKTAG('h','v','c','1') ||
+ par->codec_tag == MKTAG('h','e','v','1')) &&
profile != AV_PROFILE_UNKNOWN &&
profile_compatibility != AV_PROFILE_UNKNOWN &&
tier != 0 &&
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f2a26fc302..d763209ccf 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2404,8 +2404,9 @@ static int hls_write_header(AVFormatContext *s)
}
avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits, inner_st->time_base.num, inner_st->time_base.den);
if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
- outer_st->codecpar->codec_tag != MKTAG('h','v','c','1')) {
- av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you should use tag:v hvc1 to set it.\n");
+ outer_st->codecpar->codec_tag != MKTAG('h','v','c','1') &&
+ outer_st->codecpar->codec_tag != MKTAG('h','e','v','1')) {
+ av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1 or hev1, you should use tag:v hvc1 to set it.\n");
}
write_codec_attr(outer_st, vs);
diff --git a/tests/ref/fate/codecstring b/tests/ref/fate/codecstring
index 70f570e579..c3f03847b5 100644
--- a/tests/ref/fate/codecstring
+++ b/tests/ref/fate/codecstring
@@ -2,7 +2,7 @@ h264-annexb: avc1.64000b
h264-annexb-avc3: avc3.64000b
h264-avcc: avc1.64000b
hevc-annexb-hvc1: hvc1.1.6.L30.90
-hevc-annexb-hev1: error
+hevc-annexb-hev1: hev1.1.6.L30.90
hevc-annexb-untagged: error
hevc-hvcc-hvc1: error
hevc-hvcc-hev1: error