Local realtime person detection for RTSP cameras

I haven’t tried it, but look at these. Create a MQTT switch with the relevant frigate MQTT topics

If ha in docker and frigate in docker you may connect to frigate using host name of docker container on docker network. Expose port is optional and only needed for your external access to frigate UI on host on lan

Ok thank you. I appreciate all the work you’ve done so far! Keep it up!

i did that and now im getting this error when truing to set up frigate in unraid. Error response from daemon: error gathering device information while adding custom device “/dev/dri/renderD128”: no such file or directory.

You need to check that your config.yml is appropriate for the installation. /dev/dri/renderD128 is used for Intel ffmpeg hardware acceleration, which you don’t need because you’re using a Coral.

Try commenting out the whole global ffmpeg: section and see what happens. (Don’t comment out the ffmpeg: sections under camera:.)

I was under the impression that the coral only did the inferencing and that you still needed other hardware to do the decoding of the frames. Either a GPU or CPU.

1 Like

Your impression is correct. Two different types of hardware acceleration for different parts of processing. Using both is ideal.

2 Likes

Thanks for the confirmation Blake.

Can someone give me guidance on adding GPU memory allocation on the RPi4 for a HAOS deployment? Pretty sure I am smashing my little machine with three cameras current. Trying to limp her by till I get a NUC & Coral.

Thanks!
Jason

do i need to use FFmpeg Hardware Acceleration if i have a coral mini pcie?

FFmpeg takes the video stream and creates the frames/areas to scan for motion/objects - this is what the hardware acceleration accelerates.

The coral, offloads the object detection, after the above has take place.

… I believe :slight_smile:

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?