MFAverageTimePerFrameToFrameRate function

Calculates the frame rate, in frames per second, from the average duration of a video frame.


HRESULT MFAverageTimePerFrameToFrameRate(
  UINT64 unAverageTimePerFrame,
  UINT32 *punNumerator,
  UINT32 *punDenominator



The average duration of a video frame, in 100-nanosecond units.


Receives the numerator of the frame rate.


Receives the denominator of the frame rate.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
The function succeeded.


Average time per frame is used in the older VIDEOINFOHEADER and VIDEOINFOHEADER2 format structures. This function provides a standard conversion so that all components in the pipeline can use consistent values, if they need to translate between the older format structures and the media type attributes used in Media Foundation.

This function uses a look-up table for certain common durations. The table is listed in the Remarks section for the MFFrameRateToAverageTimePerFrame function.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also


Media Foundation Functions

Media Types