Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

H264 decoder problem

selea
Beginner
1,983 Views
Hi all. I'm using IPP lib version 7.0.4 with the latest IPP sample7.0.4.054
I have got a crash with the H264 decoder when I'm decoding a 1280x720 stream. Not all the HD ready stream get this problem, but this sistematically crash.
I attach the stream that cause me the problem.
I write the stack trace that cause me the problem:
void H264SegmentDecoder::DeblockMacroblockPSlice()
void H264SegmentDecoder::PrepareDeblockingParametersPSlice()
void H264SegmentDecoder::PrepareDeblockingParametersPSlice16x16Vert()
inline size_t H264SegmentDecoder::GetReferencePSlice(Ipp32s iMBNum, Ipp32s iBlockNum)
iMBNum=1840
iBlockNum=0
size_t DeblockPicID(Ipp32s index)
index=0
return m_ID[index]; //this row cause the problem
it's seems thatm_ID is not null but is in an inconsistent state
Can you reproduce the problem?
0 Kudos
1 Solution
Ying_H_Intel
Employee
1,984 Views

Hi Selea,

Glad to know you make progress. and thank you very much to share your experience here.

You are exact right, the GetFrame() is not always produce a frame. There is some data remain in buffer.I guessthismay be the most importantpointwhendevelop H.264 decoderwith stream data.We may need take care of the loop and condition in the loop very carefully.

See the explanation in the UMC docu

Syntax virtual UMC::Status GetFrame(UMC::MediaData* pSrc, UMC::MediaData* pDst)
Description
The method processes data.
Ifthe user allocates input and output buffers. If GetFrame does
not use all data from the input buffer, the method updates data pointer, value of the actual
data in the buffer and start time.

If the codec uses internal frame buffering it can return UMC::UMC_ERR_NOT_ENOUGH_DATA
at the beginning of the processing. This error code means that the input data is buffered
but the output data is not ready to be delivered. The application has to continue to call
GetFrame with the next input data.

To retrieve buffered data at the end of the processing, the application should call GetFrame
with NULL input pointer while output is not empty.

