Top |
Properties
GstVideoFormat | format | Read / Write |
guint | frame-stride | Read / Write |
GstFraction | framerate | Read / Write |
gint | height | Read / Write |
gboolean | interlaced | Read / Write |
GstFraction | pixel-aspect-ratio | Read / Write |
GValueArray * | plane-offsets | Read / Write |
GValueArray * | plane-strides | Read / Write |
gboolean | top-field-first | Read / Write |
gint | width | Read / Write |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GstObject ╰── GstElement ╰── GstBaseParse ╰── GstRawBaseParse ╰── GstRawVideoParse
Description
This element parses incoming data as raw video frames and timestamps these. It also handles seek queries in said raw video data, and ensures that output buffers contain exactly one frame, even if the input buffers contain only partial frames or multiple frames. In the former case, it will continue to receive buffers until there is enough input data to output one frame. In the latter case, it will extract the first frame in the buffer and output it, then the second one etc. until the remaining unparsed bytes aren't enough to form a complete frame, and it will then continue as described in the earlier case.
The element implements the properties and sink caps configuration as specified in the GstRawBaseParse documentation. The properties configuration can be modified by using the width, height, pixel-aspect-ratio, framerate, interlaced, top-field-first, plane-strides, plane-offsets, and frame-stride properties.
If the properties configuration is used, plane strides and offsets will be
computed by using gst_video_info_set_format()
. This can be overridden by passing
GValueArrays to the plane-offsets and plane-strides properties. When this is
done, these custom offsets and strides are used later even if new width,
height, format etc. property values might be set. To switch back to computed
plane strides & offsets, pass NULL to one or both of the plane-offset and
plane-array properties.
The frame stride property is useful in cases where there is extra data between the frames (for example, trailing metadata, or headers). The parser calculates the actual frame size out of the other properties and compares it with this frame-stride value. If the frame stride is larger than the calculated size, then the extra bytes after the end of the frame are skipped. For example, with 8-bit grayscale frames and a frame size of 100x10 pixels and a frame stride of 1500 bytes, there are 500 excess bytes at the end of the actual frame which are then skipped. It is safe to set the frame stride to a value that is smaller than the actual frame size (in fact, its default value is 0); if it is smaller, then no trailing data will be skipped.
If a framerate of 0 Hz is set (for example, 0/1), then output buffers will have no duration set. The first output buffer will have a PTS 0, all subsequent ones an unset PTS.
Example pipelines
1 2 |
gst-launch-1.0 filesrc location=video.raw ! rawvideoparse use-sink-caps=false \ width=500 height=400 format=y444 ! autovideosink |
1 2 3 |
gst-launch-1.0 filesrc location=video.raw ! queue ! "video/x-raw, width=320, \ height=240, format=I420, framerate=1/1" ! rawvideoparse \ use-sink-caps=true ! autovideosink |
Synopsis
Element Information
plugin |
rawparse |
author |
Carlos Rafael Giani <dv@pseudoterminal.org> |
class |
Codec/Parser/Video |
Element Pads
name |
sink |
direction |
sink |
presence |
always |
details |
video/x-unaligned-raw, format=(string){ I420, YV12, YUY2, UYVY, VYUY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, IYU2, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE, P010_10LE, P010_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ] |
video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, VYUY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, IYU2, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE, P010_10LE, P010_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ] |
name |
src |
direction |
source |
presence |
always |
details |
video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, VYUY, AYUV, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, NV12, NV21, NV16, NV61, NV24, GRAY8, GRAY16_BE, GRAY16_LE, v308, IYU2, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE, I420_10BE, I422_10LE, I422_10BE, Y444_10LE, Y444_10BE, GBR, GBR_10LE, GBR_10BE, NV12_64Z32, A420_10LE, A420_10BE, A422_10LE, A422_10BE, A444_10LE, A444_10BE, P010_10LE, P010_10BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ] |
Property Details
The “format”
property
“format” GstVideoFormat
Format of frames in raw stream.
Flags: Read / Write
Default value: GST_VIDEO_FORMAT_I420
The “frame-stride”
property
“frame-stride” guint
Stride between whole frames (0 = frames are tightly packed together).
Flags: Read / Write
Default value: 0
The “height”
property
“height” gint
Height of frames in raw stream.
Flags: Read / Write
Allowed values: >= 0
Default value: 240
The “interlaced”
property
“interlaced” gboolean
True if frames in raw stream are interlaced.
Flags: Read / Write
Default value: FALSE
The “pixel-aspect-ratio”
property
“pixel-aspect-ratio” GstFraction
Pixel aspect ratio of frames in raw stream.
Flags: Read / Write
The “plane-offsets”
property
“plane-offsets” GValueArray *
Offsets of the planes in bytes.
Flags: Read / Write
The “plane-strides”
property
“plane-strides” GValueArray *
Strides of the planes in bytes.
Flags: Read / Write
The “top-field-first”
property
“top-field-first” gboolean
True if top field in frames in raw stream come first (not used if frames aren't interlaced).
Flags: Read / Write
Default value: FALSE
The “width”
property
“width” gint
Width of frames in raw stream.
Flags: Read / Write
Allowed values: >= 0
Default value: 320