feat: update video encoding to use nvautogpuh264enc for NVIDIA driver 590+ support. (#667)

This commit is contained in:
Miroslav Šedivý
2026-07-31 14:28:19 +02:00
committed by GitHub
parent baf6eee8a9
commit e6239d6a51
4 changed files with 33 additions and 8 deletions
+9 -5
View File
@@ -263,7 +263,7 @@ See documentation for [ximagesrc](https://gstreamer.freedesktop.org/documentatio
ximagesrc display-name={display} show-pointer=true use-damage=false
! videoconvert ! queue
! video/x-raw,format=NV12
! nvh264enc
! nvautogpuh264enc
name=encoder
preset=2
gop-size=25
@@ -290,7 +290,7 @@ See documentation for [ximagesrc](https://gstreamer.freedesktop.org/documentatio
ximagesrc display-name={display} show-pointer=true use-damage=false
! cudaupload ! cudaconvert ! queue
! video/x-raw(memory:CUDAMemory),format=NV12
! nvh264enc
! nvautogpuh264enc
name=encoder
preset=2
gop-size=25
@@ -306,6 +306,10 @@ See documentation for [ximagesrc](https://gstreamer.freedesktop.org/documentatio
This configuration requires [Nvidia GPU](https://developer.nvidia.com/cuda-gpus) with [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk) support and [Cuda](https://developer.nvidia.com/cuda-zone) support.
:::tip
`nvautogpuh264enc` (GStreamer 1.22+) is the recommended encoder for NVIDIA driver 590 and newer. It auto-selects the correct memory path and replaces the older `nvh264enc`. On older GStreamer or driver versions, substitute `nvautogpuh264enc` with `nvh264enc`.
:::
</TabItem>
</Tabs>
@@ -318,7 +322,7 @@ Overview of available encoders for each codec is shown in the table below. The e
| VP8 | [vp8enc](https://gstreamer.freedesktop.org/documentation/vpx/vp8enc.html?gi-language=c) | [vaapivp8enc](https://github.com/GStreamer/gstreamer-vaapi/blob/master/gst/vaapi/gstvaapiencode_vp8.c) | ? |
| VP9 | [vp9enc](https://gstreamer.freedesktop.org/documentation/vpx/vp9enc.html?gi-language=c) | [vaapivp9enc](https://github.com/GStreamer/gstreamer-vaapi/blob/master/gst/vaapi/gstvaapiencode_vp9.c) | ? |
| AV1 | [av1enc](https://gstreamer.freedesktop.org/documentation/aom/av1enc.html?gi-language=c) | ? | [nvav1enc](https://gstreamer.freedesktop.org/documentation/nvcodec/nvav1enc.html?gi-language=c) |
| H264 | [x264enc](https://gstreamer.freedesktop.org/documentation/x264/index.html?gi-language=c) | [vaapih264enc](https://gstreamer.freedesktop.org/documentation/vaapi/vaapih264enc.html?gi-language=c) | [nvh264enc](https://gstreamer.freedesktop.org/documentation/nvcodec/nvh264enc.html?gi-language=c) |
| H264 | [x264enc](https://gstreamer.freedesktop.org/documentation/x264/index.html?gi-language=c) | [vaapih264enc](https://gstreamer.freedesktop.org/documentation/vaapi/vaapih264enc.html?gi-language=c) | [nvautogpuh264enc](https://gstreamer.freedesktop.org/documentation/nvcodec/nvautogpuh264enc.html?gi-language=c) / [nvh264enc](https://gstreamer.freedesktop.org/documentation/nvcodec/nvh264enc.html?gi-language=c) |
| H265 | [x265enc](https://gstreamer.freedesktop.org/documentation/x265/index.html?gi-language=c) | [vaapih265enc](https://gstreamer.freedesktop.org/documentation/vaapi/vaapih265enc.html?gi-language=c) | [nvh265enc](https://gstreamer.freedesktop.org/documentation/nvcodec/nvh265enc.html?gi-language=c) |
@@ -422,14 +426,14 @@ The default encoder uses `h264` for video and `aac` for audio, muxed in the `flv
! videoconvert
! queue
! video/x-raw,format=NV12
! nvh264enc name=encoder preset=low-latency-hq gop-size=25 spatial-aq=true temporal-aq=true bitrate=2800 vbv-buffer-size=2800 rc-mode=6
! nvautogpuh264enc name=encoder preset=low-latency-hq gop-size=25 spatial-aq=true temporal-aq=true bitrate=2800 vbv-buffer-size=2800 rc-mode=6
! h264parse config-interval=-1
! video/x-h264,stream-format=byte-stream,profile=high
! h264parse
! mux.
```
This configuration requires [Nvidia GPU](https://developer.nvidia.com/cuda-gpus) with [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk) support and [Nvidia docker image](/docs/v3/installation/docker-images#nvidia) of neko.
This configuration requires [Nvidia GPU](https://developer.nvidia.com/cuda-gpus) with [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk) support and [Nvidia docker image](/docs/v3/installation/docker-images#nvidia) of neko. Use `nvautogpuh264enc` for NVIDIA driver 590+ (GStreamer 1.22+), or substitute `nvh264enc` for older setups.
</TabItem>
</Tabs>
+6 -2
View File
@@ -128,7 +128,7 @@ services:
! video/x-raw,framerate=25/1
! cudaupload ! cudaconvert ! queue
! video/x-raw(memory:CUDAMemory),format=NV12
! nvh264enc
! nvautogpuh264enc
name=encoder
preset=2
gop-size=25
@@ -157,6 +157,10 @@ services:
See available [Nvidia Docker Images](/docs/v3/installation/docker-images#nvidia).
:::tip
`nvautogpuh264enc` (GStreamer 1.22+) is the recommended encoder for NVIDIA driver 590 and newer. It automatically selects the correct memory path (CUDA or system) and replaces `nvh264enc`. If you are on an older driver or GStreamer version, substitute `nvautogpuh264enc` with `nvh264enc`.
:::
:::note
If your Nvidia GPU does not support CUDA, you can use the pipeline below without `cudaupload` and `cudaconvert`. This should work with older GPUs, but the performance might be lower.
:::
@@ -185,7 +189,7 @@ services:
! videoconvert ! queue
! video/x-raw,format=NV12
# highlight-end
! nvh264enc
! nvautogpuh264enc
name=encoder
preset=2
gop-size=25