[HW Accel Support]: Inappropriate addition of FPS and Scale to detect role FFMPEG command #17448
Unanswered
foxale08
asked this question in
Hardware Acceleration Support
Replies: 1 comment 3 replies
-
Your issue is coming from your use of See |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
I am attempting to modify the hardware offload parameters for the detect role of one of my cameras to better optimize CPU and RKRGA resources but have run across a snag. There doesn't appear to be a way to remove the additional string of "-r 5 -vf fps=5,scale=3840:2160" which is added to the command. I am aware of a similar issue #4093 which mentions this string but I need the string removed, not the detect process.
The long winded backstory is as follows. The hardware in question is a CM3588 NAS board which pretty much requires hardware offloading to be useful. I use 4K cameras which support 4K/HEVC on the main stream and 1080P/AVC on the secondary. Through experimentation I determined that my object detection is significantly better with a 4K image than at 1080p due to the deep depth of field of my cameras. The caveat with the "preset-rk-h265" is that when use for the detector role it hammers the single "rga2" scheduler. In my case four 4K detect streams push the rga2 scheduler over 60% load during the day which is problematic because I'd like to have eight cameras, I have plenty of CPU and NPU resources left (1x hailo8.) I am attempting to more efficiently use the rga2 scheduler or at the very least push more load towards the rga3 schedulers and CPU but not too much as the conversion easily uses a core and a half without hardware.
cameras:
CAM-DWNE:
audio:
enabled: true
record:
retain:
days: 14
mode: all
ffmpeg:
inputs:
- path: rtsp://go2rtc:[email protected]:8554/CAM_DWNE
hwaccel_args: preset-rk-h265
roles:
- audio
- record
- path: rtsp://go2rtc:[email protected]:8554/CAM_DWNE
input_args: -hide_banner -loglevel warning -rtsp_transport tcp -timeout 5000000
hwaccel_args: -hwaccel rkmpp -hwaccel_output_format drm_prime
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
detect: -vf fps=5,scale_rkrga=w=3840:h=2160:format=nv12,hwdownload,format=nv12,format=yuv420p -f rawvideo -pix_fmt yuv420p
As seen from "cat /sys/kernel/debug/rkrga/load"
num of scheduler = 3
================= load ==================
scheduler[0]: rga3
load = 29%
scheduler[1]: rga3
load = 8%
scheduler[2]: rga2
load = 39%
........
747 active 406614 /usr/lib/ffmpeg/ffmpeg-jellyfin//bin/ffmpeg -hide_banner -loglevel warning -threads 2 -hwaccel rkmpp -hwaccel_output_format drm_prime -hide_banner -loglevel warning -rtsp_transport tcp -timeout 5000000 -i rtsp://go2rtc:[email protected]
.1:8554/CAM_DWNE -r 5 -vf fps=5,scale=3840:2160 -vf fps=5,scale_rkrga=w=3840:h=2160:format=nv12,hwdownload,format=nv12,format=yuv420p -f rawvideo -pix_fmt yuv420p pipe:
.......
Version
0.15
Frigate config file
docker-compose file or Docker CLI command
Relevant Frigate log output
Relevant go2rtc log output
FFprobe output from your camera
Install method
Docker Compose
Object Detector
Other
Network connection
Wired
Camera make and model
Assorted 4K Hikvision
Screenshots of the Frigate UI's System metrics pages
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions