diff --git a/docs/docs/configuration/ffmpeg_presets.md b/docs/docs/configuration/ffmpeg_presets.md index 7e8824c54..a0fcae20b 100644 --- a/docs/docs/configuration/ffmpeg_presets.md +++ b/docs/docs/configuration/ffmpeg_presets.md @@ -22,6 +22,8 @@ See [the hwaccel docs](/configuration/hardware_acceleration.md) for more info on | preset-nvidia-mjpeg | Nvidia GPU with mjpeg stream | Recommend restreaming mjpeg and using nvidia-h264 | | preset-jetson-h264 | Nvidia Jetson with h264 stream | | | preset-jetson-h265 | Nvidia Jetson with h265 stream | | +| preset-rk-h264 | Nvidia Jetson with h264 stream | Use image with *-rk suffix and privileged mode | +| preset-rk-h265 | Nvidia Jetson with h265 stream | Use image with *-rk suffix and privileged mode | ### Input Args Presets diff --git a/docs/docs/configuration/hardware_acceleration.md b/docs/docs/configuration/hardware_acceleration.md index 0c429d48d..62512698a 100644 --- a/docs/docs/configuration/hardware_acceleration.md +++ b/docs/docs/configuration/hardware_acceleration.md @@ -319,3 +319,25 @@ ffmpeg: If everything is working correctly, you should see a significant reduction in ffmpeg CPU load and power consumption. Verify that hardware decoding is working by running `jtop` (`sudo pip3 install -U jetson-stats`), which should show that NVDEC/NVDEC1 are in use. + +## Rockchip platform + +Hardware accelerated video de-/encoding is supported on all Rockchip SoCs. + +### Setup + +Use a frigate docker image with `-rk` suffix and enable privileged mode by adding the `--privileged` flag to your docker run command or `privileged: true` to your `docker-compose.yml` file. + +### Configuration + +Add one of the following ffmpeg presets to your `config.yaml` to enable hardware acceleration: + +```yaml +# if you try to decode a h264 encoded stream +ffmpeg: + hwaccel_args: preset-rk-h264 + +# if you try to decode a h265 (hevc) encoded stream +ffmpeg: + hwaccel_args: preset-rk-h265 +``` diff --git a/frigate/ffmpeg_presets.py b/frigate/ffmpeg_presets.py index 19922d471..e36fc4235 100644 --- a/frigate/ffmpeg_presets.py +++ b/frigate/ffmpeg_presets.py @@ -77,8 +77,8 @@ PRESETS_HW_ACCEL_SCALE = { "preset-nvidia-h265": "-r {0} -vf fps={0},scale_cuda=w={1}:h={2}:format=nv12,hwdownload,format=nv12,format=yuv420p", "preset-jetson-h264": "-r {0}", # scaled in decoder "preset-jetson-h265": "-r {0}", # scaled in decoder - "preset-rk-h264": "-r {0} -width {1} -height {2}", - "preset-rk-h265": "-r {0} -width {1} -height {2}", + "preset-rk-h264": "-r {0} -vf fps={0},scale={1}:{2}", + "preset-rk-h265": "-r {0} -vf fps={0},scale={1}:{2}", "default": "-r {0} -vf fps={0},scale={1}:{2}", }