[FFmpeg-devel] [PATCH 1/1] Added avs2 tags for MKV

Ze Yuan naturalwalker at hotmail.com
Wed Aug 19 01:00:33 EEST 2020


>From d4ae49d8fabdb70435c92457c153a869dc55a980 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=83=91=E5=A4=A9=E6=B3=A2?= <naturalwalker at hotmail.com>
Date: Wed, 19 Aug 2020 05:20:18 +0800
Subject: [PATCH] Added avs2 tags for MKV container.

Before the patch, an avs2 encoded MKV video results in dropped frames in asv2 enabled video players.

Here are the asv2/avs3 enabled video players:
VLC 3: https://github.com/xatabhk/vlc-3.0-avs2-avs3/releases/tag/v3.0-avs2-avs3-200812
Mpc-hc: https://gitee.com/zhengtianbo/cavs-avs2-avs3_decoder_added_to_mpc_hc/releases

---
libavformat/isom.c     | 3 ++-
libavformat/matroska.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 209bbac5d1..080a457a4e 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -255,7 +255,8 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
     { AV_CODEC_ID_PNG,   MKTAG('M', 'N', 'G', ' ') },

     { AV_CODEC_ID_VC1, MKTAG('v', 'c', '-', '1') }, /* SMPTE RP 2025 */
-    { AV_CODEC_ID_CAVS, MKTAG('a', 'v', 's', '2') },
+    { AV_CODEC_ID_CAVS, MKTAG('c', 'a', 'v', 's') },
+    { AV_CODEC_ID_AVS2, MKTAG('a', 'v', 's', '2') },

     { AV_CODEC_ID_DIRAC,     MKTAG('d', 'r', 'a', 'c') },
     { AV_CODEC_ID_DNXHD,     MKTAG('A', 'V', 'd', 'n') }, /* AVID DNxHD */
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 7c56aba403..2ce60c6277 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -78,6 +78,7 @@ const CodecTags ff_mkv_codec_tags[]={
     {"S_HDMV/TEXTST"    , AV_CODEC_ID_HDMV_TEXT_SUBTITLE},

     {"V_AV1"            , AV_CODEC_ID_AV1},
+    {"V_AVS2"           , AV_CODEC_ID_AVS2},
     {"V_DIRAC"          , AV_CODEC_ID_DIRAC},
     {"V_FFV1"           , AV_CODEC_ID_FFV1},
     {"V_MJPEG"          , AV_CODEC_ID_MJPEG},
-- 
2.25.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-avs2-tags-for-MKV-container.patch
Type: application/octet-stream
Size: 1502 bytes
Desc: 0001-Added-avs2-tags-for-MKV-container.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200818/060524a7/attachment.obj>


More information about the ffmpeg-devel mailing list