H264Track不过滤SEI: #411

This commit is contained in:
xiongziliang
2020-07-16 16:26:13 +08:00
parent c612f291db
commit c31b0cc26b
4 changed files with 17 additions and 11 deletions

View File

@@ -12,6 +12,7 @@
#if defined(ENABLE_HLS)
#include "mpeg-ts-proto.h"
#include "mpeg-ts.h"
#include "Extension/H264.h"
namespace mediakit {
@@ -89,8 +90,13 @@ void TsMuxer::inputFrame(const Frame::Ptr &frame) {
int64_t dts_out, pts_out;
_is_idr_fast_packet = !_have_video;
switch (frame->getCodecId()){
case CodecH265:
case CodecH264: {
int type = H264_TYPE(*((uint8_t *)frame->data() + frame->prefixSize()));
if(type == H264Frame::NAL_SEI){
break;
}
}
case CodecH265: {
//这里的代码逻辑是让SPS、PPS、IDR这些时间戳相同的帧打包到一起当做一个帧处理
if (!_frameCached.empty() && _frameCached.back()->dts() != frame->dts()) {
Frame::Ptr back = _frameCached.back();