Local realtime person detection for RTSP cameras

But better would be to make a retention period in settings. No need to do it manualy

I understand that. But my question is where and how :slight_smile:

Go to File editor(not manager sorry) find the db file and come back confirm and we go next

I think I have a lot of orphans

Sorry, again. Where?

1 Like

Added

          roles:
            - detect
            - record

Same error, cant play and cant download.
update i checked NAS, mp4 file was not created. Stupid me,didn’t checked that at first place.
So it is not creating video, will try to figure what changed between updates as it was working before.

I do not run the homeassistant addon. I run a docker container on a separate host. Where is the database file located?

The file edit is just a tool to get to the files.

1 Like

I think you have it right setting the detect & record roles under you camera. In order to get clips, I believe you need to enable recording globally but set your retention to zero if you do not want to do 24/7

@blakeblackshear may need to correct me on this one…

record:
enabled: true
retain_days: 0

@blakeblackshear
@jasonshearer

    record:
      enabled: True
      retain_days: 0
      events:
        post_capture: 10
        pre_capture: 5
        objects:
          - person
        retain:
          default: 5

in clips folder not creating mp4
Recording folder creating constantly mp4 files.
No events recorded.
In Frigate GUI when i click recordings i can watch recording. But Nower events recording available.
Maybe this is important?

[2021-10-08 21:05:18] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56288]
[2021-10-08 21:05:21] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:50112]
[2021-10-08 21:05:22] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:50112]
[2021-10-08 21:05:27] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:50194]
[2021-10-08 21:05:28] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:50194]
[2021-10-08 21:07:17] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56288]

@blakeblackshear
debug log

[2021-10-08 21:20:20] ws4py                          INFO    : Using epoll
[2021-10-08 21:20:25] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59346]
[2021-10-08 21:20:30] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:53172]
[2021-10-08 21:20:31] ws4py                          DEBUG   : Closing message received (1000) 'b'''
[2021-10-08 21:20:31] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:53172]
[2021-10-08 21:20:35] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)
[2021-10-08 21:20:35] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)', ['1633720824.0-hzt825', 'CAM_obyvak', '/media/frigate/recordings/2021-10/08/21/CAM_obyvak/20.24.mp4', 1633720824.0, 1633720834.017, 10.017])
[2021-10-08 21:20:39] frigate.events                 DEBUG   : Event received: start CAM_obyvak 1633720838.468235-rzbam6
[2021-10-08 21:20:39] frigate.events                 DEBUG   : Event received: start CAM_obyvak 1633720838.468235-24vwvo
[2021-10-08 21:20:45] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)
[2021-10-08 21:20:45] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)', ['1633720831.0-g1eh9j', 'CAM_obyvak', '/media/frigate/recordings/2021-10/08/21/CAM_obyvak/20.31.mp4', 1633720831.0, 1633720840.986, 9.986])
[2021-10-08 21:20:46] frigate.events                 DEBUG   : Event received: end CAM_obyvak 1633720838.468235-rzbam6
[2021-10-08 21:20:47] frigate.events                 DEBUG   : Event received: end CAM_obyvak 1633720838.468235-24vwvo
[2021-10-08 21:20:53] frigate.events                 DEBUG   : Event received: start CAM_obyvak 1633720853.313453-nb4kgm
[2021-10-08 21:20:56] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)
[2021-10-08 21:20:56] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)', ['1633720841.0-9um0ps', 'CAM_obyvak', '/media/frigate/recordings/2021-10/08/21/CAM_obyvak/20.41.mp4', 1633720841.0, 1633720850.997, 9.997])
[2021-10-08 21:21:02] frigate.events                 DEBUG   : Event received: end CAM_obyvak 1633720853.313453-nb4kgm
[2021-10-08 21:21:02] peewee.sqliteq                 DEBUG   : received query INSERT INTO "event" ("id", "label", "camera", "start_time", "end_time", "top_score", "false_positive", "zones", "thumbnail", "has_clip", "has_snapshot", "region", "box", "area") VALUES (?, ?, ?, ?, ?, ?, ?, json(?), ?, ?, ?, json(?), json(?), ?)
[2021-10-08 21:21:02] peewee                         DEBUG   : ('INSERT INTO "event" ("id", "label", "camera", "start_time", "end_time", "top_score", "false_positive", "zones", "thumbnail", "has_clip", "has_snapshot", "region", "box", "area") VALUES (?, ?, ?, ?, ?, ?, ?, json(?), ?, ?, ?, json(?), json(?), ?)', ['1633720853.313453-nb4kgm', 'person', 'CAM_obyvak', 1633720848.313453, 1633720871.314901, 0.8046875, False, '["zone_0"]', 'xxxxx', True, True, '[1229, 731, 1577, 1079]', '[1312, 741, 1513, 1069]', 65928])
[2021-10-08 21:21:03] frigate.events                 DEBUG   : Event received: start CAM_obyvak 1633720861.837085-w77kib
[2021-10-08 21:21:06] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)
[2021-10-08 21:21:06] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)', ['1633720851.0-rb0n8l', 'CAM_obyvak', '/media/frigate/recordings/2021-10/08/21/CAM_obyvak/20.51.mp4', 1633720851.0, 1633720860.99, 9.99])
[2021-10-08 21:21:09] frigate.events                 DEBUG   : Event received: end CAM_obyvak 1633720861.837085-w77kib
[2021-10-08 21:21:16] peewee.sqliteq                 DEBUG   : received query INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)
[2021-10-08 21:21:16] peewee                         DEBUG   : ('INSERT INTO "recordings" ("id", "camera", "path", "start_time", "end_time", "duration") VALUES (?, ?, ?, ?, ?, ?)', ['1633720861.0-w4qe4b', 'CAM_obyvak', '/media/frigate/recordings/2021-10/08/21/CAM_obyvak/21.01.mp4', 1633720861.0, 1633720870.985, 9.985])

