# vah264lpenc

vah264lpenc encodes raw video VA surfaces into H.264 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 ! vah264lpenc ! h264parse ! mp4mux ! filesink location=test.mp4

## Hierarchy

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

## 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-h264:

Presence – always

Direction – src

Object type – GstPad

## Properties

### aud

    “aud” gboolean

Insert AU (Access Unit) delimeter for each frame

Flags : Read / Write / Construct

Default value : false

### b-frames

    “b-frames” guint

Number of B frames between I and P reference frames

Flags : Read / Write / Construct

Default value : 0

### b-pyramid

    “b-pyramid” gboolean

Enable the b-pyramid reference structure in the GOP

Flags : Read / Write / Construct

Default value : false

### bitrate

    “bitrate” guint

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

Flags : Read / Write / Construct

Default value : 0

### cabac

    “cabac” gboolean

Enable CABAC entropy coding mode

Flags : Read / Write / Construct

Default value : true

### cc-insert

    “cc-insert” gboolean

Insert CEA-708 Closed Captions

Flags : Read / Write / Construct

Default value : true

### cpb-size

    “cpb-size” guint

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

Flags : Read / Write / Construct

Default value : 0

### dct8x8

    “dct8x8” gboolean

Enable adaptive use of 8x8 transforms in I-frames

Flags : Read / Write / Construct

Default value : true

### i-frames

    “i-frames” guint

Force the number of I frames insertion within one GOP, not including the first IDR frame

Flags : Read / Write / Construct

Default value : 0

### key-int-max

    “key-int-max” guint

The maximal distance between two keyframes. It decides the size of GOP (0: auto-calculate)

Flags : Read / Write / Construct

Default value : 0

### max-qp

    “max-qp” guint

Maximum quantizer value for each frame

Flags : Read / Write / Construct

Default value : 51

### mbbrc

    “mbbrc” GstVaFeature *

Macroblock level Bitrate Control. Not available in CQP mode

Flags : Read / Write / Construct

Default value : auto (2)

### min-qp

    “min-qp” guint

Minimum quantizer value for each frame

Flags : Read / Write / Construct

Default value : 1

### num-slices

    “num-slices” guint

Number of slices per frame

Flags : Read / Write / Construct

Default value : 1

### qpb

    “qpb” guint

The quantizer value for B frame. Available only in CQP mode

Flags : Read / Write / Construct

Default value : 26

### qpi

    “qpi” guint

The quantizer value for I frame. In CQP mode, it specifies the QP of I frame. In ICQ and QVBR modes, it specifies a quality factor. In other modes, it is ignored

Flags : Read / Write / Construct

Default value : 26

### qpp

    “qpp” guint

The quantizer value for P frame. Available only in CQP mode

Flags : Read / Write / Construct

Default value : 26

### rate-control

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

The desired rate control mode for the encoder

Flags : Read / Write / Construct

Default value : cqp (16)

### ref-frames

    “ref-frames” guint

Number of reference frames, including both the forward and the backward

Flags : Read / Write / Construct

Default value : 3

### target-percentage

    “target-percentage” guint

The percentage for 'target bitrate'/'maximum bitrate' (Only in VBR)

Flags : Read / Write / Construct

Default value : 66

### target-usage

    “target-usage” guint

The target usage to control and balance the encoding speed/quality

Flags : Read / Write / Construct

Default value : 4

### trellis

    “trellis” gboolean

Enable the trellis quantization method

Flags : Read / Write / Construct

Default value : false

## Named constants

### Va-encoder-rate-control_h264_lp_render-d128

#### Members

`cqp` (16) – Constant Quantizer

The results of the search are