Mp4 player for windows 10 microsoft
The duration is stored in the MF_PD_DURATION attribute of the presentation descriptor. This value can be used to track the encoding progress. Get the Source DurationĪlthough not required, it is useful to query the media source for the duration of the input file. Hr = pSource->QueryInterface(IID_PPV_ARGS(ppSource)) įor more information, see Using the Source Resolver.
Get the IMFMediaSource interface from the media source. Hr = pResolver->CreateObjectFromURL(pszURL, MF_RESOLUTION_MEDIASOURCE, Use the source resolver to create the media source HRESULT hr = MFCreateSourceResolver(&pResolver) MF_OBJECT_TYPE ObjectType = MF_OBJECT_INVALID HRESULT CreateMediaSource(PCWSTR pszURL, IMFMediaSource **ppSource) To create the media source, pass the URL of the input file to the Source Resolver. The media source is the object that reads and parses the input file. Another option is to use a COM smart pointer class, such as CComPtr.
#MP4 PLAYER FOR WINDOWS 10 MICROSOFT CODE#
This code uses the SafeRelease function to release interface pointers.
You could also specify the H.264 level, but the Microsoft Media Foundation H.264 Video Encoder can derive the proper level for a given video stream, so it is recommended not to override the encoder's selected level.
H.264 profiles are specified using the eAVEncH264VProfile enumeration. The following array contains a list of H.264 encoding formats. For this tutorial, we take a relatively simple approach, and store a list of encoding formats for H.264 video and AAC audio.įor H.264, the most important format attributes are the H.264 profile, the frame rate, the frame size, and the encoded bit rate. One approach to encoding is to define a list of target encoding profiles that are known in advance.
#MP4 PLAYER FOR WINDOWS 10 MICROSOFT HOW TO#
This tutorial shows how to use the Transcode API to encode an MP4 file, using H.264 for the video stream and AAC for the audio stream.