Hardware Acceleration
It is recommended to update your configuration to enable hardware accelerated decoding in ffmpeg. Depending on your system, these parameters may not be compatible. More information on hardware accelerated decoding for ffmpeg can be found here: https://trac.ffmpeg.org/wiki/HWAccelIntro
#
Raspberry Pi 3/4Ensure you increase the allocated RAM for your GPU to at least 128 (raspi-config > Performance Options > GPU Memory).
NOTICE: If you are using the addon, you may need to turn off Protection mode
for hardware acceleration.
#
Intel-based CPUs (<10th Generation) via QuicksyncNOTICE: With some of the processors, like the J4125, the default driver iHD
doesn't seem to work correctly for hardware acceleration. You may need to change the driver to i965
by adding the following environment variable LIBVA_DRIVER_NAME=i965
to your docker-compose file.
#
Intel-based CPUs (>=10th Generation) via Quicksync#
AMD/ATI GPUs (Radeon HD 2000 and newer GPUs) via libva-mesa-driverNote: You also need to set LIBVA_DRIVER_NAME=radeonsi
as an environment variable on the container.
#
NVIDIA GPUSupported Nvidia GPUs for Decoding
These instructions are based on the jellyfin documentation
Add --gpus all
to your docker run command or update your compose file.
If you have multiple Nvidia graphic card, you can add them with their ids obtained via nvidia-smi
command
The decoder you need to pass in the hwaccel_args
will depend on the input video.
A list of supported codecs (you can use ffmpeg -decoders | grep cuvid
in the container to get a list)
For example, for H264 video, you'll select h264_cuvid
.
If everything is working correctly, you should see a significant improvement in performance.
Verify that hardware decoding is working by running docker exec -it frigate nvidia-smi
, which should show the ffmpeg
processes: