vaapih264enc: GStreamer VA-API Plugins 1.0 Plugins Reference Manual

## vaapih264enc vaapih264enc — A VA-API based H.264 video encoder |

## Properties

gboolean | aud | Read / Write
guint | bitrate | Read / Write
gboolean | cabac | Read / Write
GstVaapiEncoderH264ComplianceMode | compliance-mode | Read / Write
guint | cpb-length | Read / Write
gboolean | dct8x8 | Read / Write
gint | default-roi-delta-qp | Read / Write
guint | init-qp | Read / Write
guint | keyframe-period | Read / Write
guint | max-bframes | Read / Write
GstVaapiEncoderMbbrc | mbbrc | Read / Write
guint | min-qp | Read / Write
guint | num-slices | Read / Write
guint | num-views | Read / Write
GstVaapiEncoderH264PredictionType | prediction-type | Read / Write
gint | qp-ib | Read / Write
gint | qp-ip | Read / Write
guint | quality-level | Read / Write
GstVaapiRateControlH264 | rate-control | Read / Write
guint | refs | Read / Write
guint | temporal-levels | Read / Write
GstVaapiEncoderTuneH264 | tune | Read / Write
GstValueArray | view-ids | Read / Write

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstVideoEncoder
                        ╰── GstVaapiEncode
                            ╰── GstVaapiEncodeH264

## Description

Encodes raw video streams into H.264 bitstreams.

The “rate-control” property controls the type of encoding. In case of Constant Bitrate Encoding (CBR), the “bitrate” will determine the quality of the encoding. Alternatively, one may choose to perform Constant Quantizer or Variable Bitrate Encoding (VBR), in which case the “bitrate” is the maximum bitrate.

The H264 profile that is eventually used depends on a few settings. If “dct8x8” is enabled, then High profile is used. Otherwise, if “cabac” entropy coding is enabled or “max-bframes” are allowed, then Main Profile is in effect. The element will alway go with the maximal profile available in the caps negotation and otherwise Baseline profile applies. But in some cases (e.g. hardware platforms) a more restrictedprofile/level may be necessary. The recommended way to set a profile is to set it in the downstream caps.

You can also set parameters to adjust the latency of encoding: “quality-level” is a number between 1-7, in the case of the Intel VAAPI driver, where a lower value will produce a higher quality output but with more latency; meanwhile a hihg number will produce a lower quality output with less latency. Also you can set “tune”, if your backend supports it, for low-power mode or high compression.

### Example launch line

    1
    gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! h264parse ! mp4mux ! filesink location=test.mp4

## Synopsis

### Element Information

plugin | vaapi
author | Wind Yuan <feng.yuan@intel.com>
class | Codec/Encoder/Video/Hardware

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV, Y410 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive
| video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, VUYA, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, Y210, Y410, NV12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, BGR10A2_LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, NV12_10LE32, NV16_10LE32, NV12_10LE40 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], interlace-mode=(string)progressive

name | src
direction | source
presence | always
details | video/x-h264, stream-format=(string){ avc, byte-stream }, alignment=(string)au, profile=(string){ constrained-baseline, baseline, main, high, multiview-high, stereo-high }

## Functions

## Property Details

### The `“aud”` property

      “aud”                      gboolean

Use AU (Access Unit) delimeter.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: FALSE

### The `“bitrate”` property

      “bitrate”                  guint

The desired bitrate expressed in kbps (0: auto-calculate).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: <= 2048000

Default value: 0

### The `“cabac”` property

      “cabac”                    gboolean

Enable CABAC entropy coding mode.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: FALSE

### The `“compliance-mode”` property

      “compliance-mode”          GstVaapiEncoderH264ComplianceMode

Tune Encode quality/performance by relaxing specification compliance restrictions.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: Strict compliance to the H264 Specification

### The `“cpb-length”` property

      “cpb-length”               guint

Length of the CPB buffer in milliseconds.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,10000]

Default value: 1500

### The `“dct8x8”` property

      “dct8x8”                   gboolean

Enable adaptive use of 8x8 transforms in I-frames.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: FALSE

### The `“default-roi-delta-qp”` property

      “default-roi-delta-qp”     gint

The default delta-qp to apply to each Region of Interest(lower value means higher-quality, higher value means lower-quality).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [-10,10]

Default value: -10

### The `“init-qp”` property

      “init-qp”                  guint

Initial quantizer value.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: <= 51

Default value: 26

### The `“keyframe-period”` property

      “keyframe-period”          guint

Maximal distance between two keyframes (0: auto-calculate).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: 30

### The `“max-bframes”` property

      “max-bframes”              guint

Number of B-frames between I and P.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: <= 10

Default value: 0

### The `“mbbrc”` property

      “mbbrc”                    GstVaapiEncoderMbbrc

Macroblock level Bitrate Control.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: Auto

### The `“min-qp”` property

      “min-qp”                   guint

Minimum quantizer value.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: <= 51

Default value: 1

### The `“num-slices”` property

      “num-slices”               guint

Number of slices per frame.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,200]

Default value: 1

### The `“num-views”` property

      “num-views”                guint

Number of Views for MVC encoding.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,10]

Default value: 1

### The `“prediction-type”` property

      “prediction-type”          GstVaapiEncoderH264PredictionType

Reference Picture Selection Modes.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: Default encode, prev/next frame as ref

### The `“qp-ib”` property

      “qp-ib”                    gint

Difference of QP between I and B frame (available only on CQP).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [-51,51]

Default value: 0

### The `“qp-ip”` property

      “qp-ip”                    gint

Difference of QP between I and P frame (available only on CQP).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [-51,51]

Default value: 0

### The `“quality-level”` property

      “quality-level”            guint

Encoding Quality Level (lower value means higher-quality/slow-encode, higher value means lower-quality/fast-encode).

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,7]

Default value: 4

### The `“rate-control”` property

      “rate-control”             GstVaapiRateControlH264

Rate control mode.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: Constant QP

### The `“refs”` property

      “refs”                     guint

Number of reference frames.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,8]

Default value: 1

### The `“temporal-levels”` property

      “temporal-levels”          guint

Number of temporal levels in the encoded stream .

Owner: GstVaapiEncodeH264

Flags: Read / Write

Allowed values: [1,4]

Default value: 1

### The `“tune”` property

      “tune”                     GstVaapiEncoderTuneH264

Encoder tuning option.

Owner: GstVaapiEncodeH264

Flags: Read / Write

Default value: None

### The `“view-ids”` property

      “view-ids”                 GstValueArray

Set of View Ids used for MVC encoding.

Owner: GstVaapiEncodeH264

Flags: Read / Write