blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
16.16k stars 1.52k forks source link

[HW Accel Support]: High CPU Usage and Low FPS in Frigate on Orange Pi 5 Plus with RK3588 #9201

Closed ThisIsLamer closed 6 months ago

ThisIsLamer commented 6 months ago

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

Version

dev-8e41913-rk

Frigate config file

detectors:
  cpu1:
    type: cpu
    num_threads: 1

logger:
  default: debug
  logs:
    frigate.mqtt: error
    ffmpeg.my_camera: debug

mqtt:
  host: mosquitto
  user: user
  password: password

cameras:
  my_camera:
    ffmpeg:
      inputs:
        - path: rtsp://admin:admin@10.7.8.131/Streaming/Channels/101
          roles:
            - detect
    detect:
      fps: 10

record:
  enabled: True
  retain:
    days: 7
    mode: all
  events:
    retain:
      default: 14

docker-compose file or Docker CLI command

version: "3.9"

services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    stop_grace_period: 1s
#    image: sha256:359a8ae17ac7c6660007e7e790ce3772a7fc88d58e089cbfd67817231cc3f133
    image: ghcr.io/blakeblackshear/frigate:dev-8e41913-rk
#    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "256mb" # update for your cameras based on calculation above
    devices:
      - /dev/mpp_service:/dev/mpp_service
      - /dev/dma_heap:/dev/dma_heap
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config:/config
      - ./storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"
    networks:
      - global

networks:
  global:
    external: true

Relevant log output

root@orangepi5-plus:~/docker/frigate# docker compose up
[+] Running 1/0
 ✔ Container frigate  Created                                                                                                                                                                               0.0s
Attaching to frigate
frigate  | s6-rc: info: service s6rc-fdholder: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner successfully started
frigate  | s6-rc: info: service fix-attrs: starting
frigate  | s6-rc: info: service s6rc-fdholder successfully started
frigate  | s6-rc: info: service fix-attrs successfully started
frigate  | s6-rc: info: service legacy-cont-init: starting
frigate  | s6-rc: info: service legacy-cont-init successfully started
frigate  | s6-rc: info: service log-prepare: starting
frigate  | s6-rc: info: service log-prepare successfully started
frigate  | s6-rc: info: service nginx-log: starting
frigate  | s6-rc: info: service go2rtc-log: starting
frigate  | s6-rc: info: service frigate-log: starting
frigate  | s6-rc: info: service nginx-log successfully started
frigate  | s6-rc: info: service go2rtc-log successfully started
frigate  | s6-rc: info: service go2rtc: starting
frigate  | s6-rc: info: service frigate-log successfully started
frigate  | s6-rc: info: service go2rtc successfully started
frigate  | s6-rc: info: service go2rtc-healthcheck: starting
frigate  | s6-rc: info: service frigate: starting
frigate  | s6-rc: info: service go2rtc-healthcheck successfully started
frigate  | s6-rc: info: service frigate successfully started
frigate  | s6-rc: info: service nginx: starting
frigate  | 2024-01-04 09:08:55.720538888  [INFO] Preparing Frigate...
frigate  | 2024-01-04 09:08:55.721214673  [INFO] Preparing new go2rtc config...
frigate  | s6-rc: info: service nginx successfully started
frigate  | s6-rc: info: service legacy-services: starting
frigate  | 2024-01-04 09:08:55.728206434  [INFO] Starting NGINX...
frigate  | 2024-01-04 09:08:55.735362985  [INFO] Starting Frigate...
frigate  | s6-rc: info: service legacy-services successfully started
frigate  | 2024-01-04 09:08:56.198107784  [INFO] Starting go2rtc...
frigate  | 2024-01-04 09:08:56.289806837  09:08:56.289 INF go2rtc version 1.8.4 linux/arm64
frigate  | 2024-01-04 09:08:56.290847784  09:08:56.290 INF [api] listen addr=:1984
frigate  | 2024-01-04 09:08:56.290856826  09:08:56.290 INF [rtsp] listen addr=:8554
frigate  | 2024-01-04 09:08:56.291480986  09:08:56.291 INF [webrtc] listen addr=:8555
frigate  | 2024-01-04 09:08:57.318909073  2024/01/04 09:08:57 [error] 146#146: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.7.8.240, server: , request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:5002/", host: "10.7.8.250:5000"
frigate  | 2024-01-04 09:08:57.318981989  10.7.8.240 - - [04/Jan/2024:09:08:57 +0000] "GET /ws HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "-"
frigate  | 2024-01-04 09:08:57.344583350  [2024-01-04 09:08:57] frigate.app                    INFO    : Starting Frigate (0.13.0-8e41913)
frigate  | 2024-01-04 09:08:58.415885525  [2024-01-04 09:08:58] peewee_migrate.logs            INFO    : Starting migrations
frigate  | 2024-01-04 09:08:58.415924025  [2024-01-04 09:08:58] peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
frigate  | 2024-01-04 09:08:58.420920807  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
frigate  | 2024-01-04 09:08:58.428700935  [2024-01-04 09:08:58] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate  | 2024-01-04 09:08:58.524643401  [2024-01-04 09:08:58] frigate.app                    INFO    : Recording process started: 461
frigate  | 2024-01-04 09:08:58.534327509  [2024-01-04 09:08:58] frigate.app                    INFO    : go2rtc process pid: 95
frigate  | 2024-01-04 09:08:58.535523330  [2024-01-04 09:08:58] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:08:58.562377969  [2024-01-04 09:08:58] frigate.comms.mqtt             DEBUG   : MQTT connected
frigate  | 2024-01-04 09:08:58.577152483  [2024-01-04 09:08:58] detector.cpu1                  INFO    : Starting detection process: 472
frigate  | 2024-01-04 09:08:58.585560855  [2024-01-04 09:08:58] frigate.app                    INFO    : Output process started: 474
frigate  | 2024-01-04 09:08:58.588083454  [2024-01-04 09:08:58] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
frigate  | 2024-01-04 09:08:58.588647239  [2024-01-04 09:08:58] peewee.sqliteq                 DEBUG   : received query DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))
frigate  | 2024-01-04 09:08:58.588908278  [2024-01-04 09:08:58] peewee                         DEBUG   : ('DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))', ['my_camera'])
frigate  | 2024-01-04 09:08:58.589132276  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."grid", "t1"."last_update" FROM "regions" AS "t1" WHERE ("t1"."camera" = ?) LIMIT ? OFFSET ?', ['my_camera', 1, 0])
frigate  | 2024-01-04 09:08:58.589348982  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT "t1"."id" FROM "event" AS "t1" WHERE ((("t1"."camera" = ?) AND (("t1"."false_positive" IS ?) OR ("t1"."false_positive" = ?))) AND ("t1"."start_time" > ?))', ['my_camera', None, False, 1704356260.122052])
frigate  | 2024-01-04 09:08:58.589640354  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : Found 2 new events for my_camera
frigate  | 2024-01-04 09:08:58.589724645  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."source", "t1"."data" FROM "timeline" AS "t1" WHERE ("t1"."source_id" IN (?, ?)) LIMIT ?', ['1704356374.09081-j17n99', '1704356569.390252-2br3hj', 10000])
frigate  | 2024-01-04 09:08:58.593448315  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : Found 4 new entries for my_camera
frigate  | 2024-01-04 09:08:58.593543397  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.014880952380952384 mean: 0.33035714285714285
frigate  | 2024-01-04 09:08:58.593602313  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0 mean: 0.37202380952380953
frigate  | 2024-01-04 09:08:58.593733270  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.15354726595116686 mean: 0.46329365079365076
frigate  | 2024-01-04 09:08:58.593740853  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0 mean: 0.5520833333333334
frigate  | 2024-01-04 09:08:58.593931310  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0342630136052924 mean: 0.3067956349206349
frigate  | 2024-01-04 09:08:58.594118850  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0 mean: 0.49404761904761907
frigate  | 2024-01-04 09:08:58.594192057  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0 mean: 0.43601190476190477
frigate  | 2024-01-04 09:08:58.594417513  [2024-01-04 09:08:58] frigate.util.object            DEBUG   : std dev: 0.0 mean: 0.3556547619047619
frigate  | 2024-01-04 09:08:58.594425388  [2024-01-04 09:08:58] peewee.sqliteq                 DEBUG   : received query INSERT INTO "regions" ("camera", "grid", "last_update") VALUES (?, json(?), ?) ON CONFLICT ("camera") DO UPDATE SET "camera" = ?, "grid" = json(?), "last_update" = ?
frigate  | 2024-01-04 09:08:58.594536220  [2024-01-04 09:08:58] peewee                         DEBUG   : ('INSERT INTO "regions" ("camera", "grid", "last_update") VALUES (?, json(?), ?) ON CONFLICT ("camera") DO UPDATE SET "camera" = ?, "grid" = json(?), "last_update" = ?', ['my_camera', '[[{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.34523809523809523, 0.31547619047619047], "x": 3, "y": 4, "std_dev": 0.014880952380952384, "mean": 0.33035714285714285}, {"sizes": []}, {"sizes": [0.37202380952380953], "x": 3, "y": 6, "std_dev": 0.0, "mean": 0.37202380952380953}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.6800595238095238, 0.36607142857142855, 0.34375], "x": 4, "y": 4, "std_dev": 0.15354726595116686, "mean": 0.46329365079365076}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.5520833333333334], "x": 5, "y": 2, "std_dev": 0.0, "mean": 0.5520833333333334}, {"sizes": []}, {"sizes": [0.34077380952380953, 0.3020833333333333, 0.36160714285714285, 0.27529761904761907, 0.2961309523809524, 0.2648809523809524], "x": 5, "y": 4, "std_dev": 0.0342630136052924, "mean": 0.3067956349206349}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": [0.49404761904761907], "x": 6, "y": 1, "std_dev": 0.0, "mean": 0.49404761904761907}, {"sizes": []}, {"sizes": []}, {"sizes": [0.43601190476190477], "x": 6, "y": 4, "std_dev": 0.0, "mean": 0.43601190476190477}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.3556547619047619], "x": 7, "y": 4, "std_dev": 0.0, "mean": 0.3556547619047619}, {"sizes": []}, {"sizes": []}, {"sizes": []}]]', 1704359338.588694, 'my_camera', '[[{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.34523809523809523, 0.31547619047619047], "x": 3, "y": 4, "std_dev": 0.014880952380952384, "mean": 0.33035714285714285}, {"sizes": []}, {"sizes": [0.37202380952380953], "x": 3, "y": 6, "std_dev": 0.0, "mean": 0.37202380952380953}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.6800595238095238, 0.36607142857142855, 0.34375], "x": 4, "y": 4, "std_dev": 0.15354726595116686, "mean": 0.46329365079365076}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.5520833333333334], "x": 5, "y": 2, "std_dev": 0.0, "mean": 0.5520833333333334}, {"sizes": []}, {"sizes": [0.34077380952380953, 0.3020833333333333, 0.36160714285714285, 0.27529761904761907, 0.2961309523809524, 0.2648809523809524], "x": 5, "y": 4, "std_dev": 0.0342630136052924, "mean": 0.3067956349206349}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": [0.49404761904761907], "x": 6, "y": 1, "std_dev": 0.0, "mean": 0.49404761904761907}, {"sizes": []}, {"sizes": []}, {"sizes": [0.43601190476190477], "x": 6, "y": 4, "std_dev": 0.0, "mean": 0.43601190476190477}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": [0.3556547619047619], "x": 7, "y": 4, "std_dev": 0.0, "mean": 0.3556547619047619}, {"sizes": []}, {"sizes": []}, {"sizes": []}]]', 1704359338.588694])
frigate  | 2024-01-04 09:08:58.615504503  [2024-01-04 09:08:58] frigate.app                    INFO    : Camera processor started for my_camera: 480
frigate  | 2024-01-04 09:08:58.624478702  [2024-01-04 09:08:58] frigate.app                    INFO    : Capture process started for my_camera: 481
frigate  | 2024-01-04 09:08:58.630688222  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT COUNT(?) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?))', ['*', 'my_camera', 0.0])
frigate  | 2024-01-04 09:08:58.634762179  [2024-01-04 09:08:58] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
frigate  | 2024-01-04 09:08:58.637532984  [2024-01-04 09:08:58] peewee                         DEBUG   : ('SELECT AVG("t1"."segment_size" / ("t1"."end_time" - "t1"."start_time")) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?)) LIMIT ?', ['my_camera', 0.0, 100])
frigate  | 2024-01-04 09:08:58.639212092  [2024-01-04 09:08:58] frigate.storage                DEBUG   : my_camera has a bandwidth of 2735.48 MiB/hr.
frigate  | 2024-01-04 09:08:58.661341780  [2024-01-04 09:08:58] tzlocal                        DEBUG   : /etc/timezone found, contents:
frigate  | 2024-01-04 09:08:58.661345863   Etc/UTC
frigate  | 2024-01-04 09:08:58.661346738
frigate  | 2024-01-04 09:08:58.662273937  [2024-01-04 09:08:58] tzlocal                        DEBUG   : /etc/localtime found
frigate  | 2024-01-04 09:08:58.663663714  [2024-01-04 09:08:58] tzlocal                        DEBUG   : 2 found:
frigate  | 2024-01-04 09:08:58.663667797   {'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
frigate  | 2024-01-04 09:08:58.976077193  [2024-01-04 09:08:58] urllib3.connectionpool         DEBUG   : https://api.github.com:443 "GET /repos/blakeblackshear/frigate/releases/latest HTTP/1.1" 200 1767
frigate  | 2024-01-04 09:08:59.056163948  [2024-01-04 09:08:59] peewee.sqliteq                 DEBUG   : received query UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)
frigate  | 2024-01-04 09:08:59.056424404  [2024-01-04 09:08:59] peewee                         DEBUG   : ('UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)', [30, None])
frigate  | 2024-01-04 09:09:03.535812141  [2024-01-04 09:09:03] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:05.718379662  [INFO] Starting go2rtc healthcheck service...
frigate  | 2024-01-04 09:09:08.535551874  [2024-01-04 09:09:08] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:13.536280055  [2024-01-04 09:09:13] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:13.646334375  [2024-01-04 09:09:13] frigate.record.maintainer      DEBUG   : Copied /media/frigate/recordings/2024-01-04/09/my_camera/08.59.mp4 in 0.06823396682739258 seconds.
frigate  | 2024-01-04 09:09:13.656682893  [2024-01-04 09:09:13] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
frigate  | 2024-01-04 09:09:13.657312595  [2024-01-04 09:09:13] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['1704359339.0-kbqdjf', 'my_camera', '/media/frigate/recordings/2024-01-04/09/my_camera/08.59.mp4', 1704359339.0, 1704359350.884766, 11.884765625, 87131464, 0, 0, 11.4])
frigate  | 2024-01-04 09:09:18.536122745  [2024-01-04 09:09:18] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:23.536810676  [2024-01-04 09:09:23] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:23.661632803  [2024-01-04 09:09:23] frigate.record.maintainer      DEBUG   : Copied /media/frigate/recordings/2024-01-04/09/my_camera/09.10.mp4 in 0.09705996513366699 seconds.
frigate  | 2024-01-04 09:09:23.672582148  [2024-01-04 09:09:23] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
frigate  | 2024-01-04 09:09:23.672696771  [2024-01-04 09:09:23] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['1704359350.0-lb9hco', 'my_camera', '/media/frigate/recordings/2024-01-04/09/my_camera/09.10.mp4', 1704359350.0, 1704359359.974844, 9.97484375, 50085873, 0, 0, 9.1])
frigate  | 2024-01-04 09:09:28.537433567  [2024-01-04 09:09:28] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:33.540068645  [2024-01-04 09:09:33] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:33.633132682  [2024-01-04 09:09:33] frigate.record.maintainer      DEBUG   : Copied /media/frigate/recordings/2024-01-04/09/my_camera/09.20.mp4 in 0.06589794158935547 seconds.
frigate  | 2024-01-04 09:09:33.641895717  [2024-01-04 09:09:33] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
frigate  | 2024-01-04 09:09:33.642196130  [2024-01-04 09:09:33] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['1704359360.0-mdtoat', 'my_camera', '/media/frigate/recordings/2024-01-04/09/my_camera/09.20.mp4', 1704359360.0, 1704359369.970078, 9.970078125, 10268645, 0, 0, 9.0])
frigate  | 2024-01-04 09:09:38.539618504  [2024-01-04 09:09:38] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:43.539784358  [2024-01-04 09:09:43] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 09:09:43.636906604  [2024-01-04 09:09:43] frigate.record.maintainer      DEBUG   : Copied /media/frigate/recordings/2024-01-04/09/my_camera/09.30.mp4 in 0.06844520568847656 seconds.
frigate  | 2024-01-04 09:09:43.646111800  [2024-01-04 09:09:43] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
frigate  | 2024-01-04 09:09:43.646420672  [2024-01-04 09:09:43] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration", "motion", "objects", "dBFS", "segment_size") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', ['1704359370.0-tlyrvf', 'my_camera', '/media/frigate/recordings/2024-01-04/09/my_camera/09.30.mp4', 1704359370.0, 1704359379.974141, 9.974140624999999, 154845, 0, 0, 9.2])
frigate  | 2024-01-04 09:09:48.540381582  [2024-01-04 09:09:48] asyncio                        DEBUG   : Using selector: EpollSelector

