I'm using Media Foundation for video capture in the following simplified algorithm:
Question: How to set framerate so ReadSample will return frames at specified framerate?
I tried to set framerate in 4. with MFSetAttributeRatio( format, MF_MT_FRAME_RATE, num, denom ) with no luck. Seems that some cameras give me samples at 30 fps, some at 15 fps and they dont respect fps set in format. I also checked MF_MT_FRAME_RATE_RANGE_MAX and my fps is valid.
I've got webcam which gave me 30 fps when using DirectShow and format says it supports 30fps. But I can get only 15 from it using Media Foundation.
Found the answer for myself. One can't set framerate on IMFSourceReader.
One should set desired format on IMFMediaSource and then wrap it with IMFSourceReader.