Bitrate | bitrate property

VideoEncodingProperties.Bitrate | bitrate property

Gets or sets the video bit rate.

Syntax


var bitrate = videoEncodingProperties.bitrate;
videoEncodingProperties.bitrate = bitrate;

Property value

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

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

Examples

The following example creates an instance of the VideoEncodingProperties class and sets the bit rate. The example also sets and gets other properties of the class.


function getVideoProperties() {
    var videoProperties = new Windows.Media.MediaProperties.VideoEncodingProperties();
    var props = videoProperties.properties;
    // Remove all values from the property set.
    props.clear();

    var videoType = videoProperties.type;
    var videoSubType = videoProperties.subtype;
    if (videoType === "Video" && videoSubType === "H264") {
        // The format is an H.264 video.
    }
    // Set the bitrate. 
    videoProperties.bitrate = value;

    // Get the frame rate ratio.
    var d_value = videoProperties.frameRate.denominator;
    var n_value = videoProperties.frameRate.numerator;

    // Get the pixel aspect ratio.
    d_value = videoProperties.pixelAspectRatio.denominator;
    n_value = videoProperties.pixelAspectRatio.numerator;

    // Set new height and width.
    videoProperties.height = h_Value;
    videoProperties.width = w_Value;
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Media.MediaProperties
Windows::Media::MediaProperties [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.MediaProperties
Windows::Media::MediaProperties [C++]

Metadata

Windows.winmd

See also

VideoEncodingProperties

 

 

Show:
© 2016 Microsoft