MediaTranscoder class

MediaTranscoder class

Transcodes audio and video files.

Syntax


var mediaTranscoder = new Windows.Media.Transcoding.MediaTranscoder();

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/write

Specifies whether the media transcoder always re-encodes the source.

HardwareAccelerationEnabled

Read/write

Specifies whether hardware acceleration is enabled.

TrimStartTime

Read/write

Gets or sets the time interval to trim from the start of the output.

TrimStopTime

Read/write

Gets or sets the time interval to trim from the end of the output.

VideoProcessingAlgorithm

Read/write

Gets 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 (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

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

See also

Object
Roadmaps
Audio, video, and camera
Audio, video, and camera
Samples
Transcoding media sample
Media extension sample
Real-Time communication sample
Transcoding media sample (Windows 10)

 

 

Show:
© 2016 Microsoft