MFAverageTimePerFrameToFrameRate function (mfapi.h)

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

Syntax

HRESULT MFAverageTimePerFrameToFrameRate(
  [in]  UINT64 unAverageTimePerFrame,
  [out] UINT32 *punNumerator,
  [out] UINT32 *punDenominator
);

Parameters

[in] unAverageTimePerFrame

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

[out] punNumerator

Receives the numerator of the frame rate.

[out] punDenominator

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
S_OK
The function succeeded.

Remarks

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.

Requirements

Requirement Value
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

MFFrameRateToAverageTimePerFrame

Media Foundation Functions

Media Types