# vaapimpeg2enc

Encodes raw video streams into MPEG2 bitstreams.

## Example launch line

      gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapimpeg2enc ! matroskamux ! filesink location=test.mkv

## Hierarchy

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

## Implemented interfaces

    GstPreset

## Factory details

Authors: – Guangxin Xu <guangxin.xu></guangxin.xu>

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

Rank – primary

Plugin – vaapi

Package – gstreamer-vaapi

## Pad Templates

### `sink`

    video/x-raw:
             format: { NV12, YV12, I420 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
     interlace-mode: progressive

    video/x-raw(memory:VASurface):
             format: { NV12, YV12, I420 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
     interlace-mode: progressive

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/mpeg:
        mpegversion: 2
       systemstream: false

Presence – always

Direction – src

Object type – GstPad

## Properties

### bitrate

    “bitrate” guint

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

Flags : Read / Write

Default value : 0

### default-roi-delta-qp

    “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)

Flags : Read / Write

Default value : -10

### keyframe-period

    “keyframe-period” guint

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

Flags : Read / Write

Default value : 30

### max-bframes

    “max-bframes” guint

Number of B-frames between I and P

Flags : Read / Write

Default value : 0

### min-force-key-unit-interval

    “min-force-key-unit-interval” guint64

Minimum interval between force-keyunit requests in nanoseconds

Flags : Read / Write

Default value : 0

### qos

    “qos” gboolean

Handle Quality-of-Service events from downstream

Flags : Read / Write

Default value : false

### quality-level

    “quality-level” guint

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

Flags : Read / Write

Default value : 4

### quantizer

    “quantizer” guint

Constant quantizer (if rate-control mode is CQP)

Flags : Read / Write

Default value : 8

### rate-control

    “rate-control” Vaapi-rate-control-mpeg2 *

Rate control mode

Flags : Read / Write

Default value : cqp (1)

### target-percentage

    “target-percentage” guint

The desired target percentage of bitrate for variable rate controls.

Flags : Read / Write

Default value : 70

### trellis

    “trellis” gboolean

The Trellis Quantization Method of Encoder

Flags : Read / Write

Default value : false

### tune

    “tune” Vaapi-encoder-tune-mpeg2 *

Encoder tuning option

Flags : Read / Write

Default value : none (0)

## Named constants

### Vaapi-encoder-tune-mpeg2

#### Members

`none` (0) – None

### Vaapi-rate-control-mpeg2

#### Members

`cqp` (1) – Constant QP
`cbr` (2) – Constant bitrate

The results of the search are