GstVideo.VideoFormatInfo

Fields

Name

Type

Access

Description

bits

int

r/w

The number of bits used to pack data items. This can be less than 8 when multiple pixels are stored in a byte. for values > 8 multiple bytes should be read according to the endianness flag before applying the shift and mask.

depth

[int]

r/w

the depth in bits for each component

description

str

r/w

use readable description of the format

flags

GstVideo.VideoFormatFlags

r/w

GstVideo.VideoFormatFlags

format

GstVideo.VideoFormat

r/w

GstVideo.VideoFormat

h_sub

[int]

r/w

subsampling factor of the height for the component. Use GST_VIDEO_SUB_SCALE to scale a height.

n_components

int

r/w

the number of components in the video format.

n_planes

int

r/w

the number of planes for this format. The number of planes can be less than the amount of components when multiple components are packed into one plane.

name

str

r/w

string representation of the format

pack_func

GstVideo.VideoFormatPack

r/w

an pack function for this format

pack_lines

int

r/w

the amount of lines that will be packed

pixel_stride

[int]

r/w

the pixel stride of each component. This is the amount of bytes to the pixel immediately to the right. When bits < 8, the stride is expressed in bits. For 24-bit RGB, this would be 3 bytes, for example, while it would be 4 bytes for RGBx or ARGB.

plane

[int]

r/w

the plane number where a component can be found

poffset

[int]

r/w

the offset in the plane where the first pixel of the components can be found.

shift

[int]

r/w

the number of bits to shift away to get the component data

tile_hs

int

r/w

The height of a tile, in bytes, represented as a shift. DEPREACTED, use tile_info[] array instead.

tile_info

[GstVideo.VideoTileInfo]

r/w

Information about the tiles for each of the planes.

tile_mode

GstVideo.VideoTileMode

r/w

The tiling mode

tile_ws

int

r/w

The width of a tile, in bytes, represented as a shift. DEPRECATED, use tile_info[] array instead.

unpack_format

GstVideo.VideoFormat

r/w

the format of the unpacked pixels. This format must have the GstVideo.VideoFormatFlags.UNPACK flag set.

unpack_func

GstVideo.VideoFormatUnpack

r/w

an unpack function for this format

w_sub

[int]

r/w

subsampling factor of the width for the component. Use GST_VIDEO_SUB_SCALE to scale a width.

Methods

component (plane)

extrapolate_stride (plane, stride)

Details

class GstVideo.VideoFormatInfo

Information for a video format.

component(plane)[source]
Parameters:

plane (int) – a plane number

Returns:

array used to store component numbers

Return type:

components: int

Fill components with the number of all the components packed in plane p for the format self. A value of -1 in components indicates that no more components are packed in the plane.

New in version 1.18.

extrapolate_stride(plane, stride)[source]
Parameters:
  • plane (int) – a plane number

  • stride (int) – The fist plane stride

Returns:

The extrapolated stride for plane

Return type:

int

Extrapolate plane stride from the first stride of an image. This helper is useful to support legacy API were only one stride is supported.

New in version 1.22.