Skip to main content

Hardware Transcoding

Tdarr containers support NVENC and VAAPI hardware/GPU accelerated transcoding.

If using NVENC on an Ubuntu or Debian host, make sure to install the NVIDIA container toolkit on the host.

You can quickly verify that you have your host system set up correctly by running the following Docker run commands. Check the transcode processes finish successfully.

FFmpeg NVENC

docker run \
-e "NVIDIA_DRIVER_CAPABILITIES=all" \
-e "NVIDIA_VISIBLE_DEVICES=all" \
--gpus=all \
ghcr.io/haveagitgat/tdarr_node:latest \
/bin/bash -e \
-c 'curl \
-o /tmp/sample.mkv \
-l https://samples.tdarr.io/api/v1/samples/sample__1080__libx264__aac__30s__video.mkv; \
ffmpeg \
-i /tmp/sample.mkv \
-c:v:0 hevc_nvenc \
/tmp/sample-out.mkv'

FFmpeg VAAPI

docker run \
--device=/dev/dri:/dev/dri \
ghcr.io/haveagitgat/tdarr_node:latest \
/bin/bash -e \
-c 'curl \
-o /tmp/sample.mkv \
-l https://samples.tdarr.io/api/v1/samples/sample__1080__libx264__aac__30s__video.mkv; \
ffmpeg \
-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
-hwaccel_output_format vaapi \
-i /tmp/sample.mkv \
-c:v:0 hevc_vaapi \
/tmp/sample-out.mkv'

FFmpeg QSV

docker run \
--device=/dev/dri:/dev/dri \
ghcr.io/haveagitgat/tdarr_node:latest \
/bin/bash -e \
-c 'ffmpeg \
-hwaccel qsv -f lavfi -i color=c=black:s=256x256:d=1:r=30 \
-c:v:0 hevc_qsv \
-f null /dev/null'

HandBrake NVENC

docker run \
-e "NVIDIA_DRIVER_CAPABILITIES=all" \
-e "NVIDIA_VISIBLE_DEVICES=all" \
--gpus=all \
ghcr.io/haveagitgat/tdarr_node:latest \
/bin/bash -e \
-c 'curl \
-o /tmp/sample.mkv \
-l https://samples.tdarr.io/api/v1/samples/sample__1080__libx264__aac__30s__video.mkv; \
HandBrakeCLI \
-i "/tmp/sample.mkv" \
-o "/tmp/sample-out.mkv" \
-e nvenc_h265'