VideoEncodingProperties.PixelAspectRatio | pixelAspectRatio property

Applies to Windows and Windows Phone

Gets or sets the pixel aspect ratio.

Syntax


var pixelAspectRatio = videoEncodingProperties.pixelAspectRatio;

Property value

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

Examples

The following example creates an instance of the VideoEncodingProperties class and gets the pixel aspect ratio. 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

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:
© 2014 Microsoft. All rights reserved.