FFprobe output from your camera

root@53bc8f4a3951:/opt/frigate# ffprobe rtsp://admin:QazWsx123@10.7.8.131/Streaming/Channels/101
ffprobe version e243e8d001-20231113 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=aarch64-ffbuild-linux-gnu- --arch=aarch64 --target-os=linux --enable-nonfree --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-openssl --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --disable-libdavs2 --enable-libdrm --enable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --disable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --disable-libvpx --enable-libwebp --enable-lv2 --enable-rkmpp --disable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --disable-libplacebo --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lstdc++ -lgomp' --extra-version=20231113
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, rtsp, from 'rtsp://admin:QazWsx123@10.7.8.131/Streaming/Channels/101':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.040000, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuvj420p(pc), 2688x1520 [SAR 1:1 DAR 168:95], 25 fps, 25 tbr, 90k tbn
[hevc_rkmpp_decoder @ 0xaaab14a9ae80] Picture format is yuv420p.

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

FROM debian:bullseye as rk-ffmpeg

RUN mkdir /root/ffmpeg
WORKDIR /root/ffmpeg

RUN apt update && apt upgrade -y && apt install wget -y

# build packages
RUN apt install -y autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libmp3lame-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev meson ninja-build pkg-config texinfo wget yasm zlib1g-dev
# ffmpeg dependencies
RUN apt install -y libx264-dev libx265-dev libnuma-dev libvpx-dev libopus-dev libdrm-dev libaom-dev libdav1d-dev libunistring-dev
# to build .deb
RUN apt install -y devscripts debhelper

RUN wget http://ftp.de.debian.org/debian/pool/main/liby/libyuv/libyuv0_0.0~git20230123.b2528b0-1_arm64.deb
RUN wget http://ftp.de.debian.org/debian/pool/main/liby/libyuv/libyuv-dev_0.0~git20230123.b2528b0-1_arm64.deb

RUN apt install -y ./libyuv0_0.0~git20230123.b2528b0-1_arm64.deb
RUN apt install -y ./libyuv-dev_0.0~git20230123.b2528b0-1_arm64.deb

RUN git clone https://github.com/rockchip-linux/mpp.git -b develop
WORKDIR /root/ffmpeg/mpp
RUN cmake CMakeLists.txt
RUN make -j8
RUN make install

