The picture below is an I-frame (333 frame) of H264 stream from our IP camera. Its h264 stream size is 141KB. The h264 stream sizes of its previous and later I-frames are 87KB and 147KB, respectively. Their results from DecodeFrameAsynclook good. But it looks like broken. Several other I-frames (frame 163, 223, 333, 423, and 593 in a short video which only includes 635 frames) have the similar situation. Does anyone know what reasons are and how to fix the problem? DoesDecodeFrameAsync return some warning to this case?
Let me first confirm that I understand your setup correctly. Is the IP camera delivering an H.264 stream that you are trying to decode using Media SDK? Is your code based on DirectShow filters or the console samples?
If possible it would be great if you could share the input H.264 stream so that we can examine it on our side.
DecodeFrameAsync does give access to "Corrupted" flag for decoded frames, to indicate potential frame corruptions, but unfortunately this feature does not work appropriately. This will be addressed in future revisions of Intel HW and drivers.
Thanks for providing the stream. I observe many encoding errors in the provided stream such as the I frame corruptions you referred to but also other corruptions. The stream error are not only seen when trying to decode the stream using Media SDK but also with all other SW decoders I tried.
I would suggest working with the camera developer to determine how to resolve the issues with the H.264 encoder embedded in the camera.
Regarding detection of frame corruption using Media SDK. Please refer to the manual and search for the Corrupted parameter in the mfxFrameData structure. This parameter will provide (if detected) some frame corruption details for broken frames. But please be aware that there are some known Media SDK/driver issues with frame corruption detection, this may not always work.
Thank you for your testing. I will work with camera developer to improve this encoder issue. But some corruptions are due to data losing (e.g. network), we can not always assume that data is correct. I want to set up a warning if decoder finds a corruption happens.
Your reply is really helpful. I will work mfxFrameData first