Transcodes audio and video files.
Syntax
var mediaTranscoder = new Windows.Media.Transcoding.MediaTranscoder();
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The MediaTranscoder class has these types of members:
Constructors
The MediaTranscoder class has these constructors.
| Constructor | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| 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 | Performs an asynchronous transcode deferral operation on the source file and sends the converted media data to the destination file. |
| PrepareStreamTranscodeAsync | Performs an asynchronous transcode deferral operation on the source stream and sends the converted media data to the destination stream. |
Properties
The MediaTranscoder class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Specifies whether the media transcoder always re-encodes the source. | |
| Read/write | Specifies whether hardware acceleration is enabled. | |
| Read/write | Gets or sets the time interval to trim from the start of the output. | |
| Read/write | Gets or sets the time interval to trim from the end of the output. |
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] |
|
Namespace |
|
|
Metadata |
|
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
Build date: 12/4/2012