WORKDIR /root/ffmpeg
RUN git clone https://github.com/tsukumijima/librga-rockchip.git
WORKDIR /root/ffmpeg/librga-rockchip
RUN debuild -us -uc -b && cp -a ../*.deb ./
RUN dpkg -i librga*.deb

WORKDIR /root/ffmpeg

RUN git clone https://github.com/hbiyik/FFmpeg.git
WORKDIR /root/ffmpeg/FFmpeg
RUN ./configure --pkg-config-flags="--static" \
    --enable-rkmpp --enable-version3 --enable-libdrm \
    --disable-doc --disable-shared --enable-static
RUN make -j8

WORKDIR /root/ffmpeg

FROM blakeblackshear/frigate:stable
#COPY --from=rk-ffmpeg /root/ffmpeg/FFmpeg/ffmpeg_g /usr/lib/btbn-ffmpeg
COPY --from=rk-ffmpeg /root/ffmpeg/FFmpeg/ffmpeg /usr/bin/ffmpeg
COPY --from=rk-ffmpeg /root/ffmpeg/FFmpeg/ffprobe /usr/bin/ffprobe
COPY --from=rk-ffmpeg /root/ffmpeg/FFmpeg/ffplay /usr/bin/ffplay
COPY --from=rk-ffmpeg /usr/local/lib/librockchip_mpp.so.1 /usr/local/lib/
COPY --from=rk-ffmpeg /usr/local/lib/librockchip_mpp.so.1 /usr/lib/
COPY --from=rk-ffmpeg /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/
ThisIsLamer commented 6 months ago

I noticed that for my camera, ffmpeg is launched with the following parameters:

ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-8e41913 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://*:*@10.7.8.131/Streaming/Channels/101 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/my_camera@%Y%m%d%H%M%S%z.mp4 -r 10 -vf fps=10,scale=2688:1520 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:

Is it possible to configure Frigate so that it simply receives the image from the camera without processing it, allowing for direct recording to the device's memory?

ThisIsLamer commented 6 months ago

image

I also found this error, if you run ffmpeg directly and send the stream to /dev/null, the processor will not be loaded, while hardware acceleration will work and the video stream will be processed

NickM-27 commented 6 months ago

Please read the docs, you are not using the GPU for decoding and not using the npu for object detection so it's no surprise CPU usage is high

NickM-27 commented 6 months ago

See https://deploy-preview-6262--frigate-docs.netlify.app/configuration/hardware_acceleration#rockchip-platform for GPU

https://deploy-preview-6262--frigate-docs.netlify.app/configuration/object_detectors#rockchip-rknn-toolkit-lite2 for NPU

Also to be clear for recordings frigate does not alter the stream at all, it is transparently written to memory

ThisIsLamer commented 6 months ago

I understand that this question might be slightly off-topic for Frigate, but I am encountering difficulties in enabling hardware acceleration on the Orange PI 5 Plus.

I have added all the repositories and installed the packages described on the Armbian website for enabling hardware acceleration. However, the devices /dev/mpp_service and /dev/dri/renderD128 have not appeared, preventing me from initiating hardware acceleration. Currently, I am using the version Armbian_23.11.1_Orangepi5-plus_jammy_edge_6.7.0-rc1.img. Previously, I used a version with kernel 5.10 because it already includes the /dev/mpp_service device. However, I am not satisfied with that version. Perhaps you could help?

armbian: https://www.armbian.com/orangepi-5/

This is what I get after launching Frigate.

orangepi5-plus:frigate:# docker compose up
[+] Running 1/0
 ✔ Container frigate  Created                                                                                                                                                                               0.0s
Attaching to frigate
frigate  | s6-rc: info: service s6rc-fdholder: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner successfully started
frigate  | s6-rc: info: service fix-attrs: starting
frigate  | s6-rc: info: service s6rc-fdholder successfully started
frigate  | s6-rc: info: service fix-attrs successfully started
frigate  | s6-rc: info: service legacy-cont-init: starting
frigate  | s6-rc: info: service legacy-cont-init successfully started
frigate  | s6-rc: info: service log-prepare: starting
frigate  | s6-rc: info: service log-prepare successfully started
frigate  | s6-rc: info: service nginx-log: starting
frigate  | s6-rc: info: service go2rtc-log: starting
frigate  | s6-rc: info: service frigate-log: starting
frigate  | s6-rc: info: service nginx-log successfully started
frigate  | s6-rc: info: service go2rtc-log successfully started
frigate  | s6-rc: info: service go2rtc: starting
frigate  | s6-rc: info: service frigate-log successfully started
frigate  | s6-rc: info: service go2rtc successfully started
frigate  | s6-rc: info: service go2rtc-healthcheck: starting
frigate  | s6-rc: info: service frigate: starting
frigate  | s6-rc: info: service frigate successfully started
frigate  | s6-rc: info: service nginx: starting
frigate  | s6-rc: info: service go2rtc-healthcheck successfully started
frigate  | s6-rc: info: service nginx successfully started
frigate  | s6-rc: info: service legacy-services: starting
frigate  | 2024-01-04 21:27:58.710921659  [INFO] Preparing Frigate...
frigate  | 2024-01-04 21:27:58.716109189  [INFO] Preparing new go2rtc config...
frigate  | 2024-01-04 21:27:58.717305302  [INFO] Starting NGINX...
frigate  | s6-rc: info: service legacy-services successfully started
frigate  | 2024-01-04 21:27:58.735906444  [INFO] Starting Frigate...
frigate  | 2024-01-04 21:27:59.082986208  [INFO] Starting go2rtc...
frigate  | 2024-01-04 21:27:59.195815423  21:27:59.195 INF go2rtc version 1.8.4 linux/arm64
frigate  | 2024-01-04 21:27:59.196828954  21:27:59.196 INF [rtsp] listen addr=:8554
frigate  | 2024-01-04 21:27:59.196833329  21:27:59.196 INF [api] listen addr=:1984
frigate  | 2024-01-04 21:27:59.197043618  21:27:59.197 INF [webrtc] listen addr=:8555
frigate  | 2024-01-04 21:28:00.309944381  [2024-01-04 21:28:00] frigate.app                    INFO    : Starting Frigate (0.13.0-8e41913)
frigate  | 2024-01-04 21:28:01.362946177  [2024-01-04 21:28:01] peewee_migrate.logs            INFO    : Starting migrations
frigate  | 2024-01-04 21:28:01.363337298  [2024-01-04 21:28:01] peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
frigate  | 2024-01-04 21:28:01.365785231  [2024-01-04 21:28:01] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
frigate  | 2024-01-04 21:28:01.373484860  [2024-01-04 21:28:01] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate  | 2024-01-04 21:28:01.384508872  [2024-01-04 21:28:01] frigate.app                    INFO    : Recording process started: 450
frigate  | 2024-01-04 21:28:01.390260771  [2024-01-04 21:28:01] frigate.app                    INFO    : go2rtc process pid: 89
frigate  | 2024-01-04 21:28:01.396081211  [2024-01-04 21:28:01] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-01-04 21:28:01.405524989  [2024-01-04 21:28:01] frigate.comms.mqtt             DEBUG   : MQTT connected
frigate  | 2024-01-04 21:28:01.438933896  [2024-01-04 21:28:01] detector.rknn                  INFO    : Starting detection process: 461
frigate  | 2024-01-04 21:28:01.443850762  [2024-01-04 21:28:01] frigate.app                    INFO    : Output process started: 463
frigate  | 2024-01-04 21:28:01.449824325  [2024-01-04 21:28:01] peewee.sqliteq                 DEBUG   : received query DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))
frigate  | 2024-01-04 21:28:01.450091489  [2024-01-04 21:28:01] peewee                         DEBUG   : ('DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))', ['my_camera'])
frigate  | 2024-01-04 21:28:01.452262925  [2024-01-04 21:28:01] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."grid", "t1"."last_update" FROM "regions" AS "t1" WHERE ("t1"."camera" = ?) LIMIT ? OFFSET ?', ['my_camera', 1, 0])
frigate  | 2024-01-04 21:28:01.460146594  [2024-01-04 21:28:01] peewee                         DEBUG   : ('SELECT "t1"."id" FROM "event" AS "t1" WHERE ((("t1"."camera" = ?) AND (("t1"."false_positive" IS ?) OR ("t1"."false_positive" = ?))) AND ("t1"."start_time" > ?))', ['my_camera', None, False, 0])
frigate  | 2024-01-04 21:28:01.461596163  [2024-01-04 21:28:01] frigate.util.object            DEBUG   : Found 0 new events for my_camera
frigate  | 2024-01-04 21:28:01.469588330  [2024-01-04 21:28:01] frigate.app                    INFO    : Camera processor started for my_camera: 468
frigate  | 2024-01-04 21:28:01.476700549  [2024-01-04 21:28:01] frigate.app                    INFO    : Capture process started for my_camera: 469
frigate  | 2024-01-04 21:28:01.482131326  [2024-01-04 21:28:01] peewee                         DEBUG   : ('SELECT COUNT(?) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?))', ['*', 'my_camera', 0.0])
frigate  | 2024-01-04 21:28:01.489381502  [2024-01-04 21:28:01] peewee                         DEBUG   : ('SELECT AVG("t1"."segment_size" / ("t1"."end_time" - "t1"."start_time")) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?)) LIMIT ?', ['my_camera', 0.0, 100])
frigate  | 2024-01-04 21:28:01.489387919  [2024-01-04 21:28:01] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
frigate  | 2024-01-04 21:28:01.489394335  [2024-01-04 21:28:01] frigate.storage                DEBUG   : my_camera has a bandwidth of 0 MiB/hr.
frigate  | 2024-01-04 21:28:01.525835085  [2024-01-04 21:28:01] tzlocal                        DEBUG   : /etc/timezone found, contents:
frigate  | 2024-01-04 21:28:01.525839752   Etc/UTC
frigate  | 2024-01-04 21:28:01.525840919
frigate  | 2024-01-04 21:28:01.527462860  [2024-01-04 21:28:01] tzlocal                        DEBUG   : /etc/localtime found
frigate  | 2024-01-04 21:28:01.530867742  [2024-01-04 21:28:01] tzlocal                        DEBUG   : 2 found:
frigate  | 2024-01-04 21:28:01.530872409   {'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
frigate  | 2024-01-04 21:28:01.717576822  E RKNN: [21:28:01.717] failed to open rknpu module, need to insmod rknpu dirver!
frigate  | 2024-01-04 21:28:01.717582072  E RKNN: [21:28:01.717] failed to open rknn device!
frigate  | 2024-01-04 21:28:01.818064413  E Catch exception when init runtime!
frigate  | 2024-01-04 21:28:01.818710157  E Traceback (most recent call last):
frigate  | 2024-01-04 21:28:01.818718615    File "/usr/local/lib/python3.9/dist-packages/rknnlite/api/rknn_lite.py", line 148, in init_runtime
frigate  | 2024-01-04 21:28:01.818724157      self.rknn_runtime.build_graph(self.rknn_data, self.load_model_in_npu)
frigate  | 2024-01-04 21:28:01.818729698    File "rknnlite/api/rknn_runtime.py", line 875, in rknnlite.api.rknn_runtime.RKNNRuntime.build_graph
frigate  | 2024-01-04 21:28:01.818734073  Exception: RKNN init failed. error code: RKNN_ERR_FAIL
frigate  | 2024-01-04 21:28:01.818736698
frigate  | 2024-01-04 21:28:01.820433597  [2024-01-04 21:28:01] frigate.detectors.plugins.rknn E       : Error initializing rknn runtime. Do you run docker in privileged mode?
frigate  | 2024-01-04 21:28:01.873525135  [2024-01-04 21:28:01] urllib3.connectionpool         DEBUG   : https://api.github.com:443 "GET /repos/blakeblackshear/frigate/releases/latest HTTP/1.1" 200 1767
frigate  | 2024-01-04 21:28:01.912728815  [2024-01-04 21:28:01] peewee.sqliteq                 DEBUG   : received query UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)
frigate  | 2024-01-04 21:28:01.912858605  [2024-01-04 21:28:01] peewee                         DEBUG   : ('UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)', [30, None])
frigate  | 2024-01-04 21:28:02.552916273  [2024-01-04 21:28:02] frigate.video                  ERROR   : my_camera: Unable to read frames from ffmpeg process.
frigate  | 2024-01-04 21:28:02.553496975  [2024-01-04 21:28:02] frigate.video                  ERROR   : my_camera: ffmpeg process is not running. exiting capture thread...

This is what I see when I try to check vainfo.

orangepi5-plus:frigate:# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.14.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit
ThisIsLamer commented 6 months ago

You can also see from the log that there were problems launching npu

the container is running in privileged mode

docker-compose.yml

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    stop_grace_period: 1s
    image: ghcr.io/blakeblackshear/frigate:dev-8e41913-rk
    shm_size: "256mb" # update for your cameras based on calculation above
    devices:
      - /dev/dma_heap:/dev/dma_heap
      - /dev/dri/renderD129:/dev/dri/renderD129
    volumes:
      - /dev/dri/renderD129:/dev/dri/renderD129
      - /proc/device-tree/compatible:/proc/device-tree/compatible
      - /etc/localtime:/etc/localtime:ro
      - ./config:/config
#      - ./config.yml:/config/config.yml
      - ./storage:/media/frigate
#      - /usr/lib/aarch64-linux-gnu/:/usr/lib/aarch64-linux-gnu-host/:ro
#      - /home/lamer/temp/mpp/mpp/librockchip_mpp.so.1:/usr/lib/librockchip_mpp.so.1:ro
#      - /home/lamer/temp/FFmpeg/ffmpeg_g:/usr/lib/btbn-ffmpeg:ro
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"
    networks:
      - global

networks:
  global:
    external: true
NickM-27 commented 6 months ago

CC @MarcA711

MarcA711 commented 6 months ago

Hey ThisIsLamer,

What does ls /dev/dri return? Does it include renderD128 renderD129? (renderD129 is your VPU used to decode frames from your camera, renderD129 is your NPU used to accelerate object detection).

If it doesn't show these devices, it means your distro does not support the Rockchip VPU or NPU. However, I think that other users successfully used armbian. First, you should try this distro, since this works very well. After the VPU and NPU show up, we can change your config to use HW acceleration and reduce the CPU load. If you prefer Armbian for some reasons, we can than see why it won't detect your hardware and set up this distro.

ThisIsLamer commented 6 months ago

Hello, MarcA711.

I tried running the image you recommended, attempted to write it to emmc using RKDevTools, and to a flash drive using BalenaEtcher, but the result was the same.

ubuntu-22.04.3-preinstalled-desktop-arm64-orangepi-5-plus.img.xz

U-Boot 2017.09 (Dec 29 2023 - 12:58:57 +0000)

Model: RK3588 Orange Pi 5 Plus
PreSerial: 2, raw, 0xfeb50000
DRAM:  16 GiB
Sysmem: init
Relocation Offset: eda64000
Relocation fdt: eb9f9638 - eb9fecc0
CR: M/C/I
Using default environment

no mmc device at slot 1
mmc@fe2c0000: 0, mmc@fe2e0000: 1 (eMMC)
Bootdev(atags): mmc 1
MMC1: HS200, 200Mhz
PartType: EFI
DM: v2
boot mode: None
Model: RK3588 Orange Pi 5 Plus
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 24000 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 24000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
Net:   No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0
mmc@fe2c0000: 0
mmc@fe2e0000: 1 (eMMC)
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
reading /boot.scr
1608 bytes read in 1 ms (1.5 MiB/s)
## Executing script at 00500000
Boot script loaded from mmc 1
reading /ubuntuEnv.txt
338 bytes read in 1 ms (330.1 KiB/s)
reading /dtbs/rockchip/rk3588-orangepi-5-plus.dtb
278673 bytes read in 6 ms (44.3 MiB/s)
reading /vmlinuz
38269440 bytes read in 211 ms (173 MiB/s)
reading /initrd.img
14665676 bytes read in 81 ms (172.7 MiB/s)
Fdt Ramdisk skip relocation
## Flattened Device Tree blob at 0x0a100000
   Booting using the fdt blob at 0x0a100000
   reserving fdt memory region: addr=a100000 size=55000
  'reserved-memory' cma: addr=10000000 size=10000000
  'reserved-memory' ramoops@110000: addr=110000 size=f0000
   Using Device Tree in place at 000000000a100000, end 000000000a157fff
Adding bank: 0x00200000 - 0xf0000000 (size: 0xefe00000)
Adding bank: 0x100000000 - 0x3fc000000 (size: 0x2fc000000)
Adding bank: 0x3fc500000 - 0x3fff00000 (size: 0x03a00000)
Adding bank: 0x4f0000000 - 0x500000000 (size: 0x10000000)
Total: 2537.916 ms

Starting kernel ...

[    4.395815] fiq_debugger fiq_debugger.0: IRQ fiq not found
[    4.395828] fiq_debugger fiq_debugger.0: IRQ wakeup not found
[    4.395836] fiq_debugger_probe: could not install nmi irq handler
[    4.453099] debugfs: Directory 'vcc_mipicsi1' with parent 'regulator' already present!
[    4.453117] debugfs: Directory 'vcc_mipicsi1' with parent 'vcc_mipicsi1' already present!
[    5.302525] rk-pcie fe180000.pcie: IRQ msi not found
[    5.302546] rk-pcie fe180000.pcie: Missing *config* reg space
[    5.302626] rk-pcie fe180000.pcie: Missing *config* reg space
[    5.302659] rk-pcie fe180000.pciIRQ msi not found
[    5.302851] rk-pcie fe190000.pcie: Missing *config* reg space
[    5.302983] rk-pcie fe190000.pcie: Missing *config* reg space
[    5.303024] rk-pcie fe190000.pcie: invalid resource
[    5.320042] rk-pcie fe150000.pcie: IRQ msi not found
[    5.320058] rk-pcie fe150000.pcie: Missing *config* reg space
[    5.320125] rk-pcie fe150000.pcie: Missing *config* reg space
[    5.320151] rk-pcie fe150000.pcie: invalid resource
[    5.323395] mpp-iep2 fdbb0000.iep: allocate roi buffer failed
[    5.325094] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_a is not found!
[    5.325108] rkvdec2_init:1022: No niu aclk reset resource define
[    5.325116] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_h is not found!
[    5.325122] rkvdec2_init:1025: No niu hclk reset resource define
[    5.325847] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_a is not found!
[    5.325857] rkvdec2_init:1022: No niu aclk reset resource define
[    5.325864] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_h is not found!
[    5.325871] rkvdec2_init:1025: No niu hclk reset resource define
[    5.326858] mpp_rkvenc2 fdbd0000.rkvenc-core: dev_pm_opp_set_regulators: no regulator (venc) found: -19
[    5.326883] rkvenc_init:1859: failed to add venc devfreq
[    5.327424] mpp_rkvenc2 fdbe0000.rkvenc-core: dev_pm_opp_set_regulators: no regulator (venc) found: -19
[    5.327443] rkvenc_init:1859: failed to add venc devfreq
[    5.366743] rk-pcie fe170000.pcie: IRQ msi not found
[    5.366793] rk-pcie fe170000.pcie: Missing *config* reg space
[    5.366961] rk-pcie fe170000.pcie: Missing *config* reg space
[    5.367013] rk-pcie fe170000.pcie: invalid resource
[    5.404401] rk806 spi2.0: no sleep-setting state
[    5.404421] rk806 spi2.0: no reset-setting pinctrl state
[    5.404430] rk806 spi2.0: no dvs-setting pinctrl state
[    5.588560] Error: Driver 'Goodix-TS' is already registered, aborting...
[    5.588803] .. rk pwm remotectl v2.0 init
[    5.734984] Goodix-TS 7-0014: i2c test failed attempt 1: -6
[    5.761624] Goodix-TS 7-0014: i2c test failed attempt 2: -6
[    5.788130] Goodix-TS 7-0014: I2C communication failure: -6
[    5.866348] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[    5.891709] debugfs: File 'Capture' in directory 'dapm' already present!
[    5.896054] debugfs: File 'Capture' in directory 'dapm' already present!
[    5.918741] ES8323 7-0011: ASoC: error at soc_component_write_no_lock on ES8323.7-0011: -5
[    6.013741] debugfs: Directory 'fb000000.gpu-mali' with parent 'vdd_gpu_s0' already present!
[    6.030883] rockchip-dmc dmc: failed to get vop bandwidth to dmc rate
[    6.030929] rockchip-dmc dmc: failed to get vop pn to msch rl
[    6.031151] rockchip-dmc dmc: could not find power_model node
[    6.049553] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdab0000-0xfdabffff]
[    6.049643] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdac0000-0xfdacffff]
[    6.049688] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdad0000-0xfdadffff]
[    6.056345] debugfs: Directory 'fdab0000.npu-rknpu' with parent 'vdd_npu_s0' already present!
[    6.083271] RKNPU fdab0000.npu: failed to find power_model node
[    6.083339] RKNPU fdab0000.npu: RKNPU: failed to initialize power model
[    6.083368] RKNPU fdab0000.npu: RKNPU: failed to get dynamic-coefficient
[    8.224796] rk-pcie fe150000.pcie: PCIe Link Fail
[    8.224812] rk-pcie fe150000.pcie: failed to initialize host
[    8.268121] rk-pcie fe170000.pcie: PCIe Link Fail
[    8.268156] rk-pcie fe170000.pcie: failed to initialize host

It seems to me that there is no significant difference in which image to use for booting. During my last attempt, I used the Armbian_23.11.1_Orangepi5-plus_jammy_legacy_5.10.160_gnome image.

This image contains all the necessary kernel extensions, and the NPU started working, but I still face the issue with hardware acceleration support. I even suspect that the hardware acceleration itself is functioning, but the issue I'm encountering is that all the processor time is going into transferring data to the video chip. During another attempt to run ffmpeg with streaming to /dev/null, the stream bitrate was 1225728 kb/s.

I tried recompiling ffmpeg with support only for the hardware encoder:

DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264_rkmpp_decoder ) (encoders: h264_rkmpp_encoder )

This did not change the situation.

The camera records video in 2k 25fps, 8192kbs.

Here are the devices available in the image:

orangepi5-plus:~:# ls /dev/
ashmem%           i2c-3%            mqueue/           tty16%            tty45%            vcs1%
autofs%           i2c-6%            mtd0%             tty17%            tty46%            vcs2%
block/            i2c-7%            mtd0ro%           tty18%            tty47%            vcs3%
btrfs-control%    i2c-9%            mtdblock0#        tty19%            tty48%            vcs4%
bus/              iio:device0%      net/              tty2%             tty49%            vcs5%
cec0%             initctl@          null%             tty20%            tty5%             vcs6%
cec1%             input/            port%             tty21%            tty50%            vcsa%
char/             kmsg%             ppp%              tty22%            tty51%            vcsa1%
console%          kvm%              ptmx%             tty23%            tty52%            vcsa2%
cpu_dma_latency%  log@              pts/              tty24%            tty53%            vcsa3%
crypto%           loop0#            ram0#             tty25%            tty54%            vcsa4%
cuse%             loop1#            random%           tty26%            tty55%            vcsa5%
disk/             loop2#            rfkill%           tty27%            tty56%            vcsa6%
dma_heap/         loop3#            rga%              tty28%            tty57%            vcsu%
dri/              loop4#            rkspi-dev2%       tty29%            tty58%            vcsu1%
drm_dp_aux0%      loop5#            rtc@              tty3%             tty59%            vcsu2%
fd@               loop6#            rtc0%             tty30%            tty6%             vcsu3%
full%             loop7#            shm/              tty31%            tty60%            vcsu4%
fuse%             loop-control%     snd/              tty32%            tty61%            vcsu5%
gpiochip0%        mali0%            stderr@           tty33%            tty62%            vcsu6%
gpiochip1%        mapper/           stdin@            tty34%            tty63%            vendor_storage%
gpiochip2%        mem%              stdout@           tty35%            tty7%             vhci%
gpiochip3%        mmcblk0#          sw_sync%          tty36%            tty8%             vhost-net%
gpiochip4%        mmcblk0boot0#     tty%              tty37%            tty9%             vhost-vsock%
gpiochip5%        mmcblk0boot1#     tty0%             tty38%            ttyFIQ0%          video0%
hdmirx_hdcp%      mmcblk0p1#        tty1%             tty39%            ttyS9%            video-dec0
hugepages/        mmcblk0p2#        tty10%            tty4%             ubi_ctrl%         video-enc0
hwrng%            mmcblk0rpmb%      tty11%            tty40%            uhid%             watchdog%
i2c-0%            mmcblk1#          tty12%            tty41%            uinput%           watchdog0%
i2c-1%            mmcblk1p1#        tty13%            tty42%            urandom%          zero%
i2c-10%           mmcblk1p2#        tty14%            tty43%            v4l/              zram0#
i2c-11%           mpp_service%      tty15%            tty44%            vcs%              zram1#
orangepi5-plus:~:# ls /dev/dri/
by-path/     card0%       card1%       renderD128%  renderD129%

Привет, ThisIsLamer!

Что значит ls /dev/driвернуть? Включает ли оно renderD128 renderD129? ( renderD129используется ли ваш VPU для декодирования кадров с вашей камеры, renderD129используется ли ваш NPU для ускорения обнаружения объектов).

Если эти устройства не отображаются, это означает, что ваш дистрибутив не поддерживает Rockchip VPU или NPU. Однако я думаю, что и другие пользователи успешно использовали Armbian. Во-первых, вам стоит попробовать этот дистрибутив , так как он работает очень хорошо. После появления VPU и NPU мы можем изменить вашу конфигурацию, чтобы использовать аппаратное ускорение и снизить нагрузку на процессор. Если по каким-то причинам вы предпочитаете Armbian, мы сможем понять, почему он не обнаружит ваше оборудование и не настроит этот дистрибутив.

ThisIsLamer commented 6 months ago

I would also like to add that after launching the stable version of the application, which has no support for Rockchip chips, the CPU load is lower, around 100%/800%. In the stable version, ffmpeg operates in software mode, and maintains a stable fps of 25.

But this is not enough because I want to utilize the hardware acceleration of the processor.

MarcA711 commented 6 months ago

Hi,

all devices seem to be present. So, hardware acceleration should work now.

Could you try out this docker-compose.yml:

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    stop_grace_period: 1s
    image: ghcr.io/blakeblackshear/frigate:dev-8e41913-rk
    shm_size: "256mb" # update for your cameras based on calculation above
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config:/config
      - ./storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

and this frigate config:

detectors:
  rknn:
    type: rknn

model:
  input_pixel_format: bgr

logger:
  default: debug
  logs:
    frigate.mqtt: error
    ffmpeg.my_camera: debug

mqtt:
  host: mosquitto
  user: user
  password: password

  detect:
    enabled: True
    fps: 10

record:
  enabled: True
  retain:
    days: 7
    mode: all
  events:
    retain:
      default: 14

cameras:
  my_camera:
    ffmpeg:
      inputs:
        - path: rtsp://admin:admin@10.7.8.131/Streaming/Channels/101
          input_args: preset-rtsp-generic
          hwaccel_args: preset-rk-h265
          roles:
            - detect
ThisIsLamer commented 6 months ago

I made all the changes and this is the result I got

It seems that two cores are loaded again, but not fully, and they manage a framerate of 10fps. image image

NickM-27 commented 6 months ago

worth mentioning that the 2688x1520 stream is being scaled down to 1280x720 here which uses software on the rockchip so that is likely part of the usage

MarcA711 commented 6 months ago

Yeah, Software scaling explains the increased CPU usage. I plan to provide a new FFmpeg version that supports hardware scaling. If you would like to, you can try out if this helps decreasing your CPU usage.

ThisIsLamer commented 6 months ago

To be honest, I couldn't find a process that could decode the video stream in 720p, and why is it needed in general?

The only process I could find is ffmpeg -hide_banner -loglevel warning -threads 2 -c:v hevc_rkmpp_decoder -user_agent FFmpeg Frigate/0.13.0-8e41913 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://:@ 10.7.8.131/Streaming/Channels/101 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/my_camera@%Y%m%d%H%M%S%z .mp4 -r 10 -vf fps=10,scale=2688:1520 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:

It uses 120-130% of the CPU, but it seems to be the only thing it does, which is copying the stream (I'm not sure about this).

NickM-27 commented 6 months ago

It uses 120-130% of the CPU, but it seems to be the only thing it does, which is copying the stream (I'm not sure about this).

that is decoding the stream for detect and also copying for record, though based on your config it is not resizing the stream

ThisIsLamer commented 6 months ago

Hello everyone,

I conducted a small study and found that certain parameters heavily load the CPU: -f rawvideo -pix_fmt yuv420p /dev/null.

/dev/null is my test implementation; in the application, the stream is passed to Python through pipe:.

I used 2 commands:

The CPU load was 5%. root@eedf4cf45f2b:/media/frigate/temp# ffmpeg -t 20 -hide_banner -c:v hevc_rkmpp_decoder -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -i rtsp://admin:QazWsx123@10.7.8.131/Streaming/Channels/101 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an my_camera.mp4 -r 10

The CPU load was 650% (there were noticeable block losses in the final video). root@eedf4cf45f2b:/media/frigate/temp# ffmpeg -hide_banner -c:v hevc_rkmpp_decoder -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -i rtsp://admin:QazWsx123@10.7.8.131/Streaming/Channels/101 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an my_camera.mp4 -r 10 -f rawvideo -pix_fmt yuv420p /dev/null

ThisIsLamer commented 6 months ago

For some reason, FFmpeg is converting rawvideo using CPU resources. I don't know how to make it do this on the GPU.

After I removed these parameters from the code, FFmpeg stopped launching.

/frigate/config.py 563 line /frigate/output.py 137 line

NickM-27 commented 6 months ago

yes because you are entirely removing the decoding of the stream and only copying it for recording, so of course the load will be lower

ThisIsLamer commented 6 months ago

I figured out the configuration and found a preset that suits me, where the processor is almost not loaded. It's still strange to me that decoding to raw is done by the processor, but thank you very much for the help.

spattinson commented 5 months ago

@NickM-27 Have you looked at this ffmpeg implementation https://github.com/nyanmisaka/ffmpeg-rockchip ? It has RGA support so pixel format and scaling can be done in hardware. I am testing on a rk3568 board for now which only has 4x A55 cpu, I'm going to get a rk3588 in future though based on how well it works. With the official image I get about 60% of one cpu, If I use this custom ffmpeg cpu drops to about 6%, amazing for such a low powered board. the basic command to do this is: ffmpeg -hwaccel rkmpp -hwaccel_output_format drm_prime -rtsp_transport tcp -i rtsp://cam.local:8554/back -vf scale_rkrga=w=1280:h=720:format=yuv420p,hwmap=mode=read,format=yuv420p -r 5 -f rawvideo -y pipe:

I changed the rk preset to use this as I dont think that the config file supports configuring the filter currently.

MarcA711 commented 5 months ago

Hey, I am the guy, who maintains the rockchip image.

I am currently experimenting with the ffmpeg fork that you mentioned and with the fork of hbiyik. Both forks support the filters to allow hw scaling using rga. However, the version that is included in the current frigate-rk image is a bit older and has no support for hw scaling. I plan to include a new FFmpeg version in the next frigate release, that supports all hardware filters.

spattinson commented 5 months ago

@MarcA711 Sounds great, I'll look out for that, I found it a struggle to get ffmpeg compiled static like the current one, gave up and added the shared libraries to /usr/lib/btbn-ffmpeg/lib and added an environment LD_LIBRARY_PATH to find them.

I've moved my rk3568 board into production for testing now, when I added go2rtc to it the CPU utilisation of each ffmpeg went up a bit, its now about 11% of one CPU. I want to consolidate my HA server and frigate server so I'll be using a Rock 5b rk3588 eventually. rk3568 NPU for object recognition also works fine with current builds 125ms inference, but it has a 1TOPS NPU, rk3588 is 6TOPS.

MarcA711 commented 5 months ago

@spattinson Yes, it is a real struggle to build the rockchip libs statically. The current ffmpeg build is a little bit hacky but it works. I've spent the last weeks to find a clean way to build all libraries.

I am glad your setup works. However, we don't have a frigate addon for rockchip boards right now. HAOS will not work, due to driver issues. The only way right now is to use HA Container. Hopefully, HA supervisor will work in the near future. For more information, see this conversation (especially my last comment, where I sum everything up): https://github.com/blakeblackshear/frigate-hass-addons/issues/145#issuecomment-1910736339

spattinson commented 5 months ago

@MarcA711 The issue you are facing accessing the device tree to determine which shared library to use is failing. The device tree was linked in the wrong place, also the file is empty if you poke around in the container in the place that supervisor mounts it. I did some digging around and found some references to "masked paths" in docker that may be the cause. I have no idea why HA addons cause this issue but standalone containers do not.

I think I have found an alternate way to determine the SOC type. The lspci command prints out the PCI bridge identity which contains the SOC type for the most part. It does this by reading /proc/bus/pci/devices and I think this path may be accessible. If you dont want or need to install lspci you can determine the soc yourself

One the first line of the file the first number is the address, the second is 1d873588 on my Rock 5b 3588 board. 1d87 is Rockchip vendor ID, 3588 is the soc. On a rock 3a rk3568 the soc string is 3566 for some reason, that doesn't matter much since 3566 uses the same library as 3568 I guess, On my old rk3399 based board which has no NPU the second part of the number is 0100. I dont own a rk3566 board but i suspect it will be the same as rk3568, ie 3566. Hope this helps. outputs: `scott@rock-5b:/proc/bus/pci$ grep 1d87 /proc/bus/pci/devices |awk '{print $2}'

1d873588

scott@rock-5b:/proc/bus/pci$ ssh rock-3a grep 1d87 /proc/bus/pci/devices |awk '{print $2}'

1d873566

1d873566

scott@rock-5b:/proc/bus/pci$ ssh hass grep 1d87 /proc/bus/pci/devices |awk '{print $2}'

1d870100`

MarcA711 commented 5 months ago

As I mentioned earlier, the file /proc/device-tree/compatible is accessed by the rknn_toolkit_lite2. This code is closed source and can't be changed. Even if I change my code in the rknn.py file and remove these lines https://github.com/blakeblackshear/frigate/blob/3df8b5829c6393f9c69e567cd73ccccfac5e8b40/frigate/detectors/plugins/rknn.py#L46-L56, the script will fail when these lines are called: https://github.com/blakeblackshear/frigate/blob/3df8b5829c6393f9c69e567cd73ccccfac5e8b40/frigate/detectors/plugins/rknn.py#L130-L138

jagheterfredrik commented 5 months ago

I managed to statically compile https://github.com/nyanmisaka/ffmpeg-rockchip using @MarcA711's patches. I ended up using the same ffmpeg args as @spattinson. Don't forget to match width: and height: in the detect: block (in this case 1280x720) or you'll have to spend a lot of time debugging why the video doesn't look right..

MarcA711 commented 5 months ago

Hey @jagheterfredrik, I also managed compiling https://github.com/nyanmisaka/ffmpeg-rockchip and https://github.com/hbiyik/FFmpeg statically. However, I currently wait if rockchip adds support for static linking (see https://github.com/rockchip-linux/mpp/issues/525) before releasing a new version.

I am curious why you chose nyanmisaka's fork over hbiyiks' one?

jagheterfredrik commented 5 months ago

Recency: hbiyik update FFmpeg a month ago, then cloned nyanmisaka ffmpeg-rockchip two weeks ago and nyanmisaka/ffmpeg-rockchip is updated last week. Community: Jellyfin accepted nyanmisaka's Rockchip support recently https://github.com/jellyfin/jellyfin-ffmpeg/pull/318.

nyanmisaka commented 5 months ago

The biggest difference between our forks is whether each component - decoder/filter/encoder is modular. hbiyik's fork bundles RGA and MPP decoder and encoder together.

The advantage of this is that when external applications do not use libavfilter, RGA can also be easily used by browsers like Firefox. The disadvantage is that the flexible and customizable filter pipeline is lost, and the libavcodec code is complex and difficult to read and maintain.

hbiyik and I agree on this, so he also moved to ffmpeg-rockchip and kept his fork as is. How to use ffmpeg-rockchip in various applications can be found in this Wiki. https://github.com/hbiyik/ffmpeg-rockchip/wiki/Rendering

Our use case Jellyfin obviously required flexible hardware filters, so we decided to rewrite the filters.

MarcA711 commented 5 months ago

@nyanmisaka thank you really much for your explanation. I guess I will switch to your fork then, because most people seem to use it and it is maybe more mature. Thank you and @hbiyik really much for your great work! Without you guys the rockchip platform would be much less usable.

I am currently working on some patches to allow rkrga and rkmpp to be built statically. Maybe I can commit these patches to your forks? This is perhaps easier than me forking your forks and applying the patches there.

nyanmisaka commented 5 months ago

@nyanmisaka thank you really much for your explanation. I guess I will switch to your fork then, because most people seem to use it and it is maybe more mature. Thank you and @hbiyik really much for your great work! Without you guys the rockchip platform would be much less usable.

I am currently working on some patches to allow rkrga and rkmpp to be built statically. Maybe I can commit these patches to your forks? This is perhaps easier than me forking your forks and applying the patches there.

You probably mean to add some fixes to the rkmpp and rkrga libs to allow them to be compiled into *.a instead of *.so and thus it can be statically linked with ffmpeg-rockchip to generate portable ffmpeg binary.

I read your post and saw that you did this in rkmpp by dropping legacy/vpu_api and adding some hacks. I'm not sure if some of rkmpp's internal functionality still relies on this code such as video de-interlacing via IEP, which Jellyfin still requires.

It would be nice if we could find some more standard ways and even better commit them back to upstream. I also have several pending patches that have not yet been submitted to upstream. As for rkrga it seems to already support compiling static libs.

https://github.com/nyanmisaka/mpp/commits/jellyfin-mpp/ https://github.com/nyanmisaka/rk-mirrors/commits/jellyfin-rga/

hbiyik commented 5 months ago

a general statement:

use https://github.com/nyanmisaka/ffmpeg-rockchip

https://github.com/hbiyik/FFmpeg is obselete now, propably i should archive this repo and give a link to new ffmpeg-rockchip to prevent future splits

MarcA711 commented 5 months ago

@nyanmisaka yes, I want to create static .a libs instead of dynamic .so.

I have a mpp fork that allows static building, but as you say it breaks some things. However, I plan to create new patches that will not break any stuff. I will try to get them merged upstream, but I am not sure if they will merge it. I already requested this feature but no response so far (https://github.com/rockchip-linux/mpp/issues/525).

Rkrga needs one line changed to allow static build on build time.

nyanmisaka commented 5 months ago

@nyanmisaka yes, I want to create static .a libs instead of dynamic .so.

I have a mpp fork that allows static building, but as you say it breaks some things. However, I plan to create new patches that will not break any stuff. I will try to get them merged upstream, but I am not sure if they will merge it. I already requested this feature but no response so far (rockchip-linux/mpp#525).

Rkrga needs one line changed to allow static build on build time.

We have a use case for this as well, so I'll keep an eye on that.

The Chinese New Year holiday has just started, so they may get back to you after next Monday.

L1800Turbo commented 4 months ago

I figured out the configuration and found a preset that suits me, where the processor is almost not loaded. It's still strange to me that decoding to raw is done by the processor, but thank you very much for the help.

I've got a similar setup I want to build. Which preset put down your CPU load? From my understanding I don't need a decoding for the main 4K stream if I just want to save it. Detection should happen with a 720p stream.

Thanks!

ThisIsLamer commented 3 months ago

Which preset put down your CPU load?

This is my preset for detecting objects, I don’t set the resolution, I’m happy with the standard resolution from the camera’s secondary stream

detect:
  enabled: True
  fps: 5

These are the parameters set by one of the cameras

cameras:
  Street:
    birdseye:
      order: 2
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://<<login>>:<<password>>@10.7.8.131/Streaming/Channels/102
          input_args: preset-rtsp-restream
          hwaccel_args: preset-rk-h264
          roles:
            - audio
            - detect
        - path: rtsp://<<login>>:<<password>>@10.7.8.131/Streaming/Channels/101
          input_args: preset-rtsp-restream
          hwaccel_args: preset-rk-h265
          roles:
            - record

In this screenshot of the camera's secondary stream settings

image

ddonevski commented 3 months ago

Hi, I'm having the same problem setting up hardware acceleration. I hope someone could point me to the proper way to set it up because from this thread, it's unclear to me whether the issue was solved with ffmpeg-rockchip or was it sufficient to use -rk image. In any case, -rk image should be sufficient because that's its purpose.

Here's info about my setup: Board: Orange Pi 3B (RK3566) OS: Orange PI OS (Arch linux) Frigate: Docker image, stable-rk Camera: Tapo C210 Important note: /dev/dri/renderD128 is present

FFMPEG info for the camera substream (used for detection):

ffplay rtsp://user:pass@192.168.1.87:554/stream2
ffplay version n6.0 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 12.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan --host-cflags='"-fPIC"'
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, rtsp, from 'rtsp://user:pass@192.168.1.87:554/stream2':
  Metadata:
    title           : Session streamed by "TP-LINK RTSP Server"
    comment         : stream2
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 640x360, 15 fps, 20 tbr, 90k tbn
  Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
[rtsp @ 0x7f30000c20] max delay reached. need to consume packet/0   
[rtsp @ 0x7f30000c20] RTP: missed 2 packets
  56.81 A-V: -0.021 fd=   2 aq=    9KB vq=   15KB sq=    0B f=0/0

docker-compose.yml

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    stop_grace_period: 1s
    image: ghcr.io/blakeblackshear/frigate:stable-rk
    shm_size: "256mb" # 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/dri/renderD128:/dev/dri/renderD128
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/davor/Docker/Frigate/config/:/config
      - /home/davor/Docker/Frigate/media/:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "pass"

config.yml

logger:
  default: debug
  logs:
    frigate.mqtt: error
    ffmpeg.my_camera: debug

mqtt:
  host: localhost
  port: 1883

ffmpeg:
  hwaccel_args: preset-rk-h264

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: True
  retain:
    days: 7
    mode: motion
  events:
    retain:
      default: 30
      mode: motion

snapshots:
  enabled: True
  retain:
    default: 30

detect:
  enabled: True
  fps: 5

cameras:
  Cam1:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.1.87:554/stream2
          input_args: preset-rtsp-restream
          hwaccel_args: preset-rk-h264
          roles:
            - detect
        - path: rtsp://user:pass@192.168.1.87:554/stream1
          input_args: preset-rtsp-restream
          hwaccel_args: preset-rk-h264
          roles:
            - record

objects:
  track:
    - person
    - cup
    - cat

Frigate container output:

 ✔ Container frigate  Created                                              0.0s 
Attaching to frigate
frigate  | s6-rc: info: service s6rc-fdholder: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner successfully started
frigate  | s6-rc: info: service fix-attrs: starting
frigate  | s6-rc: info: service s6rc-fdholder successfully started
frigate  | s6-rc: info: service fix-attrs successfully started
frigate  | s6-rc: info: service legacy-cont-init: starting
frigate  | s6-rc: info: service legacy-cont-init successfully started
frigate  | s6-rc: info: service log-prepare: starting
frigate  | s6-rc: info: service log-prepare successfully started
frigate  | s6-rc: info: service nginx-log: starting
frigate  | s6-rc: info: service go2rtc-log: starting
frigate  | s6-rc: info: service frigate-log: starting
frigate  | s6-rc: info: service nginx-log successfully started
frigate  | s6-rc: info: service go2rtc-log successfully started
frigate  | s6-rc: info: service go2rtc: starting
frigate  | s6-rc: info: service frigate-log successfully started
frigate  | s6-rc: info: service go2rtc successfully started
frigate  | s6-rc: info: service go2rtc-healthcheck: starting
frigate  | s6-rc: info: service frigate: starting
frigate  | s6-rc: info: service go2rtc-healthcheck successfully started
frigate  | s6-rc: info: service frigate successfully started
frigate  | s6-rc: info: service nginx: starting
frigate  | s6-rc: info: service nginx successfully started
frigate  | 2024-04-08 10:58:18.493085310  [INFO] Preparing Frigate...
frigate  | 2024-04-08 10:58:18.501009276  [INFO] Preparing new go2rtc config...
frigate  | s6-rc: info: service legacy-services: starting
frigate  | 2024-04-08 10:58:18.512135728  [INFO] Starting NGINX...
frigate  | s6-rc: info: service legacy-services successfully started
frigate  | 2024-04-08 10:58:18.579375980  [INFO] Starting Frigate...
frigate  | 2024-04-08 10:58:20.497676586  [INFO] Starting go2rtc...
frigate  | 2024-04-08 10:58:20.698938843  10:58:20.698 INF go2rtc version 1.8.4 linux/arm64
frigate  | 2024-04-08 10:58:20.702048288  10:58:20.701 INF [rtsp] listen addr=:8554
frigate  | 2024-04-08 10:58:20.702172538  10:58:20.701 INF [api] listen addr=:1984
frigate  | 2024-04-08 10:58:20.704300820  10:58:20.704 INF [webrtc] listen addr=:8555
frigate  | 2024-04-08 10:58:23.265868329  2024/04/08 10:58:23 [error] 145#145: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", upstream: "http://127.0.0.1:5001version", host: "127.0.0.1:5000"
frigate  | 2024-04-08 10:58:26.830834575  [2024-04-08 10:58:26] frigate.app                    INFO    : Starting Frigate (0.13.2-6476f8a)
frigate  | 2024-04-08 10:58:28.435698594  2024/04/08 10:58:28 [error] 155#155: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /api/version HTTP/1.1", upstream: "http://127.0.0.1:5001version", host: "127.0.0.1:5000"
frigate  | 2024-04-08 10:58:28.476663876  [INFO] Starting go2rtc healthcheck service...
frigate  | 2024-04-08 10:58:30.022354486  [2024-04-08 10:58:30] peewee_migrate.logs            INFO    : Starting migrations
frigate  | 2024-04-08 10:58:30.023914896  [2024-04-08 10:58:30] peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
frigate  | 2024-04-08 10:58:30.030849533  [2024-04-08 10:58:30] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
frigate  | 2024-04-08 10:58:30.057538668  [2024-04-08 10:58:30] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate  | 2024-04-08 10:58:30.103286680  [2024-04-08 10:58:30] frigate.app                    INFO    : Recording process started: 328
frigate  | 2024-04-08 10:58:30.132073181  [2024-04-08 10:58:30] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-04-08 10:58:30.138469112  [2024-04-08 10:58:30] frigate.app                    INFO    : go2rtc process pid: 91
frigate  | 2024-04-08 10:58:30.255762942  [2024-04-08 10:58:30] detector.coral                 INFO    : Starting detection process: 339
frigate  | 2024-04-08 10:58:30.263482450  [2024-04-08 10:58:30] frigate.app                    INFO    : Output process started: 341
frigate  | 2024-04-08 10:58:30.266764853  [2024-04-08 10:58:30] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
frigate  | 2024-04-08 10:58:30.289060340  [2024-04-08 10:58:30] peewee.sqliteq                 DEBUG   : received query DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))
frigate  | 2024-04-08 10:58:30.289079882  [2024-04-08 10:58:30] peewee                         DEBUG   : ('DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))', ['Cam1'])
frigate  | 2024-04-08 10:58:30.298545591  [2024-04-08 10:58:30] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."grid", "t1"."last_update" FROM "regions" AS "t1" WHERE ("t1"."camera" = ?) LIMIT ? OFFSET ?', ['Cam1', 1, 0])
frigate  | 2024-04-08 10:58:30.351051491  [2024-04-08 10:58:30] peewee                         DEBUG   : ('SELECT "t1"."id" FROM "event" AS "t1" WHERE ((("t1"."camera" = ?) AND (("t1"."false_positive" IS ?) OR ("t1"."false_positive" = ?))) AND ("t1"."start_time" > ?))', ['Cam1', None, False, 1712566667.647514])
frigate  | 2024-04-08 10:58:30.358407584  [2024-04-08 10:58:30] frigate.util.object            DEBUG   : Found 0 new events for Cam1
frigate  | 2024-04-08 10:58:30.390345239  [2024-04-08 10:58:30] frigate.app                    INFO    : Camera processor started for Cam1: 349
frigate  | 2024-04-08 10:58:30.455884499  [2024-04-08 10:58:30] frigate.app                    INFO    : Capture process started for Cam1: 352
frigate  | 2024-04-08 10:58:30.455905207  [2024-04-08 10:58:30] tzlocal                        DEBUG   : /etc/timezone found, contents:
frigate  | 2024-04-08 10:58:30.455907832   Etc/UTC
frigate  | 2024-04-08 10:58:30.455909874  
frigate  | 2024-04-08 10:58:30.455913666  [2024-04-08 10:58:30] tzlocal                        DEBUG   : /etc/localtime found
frigate  | 2024-04-08 10:58:30.473859255  [2024-04-08 10:58:30] tzlocal                        DEBUG   : 2 found:
frigate  | 2024-04-08 10:58:30.473881422   {'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
frigate  | 2024-04-08 10:58:30.484996207  [2024-04-08 10:58:30] peewee                         DEBUG   : ('SELECT COUNT(?) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?))', ['*', 'Cam1', 0.0])
frigate  | 2024-04-08 10:58:30.515010037  [2024-04-08 10:58:30] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
frigate  | 2024-04-08 10:58:30.533530207  [2024-04-08 10:58:30] peewee                         DEBUG   : ('SELECT AVG("t1"."segment_size" / ("t1"."end_time" - "t1"."start_time")) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?)) LIMIT ?', ['Cam1', 0.0, 100])
frigate  | 2024-04-08 10:58:30.542358044  [2024-04-08 10:58:30] frigate.storage                DEBUG   : Cam1 has a bandwidth of 113.93 MiB/hr.
frigate  | 2024-04-08 10:58:30.964718189  [2024-04-08 10:58:30] urllib3.connectionpool         DEBUG   : https://api.github.com:443 "GET /repos/blakeblackshear/frigate/releases/latest HTTP/1.1" 200 1440
frigate  | 2024-04-08 10:58:31.174511080  [2024-04-08 10:58:31] peewee.sqliteq                 DEBUG   : received query UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)
frigate  | 2024-04-08 10:58:31.175546201  [2024-04-08 10:58:31] peewee                         DEBUG   : ('UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)', [30, None])
frigate  | 2024-04-08 10:58:33.060761943  [2024-04-08 10:58:33] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
frigate  | 2024-04-08 10:58:34.018679668  [2024-04-08 10:58:34] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/all: client is not connected
frigate  | 2024-04-08 10:58:34.018699501  [2024-04-08 10:58:34] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/motion: client is not connected
frigate  | 2024-04-08 10:58:34.124358506  [2024-04-08 10:58:34] frigate.events.maintainer      DEBUG   : Event received: tracked_object start Cam1 1712566713.927446-q9if6b
frigate  | 2024-04-08 10:58:34.132997344  [2024-04-08 10:58:34] peewee.sqliteq                 DEBUG   : received query INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))
frigate  | 2024-04-08 10:58:34.133030594  [2024-04-08 10:58:34] peewee                         DEBUG   : ('INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))', [1712566713.927446, 'Cam1', 'tracked_object', '1712566713.927446-q9if6b', 'visible', '{"box": [0.65625, 0.002777777777777778, 0.3390625, 0.8055555555555556], "label": "person", "region": [0.4625, 0.0, 0.5375, 0.9555555555555556], "attribute": ""}'])
frigate  | 2024-04-08 10:58:35.132747557  [2024-04-08 10:58:35] asyncio                        DEBUG   : Using selector: EpollSelector
frigate  | 2024-04-08 10:58:38.982412397  [2024-04-08 10:58:38] frigate.events.maintainer      DEBUG   : Event received: tracked_object start Cam1 1712566718.611705-cm3pjj
frigate  | 2024-04-08 10:58:38.992691561  [2024-04-08 10:58:38] peewee.sqliteq                 DEBUG   : received query INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))
frigate  | 2024-04-08 10:58:38.994093597  [2024-04-08 10:58:38] peewee                         DEBUG   : ('INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))', [1712566718.611705, 'Cam1', 'tracked_object', '1712566718.611705-cm3pjj', 'visible', '{"box": [0.6578125, 0.10833333333333334, 0.115625, 0.7888888888888889], "label": "person", "region": [0.0, 0.0, 0.775, 1.3777777777777778], "attribute": ""}'])

In Frigate web interface, under GPUs, I have a message: "Hardware acceleration has not been setup, see the docs to setup hardware acceleration."

VAINFO OUTPUT

Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit

So I have more or less the same error messages as earlier reported by @ThisIsLamer:

Since I don't have enough knowledge to understand these error messages, I was hoping that someone who does might point me to the possible causes and places where to look for solutions.

Thank you.

MarcA711 commented 3 months ago

Does your setup work, if you remove hwaccel_args and use the default stable?

ddonevski commented 3 months ago

Hi, thanks for quick reply. I'll test and report as soon as I get the chance. It might take a few days with two years old baby at home, but I'll get to it eventually. Thanks.

ddonevski commented 3 months ago

Hi, I did the following:

Although I named this container frigatestable in compose.yml, the created container was named frigatestable, but only responded to name frigate in commands: docker compose stop frigate ✔ Container frigatestable Stopped

When it started, I first noticed that ffmpeg CPU usage dropped to around 9% (it was around 17% with -rk image). However, I noticed that config file in web interface contained old lines with hwaccel args so I edited them and restarted. Then I noticed that event records contained events from previous containter which used to be in another folder, and which I removed as described above. I am obviously new to Docker and this is very counter-intuitive to me. I expect new container to start clean so I guess it did, but what I saw (old config file and old events) was just browser cache. MQTT errors stayed, no connection to broker. Then I stopped the container and removed it docker compose stop frigate docker compose rm frigate so that I could try to rebuild it with renderD128 line in compose.yml. I ran docker compose up --build although I think --build shouldn't be necessary since the container was previously removed. Anyway, I got the same results as with renderD128 line commented out, ffmpeg CPU usage around 9%. And in both cases, web interface GPUs section contained the same message about hardware acceleration not being set up, as well as the same Vainfo error as the -rk image. So all errors stayed, but ffmeg CPU load was lower.

Here's Frigate log:

2024-04-08 20:57:50.376810748  [INFO] Preparing Frigate...
2024-04-08 20:57:51.119970422  [INFO] Starting Frigate...
2024-04-08 20:58:01.030404977  [2024-04-08 20:58:01] frigate.app                    INFO    : Starting Frigate (0.13.2-6476f8a)
2024-04-08 20:58:04.701300076  [2024-04-08 20:58:04] peewee_migrate.logs            INFO    : Starting migrations
2024-04-08 20:58:04.702877506  [2024-04-08 20:58:04] peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
2024-04-08 20:58:04.710611230  [2024-04-08 20:58:04] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
2024-04-08 20:58:04.728805052  [2024-04-08 20:58:04] peewee_migrate.logs            INFO    : There is nothing to migrate
2024-04-08 20:58:04.772477810  [2024-04-08 20:58:04] frigate.app                    INFO    : Recording process started: 319
2024-04-08 20:58:04.802470855  [2024-04-08 20:58:04] asyncio                        DEBUG   : Using selector: EpollSelector
2024-04-08 20:58:04.805210648  [2024-04-08 20:58:04] frigate.app                    INFO    : go2rtc process pid: 90
2024-04-08 20:58:04.917023246  [2024-04-08 20:58:04] detector.coral                 INFO    : Starting detection process: 330
2024-04-08 20:58:04.923621150  [2024-04-08 20:58:04] frigate.app                    INFO    : Output process started: 332
2024-04-08 20:58:04.926693171  [2024-04-08 20:58:04] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2024-04-08 20:58:04.938916795  [2024-04-08 20:58:04] peewee.sqliteq                 DEBUG   : received query DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))
2024-04-08 20:58:04.938937213  [2024-04-08 20:58:04] peewee                         DEBUG   : ('DELETE FROM "regions" WHERE NOT ("regions"."camera" IN (?))', ['Cam1'])
2024-04-08 20:58:04.945911682  [2024-04-08 20:58:04] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."grid", "t1"."last_update" FROM "regions" AS "t1" WHERE ("t1"."camera" = ?) LIMIT ? OFFSET ?', ['Cam1', 1, 0])
2024-04-08 20:58:04.963158988  [2024-04-08 20:58:04] peewee                         DEBUG   : ('SELECT "t1"."id" FROM "event" AS "t1" WHERE ((("t1"."camera" = ?) AND (("t1"."false_positive" IS ?) OR ("t1"."false_positive" = ?))) AND ("t1"."start_time" > ?))', ['Cam1', None, False, 1712600345.224813])
2024-04-08 20:58:04.971040887  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : Found 2 new events for Cam1
2024-04-08 20:58:04.975817513  [2024-04-08 20:58:04] peewee                         DEBUG   : ('SELECT "t1"."camera", "t1"."source", "t1"."data" FROM "timeline" AS "t1" WHERE ("t1"."source_id" IN (?, ?)) LIMIT ?', ['1712601828.912285-t0q6h4', '1712602468.756831-7rwpez', 10000])
2024-04-08 20:58:04.994209098  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : Found 12 new entries for Cam1
2024-04-08 20:58:04.994227182  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : std dev: 0.03125 mean: 0.6
2024-04-08 20:58:05.005267733  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : std dev: 0.0 mean: 1.04375
2024-04-08 20:58:05.005286109  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : std dev: 0.0 mean: 1.00625
2024-04-08 20:58:05.005290485  [2024-04-08 20:58:04] frigate.util.object            DEBUG   : std dev: 0.1011778515517507 mean: 0.6215909090909092
2024-04-08 20:58:05.016234488  [2024-04-08 20:58:05] frigate.util.object            DEBUG   : std dev: 0.03492303044633379 mean: 0.5895833333333333
2024-04-08 20:58:05.016277657  [2024-04-08 20:58:05] frigate.util.object            DEBUG   : std dev: 0.016828640022295352 mean: 0.603125
2024-04-08 20:58:05.030782837  [2024-04-08 20:58:05] peewee.sqliteq                 DEBUG   : received query INSERT INTO "regions" ("camera", "grid", "last_update") VALUES (?, json(?), ?) ON CONFLICT ("camera") DO UPDATE SET "camera" = ?, "grid" = json(?), "last_update" = ?
2024-04-08 20:58:05.035267195  [2024-04-08 20:58:05] peewee                         DEBUG   : ('INSERT INTO "regions" ("camera", "grid", "last_update") VALUES (?, json(?), ?) ON CONFLICT ("camera") DO UPDATE SET "camera" = ?, "grid" = json(?), "last_update" = ?', ['Cam1', '[[{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.63125, 0.56875], "x": 1, "y": 2, "std_dev": 0.03125, "mean": 0.6}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [1.04375], "x": 3, "y": 2, "std_dev": 0.0, "mean": 1.04375}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [1.00625], "x": 4, "y": 2, "std_dev": 0.0, "mean": 1.00625}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.74375, 0.74375, 0.5, 0.69375, 0.5, 0.73125, 0.6875, 0.66875, 0.525, 0.5125, 0.53125], "x": 5, "y": 2, "std_dev": 0.1011778515517507, "mean": 0.6215909090909092}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.54375, 0.6125, 0.60625, 0.61875, 0.61875, 0.5375], "x": 6, "y": 2, "std_dev": 0.03492303044633379, "mean": 0.5895833333333333}, {"sizes": [0.6125, 0.61875, 0.575, 0.60625], "x": 6, "y": 3, "std_dev": 0.016828640022295352, "mean": 0.603125}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}]]', 1712602684.964593, 'Cam1', '[[{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.63125, 0.56875], "x": 1, "y": 2, "std_dev": 0.03125, "mean": 0.6}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [1.04375], "x": 3, "y": 2, "std_dev": 0.0, "mean": 1.04375}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [1.00625], "x": 4, "y": 2, "std_dev": 0.0, "mean": 1.00625}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.74375, 0.74375, 0.5, 0.69375, 0.5, 0.73125, 0.6875, 0.66875, 0.525, 0.5125, 0.53125], "x": 5, "y": 2, "std_dev": 0.1011778515517507, "mean": 0.6215909090909092}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": [0.54375, 0.6125, 0.60625, 0.61875, 0.61875, 0.5375], "x": 6, "y": 2, "std_dev": 0.03492303044633379, "mean": 0.5895833333333333}, {"sizes": [0.6125, 0.61875, 0.575, 0.60625], "x": 6, "y": 3, "std_dev": 0.016828640022295352, "mean": 0.603125}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}], [{"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}, {"sizes": []}]]', 1712602684.964593])
2024-04-08 20:58:05.149143169  [2024-04-08 20:58:05] frigate.app                    INFO    : Camera processor started for Cam1: 344
2024-04-08 20:58:05.251646364  [2024-04-08 20:58:05] frigate.app                    INFO    : Capture process started for Cam1: 347
2024-04-08 20:58:05.277495738  [2024-04-08 20:58:05] peewee                         DEBUG   : ('SELECT COUNT(?) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?))', ['*', 'Cam1', 0.0])
2024-04-08 20:58:05.291812782  [2024-04-08 20:58:05] tzlocal                        DEBUG   : /etc/timezone found, contents:
2024-04-08 20:58:05.291830866   Etc/UTC
2024-04-08 20:58:05.291833200  
2024-04-08 20:58:05.314243030  [2024-04-08 20:58:05] tzlocal                        DEBUG   : /etc/localtime found
2024-04-08 20:58:05.318566379  [2024-04-08 20:58:05] peewee                         DEBUG   : ('SELECT AVG("t1"."segment_size" / ("t1"."end_time" - "t1"."start_time")) FROM "recordings" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."segment_size" > ?)) LIMIT ?', ['Cam1', 0.0, 100])
2024-04-08 20:58:05.341532160  [2024-04-08 20:58:05] frigate.storage                DEBUG   : Cam1 has a bandwidth of 135.24 MiB/hr.
2024-04-08 20:58:05.361646433  [2024-04-08 20:58:05] tzlocal                        DEBUG   : 2 found:
2024-04-08 20:58:05.361665976   {'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
2024-04-08 20:58:05.365083061  [2024-04-08 20:58:05] urllib3.connectionpool         DEBUG   : Starting new HTTPS connection (1): api.github.com:443
2024-04-08 20:58:05.725759149  [2024-04-08 20:58:05] urllib3.connectionpool         DEBUG   : https://api.github.com:443 "GET /repos/blakeblackshear/frigate/releases/latest HTTP/1.1" 200 1440
2024-04-08 20:58:06.279955672  [2024-04-08 20:58:06] peewee.sqliteq                 DEBUG   : received query UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)
2024-04-08 20:58:06.279975507  [2024-04-08 20:58:06] peewee                         DEBUG   : ('UPDATE "event" SET "end_time" = ("event"."start_time" + ?) WHERE ("event"."end_time" IS ?)', [30, None])
2024-04-08 20:58:07.752386389  [2024-04-08 20:58:07] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2024-04-08 20:58:09.735100984  [2024-04-08 20:58:09] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/all: client is not connected
2024-04-08 20:58:09.735126068  [2024-04-08 20:58:09] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/motion: client is not connected
2024-04-08 20:58:09.795518475  [2024-04-08 20:58:09] asyncio                        DEBUG   : Using selector: EpollSelector
2024-04-08 20:58:09.832549285  [2024-04-08 20:58:09] frigate.events.maintainer      DEBUG   : Event received: tracked_object start Cam1 1712602689.498457-nejjbd
2024-04-08 20:58:09.836874675  [2024-04-08 20:58:09] peewee.sqliteq                 DEBUG   : received query INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))
2024-04-08 20:58:09.839189483  [2024-04-08 20:58:09] peewee                         DEBUG   : ('INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))', [1712602689.498457, 'Cam1', 'tracked_object', '1712602689.498457-nejjbd', 'visible', '{"box": [0.5515625, 0.0, 0.4453125, 0.7], "label": "person", "region": [0.46875, 0.0, 0.53125, 0.9444444444444444], "attribute": ""}'])
2024-04-08 20:58:14.836585089  [2024-04-08 20:58:14] asyncio                        DEBUG   : Using selector: EpollSelector
2024-04-08 20:58:17.196586839  [2024-04-08 20:58:17] peewee                         DEBUG   : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" = ?)', ['Cam1'])
2024-04-08 20:58:17.426332452  [2024-04-08 20:58:17] peewee                         DEBUG   : ('SELECT MAX("t1"."id") FROM "event" AS "t1" WHERE (("t1"."camera" = ?) AND ("t1"."label" = ?))', ['Cam1', 'person'])
2024-04-08 20:58:17.436551328  [2024-04-08 20:58:17] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."label", "t1"."sub_label", "t1"."camera", "t1"."start_time", "t1"."end_time", "t1"."top_score", "t1"."score", "t1"."false_positive", "t1"."zones", "t1"."thumbnail", "t1"."has_clip", "t1"."has_snapshot", "t1"."region", "t1"."box", "t1"."area", "t1"."retain_indefinitely", "t1"."ratio", "t1"."plus_id", "t1"."model_hash", "t1"."detector_type", "t1"."model_type", "t1"."data" FROM "event" AS "t1" WHERE ("t1"."id" = ?) LIMIT ? OFFSET ?', ['1712602468.756831-7rwpez', 1, 0])
2024-04-08 20:58:19.822511254  [2024-04-08 20:58:19] asyncio                        DEBUG   : Using selector: EpollSelector
2024-04-08 20:58:24.828504741  [2024-04-08 20:58:24] asyncio                        DEBUG   : Using selector: EpollSelector
2024-04-08 20:58:25.373260025  [2024-04-08 20:58:25] frigate.comms.mqtt             ERROR   : Unable to publish to events: client is not connected
2024-04-08 20:58:25.407727802  [2024-04-08 20:58:25] frigate.events.maintainer      DEBUG   : Event received: tracked_object update Cam1 1712602689.498457-nejjbd
2024-04-08 20:58:25.430499322  [2024-04-08 20:58:25] peewee.sqliteq                 DEBUG   : received query INSERT INTO "event" ("id", "label", "camera", "start_time", "end_time", "zones", "thumbnail", "has_clip", "has_snapshot", "retain_indefinitely", "ratio", "model_hash", "detector_type", "model_type", "data") VALUES (?, ?, ?, ?, ?, json(?), ?, ?, ?, ?, ?, ?, ?, ?, json(?)) ON CONFLICT ("id") DO UPDATE SET "id" = ?, "label" = ?, "camera" = ?, "start_time" = ?, "end_time" = ?, "zones" = json(?), "thumbnail" = ?, "has_clip" = ?, "has_snapshot" = ?, "model_hash" = ?, "model_type" = ?, "detector_type" = ?, "data" = json(?)
2024-04-08 20:58:25.440913918  [2024-04-08 20:58:25] peewee                         DEBUG   : ('INSERT INTO "event" ("id", "label", "camera", "start_time", "end_time", "zones", "thumbnail", "has_clip", "has_snapshot", "retain_indefinitely", "ratio", "model_hash", "detector_type", "model_type", "data") VALUES (?, ?, ?, ?, ?, json(?), ?, ?, ?, ?, ?, ?, ?, ?, json(?)) ON CONFLICT ("id") DO UPDATE SET "id" = ?, "label" = ?, "camera" = ?, "start_time" = ?, "end_time" = ?, "zones" = json(?), "thumbnail" = ?, "has_clip" = ?, "has_snapshot" = ?, "model_hash" = ?, "model_type" = ?, "detector_type" = ?, "data" = json(?)', ['1712602689.498457-nejjbd', 'person', 'Cam1', 1712602684.498457, None, '[]', '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCACvAK8DASIAAhEBAxEB/8QAHwAAAQU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LXWo3Y1LxI3nSHlLUH5U9jj+X511oRUUKoCqBgAdAKq9idzmpPA+lsMRx4A6BuaiHhGOJv3SR4rqsU09aOdhymqaQ0UlQaDWANRsgPUVLTDSER+UvpTfLx0JH41LSUAMw/ZqQ7h70+ikMZuP8AdNIX5+6akxRigCPcx6LikCMfvN+VS4oOKYEflDuSfxpwRR0ArK1bxNpmjf8AH1K+49FVCSf6VyepfE5uU02xCn+/Mc/oP8atQbE9D0FuBk9KwNW8Y6RpW5HnE8w/5Zwncc+/YVzUej+LfE8e++vxb2rnO0Pxj/dX+proNH8D6RpZEkiG7mH8Uo4B9h0p8qW5Ldzn2n8SeNW2xL/Z+mnqckBh9erfyrp9E8N2OhR/6OgecjDzMPmP09B7Ctl2WNMnhVH5Csi88TaRZbvPuSpXqBGx/pSu3ohJGqKDXKTfEXRYyBEtxN9I8fzNUZfiXG8ojttLkYk4G+UD+hquRhdHcUxq5Eaz4t1IZs7G0tUHO53DZ9O/9Ka2g61qH/IU16YA8+VbjaB/n6UOFt2Fz//Z', True, True, False, 1.0, '381ddff7e02bc86b7e6c5b1b9cc894db', 'edgetpu', <ModelTypeEnum.ssd: 'ssd'>, '{"box": [0.5625, 0.0, 0.4296875, 0.6666666666666666], "region": [0.0, 0.0, 1.14375, 2.033333333333333], "score": 0.7265625, "top_score": 0.7109375, "attributes": [], "type": "object"}', '1712602689.498457-nejjbd', 'person', 'Cam1', 1712602684.498457, None, '[]', '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCACvAK8DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQF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X511oRUUKoCqBgAdAKq9idzmpPA+lsMRx4A6BuaiHhGOJv3SR4rqsU09aOdhymqaQ0UlQaDWANRsgPUVLTDSER+UvpTfLx0JH41LSUAMw/ZqQ7h70+ikMZuP8AdNIX5+6akxRigCPcx6LikCMfvN+VS4oOKYEflDuSfxpwRR0ArK1bxNpmjf8AH1K+49FVCSf6VyepfE5uU02xCn+/Mc/oP8atQbE9D0FuBk9KwNW8Y6RpW5HnE8w/5Zwncc+/YVzUej+LfE8e++vxb2rnO0Pxj/dX+proNH8D6RpZEkiG7mH8Uo4B9h0p8qW5Ldzn2n8SeNW2xL/Z+mnqckBh9erfyrp9E8N2OhR/6OgecjDzMPmP09B7Ctl2WNMnhVH5Csi88TaRZbvPuSpXqBGx/pSu3ohJGqKDXKTfEXRYyBEtxN9I8fzNUZfiXG8ojttLkYk4G+UD+hquRhdHcUxq5Eaz4t1IZs7G0tUHO53DZ9O/9Ka2g61qH/IU16YA8+VbjaB/n6UOFt2Fz//Z', True, True, '381ddff7e02bc86b7e6c5b1b9cc894db', <ModelTypeEnum.ssd: 'ssd'>, 'edgetpu', '{"box": [0.5625, 0.0, 0.4296875, 0.6666666666666666], "region": [0.0, 0.0, 1.14375, 2.033333333333333], "score": 0.7265625, "top_score": 0.7109375, "attributes": [], "type": "object"}'])
2024-04-08 20:58:25.452655096  [2024-04-08 20:58:25] peewee.sqliteq                 DEBUG   : received query INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))
2024-04-08 20:58:25.454863439  [2024-04-08 20:58:25] peewee                         DEBUG   : ('INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))', [1712602704.880567, 'Cam1', 'tracked_object', '1712602689.498457-nejjbd', 'stationary', '{"box": [0.5625, 0.0, 0.4296875, 0.6666666666666666], "label": "person", "region": [0.0, 0.0, 1.14375, 2.033333333333333], "attribute": ""}'])
2024-04-08 20:58:25.464267640  [2024-04-08 20:58:25] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/person/snapshot: client is not connected
2024-04-08 20:58:25.481993601  [2024-04-08 20:58:25] frigate.comms.ws               DEBUG   : payload for Cam1/person/snapshot wasn't text. Skipping...
2024-04-08 20:58:25.482015478  [2024-04-08 20:58:25] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/person: client is not connected
2024-04-08 20:58:25.482019853  [2024-04-08 20:58:25] frigate.comms.mqtt             ERROR   : Unable to publish to Cam1/all: client is not connected
2024-04-08 20:58:26.603270363  [2024-04-08 20:58:26] frigate.events.maintainer      DEBUG   : Event received: tracked_object start Cam1 1712602706.108232-5kusjd
2024-04-08 20:58:26.621902588  [2024-04-08 20:58:26] peewee.sqliteq                 DEBUG   : received query INSERT INTO "timeline" ("timestamp", "camera", "source", "source_id", "class_type", "data") VALUES (?, ?, ?, ?, ?, json(?))

Thank you

MarcA711 commented 3 months ago

I am probably busy for the next couple of days, so maybe you will have to wait a bit for a response. You are using the default frigate image now, so you have no hardware acceleration. After everything works, we can try to switch back to the -rk image. We can then enable hw accceleration for video processing to reduce CPU load and even use the NPU of your board for object detection (this way you don't need the coral anymore and can use it for other stuff).

Now you should try to connect to your MQTT broker. You will need to setup a network to allow the containers to communicate. Try something like this as docker-compose.yml (adjust pahts etc):

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    image: frigate:stable
    shm_size: "400mb"
#    group_add:
#      - "110" # render
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - your/path/config:/config
      - your/path/media:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "1984:1984"
      - "5000:5000"
      - "8554:8554"
      - "8555:8555/tcp"
      - "8555:8555/udp"
    networks:
      - mqtt

  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - your/path/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    ports:
      - "8123:8123"
    networks:
      - mqtt

  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto:latest
    restart: always
    volumes:
      - your/path/mosquitto.conf:/mosquitto/config/mosquitto.conf
      - your/path/mosquitto.passwd:/mosquitto/config/mosquitto.passwd
      - your/path/mosquitto.log:/mosquitto/log/mosquitto.log
      - your/path/data:/mosquitto/data
    ports:
      - "1883:1883"
      - "9001:9001"

    networks:
      - mqtt

networks:
  mqtt:

and add this section to frigate's config.yml

mqtt:
  enabled: true
  host: mosquitto # this must match the container_name of the mosquitto container
  port: 1883
  user: xxx
  password: xxx

This creates a network called mqtt and adds the mosquitto, frigate and homeassistant container to it. You can use the container_name instead of an IP.

ddonevski commented 3 months ago

Hi @MarcA711, thank you very much for the help and time. I did as you instructed me in the previous post. For anyone else who might be reading this, in the docker-compose.yml file posted above, you have to replace Frigate "image: stable" with "image: "ghcr.io/blakeblackshear/frigate:stable"". Also, you need to add the "listener 1883" line to mosquitto.conf and set up authentication. If you don't want to setup authentication, just add the "allow_anonymous true" to mosquitto.conf. Everything that we expected to work, works perfect. MQTT works, I installed HACS in Home Assistant, installed Frigate integration via HACS and Home Assistant connected to Frigate without any problems. Inside Figate, everything works without any errors except the VAINFO error. Thanks, I'll do as you instruct me further when you find the time. I'm just a bit skeptical about ditching CORAL since my Orange Pi 3B board has only 0.8 TOPS NPU, but I'm willing to try it. Thanks again very much!

MarcA711 commented 3 months ago

Glad it works now. I will post some more instructions later regarding hardware acceleration.

@NickM-27 What do you think about adding a section to the installation guide about setting up HA, mosquitto and frigate as docker containers? Including a minimal docker-compose.yml, mosquitto configuration files, how to add a user to mosquitto, how to configure mqtt in frigate etc. This is difficult for users that are new to mqtt, frigate and docker. I hope to have some more time within the next couple of weeks and I would be glad to contribute this section.

spattinson commented 3 months ago

@ddonevski Rockchip hwaccel does not use /dev/dri/render* it uses /dev/mpp_service. If that doesn't exist you have wrong kernel. You need rockchip BSP kernel. Frigate erroneously reports "hardware acceleration not configured" for me too, although it is and it works. I was testing with a RK3566 board before I bought a Rock pi 5b rk3588 and it worked fine in both cases. When you go back to using the RK image check CPU usage, and use ps -ef to see the ffmpeg options to check your preset is applied. Eg: root 3704790 3704778 3 Apr09 ? 00:33:59 ffmpeg -hide_banner -loglevel warning -threads 2 -hwaccel rkmpp -hwaccel_output_format drm_prime -user_agent FFmpeg Frigate/0.13.2-6476f8a -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/front_sub -r 5 -vf scale_rkrga=w=1280:h=720:format=yuv420p:force_original_aspect_ratio=0,hwmap=mode=read,format=yuv420p -threads 2 -f rawvideo -pix_fmt yuv420p pipe:

MarcA711 commented 3 months ago

Rockchip HW Accel uses /dev/dri/renderD128 as well. If this device is present, he is very likely using Rockchip BSP kernel.

This list contains all devices necessary for HW Video acceleration:

# DRM allocator
/dev/dri

# DMA_HEAP allocator
/dev/dma_heap

# RGA filters
/dev/rga

# MPP codecs
/dev/mpp_service

# Optional, for compatibility with older kernels and socs
/dev/iep
/dev/mpp-service
/dev/vpu_service
/dev/vpu-service
/dev/hevc_service
/dev/hevc-service
/dev/rkvdec
/dev/rkvenc
/dev/vepu
/dev/h265e

Frigate reports "hardware acceleration not configured" because I haven't added GPU stats yet. I am looking forward to adding this feature. For now, just ignore this message.

ddonevski commented 3 months ago

@spattinson, @MarcA711 Thanks for help, I'll check when I get to my board. The reason I installed Orange Pi OS instead of Armbian was the expectation that the board manufacturer took care that their OS supports all hardware. Armbian only has community images for 3B board. I'm normally used to Debian based distros, but went with Pi OS (Arch) for this reason. In any case, I'll try your suggestion as soon as I get the chance and report the results. Thanks for all help!

NickM-27 commented 3 months ago

@MarcA711 the docs already contain a full hardware and OS installation guide along with frigate https://docs.frigate.video/guides/getting_started . I am a bit hesitant to include directly guides for HA and MQTT because that will be a lot for us to ensure stays up to date and may also give more of an impression that HA is required when many users run frigate without it.

MarcA711 commented 3 months ago

I really recommend this ubuntu based Distro: https://github.com/Joshua-Riek/ubuntu-rockchip

It supports all HW as well. There will be a beta version for Ubuntu 24.04 within the next couple of days. Official release of ubuntu 24.04 will be within the next couple of weeks.

ddonevski commented 3 months ago

Thanks, I can try it when it is released. I'm not very happy with Orange Pi Os. When I first started it, the official package repository did not work so I had to switch to Arch Linux ARM repositories.