diff --git a/src/Extension/H264.h b/src/Extension/H264.h index b4c71a6b..e89aa5d9 100644 --- a/src/Extension/H264.h +++ b/src/Extension/H264.h @@ -257,7 +257,7 @@ public: */ void inputFrame(const Frame::Ptr &frame) override{ int type = H264_TYPE(*((uint8_t *)frame->data() + frame->prefixSize())); - if(type == H264Frame::NAL_SPS){ + if(type == H264Frame::NAL_SPS || type == H264Frame::NAL_SEI){ //有些设备会把SPS PPS IDR帧当做一个帧打包,所以我们要split一下 bool first_frame = true; splitH264(frame->data() + frame->prefixSize(), diff --git a/src/Record/MP4Demuxer.cpp b/src/Record/MP4Demuxer.cpp index a854012d..099b83a3 100644 --- a/src/Record/MP4Demuxer.cpp +++ b/src/Record/MP4Demuxer.cpp @@ -229,12 +229,12 @@ Frame::Ptr MP4Demuxer::makeFrame(uint32_t track_id, const Buffer::Ptr &buf, int6 iOffset += (iFrameLen + 4); } if (codec == CodecH264) { - return std::make_shared >(buf, pts, dts,4); + return std::make_shared >(buf, pts, dts, 4); } - return std::make_shared >(buf, pts, dts,4); + return std::make_shared >(buf, pts, dts, 4); } case CodecAAC : - return std::make_shared > (buf, pts, dts, 0); + return std::make_shared >(buf, pts, dts, 0); default: return nullptr; }