Share via


MediaEncodingProfile Class

Definition

Describes the encoding profile for an audio or video file. The encoding profile includes descriptions of the audio and video encoding formats, and a description of the media container.

public ref class MediaEncodingProfile sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class MediaEncodingProfile final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class MediaEncodingProfile final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class MediaEncodingProfile
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class MediaEncodingProfile
function MediaEncodingProfile()
Public NotInheritable Class MediaEncodingProfile
Inheritance
Object Platform::Object IInspectable MediaEncodingProfile
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The encoding quality Auto is a special preset that fills in the proper settings based on the current camera settings. Settings that are manually modified are ignored. For example, if you create a preset profile using one the static create methods, such as CreateM4a, and specify Auto as the encoding quality, any changes you make to the properties will be overwritten with values based on the current camera settings.

Note

It is possible to create a MediaEncodingProfile that is not supported on a particular device. For example, you may successfully call CreateMp3, but if an mp3 encoder is not present on the device, attempting to encode audio with the properties returned from this method will fail. For a list of the codecs present by default for each device family, see Supported codecs..

Note

Only video encoding profile types support the encoding quality setting of Auto. Audio profiles don’t support this setting and will generate an error when the setting is used. For example: If you create a profile using MediaEncodingProfile.CreateMp3 with AudioEncodingQuality.Auto and then call PrepareStreamTranscodeAsync, you will receive a NullReferenceException error. In this case you will need to choose an encoding quality setting other than Auto to allow you to create a functional profile.

For how-to guidance for using MediaEncodingProfile to set the encoding properties for captured images, see Basic photo, video, and audio capture with MediaCapture. For information on using MediaEncodingProfile when transcoding media files, see Transcode media files.

Version history

Windows version SDK version Value added
1703 15063 CreateAlac
1703 15063 CreateFlac
1703 15063 CreateHevc
1709 16299 GetAudioTracks
1709 16299 GetVideoTracks
1709 16299 SetAudioTracks
1709 16299 SetVideoTracks
1803 17134 GetTimedMetadataTracks
1803 17134 SetTimedMetadataTracks

Constructors

MediaEncodingProfile()

Creates a new instance of the MediaEncodingProfile class.

Properties

Audio

Gets or sets the encoding properties for the audio stream.

Container

Gets or sets the properties of the media container.

Video

Gets or sets the encoding properties for the video stream.

Methods

CreateAlac(AudioEncodingQuality)

Creates an instance of MediaEncodingProfile for Apple Lossless Audio Codec (ALAC) audio.

CreateAv1(VideoEncodingQuality)

Creates an encoding profile for AOMedia Video 1 (AV1) video.

CreateAvi(VideoEncodingQuality)

Creates an instance of MediaEncodingProfile for AVI.

CreateFlac(AudioEncodingQuality)

Creates an instance of MediaEncodingProfile for Free Lossless Audio Codec (FLAC) audio.

CreateFromFileAsync(IStorageFile)

Creates an encoding profile from an existing media file.

CreateFromStreamAsync(IRandomAccessStream)

Creates an encoding profile from a stream that contains media data.

CreateHevc(VideoEncodingQuality)

Creates an instance of MediaEncodingProfile for High Efficiency Video Coding (HEVC) video, also known as H.265 video.

CreateM4a(AudioEncodingQuality)

Creates an encoding profile for AAC audio.

CreateMp3(AudioEncodingQuality)

Creates an encoding profile for MP3 (MPEG-1 layer 3) audio.

CreateMp4(VideoEncodingQuality)

Creates an encoding profile for H.264 video.

CreateVp9(VideoEncodingQuality)

Creates an encoding profile for VP9 video.

CreateWav(AudioEncodingQuality)

Creates an instance of MediaEncodingProfile for WAV

CreateWma(AudioEncodingQuality)

Creates an encoding profile for Windows Media Audio (WMA).

CreateWmv(VideoEncodingQuality)

Creates an encoding profile for Windows Media Video (WMV).

GetAudioTracks()

Retrieves the list of AudioStreamDescriptor objects describing the audio streams included in the MediaEncodingProfile.

GetTimedMetadataTracks()

Retrieves the list of TimedMetadataStreamDescriptor objects describing the timed metadata streams included in the MediaEncodingProfile.

GetVideoTracks()

Retrieves the list of VideoStreamDescriptor objects describing the video streams included in the MediaEncodingProfile.

SetAudioTracks(IIterable<AudioStreamDescriptor>)

Sets the list of AudioStreamDescriptor objects describing the audio streams included in the MediaEncodingProfile.

SetTimedMetadataTracks(IIterable<TimedMetadataStreamDescriptor>)

Sets the list of TimedMetadataStreamDescriptor objects describing the timed metadata streams included in the MediaEncodingProfile.

SetVideoTracks(IIterable<VideoStreamDescriptor>)

Sets the list of VideoStreamDescriptor objects describing the video streams included in the MediaEncodingProfile.

Applies to

See also