MediaEncodingProfile MediaEncodingProfile MediaEncodingProfile MediaEncodingProfile Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
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 : sealed class MediaEncodingProfile : IMediaEncodingProfilepublic sealed class MediaEncodingProfile : IMediaEncodingProfilePublic NotInheritable Class MediaEncodingProfile Implements IMediaEncodingProfile// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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..

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.

Constructors

MediaEncodingProfile() MediaEncodingProfile() MediaEncodingProfile() MediaEncodingProfile()

Creates a new instance of the MediaEncodingProfile class.

public : MediaEncodingProfile()public MediaEncodingProfile()Public Sub New()// You can use this method in JavaScript.

Properties

Audio Audio Audio Audio

Gets or sets the encoding properties for the audio stream.

public : AudioEncodingProperties Audio { get; set; }public AudioEncodingProperties Audio { get; set; }Public ReadWrite Property Audio As AudioEncodingProperties// You can use this property in JavaScript.
Value
AudioEncodingProperties AudioEncodingProperties AudioEncodingProperties AudioEncodingProperties

The encoding properties of the audio stream. If the profile does not contain an audio stream, the value is null.

Container Container Container Container

Gets or sets the properties of the media container.

public : ContainerEncodingProperties Container { get; set; }public ContainerEncodingProperties Container { get; set; }Public ReadWrite Property Container As ContainerEncodingProperties// You can use this property in JavaScript.

Video Video Video Video

Gets or sets the encoding properties for the video stream.

public : VideoEncodingProperties Video { get; set; }public VideoEncodingProperties Video { get; set; }Public ReadWrite Property Video As VideoEncodingProperties// You can use this property in JavaScript.
Value
VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties

The encoding properties of the video stream. If the profile does not contain a video stream, the value is null.

Methods

CreateAlac(AudioEncodingQuality) CreateAlac(AudioEncodingQuality) CreateAlac(AudioEncodingQuality) CreateAlac(AudioEncodingQuality)

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

