Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
2927 Discussions

How can I remove the AUD, SEI, and PPS headers after encoding?

nrson
Beginner
616 Views

Hi,

I have a analysis H264 bitstreams after encoding. There are other headers(AUD, PPS, SEI) as like figure 1.

I want to remove the other headers because the encoded bitstream is transfered to other client.

How do I delete it?

Thanks in advance,

nrson

0 Kudos
7 Replies
Petter_L_Intel
Employee
616 Views
This is a duplicate. See response in other post,
nrson
Beginner
616 Views
Hi, Petter I rewrite my source your advices, but output stream is as like previouse status. My source is as following: mfxStatus CEncodingPipeline::InitMfxEncParams(sInputParams *pInParams) { m_mfxExtCodingOption.NalHrdConformance = MFX_CODINGOPTION_OFF; m_mfxExtCodingOption.PicTimingSEI = MFX_CODINGOPTION_OFF; m_mfxExtCodingOption.AUDelimiter = MFX_CODINGOPTION_OFF; m_mfxEncParams.mfx.CodecId = pInParams->CodecId; m_mfxEncParams.mfx.TargetUsage = pInParams->nTargetUsage; // trade-off between quality and speed m_mfxEncParams.mfx.TargetKbps = pInParams->nBitRate; // in Kbps m_mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_CBR; ConvertFrameRate(pInParams->dFrameRate, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtN, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtD); m_mfxEncParams.mfx.EncodedOrder = 0; // binary flag, 0 signals encoder to take frames in display order ................... return MFX_ERR_NONE; } Where is the problems? Best regareds, nrson
nrson
Beginner
616 Views
Hi, Petter I rewrite my source your advices, but output stream is as like previouse status. My source is as following: mfxStatus CEncodingPipeline::InitMfxEncParams(sInputParams *pInParams) { m_mfxExtCodingOption.NalHrdConformance = MFX_CODINGOPTION_OFF; m_mfxExtCodingOption.PicTimingSEI = MFX_CODINGOPTION_OFF; m_mfxExtCodingOption.AUDelimiter = MFX_CODINGOPTION_OFF; m_mfxEncParams.mfx.CodecId = pInParams->CodecId; m_mfxEncParams.mfx.TargetUsage = pInParams->nTargetUsage; // trade-off between quality and speed m_mfxEncParams.mfx.TargetKbps = pInParams->nBitRate; // in Kbps m_mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_CBR; ConvertFrameRate(pInParams->dFrameRate, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtN, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtD); m_mfxEncParams.mfx.EncodedOrder = 0; // binary flag, 0 signals encoder to take frames in display order ................... return MFX_ERR_NONE; } Where are the problems? Best regareds, nrson
Petter_L_Intel
Employee
616 Views
Hi nrson, can you explain what NAL types you see in the generated stream? Are you using HW or SW encode? Regards, Petter
nrson
Beginner
616 Views
Hi Petter, I want to encode using HW, and NAL type's sequence are SPS->PPS->I->P->P...->SPS->PPS->I->P->-P->.... That is to say, GOP's interval is 10 not using B frame and SPS and PPS before I frame are inserted. Tnanks in advance, nrson
Petter_L_Intel
Employee
616 Views
Hi nrson, as explained in previous post (see duplicate) PPS and AUD does get inserted when encoding using HW. This is known HW limitation. If you do not want to have these part of the stream you have to remove them manually. To generate I-P-P..... GOP pattern then set GopRefDist=1. GopPicSize is used to control GOP size and IdrInterval is used to configure frequency of key frames. Regards, Petter
Liu__Cheng-Hung
Beginner
616 Views

Please see this: 

https://forum.doom9.org/showthread.php?t=152419

 

Someone altered ffmpeg and implemented a new bistream filter: h264_changesps=removedupheader

I tried and found it can do what you want to do: only leave the 1st SPS and 1st PPS.

 

Example: ffmpeg -i in.h264  -vcodec copy -vbsf "h264_changesps=removedupheader"  out.h264

Reply