GstVideo.VideoInfo¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
chroma_site |
r/w |
||
colorimetry |
r/w |
the colorimetry info |
|
finfo |
r/w |
the format info of the video |
|
flags |
r/w |
additional video flags |
|
fps_d |
r/w |
the framerate denominator |
|
fps_n |
r/w |
the framerate numerator |
|
height |
r/w |
the height of the video |
|
interlace_mode |
r/w |
the interlace mode |
|
offset |
[ |
r/w |
offsets of the planes |
par_d |
r/w |
the pixel-aspect-ratio denominator |
|
par_n |
r/w |
the pixel-aspect-ratio numerator |
|
size |
r/w |
the default size of one frame |
|
stride |
[ |
r/w |
strides of the planes |
views |
r/w |
the number of views for multiview video |
|
width |
r/w |
the width of the video |
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstVideo.VideoInfo¶
Information describing image properties. This information can be filled in from
Gst.CapswithGstVideo.VideoInfo.from_caps(). The information is also used to store the specific video info when mapping a video frame withGstVideo.VideoFrame.map().Use the provided macros to access the info in this structure.
- classmethod from_caps(caps)[source]¶
- Parameters:
- Returns:
Trueif caps could be parsed- info:
- Return type:
(
bool, info:GstVideo.VideoInfo)
Parse caps and update info.
- classmethod init()[source]¶
- Returns:
- Return type:
info:
GstVideo.VideoInfo
Initialize info with default values.
- classmethod new()[source]¶
- Returns:
a new
GstVideo.VideoInfo. free withGstVideo.VideoInfo.free().- Return type:
Allocate a new
GstVideo.VideoInfothat is also initialized withGstVideo.VideoInfo.init().New in version 1.6.
- classmethod new_from_caps(caps)[source]¶
- Parameters:
- Returns:
A
GstVideo.VideoInfo, orNoneif caps couldn’t be parsed- Return type:
Parse caps to generate a
GstVideo.VideoInfo.New in version 1.20.
- align(align)[source]¶
- Parameters:
align (
GstVideo.VideoAlignment) – alignment parameters- Returns:
Falseif alignment could not be applied, e.g. because the size of a frame can’t be represented as a 32 bit integer- Return type:
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:
Falseif 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:
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.ALTERNATEinfo, 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:
src_format (
Gst.Format) –Gst.Formatof the src_valuesrc_value (
int) – value to convertdest_format (
Gst.Format) –Gst.Formatof the dest_value
- Returns:
Trueif the conversion was successful.- dest_value:
pointer to destination value
- Return type:
Converts among various
Gst.Formattypes. This function handlesGst.Format.BYTES,Gst.Format.TIME, andGst.Format.DEFAULT. For raw video,Gst.Format.DEFAULTcorresponds to video frames. This function can be used to handle pad queries of the typeGst.QueryType.CONVERT.
- copy()[source]¶
- Returns:
a new
GstVideo.VideoInfo. free withGstVideo.VideoInfo.free.- Return type:
Copy a
GstVideo.VideoInfostructure.New in version 1.6.
- free()[source]¶
Free a
GstVideo.VideoInfostructure previously allocated withGstVideo.VideoInfo.new() orGstVideo.VideoInfo.copy().New in version 1.6.
- is_equal(other)[source]¶
- Parameters:
other (
GstVideo.VideoInfo) – aGstVideo.VideoInfo- Returns:
- Return type:
Compares two
GstVideo.VideoInfoand returns whether they are equal or not
- set_format(format, width, height)[source]¶
- Parameters:
format (
GstVideo.VideoFormat) – the formatwidth (
int) – a widthheight (
int) – a height
- Returns:
Falseif 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:
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:
format (
GstVideo.VideoFormat) – the formatmode (
GstVideo.VideoInterlaceMode) – aGstVideo.VideoInterlaceModewidth (
int) – a widthheight (
int) – a height
- Returns:
Falseif 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:
Same as
GstVideo.VideoInfo.set_formatbut also allowing to set the interlaced mode.New in version 1.16.