(and ifwe did search, there aremany discussion about the h.264 decoder's delay or get UMC_ERR_NOT _ENOUGH_DATA in the forum.Unfortunately whentheapplication become large and complex, the basic problem weresubmerged)

With comment if (/*(3 > in->GetDataSize()) &&*/ andif (UMC_ERR_NOT_ENOUGH_DATA == ret)
{
if (bEndOfStream)
break;
// else
// continue;
}

//if (UMC_OK != ret)
// continue;
numDecodedFrames++;
printf("Frame decoder %d\n", numDecodedFrames);

I can't reproduce the crash, butI believedyou will getwrong result if discard someremain data by some condition clause.
For example, with above comment,iwill get 27 frame and thereal frame with thestream is 24 frame. some frame is actually black.

Best Regards,
Ying

View solution in original post

0 Kudos
30 Replies
selea
Beginner
1,559 Views
I re-attach the file
0 Kudos
selea
Beginner
1,559 Views
Anyway I think that the problem is the address of the m_ID array. When the decoder crash m_IDhas a very strange address like someone has corrupt the array's address
0 Kudos
selea
Beginner
1,559 Views
Someone has check this problem? just to know if it's a library bug or something else
0 Kudos
thompson_ng
Beginner
1,559 Views
I had this problem as well. Sometimes it works and sometimes it crash with this error.
Anyone has a solution?
0 Kudos
selea
Beginner
1,559 Views

Good, I'm not alone :) I got always the error. I think it's some kind of buffer corruption. Perhaps something related to the resolution.

0 Kudos
kwlee88
Beginner
1,559 Views
I have same problem too :(, and it's very easy to crash when multiple threads are decoding concurrently.
There is no such problem when using IPP 5.
And when upgrade to IPP7, the diaster is coming...
0 Kudos
selea
Beginner
1,559 Views
I think we have to wait for a bugfixed release of the h264 decoder.
Same stream with different resolution (lower or higher doesn't matter) do not have the problem
0 Kudos
thompson_ng
Beginner
1,559 Views
For me, it happens seems randomly. It seems to happen more frequently at frames that are bigger in size. 720x576
This does not happen at IPP 6 as well
0 Kudos
Ying_H_Intel
Employee
1,559 Views

Dear all,

Sorry for the slow response as summur vacation season :)

The simple_player doesn't recoginze the fileof h264_1280x720.mkv. Could any one of you please provide another test stream or tell how to feed the video stream to decoder?

Thanks
Ying

0 Kudos
selea
Beginner
1,559 Views
Dear Ying the file I submitted is a standard matroska (mkv) file that contain an h264 stream.
If you want you can convert it with avidemux or virtualdub mod. Anyway you should not recode the stream otherwise you lost the problem. I think anyway you should be able to open the mkv stream in a standard way. Anyway if I have enough time I try to produce an avi stream
0 Kudos
selea
Beginner
1,559 Views
ok here you are an avi file. Try this and you can get the decode problem (crash)
0 Kudos
Ying_H_Intel
Employee
1,559 Views
Hi Selea,

Thank you for the file.But i can't decode the file with simple_player.exe or umc_h264_dec_con, whatever under linux or windows, IPP 6.1 or IPP 7.0.4

What platform are you working on? I'mlooking at thediscussion in forum81357too.
http://software.intel.com/en-us/forums/showthread.php?t=81357&o=a&s=lr
It included a 1280x960 stream. Could you try the stream and see if the crash can be reproduced?

Thanks
Ying


Windows 7.0.4:
C:\Users\yhu5\Desktop\IPP7.0\w_ipp-samples_p_7.0.4.054\ipp-samples\audio-video-c
odecs\_bin\ia32_icl120>simple_player.exe -vdx C:\Users\yhu5\Desktop\UMC\h264_128
0x720.avi

Stream Type : AVI

Linux 6.1:

[yhu5@NHM02 linuxem64t_gcc4]$ ./simple_player -t3 /tmp/h264_1280x720.avi

Stream Type : AVI
[yhu5@NHM02 linuxem64t_gcc4]$ pwd
/home/yhu5/IPP6.1/ipp-samples/audio-video-codecs/_bin/linuxem64t_gcc4

0 Kudos
selea
Beginner
1,559 Views
I'm usingsamples_p_7.0.4.054 and I'm working on windows xp.
Anyway the problem is that I can't decode it, or I can decode only a frame and than the decoder crash. Have you try to continue to decode the frame till the end of the file? did you see a decoder crash? anyway if you open the file with VLC player you can see some frame decoded.
Anyway the stream come from a camera that should produce 1280x720 h264 frames. You tell me that the stream you see is 1280x960: that could be the problem. If for some reason the SPS or PPS is declaring 1280x720 and the stream inside is 960 or vice-versa, that could be a problem for the decoder
I'm going to try the h264 stream from the discussion you tell me, and I let you know
0 Kudos
kwlee88
Beginner
1,559 Views
In my case, single stream decoding is not so easy to crash.
But it's quite easy to crash when there areover 4 threads, each
decoding different video stream.

The video stream coming from different IP Cameras(Samsung
&HikVision..)

Most of the time, I found the crash happened like:
One or twothreads are decoding normally, and then,
there is another thread entering "init" stage, the init thread get crashed.

To me, I have no idea how to send you the data to debug.
0 Kudos
Ying_H_Intel
Employee
1,559 Views

Hello Selea,

The docoder doesn't recognize the format of h264_1280x720.avi, it quits right away aftershow the error"Video Decoder creation failed". so i can't decode theh264_1280x720.avi.

the "1280x960"is fromthestream inforum U81357.Just verify that the decoder can decodewith the HD streamat my sides.

Thanks,
Ying

0 Kudos
selea
Beginner
1,559 Views
I'm trying to use the h264 stream I took from the post you suggest me, but how can I read frame by frame to decode the file in my application? I can't see header that describe the of each frame, because seems a pure stream without container. I can start for the start code00000001 but it's not so fast to get a try. I let you know when I make a try
0 Kudos
selea
Beginner
1,559 Views
In my case I got the decoder problem even with one stream.
I can useUMC::H264VideoDecoder to get the information about the stream, and the decoder tell me that the stream is 1280x720.
I attach the Info struct that is theH264VideoDecoderParams after the GetInfo that I do after the Init of the h264 decoder. All operation succesfull for me

Anyway if you want I can create a stream .h264 without avi container so perhaps you could succesfull decode it. Give me the time to save the file
0 Kudos
selea
Beginner
1,559 Views
Ok done: I make a file .h264 that contain only the h264 stream, like that one you tell me to download from the other post.
Try that and tell me if you can decode it and if you got the error
0 Kudos
selea
Beginner
1,559 Views
Can you read the file I attached in the previews message? can you reproduce the problem?
0 Kudos
Ying_H_Intel
Employee
1,362 Views
Hello Selea,

Great!. The file you attached can work now.Idecodeit with umc_h264_dec_con.exe and simpledecoder.cpp under debug mode several times. It seems work no problem.

I'm on Window ia32UMC sample7.0.4.054.

Regards,
Ying

0 Kudos
Reply