fix scaling preset and update docs for rk hwaccel

This commit is contained in:
MarcA711 2023-11-14 20:33:29 +00:00
parent 8a3e36d92b
commit 50e3ae7e37
3 changed files with 26 additions and 2 deletions

View File

@ -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-nvidia-mjpeg | Nvidia GPU with mjpeg stream | Recommend restreaming mjpeg and using nvidia-h264 |
| preset-jetson-h264 | Nvidia Jetson with h264 stream | | | preset-jetson-h264 | Nvidia Jetson with h264 stream | |
| preset-jetson-h265 | Nvidia Jetson with h265 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 ### Input Args Presets

View File

@ -319,3 +319,25 @@ ffmpeg:
If everything is working correctly, you should see a significant reduction in ffmpeg CPU load and power consumption. 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 Verify that hardware decoding is working by running `jtop` (`sudo pip3 install -U jetson-stats`), which should show
that NVDEC/NVDEC1 are in use. 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
```

View File

@ -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-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-h264": "-r {0}", # scaled in decoder
"preset-jetson-h265": "-r {0}", # scaled in decoder "preset-jetson-h265": "-r {0}", # scaled in decoder
"preset-rk-h264": "-r {0} -width {1} -height {2}", "preset-rk-h264": "-r {0} -vf fps={0},scale={1}:{2}",
"preset-rk-h265": "-r {0} -width {1} -height {2}", "preset-rk-h265": "-r {0} -vf fps={0},scale={1}:{2}",
"default": "-r {0} -vf fps={0},scale={1}:{2}", "default": "-r {0} -vf fps={0},scale={1}:{2}",
} }