GstVideo.VideoInfo

Fields

Name

Type

Access

Description

chroma_site

GstVideo.VideoChromaSite

r/w

a GstVideo.VideoChromaSite.

colorimetry

GstVideo.VideoColorimetry

r/w

the colorimetry info

finfo

GstVideo.VideoFormatInfo

r/w

the format info of the video

flags

GstVideo.VideoFlags

r/w

additional video flags

fps_d

int

r/w

the framerate denominator

fps_n

int

r/w

the framerate numerator

height

int

r/w

the height of the video

interlace_mode

GstVideo.VideoInterlaceMode

r/w

the interlace mode

offset

[int]

r/w

offsets of the planes

par_d

int

r/w

the pixel-aspect-ratio denominator

par_n

int

r/w

the pixel-aspect-ratio numerator

size

int

r/w

the default size of one frame

stride

[int]

r/w

strides of the planes

views

int

r/w

the number of views for multiview video

width

int

r/w

the width of the video

Methods

class

from_caps (caps)

class

init ()

class

new ()

class

new_from_caps (caps)

align (align)

align_full (align)

convert (src_format, src_value, dest_format)

copy ()

free ()

is_equal (other)

set_format (format, width, height)

set_interlaced_format (format, mode, width, height)

to_caps ()

Details

class GstVideo.VideoInfo

Information describing image properties. This information can be filled in from Gst.Caps with GstVideo.VideoInfo.from_caps(). The information is also used to store the specific video info when mapping a video frame with GstVideo.VideoFrame.map().

Use the provided macros to access the info in this structure.

classmethod from_caps(caps)[source]
Parameters:

caps (Gst.Caps) – a Gst.Caps

Returns:

True if caps could be parsed

info:

GstVideo.VideoInfo

Return type:

(bool, info: GstVideo.VideoInfo)

Parse caps and update info.

classmethod init()[source]
Returns:

a GstVideo.VideoInfo

Return type:

info: GstVideo.VideoInfo

Initialize info with default values.

classmethod new()[source]
Returns:

a new GstVideo.VideoInfo. free with GstVideo.VideoInfo.free().

Return type:

GstVideo.VideoInfo

Allocate a new GstVideo.VideoInfo that is also initialized with GstVideo.VideoInfo.init().

New in version 1.6.

classmethod new_from_caps(caps)[source]
Parameters:

caps (Gst.Caps) – a Gst.Caps

Returns:

A GstVideo.VideoInfo, or None if caps couldn’t be parsed

Return type:

GstVideo.VideoInfo or None

Parse caps to generate a GstVideo.VideoInfo.

New in version 1.20.

align(align)[source]
Parameters:

align (GstVideo.VideoAlignment) – alignment parameters

Returns:

False if alignment could not be applied, e.g. because the size of a frame can’t be represented as a 32 bit integer

Return type:

bool

Adjust the offset and stride fields in self so that the padding and stride alignment in align is respected.

Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

align_full(align)[source]
Parameters:

align (GstVideo.VideoAlignment) – alignment parameters

Returns:

False if alignment could not be applied, e.g. because the size of a frame can’t be represented as a 32 bit integer

plane_size:

array used to store the plane sizes

Return type:

(bool, plane_size: int)

Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

This variant of GstVideo.VideoInfo.align() provides the updated size, in bytes, of each video plane after the alignment, including all horizontal and vertical paddings.

In case of GstVideo.VideoInterlaceMode.ALTERNATE info, the returned sizes are the ones used to hold a single field, not the full frame.

New in version 1.18.

convert(src_format, src_value, dest_format)[source]
Parameters:
Returns:

True if the conversion was successful.

dest_value:

pointer to destination value

Return type:

(bool, dest_value: int)

Converts among various Gst.Format types. This function handles Gst.Format.BYTES, Gst.Format.TIME, and Gst.Format.DEFAULT. For raw video, Gst.Format.DEFAULT corresponds to video frames. This function can be used to handle pad queries of the type Gst.QueryType.CONVERT.

copy()[source]
Returns:

a new GstVideo.VideoInfo. free with GstVideo.VideoInfo.free.

Return type:

GstVideo.VideoInfo

Copy a GstVideo.VideoInfo structure.

New in version 1.6.

free()[source]

Free a GstVideo.VideoInfo structure previously allocated with GstVideo.VideoInfo.new() or GstVideo.VideoInfo.copy().

New in version 1.6.

is_equal(other)[source]
Parameters:

other (GstVideo.VideoInfo) – a GstVideo.VideoInfo

Returns:

True if self and other are equal, else False.

Return type:

bool

Compares two GstVideo.VideoInfo and returns whether they are equal or not

set_format(format, width, height)[source]
Parameters:
Returns:

False if the returned video info is invalid, e.g. because the size of a frame can’t be represented as a 32 bit integer

Return type:

bool

Set the default info for a video frame of format and width and height.

Note: This initializes self first, no values are preserved. This function does not set the offsets correctly for interlaced vertically subsampled formats.

set_interlaced_format(format, mode, width, height)[source]
Parameters:
Returns:

False if the returned video info is invalid, e.g. because the size of a frame can’t be represented as a 32 bit integer.

Return type:

bool

Same as GstVideo.VideoInfo.set_format but also allowing to set the interlaced mode.

New in version 1.16.

to_caps()[source]
Returns:

a new Gst.Caps containing the info of self.

Return type:

Gst.Caps

Convert the values of self into a Gst.Caps.