public : static MediaEncodingProfile CreateAlac(AudioEncodingQuality quality)public static MediaEncodingProfile CreateAlac(AudioEncodingQuality quality)Public Static Function CreateAlac(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

CreateAvi(VideoEncodingQuality) CreateAvi(VideoEncodingQuality) CreateAvi(VideoEncodingQuality) CreateAvi(VideoEncodingQuality)

Creates an instance of MediaEncodingProfile for AVI.

public : static MediaEncodingProfile CreateAvi(VideoEncodingQuality quality)public static MediaEncodingProfile CreateAvi(VideoEncodingQuality quality)Public Static Function CreateAvi(quality As VideoEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
Returns

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.

CreateFlac(AudioEncodingQuality) CreateFlac(AudioEncodingQuality) CreateFlac(AudioEncodingQuality) CreateFlac(AudioEncodingQuality)

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

public : static MediaEncodingProfile CreateFlac(AudioEncodingQuality quality)public static MediaEncodingProfile CreateFlac(AudioEncodingQuality quality)Public Static Function CreateFlac(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile) CreateFromFileAsync(IStorageFile)

Creates an encoding profile from an existing media file.

public : static IAsyncOperation<MediaEncodingProfile> CreateFromFileAsync(IStorageFile file)public static IAsyncOperation<MediaEncodingProfile> CreateFromFileAsync(IStorageFile file)Public Static Function CreateFromFileAsync(file As IStorageFile) As IAsyncOperation( Of MediaEncodingProfile )// You can use this method in JavaScript.
Parameters
file
IStorageFile IStorageFile IStorageFile IStorageFile

The media file from which to create the profile.

Returns

CreateFromStreamAsync(IRandomAccessStream) CreateFromStreamAsync(IRandomAccessStream) CreateFromStreamAsync(IRandomAccessStream) CreateFromStreamAsync(IRandomAccessStream)

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

public : static IAsyncOperation<MediaEncodingProfile> CreateFromStreamAsync(IRandomAccessStream stream)public static IAsyncOperation<MediaEncodingProfile> CreateFromStreamAsync(IRandomAccessStream stream)Public Static Function CreateFromStreamAsync(stream As IRandomAccessStream) As IAsyncOperation( Of MediaEncodingProfile )// You can use this method in JavaScript.
Parameters
stream
IRandomAccessStream IRandomAccessStream IRandomAccessStream IRandomAccessStream

The media stream from which to create the profile.

Returns

CreateHevc(VideoEncodingQuality) CreateHevc(VideoEncodingQuality) CreateHevc(VideoEncodingQuality) CreateHevc(VideoEncodingQuality)

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

public : static MediaEncodingProfile CreateHevc(VideoEncodingQuality quality)public static MediaEncodingProfile CreateHevc(VideoEncodingQuality quality)Public Static Function CreateHevc(quality As VideoEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

CreateM4a(AudioEncodingQuality) CreateM4a(AudioEncodingQuality) CreateM4a(AudioEncodingQuality) CreateM4a(AudioEncodingQuality)

Creates an encoding profile for AAC audio.

public : static MediaEncodingProfile CreateM4a(AudioEncodingQuality quality)public static MediaEncodingProfile CreateM4a(AudioEncodingQuality quality)Public Static Function CreateM4a(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
quality
AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality

Specifies whether to create a profile with a low bit rate, medium bit rate, or high bit rate.

Returns

CreateMp3(AudioEncodingQuality) CreateMp3(AudioEncodingQuality) CreateMp3(AudioEncodingQuality) CreateMp3(AudioEncodingQuality)

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

public : static MediaEncodingProfile CreateMp3(AudioEncodingQuality quality)public static MediaEncodingProfile CreateMp3(AudioEncodingQuality quality)Public Static Function CreateMp3(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
quality
AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality

Specifies whether to create a profile with a low bit rate, medium bit rate, or high bit rate.

Returns

CreateMp4(VideoEncodingQuality) CreateMp4(VideoEncodingQuality) CreateMp4(VideoEncodingQuality) CreateMp4(VideoEncodingQuality)

Creates an encoding profile for H.264 video.

public : static MediaEncodingProfile CreateMp4(VideoEncodingQuality quality)public static MediaEncodingProfile CreateMp4(VideoEncodingQuality quality)Public Static Function CreateMp4(quality As VideoEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
quality
VideoEncodingQuality VideoEncodingQuality VideoEncodingQuality VideoEncodingQuality

Specifies the video resolution of the profile.

Returns

CreateWav(AudioEncodingQuality) CreateWav(AudioEncodingQuality) CreateWav(AudioEncodingQuality) CreateWav(AudioEncodingQuality)

Creates an instance of MediaEncodingProfile for WAV

public : static MediaEncodingProfile CreateWav(AudioEncodingQuality quality)public static MediaEncodingProfile CreateWav(AudioEncodingQuality quality)Public Static Function CreateWav(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
Returns

CreateWma(AudioEncodingQuality) CreateWma(AudioEncodingQuality) CreateWma(AudioEncodingQuality) CreateWma(AudioEncodingQuality)

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

public : static MediaEncodingProfile CreateWma(AudioEncodingQuality quality)public static MediaEncodingProfile CreateWma(AudioEncodingQuality quality)Public Static Function CreateWma(quality As AudioEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
quality
AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality AudioEncodingQuality

Specifies whether to create a profile with a low bit rate, medium bit rate, or high bit rate.

Returns

CreateWmv(VideoEncodingQuality) CreateWmv(VideoEncodingQuality) CreateWmv(VideoEncodingQuality) CreateWmv(VideoEncodingQuality)

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

public : static MediaEncodingProfile CreateWmv(VideoEncodingQuality quality)public static MediaEncodingProfile CreateWmv(VideoEncodingQuality quality)Public Static Function CreateWmv(quality As VideoEncodingQuality) As MediaEncodingProfile// You can use this method in JavaScript.
Parameters
quality
VideoEncodingQuality VideoEncodingQuality VideoEncodingQuality VideoEncodingQuality

Specifies the video resolution of the profile.

Returns

GetAudioTracks() GetAudioTracks() GetAudioTracks() GetAudioTracks()

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

public : IVector<AudioStreamDescriptor> GetAudioTracks()public IList<AudioStreamDescriptor> GetAudioTracks()Public Function GetAudioTracks() As IList( Of AudioStreamDescriptor )// You can use this method in JavaScript.
Returns
IVector<AudioStreamDescriptor> IList<AudioStreamDescriptor> IList<AudioStreamDescriptor> IList<AudioStreamDescriptor>

A list of AudioStreamDescriptor objects.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

GetVideoTracks() GetVideoTracks() GetVideoTracks() GetVideoTracks()

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

public : IVector<VideoStreamDescriptor> GetVideoTracks()public IList<VideoStreamDescriptor> GetVideoTracks()Public Function GetVideoTracks() As IList( Of VideoStreamDescriptor )// You can use this method in JavaScript.
Returns
IVector<VideoStreamDescriptor> IList<VideoStreamDescriptor> IList<VideoStreamDescriptor> IList<VideoStreamDescriptor>

A list of VideoStreamDescriptor objects.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

SetAudioTracks(IIterable) SetAudioTracks(IIterable) SetAudioTracks(IIterable) SetAudioTracks(IIterable)

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

public : void SetAudioTracks(IIterable<AudioStreamDescriptor> value)public void SetAudioTracks(IEnumerable<AudioStreamDescriptor> value)Public Function SetAudioTracks(value As IEnumerable<AudioStreamDescriptor>) As void// You can use this method in JavaScript.
Parameters
value
IIterable<AudioStreamDescriptor> IEnumerable<AudioStreamDescriptor> IEnumerable<AudioStreamDescriptor> IEnumerable<AudioStreamDescriptor>

A list of VideoStreamDescriptor objects.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The Label field for each AudioStreamDescriptor in the collection must be unique. If you attempt to add more than one stream descriptor with the same label, an invalid argument error will occur.

If you set the Audio property, the list of video tracks is reset to a list with a single AudioStreamDescriptor entry. If you retrieve the Audio property after calling SetVideoTracks, the property will return the first entry in the provided list.

SetVideoTracks(IIterable) SetVideoTracks(IIterable) SetVideoTracks(IIterable) SetVideoTracks(IIterable)

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

public : void SetVideoTracks(IIterable<VideoStreamDescriptor> value)public void SetVideoTracks(IEnumerable<VideoStreamDescriptor> value)Public Function SetVideoTracks(value As IEnumerable<VideoStreamDescriptor>) As void// You can use this method in JavaScript.
Parameters
value
IIterable<VideoStreamDescriptor> IEnumerable<VideoStreamDescriptor> IEnumerable<VideoStreamDescriptor> IEnumerable<VideoStreamDescriptor>

A collection of VideoStreamDescriptor objects.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The Label field for each VideoStreamDescriptor in the collection must be unique. If you attempt to add more than one stream descriptor with the same label, an invalid argument error will occur.

If you set the Video property, the list of video tracks is reset to a list with a single VideoStreamDescriptor entry. If you retrieve the Video property after calling SetVideoTracks, the property will return the first entry in the provided list.

See Also