[FFmpeg-cvslog] avformat/vpcc: fix VP9 metadata in FLV and RTMP

Alessandro Ros git at videolan.org
Mon Sep 4 15:07:04 EEST 2023


ffmpeg | branch: master | Alessandro Ros <aler9.dev at gmail.com> | Sun Sep  3 18:00:13 2023 +0200| [5d84ac5a405da889fcf5b32ba970b049452b9f8a] | committer: James Almer

avformat/vpcc: fix VP9 metadata in FLV and RTMP

In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
ISO-BMFF box, must be inserted into a metadata message. However, the
function responsible for generating vpcCs currently returns invalid
boxes, that are lacking the Version and Flag fields, inherited from
FullBox. For some reason, both flags were being added manually in
movenc. This patch fixes the issue.

Signed-off-by: Alessandro Ros <aler9.dev at gmail.com>
Reviewed-by: Steven Liu <lingjiujianke at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d84ac5a405da889fcf5b32ba970b049452b9f8a
---

 libavformat/movenc.c | 3 ---
 libavformat/vpcc.c   | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7ef6cef46a..696ae5a6c9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
 
     avio_wb32(pb, 0);
     ffio_wfourcc(pb, "vpcC");
-    avio_w8(pb, 1); /* version */
-    avio_wb24(pb, 0); /* flags */
     ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len, track->par);
-
     return update_size(pb, pos);
 }
 
diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
index ea66959abf..256407dd6d 100644
--- a/libavformat/vpcc.c
+++ b/libavformat/vpcc.c
@@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb,
     if (ret < 0)
         return ret;
 
+    avio_w8(pb, 1); /* version */
+    avio_wb24(pb, 0); /* flags */
     avio_w8(pb, vpcc.profile);
     avio_w8(pb, vpcc.level);
     avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1) | vpcc.full_range_flag);



More information about the ffmpeg-cvslog mailing list