Closed ThisIsLamer closed 7 months ago
Hi, I decided not to wait and installed the latest release of Ubuntu Rockchip. All of the necessary devices mentioned a few posts earlier are present. From the list of optional devices, I only have /dev/mpp-service. I'll reinstall Docker stuff tomorrow and then I guess I'll be ready for the -rk image. Thanks.
Hi, I installed everything as earlier, but tried -rk image. In the compose.yml, I added device mappings for all of the devices @MarcA711 listed as necessary in the previous post. However, with -rk image i'm back to around 17% CPU usage for ffmpeg for only 1 camera at 640x380 resolution. This is what I put in compose.yml:
devices:
- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
- /dev/dri:/dev/dri # For Orange Pi 3B
- /dev/dma_heap:/dev/dma_heap # For Orange Pi 3B
- /dev/rga:/dev/rga # For Orange Pi 3B
- /dev/mpp_service:/dev/mpp_service # For Orange Pi 3B
# - /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
I tried with renderD128 commented and uncommented, no difference.
I also tried with
group_add:
- "110" # render
commented and uncommented, no difference.
As @spattinson suggested, I ran ps -ef which provided the following output:
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 640x360 -i pipe: -f mpegts -s 12
ffmpeg -hide_banner -loglevel warning -threads 2 -c:v h264_rkmpp_decoder -user_a
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1
ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13
So I tried a few things, but the problem persists.
Hi, you are using the stable image of rockchip. This currently includes an old ffmpeg version. The newer FFmpeg version is currently only merged in the dev branch of frigate.
I have a fork where I merged the newer FFmpeg version to the stable frigate branch. You can build it using
git clone -b 13.2 https://github.com/MarcA711/frigate-rockchip/
cd frigate-rockchip
make local-rk
Afterwards, you can use it by changing the image of your docker-compose.yml to frigate:latest-rk
.
If you don't want to build the image yourself, I pushed it to docker hub marca711/frigate:latest-rk
.
However, you are using just one Camera with a low resolution. If you add more cameras and increase the resolution to 2k or higher, you will notice a much bigger difference between software and hardware trancoding.
Hi, thanks a lot for all the help. I'll test as soon as I can and let you know how it went. And I'll be interested in enabling board's NPU because I ordered Pi 5B board. I'll see the docs and previous threads on that topic. Thanks.
Hi, I pulled marca711/frigate:latest-rk
image and everything works great. I used the "Detectors" section of the documenation from Frigate Rockchip GitHub repo to fill in ymls properly. The ffmpeg CPU usage went below 6% and Frigate seems to handle 3 cams at 640x380 resolution without problems. I also enabled NPU, but Orange Pi 3B board only has 0.8 TOPS so it reports inference speed around 85 ms and CPU usage up to 40%. I also have Coral enbled and for Corlad, Frigate reports inference speeds varying from 25 ms up to 120 ms. So it's nowhere near those 5 ms speeds obtained on Coral's image database test. For some reason, parts of Frigate's UI turned gray after I added 2 more cams to the one connected before, as shown in the image below.
Ubuntu's System monitor reports overall CPU usage around 60% for all four cores most of the time, with occasional peaks up to about 90%.
If I understood correctly, inference speed of 100 ms means that the detector can keep up with 10 images per second. So 3 cams x 5 fps should be too much for a detector if it kept the inference speed at 100 ms. However, inference speeds reported by Friagate are quite variable so I'm not sure how this reflects on detecton. For example, at some moment Coral is reported to run at 120 ms speed. If it were the only detector covering 3 cams at 5 fps, it'd have to skip frames. Or maybe those instantaneous speeds don't matter, maybe the average is what counts. I haven't figured this out yet.
However, back to the actual thread topic, hardware accelerations works great with @MarcA711 's image. Thanks everyone for help.
By using the marca711/frigate:latest-rk
image, I went from 11-16% CPU usage to less than 3%. It's impressive!
@simon511000 yeah, I suppose you have 5B board (8 cores at 2.4 GHz) so you get around 3%, while I have 3B board (4 cores at 1.8 GHz) so I get around 6% which is great! I'm very happy with this image.
Hi , you are using the stable image of rockchip. This currently includes an old ffmpeg version. The newer FFmpeg version is currently only merged in the dev branch of frigate.
I have a fork where I merged the newer FFmpeg version to the stable frigate branch. You can build it using
git clone -b 13.2 https://github.com/MarcA711/frigate-rockchip/ cd frigate-rockchip make local-rk
Afterwards, you can use it by changing the image of your docker-compose.yml to
frigate:latest-rk
.If you don't want to build the image yourself, I pushed it to docker hub
marca711/frigate:latest-rk
.However, you are using just one Camera with a low resolution. If you add more cameras and increase the resolution to 2k or higher, you will notice a much bigger difference between software and hardware trancoding.
Hello @MarcA711 . I have Joshua Ubuntu 22.04 with Kernel 5.1 installed(Orange Pi 5 plus 16gb ram). I have connected 3 cameras with 2.5k resolution, they all works well. But when i try to chose in config of Frigate 6 streams instead of 3. One stream for record, another sub stream for detection for each cameras, i have green records and frigate doesn't recognise correctly detection after that. When i try to restart frigate or System itself, the system freezing. Seems like some decoding issue related to ffmpeg?
Would be much appreciated for any help.
@flyzet-prog Sorry for the late reply! Are you using the marca711/frigate:latest-rk image? I have the same setup (OPi5+ 16gb, Joshua riek 22.04 and 3 cams with two streams each) and don't experience these issues. Maybe you could describe your problem in nyanmisaka's repo https://github.com/nyanmisaka/ffmpeg-rockchip
Check error logs with sudo dmesg
. I've never seen this before. I guess it is a similar issue to the IOVA 4GB limit.
@flyzet-prog Sorry for the late reply! Are you using the marca711/frigate:latest-rk image? I have the same setup (OPi5+ 16gb, Joshua riek 22.04 and 3 cams with two streams each) and don't experience these issues. Maybe you could describe your problem in nyanmisaka's repo https://github.com/nyanmisaka/ffmpeg-rockchip
No worries. I am tried to use your fork, it started with newer interface and then restarts. I use official 0.13.2-6476f8a one, and this glitch appears only here. I wanted to try yours image, but can’t run it properly. Also opened an issue at Joshua repo, but i think it’s not related to OS. Thank you for your reply
Check error logs with
sudo dmesg
. I've never seen this before. I guess it is a similar issue to the IOVA 4GB limit.
Let me please change it again to 6 streams, and waiting for that issue. As soon as it appears, i will update with log. Thank you for your reply
No worries. I am tried to use your fork, it started with newer interface and then restarts. I use official 0.13.2-6476f8a one, and this glitch appears only here. I wanted to try yours image, but can’t run it properly. Also opened an issue at Joshua repo, but i think it’s not related to OS. Thank you for your reply
So you are using the frigate:stable-rk? This uses the fork from hbiyik. I think I saw this issue before with this FFmpeg version.
Try to build from my repo. You need to switch to the 13.2 branch. Try this:
git clone -b 13.2 https://github.com/MarcA711/frigate-rockchip
cd frigate-rockchip
sudo make local-rk
afterwards use image: frigate:local-rk
in your docker compose file.
Alternatively, there is also a prebuild image available using docker pull marca711/frigate:latest-rk
image: frigate:local-rk I got an error while build an image
ERROR: failed to solve: process "/bin/sh -c apt-get -qq update && apt-get -qq install -y wget python3 python3-distutils && wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py && python3 get-pip.py \"pip\" && pip install -r /requirements-ov.txt" did not complete successfully: exit code: 1 make: *** [docker/rockchip/rk.mk:4: local-rk] Error 1`
No worries. I am tried to use your fork, it started with newer interface and then restarts. I use official 0.13.2-6476f8a one, and this glitch appears only here. I wanted to try yours image, but can’t run it properly. Also opened an issue at Joshua repo, but i think it’s not related to OS. Thank you for your reply
So you are using the frigate:stable-rk? This uses the fork from hbiyik. I think I saw this issue before with this FFmpeg version.
Try to build from my repo. You need to switch to the 13.2 branch. Try this:
git clone -b 13.2 https://github.com/MarcA711/frigate-rockchip cd frigate-rockchip sudo make local-rk
afterwards use
image: frigate:local-rk
in your docker compose file.Alternatively, there is also a prebuild image available using
docker pull marca711/frigate:latest-rk
I use this one
ghcr.io/blakeblackshear/frigate:0.13.2-rk
I applied a fix, could you try this again:
git clone -b 13.2 https://github.com/MarcA711/frigate-rockchip
cd frigate-rockchip
sudo make local-rk
I use this one ghcr.io/blakeblackshear/frigate:0.13.2-rk
This means you are using the older hbiyik fork. I guess I saw this problem there. Try to use the newer image.
ghcr.io/blakeblackshear/
Sure, i will try again Sorry, but i don't see any newer images there. Where i can find any newer?
It is no official release. The last official release 13.2 included an old ffmpeg version. Since then I merged some changes to the dev branch with some fixes and improvements. However, some code had to be removed due to a copyright complaint... That's why I backported some important changes to the 13.2 branch of my repo mentioned above. So everyone should use this branch for now.
Currently, I work on reimplementing everything and hopefully the official 14.0 image, will work out of the box.
It is no official release. The last official release 13.2 included an old ffmpeg version. Since then I merged some changes to the dev branch with some fixes and improvements. However, some code had to be removed due to a copyright complaint... That's why I backported some important changes to the 13.2 branch of my repo mentioned above. So everyone should use this branch for now.
Currently, I work on reimplementing everything and hopefully the official 14.0 image, will work out of the box.
So the main reason of my problem is old ffmpeg. May i see frigate config and docker-compose.yml for your fork? Mine looks like bellow
` mqtt: enabled: true host: 192.168.8.163 port: 1883 user: mqtt password: Abcd1234 topic_prefix: frigate detectors: armnn: type: rknn core_mask: 0b111 # 0b111 3 cores model:
path: default-yolov8m width: 320 height: 320 input_pixel_format: bgr input_tensor: nhwc
ffmpeg: hwaccel_args: preset-rk-h264
output_args: record: preset-record-generic-audio-aac detect: -f rawvideo rtmp: -c copy -f flv -flvflags no_duration_filesize
ui:
live_mode: mse timezone: Etc/GMT-3 use_experimental: true time_format: 24hour date_style: full time_style: medium strftime_fmt: "%a, %H:%M (%d.%m.%Y)"
go2rtc: streams: camera_ptz:
birdseye: enabled: true mode: continuous
database: path: /media/frigate/frigate.db
objects: track:
motion: threshold: 25 contour_area: 15 delta_alpha: 0.2 frame_alpha: 0.2 frame_height: 50 improve_contrast: true mqtt_off_delay: 30
record: enabled: true retain: days: 2 mode: all
events:
pre_capture: 5 # sec
post_capture: 15 # sec
objects:
- person
#- car
- dog
- cat
- bird
retain:
default: 7
mode: active_objects
objects:
person: 10
#car: 3
dog: 1
cat: 1
bird: 7
snapshots: enabled: true clean_copy: false timestamp: true bounding_box: true crop: false height: 1920 retain: default: 15 objects: person: 15
dog: 2
cat: 2
bird: 7
rtmp: enabled: false
live: height: 1080 quality: 1
timestamp_style: position: "br" format: "%d.%m.%Y %H:%M:%S" color: red: 255 green: 255 blue: 255 thickness: 2 effect: "solid"
detect: enabled: true fps: 5 max_disappeared: 25 stationary: interval: 100 threshold: 50
cameras: camera_ptz: ffmpeg: inputs:
0,0,800,0,800,98,644,102,653,100,646,215,0,351 objects: filters: person: mask:
camera_backyard: ffmpeg: inputs:
1296,0,1296,326,439,134,419,0 objects: filters: person: mask:
camera_terrace: ffmpeg: inputs:
and docker compose file
`
GNU nano 6.2 docker-compose.yml
version: "3.9"
services:
frigate:
container_name: frigate
image: ghcr.io/blakeblackshear/frigate:0.13.2-rk
privileged: true # this may not be necessary for all setups
restart: unless-stopped
shm_size: "300mb" # update for your cameras based on calculation above
devices:
Thank you
The config and docker compose should be the same. You only need to modify the image in the docker compose file to image: frigate:local-rk
The config and docker compose should be the same. You only need to modify the image in the docker compose file to
image: frigate:local-rk
It not allow me to run docker-compose, after i changed image to frigate: latest-rk, it's started but cameras not appeared after coupe of minutes system freezed and also here is the log:
i am really want to try your fork, but couldn't run it properly(
Could you please post again your your config, your docker-compose and the frigate log output and enclose it with 3 backticks (```) at the beginning and end?
Could you please post again your your config, your docker-compose and the frigate log output and enclose it with 3 backticks (```) at the beginning and end?
The image is image: frigate:local-rk in docker-compose.yml Here is the log frigate
2024-05-10 14:41:30.355475455 [INFO] Starting Frigate...
2024-05-10 14:41:33.464716226 [2024-05-10 14:41:33] frigate.app INFO : Starting Frigate (0.13.2-1f8ac4c1)
2024-05-10 14:41:33.541713900 [2024-05-10 14:41:33] peewee_migrate.logs INFO : Starting migrations
2024-05-10 14:41:33.551930693 [2024-05-10 14:41:33] peewee_migrate.logs INFO : There is nothing to migrate
2024-05-10 14:41:33.566602986 [2024-05-10 14:41:33] frigate.app INFO : Recording process started: 454
2024-05-10 14:41:33.569765820 [2024-05-10 14:41:33] frigate.app INFO : go2rtc process pid: 90
2024-05-10 14:41:33.604222448 [2024-05-10 14:41:33] detector.armnn INFO : Starting detection process: 464
2024-05-10 14:41:33.609484699 [2024-05-10 14:41:33] frigate.app INFO : Output process started: 466
2024-05-10 14:41:33.958804567 I RKNN: [14:41:33.958] RKNN Runtime Information, librknnrt version: 1.6.0 (9a7b5d24c@2023-12-13T17:31:11)
2024-05-10 14:41:33.959097984 I RKNN: [14:41:33.959] RKNN Driver Information, version: 0.9.2
2024-05-10 14:41:33.960447234 E RKNN: [14:41:33.960] parseRKNN: exportDataSize large then model size: 55727936 vs 36904960!
2024-05-10 14:41:33.960450442 E RKNN: [14:41:33.960] parseRKNN from buffer: Invalid RKNN format!
2024-05-10 14:41:33.960457151 E RKNN: [14:41:33.960] rknn_init, load model failed!
2024-05-10 14:41:33.960719067 E Catch exception when init runtime!
2024-05-10 14:41:33.961580359 E Traceback (most recent call last):
2024-05-10 14:41:33.961583859 File "/usr/local/lib/python3.9/dist-packages/rknnlite/api/rknn_lite.py", line 148, in init_runtime
2024-05-10 14:41:33.961585318 self.rknn_runtime.build_graph(self.rknn_data, self.load_model_in_npu)
2024-05-10 14:41:33.961586484 File "rknnlite/api/rknn_runtime.py", line 919, in rknnlite.api.rknn_runtime.RKNNRuntime.build_graph
2024-05-10 14:41:33.961619734 Exception: RKNN init failed. error code: RKNN_ERR_MODEL_INVALID
2024-05-10 14:41:33.961620901
2024-05-10 14:41:33.962499984 [2024-05-10 14:41:33] frigate.detectors.plugins.rknn E : Error initializing rknn runtime. Do you run docker in privileged mode?
2024-05-10 14:41:34.141235377 [2024-05-10 14:41:34] frigate.app INFO : Camera processor started for camera_ptz: 491
2024-05-10 14:41:34.155035879 [2024-05-10 14:41:34] frigate.app INFO : Camera processor started for camera_backyard: 492
2024-05-10 14:41:34.168274338 [2024-05-10 14:41:34] frigate.app INFO : Camera processor started for camera_terrace: 493
2024-05-10 14:41:34.182405006 [2024-05-10 14:41:34] frigate.app INFO : Capture process started for camera_ptz: 495
2024-05-10 14:41:34.195974508 [2024-05-10 14:41:34] frigate.app INFO : Capture process started for camera_backyard: 496
2024-05-10 14:41:34.212470884 [2024-05-10 14:41:34] frigate.app INFO : Capture process started for camera_terrace: 501
2024-05-10 14:41:39.263652142 [2024-05-10 14:41:39] frigate.video ERROR : camera_ptz: Unable to read frames from ffmpeg process.
2024-05-10 14:41:39.267517601 [2024-05-10 14:41:39] frigate.video ERROR : camera_ptz: ffmpeg process is not running. exiting capture thread...
2024-05-10 14:41:39.322085523 [2024-05-10 14:41:39] frigate.video ERROR : camera_backyard: Unable to read frames from ffmpeg process.
2024-05-10 14:41:39.323862648 [2024-05-10 14:41:39] frigate.video ERROR : camera_terrace: Unable to read frames from ffmpeg process.
2024-05-10 14:41:39.323887731 [2024-05-10 14:41:39] frigate.video ERROR : camera_terrace: ffmpeg process is not running. exiting capture thread...
2024-05-10 14:41:39.323892106 [2024-05-10 14:41:39] frigate.video ERROR : camera_backyard: ffmpeg process is not running. exiting capture thread...
2024-05-10 14:41:54.248599148 [2024-05-10 14:41:54] watchdog.camera_ptz ERROR : Ffmpeg process crashed unexpectedly for camera_ptz.
2024-05-10 14:41:54.250408648 [2024-05-10 14:41:54] watchdog.camera_ptz ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-05-10 14:41:54.252627648 [2024-05-10 14:41:54] ffmpeg.camera_ptz.detect ERROR : [tcp @ 0xaaaafa70efa0] Connection to tcp://192.168.8.163:8554?timeout=5000000 failed: Connection timed out
2024-05-10 14:41:54.252639606 [2024-05-10 14:41:54] ffmpeg.camera_ptz.detect ERROR : [in#0 @ 0xaaaafa70eac0] Error opening input: Connection timed out
2024-05-10 14:41:54.252644273 [2024-05-10 14:41:54] ffmpeg.camera_ptz.detect ERROR : Error opening input file rtsp://*:*@192.168.8.163:8554/camera.move.
2024-05-10 14:41:54.252648065 [2024-05-10 14:41:54] ffmpeg.camera_ptz.detect ERROR : Error opening input files: Connection timed out
2024-05-10 14:41:54.271491192 [2024-05-10 14:41:54] watchdog.camera_backyard ERROR : Ffmpeg process crashed unexpectedly for camera_backyard.
2024-05-10 14:41:54.272236108 [2024-05-10 14:41:54] watchdog.camera_backyard ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-05-10 14:41:54.273337442 [2024-05-10 14:41:54] ffmpeg.camera_backyard.detect ERROR : [tcp @ 0xaaab0987dfa0] Connection to tcp://192.168.8.163:8554?timeout=5000000 failed: Connection timed out
2024-05-10 14:41:54.274201650 [2024-05-10 14:41:54] ffmpeg.camera_backyard.detect ERROR : [in#0 @ 0xaaab0987dac0] Error opening input: Connection timed out
2024-05-10 14:41:54.275095025 [2024-05-10 14:41:54] ffmpeg.camera_backyard.detect ERROR : Error opening input file rtsp://*:*@192.168.8.163:8554/camera.terrace_main?video=all&audio=all.
2024-05-10 14:41:54.275628484 [2024-05-10 14:41:54] ffmpeg.camera_backyard.detect ERROR : Error opening input files: Connection timed out
2024-05-10 14:41:54.282561401 [2024-05-10 14:41:54] watchdog.camera_terrace ERROR : Ffmpeg process crashed unexpectedly for camera_terrace.
2024-05-10 14:41:54.283866026 [2024-05-10 14:41:54] watchdog.camera_terrace ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-05-10 14:41:54.285205068 [2024-05-10 14:41:54] ffmpeg.camera_terrace.detect ERROR : [tcp @ 0xaaaac7bc5fa0] Connection to tcp://192.168.8.163:8554?timeout=5000000 failed: Connection timed out
2024-05-10 14:41:54.286238151 [2024-05-10 14:41:54] ffmpeg.camera_terrace.detect ERROR : [in#0 @ 0xaaaac7bc5ac0] Error opening input: Connection timed out
2024-05-10 14:41:54.287038485 [2024-05-10 14:41:54] ffmpeg.camera_terrace.detect ERROR : Error opening input file rtsp://*:*@192.168.8.163:8554/camera.cam_1?video=all&audio=all.
2024-05-10 14:41:54.287713401 [2024-05-10 14:41:54] ffmpeg.camera_terrace.detect ERROR : Error opening input files: Connection timed out
2024-05-10 14:41:56.488361956 E Catch exception when setting inputs.
2024-05-10 14:41:56.488677539 E Traceback (most recent call last):
2024-05-10 14:41:56.488681039 File "/usr/local/lib/python3.9/dist-packages/rknnlite/api/rknn_lite.py", line 200, in inference
2024-05-10 14:41:56.488682789 self.rknn_runtime.set_inputs(inputs, data_type, data_format, inputs_pass_through=inputs_pass_through)
2024-05-10 14:41:56.488684248 File "rknnlite/api/rknn_runtime.py", line 983, in rknnlite.api.rknn_runtime.RKNNRuntime.set_inputs
2024-05-10 14:41:56.488685998 File "rknnlite/api/rknn_runtime.py", line 1207, in rknnlite.api.rknn_runtime.RKNNRuntime.get_in_out_num
2024-05-10 14:41:56.488687164 ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
2024-05-10 14:41:56.488688039
2024-05-10 14:41:56.489209248 Process detector:armnn:
2024-05-10 14:41:56.490452039 Traceback (most recent call last):
2024-05-10 14:41:56.490468081 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-05-10 14:41:56.490469248 self.run()
2024-05-10 14:41:56.490470414 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-05-10 14:41:56.490471289 self._target(*self._args, **self._kwargs)
2024-05-10 14:41:56.490484706 File "/opt/frigate/frigate/object_detection.py", line 125, in run_detector
2024-05-10 14:41:56.490485873 detections = object_detector.detect_raw(input_frame)
2024-05-10 14:41:56.490487039 File "/opt/frigate/frigate/object_detection.py", line 75, in detect_raw
2024-05-10 14:41:56.490488206 return self.detect_api.detect_raw(tensor_input=tensor_input)
2024-05-10 14:41:56.490489373 File "/opt/frigate/frigate/detectors/plugins/rknn.py", line 192, in detect_raw
2024-05-10 14:41:56.490490248 return self.postprocess(np.array(output))
2024-05-10 14:41:56.490491414 File "/opt/frigate/frigate/detectors/plugins/rknn.py", line 145, in postprocess
2024-05-10 14:41:56.490492581 results = np.transpose(results[0, 0, :, :]) # array shape (2100, 84)
2024-05-10 14:41:56.490501914 IndexError: too many indices for array: array is 0-dimensional, but 4 were indexed ```
And docker-compose.yml
``` version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.13.2-rk
shm_size: "300mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
- /dev/dri/renderD129
- /dev/dri/card0
- /dev/dri/card1
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/flyzet/frigate/config:/config/
- /home/flyzet/media/frigate:/media/frigate
- /home/flyzet/media/frigate/clips:/media/frigate/clips
- /home/flyzet/media/frigate/recordings:/media/frigate/recordings
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8553:8553" # RTSP feeds
- "8556:8556/tcp" # WebRTC over tcp
- "8556:8556/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
FFMPEG_RKMPP_PIXFMT: "YUV420P" ```
Could you try to remove the config/model_cache/rknn
folder? If this won't help, try to use path: default-yolov8n
in your config.
Could you try to remove the
config/model_cache/rknn
folder? If this won't help, try to usepath: default-yolov8n
in your config.
Tried both ways without luck, it's started and showing green cameras after couple minutes system freezing.
What does sudo dmesg
say after the green recordings?
What does
sudo dmesg
say after the green recordings?
i pasted dmesg output here, because it's too long
I can't find anything useful in the logs and have no more idea.
Describe the problem you are having
I am using an Orange Pi 5 Plus with 16GB RAM and running Armbian with kernel 5.10. In my Frigate configuration, I deliberately set ffmpeg to decode at 10 fps to reduce CPU load, even though my camera can transmit at 25 fps in 2K resolution. Despite this reduced frame rate, I am still encountering a substantial CPU overload, averaging around 50%. I suspect that the integrated NPU in the RK3588 is not being effectively utilized or might not be supported. As a novice in GNU Linux systems and a user of Frigate, I am looking for assistance to optimize my setup.
I'm afraid that when connecting 4 or more cameras, my mini PC may not cope![image](https://github.com/blakeblackshear/frigate/assets/67061567/915d1d26-3ccc-4eba-8606-402406e90c53)
Version
dev-8e41913-rk
Frigate config file
docker-compose file or Docker CLI command
Relevant log output
FFprobe output from your camera
Operating system
Debian
Install method
Docker Compose
Network connection
Wired
Camera make and model
Hikvision DS-2CD2043G2-I
Any other information that may be helpful
Previously, I used the stable image from Docker Hub, but for some reason, the publication of current versions there stopped. Since there was no image with RK support on Docker Hub, I had to compile FFmpeg in the Docker image myself, then transfer it through layers to the stable Frigate image. I also had to replace some arguments because they were not present in the new versions of ffmpeg (stimeout). However, after all the work, Frigate on the stable version functioned just as it does now on the dev version with RK support.
here is my Dockerfile for compiling ffmpeg