Local realtime person detection for RTSP cameras

I hate to see yellow font logs :slight_smile:

any fix/patch coming soon to take care of this?

Loving this integrationā€¦ thank you!

Is there a way to enable/disable recording on a per-camera basis from Homeassistant? I see the switches for detect, clips and snapshots, but nothing similar for recording.

1 Like

As per docs

    # Optional: save clips configuration
    clips:

      # Required: enables clips for the camera (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 5
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 5
      # Optional: Objects to save clips for. (default: all tracked objects)
      objects:
        - person
      # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
      #required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 14
        # Optional: Per object retention days
        #objects:
          #person: 15

    # Optional: 24/7 recording configuration
    record:
      # Optional: Enable recording (default: global setting)
      enabled: False
      # Optional: Number of days to retain (default: global setting)
      retain_days: 30

I am a longtime zoneminder/zmeventnotification user and I am really impressed with Frigate, really easy to setup!

You can only set width & height once per camera, and not per input, right? When using a lower resolution stream (640x360) for object detection, and a higher resolution (1920x1080) for recording/clips/rtmp, what width & height should be used in that case?
If using two inputs for a camera, can you select which of them is displayed in the web ui? Currently my low resolution stream (640x360) is the primary in the webui.

I saw thatā€¦ I should have been clearer in my question. Is there a way to enable/disable recording from HA? For instance, when Iā€™m home, I only want to record my front cameras; if Iā€™m away I want all cameras recording.

I thought MQTT have that, but i checked and i donā€™t see in docs. Lets ask @blakeblackshear

Hey @allenporter I know this is from a long time ago but Iā€™m finally at a point where I have some mental capacity for this kind of stuff. Would the HLS URL look something like this?

blob:https://<HA_External_URL>/77tg6761-acd5-4563-9ea4-976843835a41

Probably not? Iā€™m interested in getting this going again because I heard some pretty interesting things about playing Frigate clips via a lovelace card.

Has anyone a nice lovelance card setup for viewing history events.

greetings Chris

1 Like

I use a picture card and the camera entity made by the frigate integration to display the last detection of each type. Itā€™s super simple and youā€™re likely looking for something more complicated, but if you werenā€™t aware maybe itā€™ll help.

Ok can you give me a screenshot?
And maybe the code for the lovelance too? :slight_smile:

mfg Chris

Just an update, the Nest integration sometimes spits out errors with the camera RTSPS stream path. I grabbed it an it worked.

My fear is the token attached to the end of the stream path is going to expire and Iā€™ll lose the stream.

image

type: picture-glance
title: test
entities: []
camera_image: camera.front_door_camera_person
camera_view: live

Hi @keithcroshaw , One example is when you call the camera.play_stream service to the media palyer its going to send over a url like https://home-assistant.your-domain/api/hls/<long string>/master_playlist.m3u8

1 Like

Yes, that is an expiring URL that changes every few minutes.

1 Like

Does this mean that RTSP isnā€™t possible with Nest?

So I finally found what the lovelace card put out, itā€™s just the blob as I posted before:
image

Iā€™ve been trying to with verbose logging enabled for the nest components call the service like you mentioned and watch the logs but I really donā€™t see anything with /hls/ and or /master_playlist.m3u8

Hi @keithcroshaw ā€“ If you start playing the stream and open up developer tools you should see the HLS urls fly by. I grabbed that from a browser then opened it in VLC player and it started playing for example.

Hi @flyize I wouldnā€™t quite say it that way, but can share what I know plus have some questions:

  • The SDM API support RTSP streams and there is an RPC to get one, and an RPC to extend the stream and get an updated URL.
  • Home assistant does exactly this to consume the RTSP stream (updating every few minutes) to produce an HLS feed for Nest, just like any other camera.
  • However, if you are taking the source RTSP stream from home assistant (somehow?) then its going to be changing every few minutes so youā€™ll have to follow those updates somehow. I went and read the frigate config, which looks like a fixed config file, so no that probably wonā€™t work.
  • Other software can either interact with the SDM API directly itself, like how home assistant does as an option. The python library is shared. I imagine frigate wouldnā€™t want to support that directly though since it seems to be pretty generic.
  • Home Assistant has a media player API Camera - Home Assistant ā€“ which can push the HLS stream to other players. Does frigate support calling this to get the HLS feed?
  • Does frigate support HLS feeds at all? If that does work with a manually fetched home assistant url (the discussion with @keithcroshaw ) then that could be interesting to explore, as we might be able to figure out a feature request for home assistant to have a stable url and/or have frigate pass in an authentication token in a header, etc kind of like how images work.

I installed frigate to try to learn more but havenā€™t had time to learn how to configure it yet.

Edit:

  • Frigate takes an ffmpeg input, so it seems like HLS should probably work?
1 Like

Ok so I see by listening to events I was able to capture this too.
Sorry events are uncharted territory for me.
so I got:
https:///api/hls//master_playlist.m3u8

I pasted that into Frigate and got a green screen upon restarting.

Canā€™t tell if Frigate is slowing down my system without the Coral hardware.
Iā€™m spinning a few plates at a time, so itā€™s hard to isolate, but I still would like to explore it as a more competent NVR option that paying Google every month.

This issue seems fixed in ā€œblakeblackshear/frigate:0.9.0-50f0c05-amd64ā€
I can now see clips in HA :smiley:

Blockquote
I donā€™t seem unable to save clips. In the ā€œmedia/clipsā€ directory I just see snapshot png/jpgs. But no videos.
I am running Frigate in a container on my NAS using a Coral USB
I think I have enabled the role for clips?
Any Ideas?