Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
16 Views

H264 stream decoding: never get the decoder frame

Hello,

I am using Intel IPP 5.2 (and Iwill upgrade to 5.3 soon) with Intel UMC to decode H264 streams coming via rtsp.

All the depacketisation part was already done and validated with ffmpeg library. We send to the decoder the NAL units with delimiter(0x00000001) in front of every units and the SPS/PPS unitsare extracted from the SDP and sent with every I-Frame with delimiter also.

When I try to use theIntel decoder I have got a UMC_OK code returned by GetInfo() and Init() so I guess that the SPS and PPS are correctly read and understand by the decoder. However I have never get the UMC_OK from GetFrame(). It always returnsUMC_ERR_NOT_ENOUGH_DATA.

I read many threads on the forum talking about this behavior, butas far as I understand I can not find whatismissing. Even if I "forced" to get the decoded frame with "GetFrame(NULL,..)" it fails.

In one of the thread (http://software.intel.com/en-us/forums//topic/58845) it looks like the decoder is not able to process FU-A units (fragmented ones) which appear strange to me.

Is it really the case ?

Do you think my problem comes from that ? (I know that I receive many FU-A units).

How can I process these units ?

The way my decoder wrapper works is the following :

- my wrapper class contains among all:

UMC::VideoDecoderParams *m_pVideoDecoderParams;

UMC::MediaData *m_pInputNALData;

UMC::VideoData *m_pOutputData;

UMC::VideoDecoder *m_pVideoDecoder;

- In my wrapper contructor:

m_pInputNALData = new UMC::MediaData();

m_pOutputData = new UMC::VideoData();

m_pVideoDecoderParams =

new UMC::VideoDecoderParams();

m_pVideoDecoderParams->uiLimitThreads = 1;

m_pVideoDecoderParams->m_pData = m_pInputNALData;

m_pVideoDecoder =

new UMC::H264VideoDecoder();

- My wrapper receivesevery NAL unit one by one inside a buffer.

For I-Frame,the buffer contains : SPS unitPPS unitNAL unit

as it is explained in RFC 3984

For the other frame, there is NAL unit.

NAL units can be STAP-A, STAP-B or FU-A unit (and eventually others)

For each buffer received, I do (I removed "details" like return code check, memory allocation etc..):

// Set the input buffer with the NAL unit data (pBuffer)

m_pInputNALData->SetBufferPointer(pInputBuffer,nSize);

m_pInputNALData->SetDataSize(nSize);

// Init the intel decoder with the decoder parameters

m_pVideoDecoder->Init(m_pVideoDecoderParams);

m_pVideoDecoder->GetInfo(m_pVideoDecoderParams);

// If the get info is OK and the info are correct, I allocate the output data buffer. This is done only once if the info size do not change

......

m_nCurrentWidth = m_pVideoDecoderParams->info.clip_info.width;

m_nCurrentHeight = m_pVideoDecoderParams->info.clip_info.height;

m_nBufferSize = m_nCurrentWidth * m_nCurrentHeight * 1.5;

// this is for YUV420

m_pOutputBuffer =

new unsigned char[m_nBufferSize];

....

// Then I init my ouput VideoData object

m_pOutputData->Init(m_nCurrentWidth,m_nCurrentHeight,UMC::YUV420,8);

m_pOutputData->SetBufferPointer((Ipp8u*)m_pOutputBuffer,m_nBufferSize);

nRet = m_pVideoDecoder->GetFrame(m_pInputNALData,m_pOutputData);

// This is where I always get the UMC_ERR_NOT_ENOUGH_DATA.

Any help and suggestions are welcomed

Thanks

N.

0 Kudos
0 Replies