From 788915c7f7ca7198c5498880491aae41a1881c6e Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Thu, 6 Jul 2023 15:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmp4=E8=A7=A3=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E5=99=A8=E8=BE=93=E5=87=BAsps=20pps=E5=B8=A7=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B5=B7=E5=A7=8B=E5=A4=B4=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20(#2627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mp4解复用器在解析mp4文件时,当获取到mp4头中sps/pps等配置帧信息时,创建相应的Frame未设置prefix size;导致后续输入H264Track分帧逻辑异常。 --- src/Record/MP4Demuxer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Record/MP4Demuxer.cpp b/src/Record/MP4Demuxer.cpp index a1bbd34c..a3f29958 100644 --- a/src/Record/MP4Demuxer.cpp +++ b/src/Record/MP4Demuxer.cpp @@ -102,7 +102,7 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei uint8_t config[1024 * 10] = {0}; int size = mpeg4_avc_to_nalu(&avc, config, sizeof(config)); if (size > 0) { - video->inputFrame(std::make_shared((char *)config, size, 0, 4)); + video->inputFrame(std::make_shared((char *)config, size, 0, 0,4)); } } } @@ -117,7 +117,7 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei uint8_t config[1024 * 10] = {0}; int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config)); if (size > 0) { - video->inputFrame(std::make_shared((char *) config, size, 0, 4)); + video->inputFrame(std::make_shared((char *) config, size, 0, 0,4)); } } }