# v4l2h264enc
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264enc.html](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264enc.html)
The v4l2h264enc plugin uses the V4L2 APIs to encode the video stream.
- The plugin uses the H.264 video encoder to provide hardware accelerated H.264
(MPEG-4 Part 10) encoding on supported platforms.
- The plugin is based on the [GstVideoEncoder](https://gstreamer.freedesktop.org/documentation/video/gstvideoencoder.html?gi-language=c) base class.
## Inheritance chain
[GObject](https://docs.gtk.org/gobject/) → [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c) → [GstElement](https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c) → [GstVideoEncoder](https://gstreamer.freedesktop.org/documentation/video/gstvideoencoder.html?gi-language=c) → GstV4l2VideoEnc →
v4l2h264enc
The following tables provide information on pad templates and element properties of
v4l2h264enc. For use cases, see [Video encode and decode](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-and-video-encode.html) and
[Slice-based encoding](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-and-video-encode.html#slice-based-encoding).
## Pad configuration
| Pad Name | Capabilities | Capabilities | Capabilities |
| --- | --- | --- | --- |
| SINK template: 'sink'
- Availability: Always
- Direction: sink
| video/x-raw | format: | { (string)NV12, (string)NV21 } |
| SINK template: 'sink'
- Availability: Always
- Direction: sink
| video/x-raw | width: | [ 1, 32768 ] |
| SINK template: 'sink'
- Availability: Always
- Direction: sink
| video/x-raw | height: | [ 1, 32768 ] |
| SINK template: 'sink'
- Availability: Always
- Direction: sink
| video/x-raw | framerate: | [ 0/1, 2147483647/1 ] |
| SRC template: 'src'
- Availability: Always
- Direction: source
| video/x-h264 | alignment: | au |
| SRC template: 'src'
- Availability: Always
- Direction: source
| video/x-h264 | stream-format: | byte-stream |
| SRC template: 'src'
- Availability: Always
- Direction: source
| video/x-h264 | level: | { (string)1, (string)1b, (string)1.1, (string)1.2, (string)1.3,
(string)2, (string)2.1, (string)2.2, (string)3, (string)3.1,
(string)3.2, (string)4, (string)4.1, (string)4.2, (string)5,
(string)5.1 } |
| SRC template: 'src'
- Availability: Always
- Direction: source
| video/x-h264 | profile: | { (string)baseline, (string)constrained-baseline, (string)main,
(string)high, (string)constrained-high } |
| | | | |
| | | | |
| | | | |
## Element configuration
Table : Element properties of v4l2h264enc
| Property | Description |
| --- | --- |
| capture-io-mode | Capture I/O mode (matches src pad).
- flags: readable, writable
- Enum "GstV4l2IOMode"; default: 0, "auto"
- (0): auto - GST_V4L2_IO_AUTO
- (1): rw - GST_V4L2_IO_RW
- (2): mmap - GST_V4L2_IO_MMAP
- (3): userptr - GST_V4L2_IO_USERPTR
- (4): dmabuf - GST_V4L2_IO_DMABUF
- (5): dmabuf-import - GST_V4L2_IO_DMABUF_IMPORT
|
| device | Device location.
- flags: readable
- String. Default: "/dev/video1"
|
| device-fd | File descriptor of the device.
- flags: readable
- Integer. Range: ˗1 to 2147483647, default: ˗1
|
| device-name | Name of the device.
- flags: readable
- String. Default: null
|
| extra-controls | Extra v4l2 control IDs (CIDs) for the device.
- flags: readable, writable
- Boxed pointer of type "GstStructure"
|
| min-force-key-unit-interval | Minimum interval between force-key unit requests in
nanoseconds.
- flags: readable, writable
- Unsigned Integer 64
- Range: 0 - 18446744073709551615; default: 0
|
| name | The name of the object.
- flags: readable, writable, 0x2000
- String. Default: "v4l2h264enc0"
|
| output-io-mode | Output side I/O mode (matches sink pad).
|
| parent | The parent of the object.
- flags: readable, writable, 0x2000
- Object of type "GstObject"
|
| qos | Handle Quality-of-Service events from downstream.
- flags: readable, writable
- Boolean. Default: true
|
Table : v4l2ctl extra-controls–user controls
| Control name | Control type | Parameters |
| --- | --- | --- |
| horizontal\_flip | Boolean |
- value=0; this is the default value
- flags=execute-on-write
|
| vertical\_flip | Boolean |
- value=0; this is the default value
- flags= execute-on-write
|
| rotate | Integer |
- min=0
- max=270
- step=90
- value=0; this is the default value
- flags=execute-on-write and modify-layout
|
Table : v4l2ctl extra-controls–codec controls
| Control name | Control type | Parameters |
| --- | --- | --- |
| video\_b\_frames | Integer |
- min=0
- max=7
- step=1
- value=0; this is the default value
- flags=update and execute-on-write
|
| video\_gop\_size | Integer |
- min=0
- max=2147483647
- step=1
- value=59; this is the default value
- flags=execute-on-write
|
| video\_bitrate\_mode | Menu |
- min=0
- max=3
- value=0: Variable Bitrate
- 0: Variable Bitrate; this is the default value
- 1: Constant Bitrate
- 3: Maximum Bitrate
- flags=update, execute-on-write
|
| video\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000
- flags=execute-on-write
-
|
| frame\_level\_rate\_control\_enable | Integer |
- value=1; this is the default value
- flags=execute-on-write
|
| maximum\_bytes\_in\_a\_slice | Integer |
- min=512
- max=12500000
- step=1
- value=512; this is the default value
- flags=execute-on-write
|
| number\_of\_mbs\_in\_a\_slice | Integer |
- min=1
- max=36864
- step=1
- value=1; this is the default value
- flags=execute-on-write
|
| slice\_partitioning\_method | Menu |
- min=0
- max=2
- value=0:Single
- 0: Single; this is the default value
- 1: Max macro blocks
- 2: Max Bytes
- flags=execute-on-write
|
| ltr\_count | Integer |
- min=0
- max=2
- step=1
- value=0; this is the default value
- flags=execute-on-write
|
| frame\_ltr\_index | Integer |
- min=-1
- max=1
- step=1
- value=-1; this is the default value
- flags=execute-on-write
|
| use\_ltr\_frames | Bitmask |
- max=0x00000003
- default=0x00000000
- value=0
- flags=execute-on-write
|
| intra\_refresh\_period | Integer |
- min=0
- max=2147483647
- step=1
- value=0; this is the default value
- flags=execute-on-write
|
| intra\_refresh\_period\_type | Menu |
- min=0
- max=1
- value=0
- 0: Random; this is the default value
- 1: Cyclic
- flags=execute-on-write
|
Table : v4l2ctl extra-controls–H.264 codec controls
| Control name | Control type | Parameters |
| --- | --- | --- |
| h264\_i\_frame\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=20; this is the default value
- flags=execute-on-write
|
| h264\_p\_frame\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=20; this is the default value
- flags=execute-on-write
|
| h264\_b\_frame\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=20; this is the default value
- flags=execute-on-write
|
| h264\_minimum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=1; this is the default value
- flags=execute-on-write
|
| h264\_maximum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=51; this is the default value
- flags=execute-on-write
|
| h264\_entropy\_mode | Menu |
- min=0
- max=1
- value=1 (CABAC)
- 0: CAVLC
- 1: CABAC; this is the default value
- flags=execute-on-write
|
| h264\_level | Menu |
- min=0
- max=15
- value=15 (5.1)
- 0: 1
- 1: 1b
- 2: 1.1
- 3: 1.2
- 4: 1.3
- 5: 2
- 6: 2.1
- 7: 2.2
- 8: 3
- 9: 3.1
- 10: 3.2
- 11: 4
- 12: 4.1
- 13: 4.2
- 14: 5
- 15: 5.1; this is the default value
- flags=execute-on-write
|
| h264\_profile | Menu |
- min=0
- max=17
- value=4 (High)
- 0: Baseline
- 1: Constrained Baseline
- 2: Main
- 4: High; this is the default value
- 17: Constrained High
- flags=execute-on-write
|
| enable\_h264\_hierarchical\_coding | Integer |
- min=0
- max=1
- step=1
- value=0; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_coding\_type | Menu |
- min=0
- max=1
- value =1
- 0: Hier Coding B
- 1: Hier Coding P; this is the default value
- flags=execute-on-write
|
| h264\_number\_of\_hc\_layers | Integer |
- min=0
- max=5
- step=1
- value=0; this is the default value
- flags=execute-on-write
|
| h264\_i\_frame\_minimum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=1; this is the default value
- flags=execute-on-write
|
| h264\_i\_frame\_maximum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=51; this is the default value
- flags=execute-on-write
|
| h264\_p\_frame\_minimum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=1; this is the default value
- flags=execute-on-write
|
| h264\_p\_frame\_maximum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=51; this is the default value
- flags=execute-on-write
|
| h264\_b\_frame\_minimum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=1; this is the default value
- flags=execute-on-write
|
| h264\_b\_frame\_maximum\_qp\_value | Integer |
- min=1
- max=51
- step=1
- value=51; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_0\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_1\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_2\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_3\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_4\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
| h264\_hierarchical\_lay\_5\_bitrate | Integer |
- min=1
- max=100000000
- step=1
- value=20000000; this is the default value
- flags=execute-on-write
|
**Parent Topic:** [Configure display, camera, encode and decode plugins](https://docs.qualcomm.com/doc/80-70022-50/topic/display-plugins.html)
Last Published: Feb 20, 2026
[Previous Topic
v4l2h265dec](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/v4l2h265dec.md) [Next Topic
v4l2h265enc](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/v4l2h265enc.md)