VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties VideoEncodingProperties Class

Describes the format of a video stream.

Syntax

Declaration

public sealed class VideoEncodingPropertiespublic sealed class VideoEncodingPropertiesPublic NotInheritable Class VideoEncodingPropertiespublic sealed class VideoEncodingProperties

Remarks

Properties that are manually set are ignored for @Windows.Media.MediaProperties.VideoEncodingProperties.#ctor 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(AudioEncodingQuality), 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 summary

Creates a new instance of the VideoEncodingProperties class.

Properties summary

Gets or sets the video bit rate.

Gets or sets the video frame rate.

Gets or sets the video image height.

Gets or sets the pixel aspect ratio.

Gets or sets the media format profile.

Gets additional format properties for the video stream.

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

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

Gets or sets the subtype of the format.

Gets the format type.

Gets or sets the video image width.

Methods summary

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

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

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

Creates an instance of VideoEncodingProperties for a uncompressed video.

Gets the media format user data.

Sets the media format user data.

Constructors

  • VideoEncodingProperties()
    VideoEncodingProperties()
    VideoEncodingProperties()
    VideoEncodingProperties()

    Creates a new instance of the VideoEncodingProperties class.

    public VideoEncodingProperties()public New()Public Sub New()public VideoEncodingProperties()

Properties

  • Bitrate
    Bitrate
    Bitrate
    Bitrate

    Gets or sets the video bit rate.

    public uint Bitrate { get; set; }public uint Bitrate { get; set; }Public ReadWrite Property Bitrate As uintpublic uint Bitrate { get; set; }

    Property Value

    • uint
      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 MediaRatiopublic MediaRatio FrameRate { get; }

    Property Value

    • 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 uint Height { get; set; }public uint Height { get; set; }Public ReadWrite Property Height As uintpublic uint Height { get; set; }

    Property Value

    • uint
      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 MediaRatiopublic MediaRatio PixelAspectRatio { get; }

    Property Value

    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 intpublic int ProfileId { get; set; }

    Property 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 MediaPropertySetpublic MediaPropertySet Properties { get; }

    Property Value

    Remarks

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

  • SphericalVideoFrameFormat
    SphericalVideoFrameFormat
    SphericalVideoFrameFormat
    SphericalVideoFrameFormat

    Prerelease. 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 SphericalVideoFrameFormatpublic SphericalVideoFrameFormat SphericalVideoFrameFormat { get; }

    Property Value

  • 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 StereoscopicVideoPackingModepublic StereoscopicVideoPackingMode StereoscopicVideoPackingMode { get; }

    Property Value

  • Subtype
    Subtype
    Subtype
    Subtype

    Gets or sets the subtype of the format.

    public string Subtype { get; set; }public string Subtype { get; set; }Public ReadWrite Property Subtype As stringpublic string Subtype { get; set; }

    Property Value

    • 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 Subtype, Subtype, Subtype, and 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 string Type { get; }public string Type { get; }Public ReadOnly Property Type As stringpublic string Type { get; }

    Property Value

    • 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 uint Width { get; set; }public uint Width { get; set; }Public ReadWrite Property Width As uintpublic uint Width { get; set; }

    Property Value

    • uint
      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 VideoEncodingPropertiespublic static VideoEncodingProperties CreateH264()

    Returns

  • CreateHevc()
    CreateHevc()
    CreateHevc()
    CreateHevc()

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

    public static VideoEncodingProperties CreateHevc()public static VideoEncodingProperties CreateHevc()Public Static Function CreateHevc() As VideoEncodingPropertiespublic static VideoEncodingProperties CreateHevc()

    Returns

  • 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 VideoEncodingPropertiespublic static VideoEncodingProperties CreateMpeg2()

    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(String subtype, UInt32 width, UInt32 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 VideoEncodingPropertiespublic static VideoEncodingProperties CreateUncompressed(String subtype, UInt32 width, UInt32 height)

    Parameters

    • subtype
      System.String
      System.String
      System.String
      System.String

      The media subtype of the format.

    • width
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The video image width.

    • height
      System.UInt32
      System.UInt32
      System.UInt32
      System.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 voidpublic void GetFormatUserData(Byte[] value)

    Parameters

    • value
      System.Byte[]
      System.Byte[]
      System.Byte[]
      System.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 voidpublic void SetFormatUserData(Byte[] value)

    Parameters

    • value
      System.Byte[]
      System.Byte[]
      System.Byte[]
      System.Byte[]

      The media data to set.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Media.MediaProperties.dll