Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

IMFSourceReader::ReadSample - notification for receiving all bytes for a whole encoded video frame?

$
0
0

Hi,

using the IMFSourceReader API, how do you know that you receive a whole frame by using the ReadSample method?

In my special case, I have a MPEG2 video file. I do not use the SourceReader API to decode the frames - I just want to get the encoded frames. Therefore I set "MFVideoFormat_MPEG2" as native format for the IMFSourceReader.  

Microsoft says: "The contents of the media data depend on the format of the stream. For an uncompressed video stream, each media sample contains a single video frame. For an uncompressed audio stream, each media sample contains a sequence of audio frames." (https://msdn.microsoft.com/en-us/library/windows/desktop/dd389281%28v=vs.85%29.aspx)

In my case, it seems to me that each MPEG2 frame needs several IMFSourceReader::ReadSample() calls to get a complete frame. Is there any chance or option to know when you get all bytes from the IMFSourceReader for one video frame? I`m not sure if I can use the GetSampleDuration() method to determine if I have a complete sample or not. 

best regards

saoirse


Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>