Skip to content
Snippets Groups Projects
Commit 35e9d9cb authored by James Almer's avatar James Almer
Browse files

avformat/dashenc: fix writing the AV1 codec string in mp4 mode

From https://aomediacodec.github.io/av1-isobmff/#codecsparam

, the parameters
sample entry 4CC, profile, level, tier, and bitDepth are all mandatory fields.
All the other fields are optional, mutually inclusive (all or none).

Fixes ticket #8049

Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
(cherry picked from commit 1cf2f040)
parent d1c81070
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "libavutil/time.h" #include "libavutil/time.h"
#include "libavutil/time_internal.h" #include "libavutil/time_internal.h"
#include "av1.h"
#include "avc.h" #include "avc.h"
#include "avformat.h" #include "avformat.h"
#include "avio_internal.h" #include "avio_internal.h"
...@@ -385,6 +386,21 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par, ...@@ -385,6 +386,21 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par,
av_strlcatf(str, size, ".%02x%02x%02x", av_strlcatf(str, size, ".%02x%02x%02x",
extradata[1], extradata[2], extradata[3]); extradata[1], extradata[2], extradata[3]);
av_free(tmpbuf); av_free(tmpbuf);
} else if (!strcmp(str, "av01")) {
AV1SequenceParameters seq;
if (!par->extradata_size)
return;
if (ff_av1_parse_seq_header(&seq, par->extradata, par->extradata_size) < 0)
return;
av_strlcatf(str, size, ".%01u.%02u%s.%02u",
seq.profile, seq.level, seq.tier ? "H" : "M", seq.bitdepth);
if (seq.color_description_present_flag)
av_strlcatf(str, size, ".%01u.%01u%01u%01u.%02u.%02u.%02u.%01u",
seq.monochrome,
seq.chroma_subsampling_x, seq.chroma_subsampling_y, seq.chroma_sample_position,
seq.color_primaries, seq.transfer_characteristics, seq.matrix_coefficients,
seq.color_range);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment