diff options
author | Vignesh Venkatasubramanian <vigneshv-at-google.com@ffmpeg.org> | 2023-01-04 14:16:18 -0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2023-01-13 20:03:28 +0800 |
commit | f2b175087197e983ac13e4c8c554b1b2f42612e0 (patch) | |
tree | 07a7dbb56f180515feb4ca5cd1acc5abef108c94 | |
parent | 8e58d20e1091f58287f430299edabc2f9a9b0c4b (diff) | |
download | ffmpeg-f2b175087197e983ac13e4c8c554b1b2f42612e0.tar.gz |
avformat/movenc: Add movie_timescale option to AVIF
Allow specifying the movie_timescale options to AVIF ouptut.
This also makes sure that when movie_timescale is not specified,
the default value of 1000 is used instead of 0. Animated AVIF
files which don't specify the movie_timescale will have the
correct duration written in the track and movie headers after this
change (instead of writing 0).
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
-rw-r--r-- | libavformat/movenc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7d49892283..36c76f7f60 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -7758,6 +7758,11 @@ static const AVCodecTag codec_f4v_tags[] = { }; #if CONFIG_AVIF_MUXER + +static const AVOption avif_options[] = { + { "movie_timescale", "set movie timescale", offsetof(MOVMuxContext, movie_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + { NULL }, +}; static const AVCodecTag codec_avif_tags[] = { { AV_CODEC_ID_AV1, MKTAG('a','v','0','1') }, { AV_CODEC_ID_NONE, 0 }, @@ -7767,6 +7772,7 @@ static const AVCodecTag *const codec_avif_tags_list[] = { codec_avif_tags, NULL static const AVClass mov_avif_muxer_class = { .class_name = "avif muxer", .item_name = av_default_item_name, + .option = avif_options, .version = LIBAVUTIL_VERSION_INT, }; #endif |