Local realtime person detection for RTSP cameras

Did you ever solve your issue with reolink cameras? I get the same errors “left block unavailable for requested intra mode.” The only solution I found was to pass the cameras to blue iris then connect frigate to the blue iris rtsp stream.

Does anyone have an automation setup where, if frigate detects a person, it sends the picture to deepstack for face detection? If so, could you share? Thanks!

1 Like

Hi, I’m able to receive images but still no videos on telegram

This is my automation
For the video link, is my HA link correctly setup? I’m using duckdns with caddy on digitalocean (I’m 4g broadband, so I can only use reverse tunneling to access my services at home)

  - alias: Notify of events
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - service: notify.telegram
        data_template:
          message: 'A {{trigger.payload_json["after"]["label"]}} was detected.'
          data:
            photo:
              # this url should work for addon users
              - url: 'http://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg'
                caption: 'A {{trigger.payload_json["after"]["label"]}} was detected on {{ trigger.payload_json["after"]["camera"] }} camera'
      - delay:
          hours: 0
          minutes: 0
          seconds: 45
          milliseconds: 0
      - service: notify.telegram
        data_template:
          message: Video of alert
          data:
            video:
              - url: 'https://rpixxxxx.duckdns.org:8133/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/{{trigger.payload_json["after"]["camera"]}}/clip.mp4'
                timeout: 1000
                caption: 'A {{trigger.payload_json["after"]["label"]}} was detected on {{ trigger.payload_json["after"]["camera"] }} camera'
    mode: single 

Logs

ffmpeg.bedroom.clips           ERROR   : rtsp://192.168.1.211:554/ch0.h264: No route to host
watchdog.bedroom               INFO    : Terminating the existing ffmpeg process...
watchdog.bedroom               INFO    : Waiting for ffmpeg to exit gracefully...
ffmpeg.kitchen.detect          ERROR   : [flv @ 0x2272d30] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.kitchen.detect          ERROR   : [flv @ 0x2272d30] Failed to update header with correct duration.
ffmpeg.kitchen.detect          ERROR   : [flv @ 0x2272d30] Failed to update header with correct filesize.
ffmpeg.kitchen.clips           ERROR   : [tcp @ 0xc2e7b0] Connection to tcp://192.168.1.97:554?timeout=5000000 failed: No route to host
ffmpeg.kitchen.clips           ERROR   : rtsp://192.168.1.97:554/ch0.h264: No route to host
watchdog.kitchen               INFO    : Terminating the existing ffmpeg process...
watchdog.kitchen               INFO    : Waiting for ffmpeg to exit gracefully...
watchdog.bedroom               INFO    : No frames received from bedroom in 20 seconds. Exiting ffmpeg...
watchdog.bedroom               INFO    : Waiting for ffmpeg to exit gracefully...
frigate.video                  INFO    : bedroom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures

Anything I need to fix?

@ferbulous

What does the log in HA say?

I guess this was intentional, using 8133 rather than 8123 ?

video:
  - url: 'https://rpixxxxx.duckdns.org:8133/

Hi yes, correct
I posted my logs here

and I used ‘http://ccab4aaf-frigate:5000/api/events/’ instead of the https link if that’s acceptable?

thanks! I got that setup now.

@ferbulous

Afaik I think your HA need to be exposed to internet for the video to work, that is what I experienced. Also, did you set the parse_mode: html for Telegram_bot setup in configuration.yaml ?

telegram_bot:
  - platform: polling
    api_key: !secret telegram_api_key
    parse_mode: html
    allowed_chat_ids:
      - xyz

I tested the setup without using templates in caption to make sure nothing else conflicted.

I couldn find anything on search. is there a way to have audio in live stream?

Works with nuc without problems

Can someone please explain how rtmp is used?
In particular I am trying to find a way to have the least possible lag in the video. When I open the camera from the frigate integration, I have about 1 sec of delay. But when I open from the picture element that I placed in my lovelace, I have around 10 seconds of delay.
Can RTMP help on that?
I have it all messed up in my head!!! :exploding_head:

Did you happen to figure out if this would work? I’m curious too since I have a board that has a similar slot. I’m guessing it won’t since I don’t think it has the right PCI-E lanes but may be worth a try.

You could try the alexxit webRTC card

@blakeblackshear A very big thank you for your job. Well done…it’s an amazing realtime person detection.

I have a docker home assistant installation in a NAS (OMV) and I installed frigate in a different server than Home Assistant.
I installed the blakeblackshear/frigate-hass-integration and it created so many sensosrs, but most of them, all the objects sensors are always unanvailable.

what did i wrong? (no evident error in logs)

Thank You

my card is on the way

1 Like

Home assistant and frigate must be connected to the same mqtt server

Wow great thank you… it was just that.

i’m migrating my mqtt server and using the new one with proxy gtw to old.

Now i changed the frigate one and it works!

Thank You!

Where is more documentation available for this section:


    # Optional: Zone level object filters.
    # NOTE: The global and camera filters are applied upstream.
    filters:
      person:
        min_area: 5000
        max_area: 100000
        threshold: 0.7

in here:

What is the correct syntaxt in config.yml to apply a mask to an object?

e.g. I want to mask a parking place only for object car and not for persons etc…

Their is mask maker in Frigate UI>>cameras>>select camera live view>>show options>>mask and zone creator

You can create mask/zone and then copy/paste into your config. Just correct spacing