GstVideo.VideoMeta

Fields

Name

Type

Access

Description

alignment

GstVideo.VideoAlignment

r/w

the paddings and alignment constraints of the video buffer. It is up to the caller of gst_buffer_add_video_meta_full() to set it using GstVideo.VideoMeta.set_alignment(), if they did not it defaults to no padding and no alignment.

buffer

Gst.Buffer

r/w

the buffer this metadata belongs to

flags

GstVideo.VideoFrameFlags

r/w

additional video flags

format

GstVideo.VideoFormat

r/w

the video format

height

int

r/w

the video height

id

int

r/w

identifier of the frame

map

object

r

map the memory of a plane

meta

Gst.Meta

r/w

parent Gst.Meta

n_planes

int

r/w

the number of planes in the image

offset

[int]

r/w

array of offsets for the planes. This field might not always be valid, it is used by the default implementation of map.

stride

[int]

r/w

array of strides for the planes. This field might not always be valid, it is used by the default implementation of map.

unmap

object

r

unmap the memory of a plane

width

int

r/w

the video width

Methods

class

get_info ()

get_plane_height ()

get_plane_size ()

set_alignment (alignment)

Details

class GstVideo.VideoMeta

Extra buffer metadata describing image properties

This meta can also be used by downstream elements to specifiy their buffer layout requirements for upstream. Upstream should try to fit those requirements, if possible, in order to prevent buffer copies.

This is done by passing a custom Gst.Structure to Gst.Query.add_allocation_meta() when handling the ALLOCATION query. This structure should be named ‘video-meta’ and can have the following fields:

  • padding-top (uint): extra pixels on the top

  • padding-bottom (uint): extra pixels on the bottom

  • padding-left (uint): extra pixels on the left side

  • padding-right (uint): extra pixels on the right side The padding fields have the same semantic as GstVideo.VideoMeta.alignment and so represent the paddings requested on produced video buffers.

Since 1.24 it can be serialized using Gst.Meta.serialize() and Gst.Meta.deserialize().

classmethod get_info()[source]
Return type:

Gst.MetaInfo

get_plane_height()[source]
Returns:

True if self's alignment is valid and plane_height has been updated, False otherwise

plane_height:

array used to store the plane height

Return type:

(bool, plane_height: [int])

Compute the padded height of each plane from self (padded size divided by stride).

It is not valid to call this function with a meta associated to a TILED video format.

New in version 1.18.

get_plane_size()[source]
Returns:

True if self's alignment is valid and plane_size has been updated, False otherwise

plane_size:

array used to store the plane sizes

Return type:

(bool, plane_size: [int])

Compute the size, in bytes, of each video plane described in self including any padding and alignment constraint defined in self->alignment.

New in version 1.18.

set_alignment(alignment)[source]
Parameters:

alignment (GstVideo.VideoAlignment) – a GstVideo.VideoAlignment

Returns:

True if alignment's meta has been updated, False if not

Return type:

bool

Set the alignment of self to alignment. This function checks that the paddings defined in alignment are compatible with the strides defined in self and will fail to update if they are not.

New in version 1.18.