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

How to decompress every I_PICTURE without image corruption?

I'm using that loop to decompress every I_PICTURE only:

do {
if (4 >= in.GetDataSize() || sts == UMC::UMC_ERR_NOT_ENOUGH_DATA) {
while (((sts = pSplitter->GetNextData(&in, videoTrack)) == UMC::UMC_ERR_NOT_ENOUGH_DATA))vm_time_sleep(5);
}
if (in.GetFrameType() != UMC::I_PICTURE) {
sts = UMC::UMC_ERR_NOT_ENOUGH_DATA;
continue;
}
out.SetTime(in.GetTime());
out.SetFrameType(in.GetFrameType());
sts = pVideoDecoder->GetFrame(&in, &out);
while (sts == UMC::UMC_ERR_NOT_ENOUGH_DATA || sts == UMC::UMC_ERR_SYNC);

With that continue statement the image becomes corrupted as in the attachement on the right.
Grabbing all frames however renders correct image as on the left.

The video is MTS:
stream type: MPEGx
video track 0: H264 H264 1920x1080 YUV420 0bps 29.97fps 96.5286 seconds

0 Kudos
1 Reply
Highlighted
Employee
14 Views

Hi 9ine,

The bad image looks a kind of interlace image or half of framewas decompressed, other half frame are missed. Are you working on dual core machine? what version of the OS and the compiler ?

Regards,
Ying
0 Kudos