Local realtime person detection for RTSP cameras

Hi
I a ma trying Frigate 0.8 Beta
Intel i7 6th gen with coral.
Dahua Cameras

It is running fine for some hours and then it starts throwing the following in the log and not working anymore
How can I help solve?
What logs do you need

Thanks


frigate.video                  INFO    : portico: ffmpeg sent a broken frame. something is wrong.


frigate.video                  INFO    : portico: ffmpeg process is not running. exiting capture thread...


frigate.video                  INFO    : casetta: ffmpeg sent a broken frame. something is wrong.


frigate.video                  INFO    : casetta: ffmpeg process is not running. exiting capture thread...


frigate.video                  INFO    : cucina: ffmpeg sent a broken frame. something is wrong.


frigate.video                  INFO    : cucina: ffmpeg process is not running. exiting capture thread...


frigate.video                  INFO    : ingresso: ffmpeg sent a broken frame. something is wrong.


frigate.video                  INFO    : ingresso: ffmpeg process is not running. exiting capture thread...


 * Starting nginx nginx


I had the same issue, fixed it by removing by mask on the only camera I had one on.

You should turn on ffmpeg logging for one of your cameras so you can see what the error message is. If post your config, I can show you where to add it. Probably easier if you post as an issue on GH so it doesnt get list here.

1 Like

The mask for your yard camera is missing the poly, prefix like the others.

It would likely get overwritten in the middle of trying to send via telegram. I would set my retention to 1 day and read the mp4 directly from the api when sending via telegram. You can get the clip at frigate:5000/clips/<camera>-<id>.mp4.

Thanks for the QSV support in beta2, it works great now!

Thanks, that will suit better indeed

1 Like

Well shoot, it was a working config, but I had it open in vim, and adding that word was the last thing I did. I must have hit ā€˜uā€™ to undo that change. Thanks :slight_smile:

how can i get the id blake?
ignore, found it

Iā€™ve tried 0.8.0 beta 2, but it seems that the events are not displayed in the HTTP endpoint /events but they are only in the MQTT topic frigate/events.

Iā€™ve used the following config:

detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: '{FRIGATE_MQTT_IP}'
  topic_prefix: frigate
  user: '{FRIGATE_MQTT_USER}'
  password: '{FRIGATE_MQTT_PASSWORD}'

save_clips:
  max_seconds: 300
  retain:
    default: 10

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128

objects:
  track:
    - person
    - car
    - truck
    - cat
    - dog
  filters:
    person:
      min_area: 5000
      max_area: 100000
      min_score: 0.5
      threshold: 0.7

detect:
  max_disappeared: 10

cameras:
  back:
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@REDACTED
          roles:
            - detect
    width: 1920
    height: 1080
    fps: 10
    rtmp:
      enabled: False
    save_clips:
      enabled: False
      pre_capture: 5
      post_capture: 5
    snapshots:
      show_timestamp: True
      draw_zones: False
      draw_bounding_boxes: True
      crop_to_region: False
      height: 1080

Events are only stored in the database when save_clips is enabled. I built that API to support viewing clips in the media browser. What are you looking to use that for?

Added Beta Release 3 with a few bug fixes.

Also, I think many of you may have glossed over this feature introduced in beta 2, but the new parameters for the mjpeg feed give some interesting insight into what frigate sees. Try going to frigate:5000/<camera_name>?motion=1&regions=1. You will see any areas of motion bound by a red box, and you can see anywhere frigate runs object detection outlined in a green box. These now show up even when no objects are detected so you can see what frigate is doing. See other parameters available here.

6 Likes

I understand now why I wasnā€™t seeing any events :grin:
Iā€™m using Frigate to get notified when a person is seen on the camera but, for the moment, Iā€™ve tried your custom component but with the stream: component built in HA, it induces ~ 10 sec of lag.

Does the custom component create MQTT camera or generic one ?

It creates an mqtt camera for the snapshots, and a generic one for the live feed. If you want, you can disable rtmp on the camera and homeassistant should switch to a mjpeg camera. Should be more realtime at the expense of additional bandwidth.

Iā€™ve been playing with the beta release 2 since last night & MobileDet seems pretty amazing. I have disabled all the filters and now Frigate detects small objects in the distance that have a tiny area with what seems to be a very good false positive rate. I need to refine my setup somewhat, but it appears to be a very good upgrade.

I also played with the new query string parameters after scratching my head wondering where the bounding boxes had gone. This is another useful addition.

I have noticed that some degree of lag has crept in, however I need to investigate this further as it may well be my Home Assistant configuration or cameras. I also encountered bus errors, but after working through a few problems with my configuration, that issue appears to be resolved now.

I have several cameras running various resolutions and will test an additional camera tonight, which is situated in a challenging environment.

Logs are also looking good, although there are a few errors that I havenā€™t seen before. I will keep playing.

frigate.video                  INFO    : porch_beta: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : porch_beta: ffmpeg process is not running. exiting capture thread...
frigate.video                  INFO    : front_gate: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : front_gate: ffmpeg process is not running. exiting capture thread...
[h264 @ 0x5557acaade00] cabac decode of qscale diff failed at 32 46
[h264 @ 0x5557acaade00] error while decoding MB 32 46, bytestream 36076
[h264 @ 0x55564a4f5e00] error while decoding MB 56 67, bytestream -13

Amazing work!! Thank you!

Iā€™m having trouble with zones . . . I have two cameras that share a zone named ā€˜driveway_hasā€™. The two cameras are named ā€˜drivewayā€™ and ā€˜front_yardā€™. Comments in the example config.yml indicate that having duplicate zone names is fine as long as they are in different cameras. However, HASS complains (below). Is my understanding correct? If so, then Iā€™ll post the issue with details on git.

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:490
Integration: Sensor (documentation, issues)
First occurred: 4:24:00 PM (6 occurrences)
Last logged: 4:25:53 PM

  • Platform frigate does not generate unique IDs. ID frigate_driveway_has_car already exists - ignoring sensor.driveway_has_car
  • Platform frigate does not generate unique IDs. ID frigate_driveway_has_person already exists - ignoring sensor.driveway_has_person

This is definitely a bug for the integration. Please post an issue.

just moved to the beta and installed the HA integration.

when I go to the media browser and ino the Firgate Clips folder I get this error:

[140095497910976] Error handling message: expected str for dictionary value @ data['media_content_type']. Got None

Iā€™m running frigate in a different host, and entered it as http://ip:5000 when I loaded the integration.

That is a known issue if you have anything other than web browser as the media player selected.

Iā€™ve noticed some lag as well with the beta 0.8.x and the custom component that I donā€™t have with branch 0.7.x of Frigate.

Iā€™m using the stream: HA component for my camera, maybe that could be the issue. Are you using it as well ? I have to test it without that stream.