VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties Class

Definition

Describes the format of a video stream.

public : sealed class VideoEncodingProperties : IMediaEncodingProperties, IVideoEncodingProperties, IVideoEncodingProperties2, IVideoEncodingProperties3, IVideoEncodingProperties4public sealed class VideoEncodingProperties : IMediaEncodingProperties, IVideoEncodingProperties, IVideoEncodingProperties2, IVideoEncodingProperties3, IVideoEncodingProperties4Public NotInheritable Class VideoEncodingProperties Implements IMediaEncodingProperties, IVideoEncodingProperties, IVideoEncodingProperties2, IVideoEncodingProperties3, IVideoEncodingProperties4// 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

Properties that are manually set are ignored for VideoEncodingProperties created from one of the presets encoding profiles: CreateH264 and CreateMpeg2.

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 an VideoEncodingProperties that is not supported on a particular device. For example, you may successfully call CreateH264, but if an h264 encoder is not present on the device, attempting to encode video 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 setting the encoding properties for captured audio, see Basic photo, video, and audio capture with MediaCapture.

Constructors

VideoEncodingProperties() VideoEncodingProperties() VideoEncodingProperties() VideoEncodingProperties()

Creates a new instance of the VideoEncodingProperties class.

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

Properties

Bitrate Bitrate Bitrate Bitrate

Gets or sets the video bit rate.

public : unsigned int Bitrate { get; set; }public uint Bitrate { get; set; }Public ReadWrite Property Bitrate As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The average bit rate of the video stream, in bits per second.

FrameRate FrameRate FrameRate FrameRate

Gets or sets the video frame rate.

public : MediaRatio FrameRate { get; }public MediaRatio FrameRate { get; }Public ReadOnly Property FrameRate As MediaRatio// You can use this property in JavaScript.
Value
MediaRatio MediaRatio MediaRatio MediaRatio

The frame rate, in frames per second.

The frame rate is expressed as a ratio. For example, if the frame rate is 30 frames per second (fps), the ratio is 30/1. If the frame rate is 29.97 fps, the ratio is 30,000/1001.

Height Height Height Height

Gets or sets the video image height.

public : unsigned int Height { get; set; }public uint Height { get; set; }Public ReadWrite Property Height As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The height of the video image, in pixels.

PixelAspectRatio PixelAspectRatio PixelAspectRatio PixelAspectRatio

Gets or sets the pixel aspect ratio.

public : MediaRatio PixelAspectRatio { get; }public MediaRatio PixelAspectRatio { get; }Public ReadOnly Property PixelAspectRatio As MediaRatio// You can use this property in JavaScript.
Value
MediaRatio MediaRatio MediaRatio MediaRatio

The pixel aspect ratio.

Remarks

The pixel aspect ratio describes the shape of the pixels in the displayed video image. For square pixels, the pixel aspect ratio is 1:1.

ProfileId ProfileId ProfileId ProfileId

Gets or sets the media format profile.

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

The media format profile.

Properties Properties Properties Properties

Gets additional format properties for the video stream.

public : MediaPropertySet Properties { get; }public MediaPropertySet Properties { get; }Public ReadOnly Property Properties As MediaPropertySet// You can use this property in JavaScript.
Value
MediaPropertySet MediaPropertySet MediaPropertySet MediaPropertySet

A property set that contains format properties.

Remarks

For information on working with a property set collection, see PropertySet.

SphericalVideoFrameFormat SphericalVideoFrameFormat SphericalVideoFrameFormat SphericalVideoFrameFormat

Gets a value that specifies the spherical video format of a video frame.

public : SphericalVideoFrameFormat SphericalVideoFrameFormat { get; }public SphericalVideoFrameFormat SphericalVideoFrameFormat { get; }Public ReadOnly Property SphericalVideoFrameFormat As SphericalVideoFrameFormat// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

StereoscopicVideoPackingMode StereoscopicVideoPackingMode StereoscopicVideoPackingMode StereoscopicVideoPackingMode

Gets a value indicating the stereoscopic video packing mode of the video stream.

public : StereoscopicVideoPackingMode StereoscopicVideoPackingMode { get; }public StereoscopicVideoPackingMode StereoscopicVideoPackingMode { get; }Public ReadOnly Property StereoscopicVideoPackingMode As StereoscopicVideoPackingMode// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Subtype Subtype Subtype Subtype

Gets or sets the subtype of the format.

public : PlatForm::String Subtype { get; set; }public string Subtype { get; set; }Public ReadWrite Property Subtype As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The subtype.

