MediaTranscoder class

Applies to Windows and Windows Phone

Transcodes audio and video files.

Syntax


public ref class MediaTranscoder sealed 

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The MediaTranscoder class has these types of members:

Constructors

The MediaTranscoder class has these constructors.

ConstructorDescription
MediaTranscoder Creates a new instance of the MediaTranscoder class.

 

Methods

The MediaTranscoder class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
AddAudioEffect(String) Adds the specified audio effect.
AddAudioEffect(String, Boolean, IPropertySet) Adds the specified audio effect with configuration properties, and indicates whether the effect is required.
AddVideoEffect(String) Adds the specified video effect.
AddVideoEffect(String, Boolean, IPropertySet) Adds the specified video effect with configuration properties and indicates whether the effect is required.
ClearEffects Removes all audio and video effects from the transcode session.
PrepareFileTranscodeAsync Asynchronously initializes the trancode operation on the specified file and returns a PrepareTranscodeResult object which can be used to start the transcode operation.
PrepareMediaStreamSourceTranscodeAsync Asynchronously initializes the trancode operation on the specified media source and returns a PrepareTranscodeResult object which can be used to start the transcode operation.
PrepareStreamTranscodeAsync Asynchronously initializes the trancode operation on the specified stream and returns a PrepareTranscodeResult object which can be used to start the transcode operation.

 

Properties

The MediaTranscoder class has these properties.

PropertyAccess typeDescription

AlwaysReencode

Read/writeSpecifies whether the media transcoder always re-encodes the source.

HardwareAccelerationEnabled

Read/writeSpecifies whether hardware acceleration is enabled.

TrimStartTime

Read/writeGets or sets the time interval to trim from the start of the output.

TrimStopTime

Read/writeGets or sets the time interval to trim from the end of the output.

VideoProcessingAlgorithm

Read/writeGets or sets the video processing algorithm which will be used for transcoding.

 

Examples

The following code sample shows how to create a new MediaTranscoder object.


...
var profile = Windows.Media.MediaProperties.MediaEncodingProfile.createMp4(
    Windows.Media.MediaProperties.VideoEncodingQuality.hd720p);

var transcoder = new Windows.Media.Transcoding.MediaTranscoder();
transcoder.trimStartTime = 1000;
transcoder.trimStopTime = 9000;
...


Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.Transcoding
Windows::Media::Transcoding [C++]

Metadata

Windows.winmd

See also

Roadmaps
Adding multimedia to Windows Store apps using C++, C#, or Visual Basic
Adding multimedia to Windows Store apps using JavaScript
Samples
Transcoding media sample
Media extension sample
Real-Time communication sample

 

 

Show:
© 2014 Microsoft