You see that it sees person, but no clip created.
@blakeblackshear
I dont know what changed but now it is creating event atleast and not making error as previous screenshot, but now its loading screen forever. Clips folder no mp4

Since the latest changes to Frigate NVR in Home assistant the Frigate NVR will load due to being unable to load the Frigate integration.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-10-08 22:13:23] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
Error parsing config: 6 validation errors for FrigateConfig
cameras -> camera1:front_driveway
  none is not an allowed value (type=type_error.none.not_allowed)
cameras -> ffmpeg -> ffmpeg
  field required (type=value_error.missing)
cameras -> ffmpeg -> inputs
  extra fields not permitted (type=value_error.extra)
cameras -> width
  value is not a valid dict (type=type_error.dict)
cameras -> height
  value is not a valid dict (type=type_error.dict)
cameras -> fts
  value is not a valid dict (type=type_error.dict)
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

here is the error for frigate integration, I assume if i can get this sorted the  config should be readable?Frigate
URL you use to access Frigate (ie. http://frigate:5000/)

If you are using HassOS with the addon, the URL should be http://ccab4aaf-frigate:5000/

Home Assistant needs access to port 5000 (api) and 1935 (rtmp) for all features.

The integration will setup sensors, cameras, and media browser functionality.

Sensors:

Stats to monitor frigate performance
Object counts for all zones and cameras
Cameras:

Cameras for image of the last detected object for each camera
Camera entities with stream support (requires RTMP)
Media Browser:

Rich UI with thumbnails for browsing event clips
Rich UI for browsing 24/7 recordings by month, day, camera, time
API:

Notification API with public facing endpoints for images in notifications
Failed to connect
 
URL
http://ccab4aaf-frigate:5000

Any advise would be appreciated.

I’m in the process of backing up my docker volumes and frigate is the only one not working. I’m using the command as described in the docker docs.

docker run --rm --volumes-from frigate -v $(pwd):/backup busybox tar cvf /backup/frigate.tar /config

But for some reason I get this output.

Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
Digest: sha256:f7ca5a32c10d51aeda3b4d01c61c6061f497893d7f6628b92f822f7117182a57
Status: Image is up to date for busybox:latest
docker: Error response from daemon: get: no such volume.
See 'docker run --help'.

Compare that to:

docker run --rm --volumes-from zigbee2mqtt -v $(pwd):/backup busybox tar cvf /backup/zigbee2mqtt.tar /app/data

Which gives:

tar: removing leading '/' from member names
app/data/
app/data/database.db
app/data/state.json
app/data/configuration.yaml
app/data/log/

Anyone know what’s going on here?

same issue as @sender above. you need to modify config to new format
I dont think docs explain this yet but you can look at @ukro post above for how config should look

2 Likes

After update I have tried change my config but its not working:

cameras:
  bejarati:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@ip:port/Streaming/Channels/101
          roles:
          - clips
        - path: rtsp://user:pass@ip:port/Streaming/Channels/102
          roles:
            - record
            - detect
    detect:
      enabled: True
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
        - cat
        - dog
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      retain: 
        default: 7
    clips:
      enabled: True
      retain:
        default: 7
    record:
      enabled: True
      retain_days: 7
    rtmp:
      enabled: False

What am I missing?

log:

[2021-10-09 00:24:03] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
Error parsing config: 6 validation errors for FrigateConfig
cameras -> bejarati -> ffmpeg -> inputs -> 0 -> roles -> 0
  value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>])
cameras -> bejarati -> clips
  extra fields not permitted (type=value_error.extra)

clips is NOT a role
likely you have error in log that points to that

I missed the Major Changes for 0.9.0

BREAKING: Clips have been merged into Recordings

Yeah…may be good to look through recent releases to see breaking changes

EDIT
I been using 0.9 for about a month so didnt notice but the docs were updated and release notes say this in great detail

Been running frigate for quite some time and am very happy with how it has been working out. I have recently purchased a second camera that I am looking to integrate and I am unsure of a couple items.

  1. Does each camera require it’s own docker container?
  2. Can a single usb Coral device handle two (multiple) docker containers, or do I require a separate coral for each container / camera?

Thanks for the great software!!

No.
With coral multiple camera is possible

No.
1 container per coral

1 Like