# vaav1enc

vaav1enc encodes raw video VA surfaces into AV1 bitstreams using the installed and chosen VA-API driver.

The raw video frames in main memory can be imported into VA surfaces.

## Example launch line

    gst-launch-1.0 videotestsrc num-buffers=60 ! timeoverlay ! vaav1enc ! av1parse ! mp4mux ! filesink location=test.mp4

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstVideoEncoder
                        ╰──GstVaBaseEnc
                            ╰──vaav1enc

## Implemented interfaces

    GstPreset

## Factory details

Authors: – He Junyan

Classification: – `Codec/Encoder/Video/Hardware`

Rank – none

Plugin – va

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink`

    video/x-raw(memory:VAMemory):
             format: { NV12 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-raw:
             format: { NV12 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/x-av1:
          alignment: tu
      stream-format: obu-stream

Presence – always

Direction – src

Object type – GstPad

## Properties

### bitrate

    “bitrate” guint

The desired target bitrate, expressed in kbps. This is not available in CQP mode.

CBR: This applies equally to the minimum, maximum and target bitrate. VBR: This applies to the target bitrate. The driver will use the "target-percentage" together to calculate the minimum and maximum bitrate. VCM: This applies to the target bitrate. The minimum and maximum bitrate are not needed.

Flags : Read / Write / Construct

Default value : 0

### cpb-size

    “cpb-size” guint

The desired max CPB size in Kb (0: auto-calculate).

Flags : Read / Write / Construct

Default value : 0

### gf-group-size

    “gf-group-size” guint

The size of the golden frame group.

Flags : Read / Write / Construct

Default value : 32

### hierarchical-level

    “hierarchical-level” guint

The hierarchical level for golden frame group.

Flags : Read / Write / Construct

Default value : 6

### key-int-max

    “key-int-max” guint

The maximal distance between two keyframes.

Flags : Read / Write / Construct

Default value : 60

### max-qp

    “max-qp” guint

The maximum quantizer value.

Flags : Read / Write / Construct

Default value : 255

### mbbrc

    “mbbrc” GstVaFeature *

Macroblock level bitrate control. This is not compatible with Constant QP rate control.

Flags : Read / Write / Construct

Default value : disabled (0)

### min-qp

    “min-qp” guint

The minimum quantizer value.

Flags : Read / Write / Construct

Default value : 0

### num-tile-cols

    “num-tile-cols” guint

The number of tile columns when tile encoding is enabled.

Flags : Read / Write / Construct

Default value : 1

### num-tile-rows

    “num-tile-rows” guint

The number of tile rows when tile encoding is enabled.

Flags : Read / Write / Construct

Default value : 1

### qp

    “qp” guint

The basic quantizer value for all frames.

Flags : Read / Write / Construct

Default value : 128

### rate-control

    “rate-control” Va-encoder-rate-control_av01_render-d128 *

The desired rate control mode for the encoder

Flags : Read / Write / Construct

Default value : cbr (2)

### ref-frames

    “ref-frames” guint

The number of reference frames.

Flags : Read / Write / Construct

Default value : 7

### superblock-128x128

    “superblock-128x128” gboolean

Enable the 128x128 superblock mode.

Flags : Read / Write / Construct

Default value : false

### target-percentage

    “target-percentage” guint

The target percentage of the max bitrate, and expressed in uint, equal to "target percentage"*100. "target percentage" = "target bitrate" * 100 / "max bitrate" This is available only when rate-control is VBR. The driver uses it to calculate the minimum and maximum bitrate.

Flags : Read / Write / Construct

Default value : 66

### target-usage

    “target-usage” guint

The target usage of the encoder. It controls and balances the encoding speed and the encoding quality. The lower value has better quality but slower speed, the higher value has faster speed but lower quality.

Flags : Read / Write / Construct

Default value : 4

### tile-groups

    “tile-groups” guint

The number of tile groups for each frame.

Flags : Read / Write / Construct

Default value : 1

## Named constants

### Va-encoder-rate-control_av01_render-d128

#### Members

`cbr` (2) – Constant Bitrate
`vbr` (4) – Variable Bitrate
`cqp` (16) – Constant Quantizer

The results of the search are