Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

MFCreateTranscodeTopology function

Creates a partial transcode topology.

The underlying topology builder creates a partial topology by connecting the required pipeline objects: source, encoder, and sink. The encoder and the sink are configured according to the settings specified by the caller in the transcode profile.

To create the transcode profile object, call the MFCreateTranscodeProfile function and set the required attributes by calling the appropriate the IMFTranscodeProfile methods.

The configured transcode profile is passed to the MFCreateTranscodeTopology function, which creates the transcode topology with the appropriate settings. The caller can then set this topology on the Media Session and start the session to begin the encoding process. When the Media Session ends, the transcoded file is generated.

Syntax


STDAPI MFCreateTranscodeTopology(
  _In_   IMFMediaSource *pSrc,
  _In_   LPCWSTR pwszOutputFilePath,
  _In_   IMFTranscodeProfile *pProfile,
  _Out_  IMFTopology **ppTranscodeTopo
);

Parameters

pSrc [in]

A pointer to a media source that encapsulates the source file to be transcoded. The media source object exposes the IMFMediaSource interface and can be created by using the source resolver. For more information, see Using the Source Resolver.

pwszOutputFilePath [in]

A pointer to a null-terminated string that contains the name and path of the output file to be generated.

pProfile [in]

A pointer to the transcode profile that contains the configuration settings for the audio stream, the video stream, and the container to which the file is written. The transcode profile object exposes the IMFTranscodeProfile interface and must be created by calling the MFCreateTranscodeProfile function. After the object has been created the caller must provide the configuration settings by calling appropriate the IMFTranscodeProfile methods.

ppTranscodeTopo [out]

Receives a pointer to the IMFTopology interface of the transcode topology object. The caller must release the interface.

Return value

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

Return codeDescription
S_OK

The function call succeeded, and ppTranscodeTopo receives a pointer to the transcode topology.

E_INVALIDARG

pwszOutputFilePath contains invalid characters.

MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED

No streams are selected in the media source.

MF_E_TRANSCODE_NO_CONTAINERTYPE

The profile does not contain the MF_TRANSCODE_CONTAINERTYPE attribute.

MF_E_TRANSCODE_NO_MATCHING_ENCODER

For one or more streams, cannot find an encoder that accepts the media type given in the profile.

MF_E_TRANSCODE_PROFILE_NO_MATCHING_STREAMS

The profile does not specify a media type for any of the selected streams on the media source.

 

Remarks

For example code that uses this function, see the following topics:

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Mfidl.h

Library

Mf.lib

DLL

Mf.dll

See also

Media Foundation Functions
Topologies
Transcode API
IMFTopology

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.