Remarks

The value can be the string representation of a GUID in canonical form, or one of the predefined values listed in the following table.

ValueDescription
"ARGB32"RGB, 32 bpp with alpha channel.
"BGRA8"BGRA, 32 bpp with alpha channel.
"D16"16-bit z-buffer depth
"H263"H.263 video
"H264"H.264 video
"H264ES"H.264 elementary stream
"HEVC"HEVC video
"HEVCES"HEVT elementary stream
"IYUV"YUV 8 bpp 4:2:0
"L8"8-bit luminance only.
"L16"16-bit luminance only.
"MJPG"Motion jpeg
"NV12"YUV 8 bpp 4:2:0
"MPEG1"MPEG-1 video
"MPEG2"MPEG-2 video
"RGB24"RGB, 24 bpp
"RGB32"RGB, 32 bpp
"WMV3"Windows Media Video 9 codec
"WVC1"SMPTE 421M ("VC-1") codec
"VP9"VP9 video
"YUY2"YUV 8 bpp 4:2:2
"YV12"YUV 8 bpp 4:2:0

Warning

The string values returned by the MediaEncodingSubtypes properties may not use the same letter casing as AudioEncodingProperties.Subtype, VideoEncodingProperties.Subtype, ContainerEncodingProperties.Subtype, and ImageEncodingProperties.Subtype. For this reason, if you compare the values, you should use a case-insensitive comparison or use hardcoded strings that match the casing returned by the encoding properties.

Type Type Type Type

Gets the format type.

public : PlatForm::String Type { get; }public string Type { get; }Public ReadOnly Property Type As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The format type. For video streams, the format type is "Video".

Width Width Width Width

Gets or sets the video image width.

public : unsigned int Width { get; set; }public uint Width { get; set; }Public ReadWrite Property Width As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The width of the video image, in pixels.

Methods

CreateH264() CreateH264() CreateH264() CreateH264()

Creates an instance of VideoEncodingProperties for a H.263 video.

public : static VideoEncodingProperties CreateH264()public static VideoEncodingProperties CreateH264()Public Static Function CreateH264() As VideoEncodingProperties// You can use this method in JavaScript.
Returns

CreateHevc() CreateHevc() CreateHevc() CreateHevc()

Creates an instance of VideoEncodingProperties for High Efficiency Video Coding (HEVC).

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

CreateMpeg2() CreateMpeg2() CreateMpeg2() CreateMpeg2()

Creates an instance of VideoEncodingProperties for a MPEG-2 video.

public : static VideoEncodingProperties CreateMpeg2()public static VideoEncodingProperties CreateMpeg2()Public Static Function CreateMpeg2() As VideoEncodingProperties// You can use this method in JavaScript.
Returns

CreateUncompressed(String, UInt32, UInt32) CreateUncompressed(String, UInt32, UInt32) CreateUncompressed(String, UInt32, UInt32) CreateUncompressed(String, UInt32, UInt32)

Creates an instance of VideoEncodingProperties for a uncompressed video.

public : static VideoEncodingProperties CreateUncompressed(PlatForm::String subtype, unsigned int width, unsigned int height)public static VideoEncodingProperties CreateUncompressed(String subtype, UInt32 width, UInt32 height)Public Static Function CreateUncompressed(subtype As String, width As UInt32, height As UInt32) As VideoEncodingProperties// You can use this method in JavaScript.
Parameters
subtype
PlatForm::String String String String

The media subtype of the format.

width
unsigned int UInt32 UInt32 UInt32

The video image width.

height
unsigned int UInt32 UInt32 UInt32

The video image height.

Returns

GetFormatUserData(Byte[]) GetFormatUserData(Byte[]) GetFormatUserData(Byte[]) GetFormatUserData(Byte[])

Gets the media format user data.

public : void GetFormatUserData(Byte[] value)public void GetFormatUserData(Byte[] value)Public Function GetFormatUserData(value As Byte[]) As void// You can use this method in JavaScript.
Parameters
value
Byte[] Byte[] Byte[] Byte[]

Receives the media format data.

SetFormatUserData(Byte[]) SetFormatUserData(Byte[]) SetFormatUserData(Byte[]) SetFormatUserData(Byte[])

Sets the media format user data.

public : void SetFormatUserData(Byte[] value)public void SetFormatUserData(Byte[] value)Public Function SetFormatUserData(value As Byte[]) As void// You can use this method in JavaScript.
Parameters
value
Byte[] Byte[] Byte[] Byte[]

The media data to set.

See Also