Local realtime person detection for RTSP cameras

Hi @mcpaha,

I am still not there in integrating Frigate into HA so I could be wrong but I believe you have to:

  1. Add Frigate custom repository in HACS
  2. Install the custom component & restart HA
  3. Go to “Settings” in the left side bar in home assistant (should be below “Supervisor”)
  4. Go to “Integration” (should be below “Home assistant Cloud”) in the Main page
  5. On the low right side corner you should fine a blue button “Add Integration”

Hope this helps

Thx for this but already checked… cannot find integration “frigate”

Try to add your IP where frigate is located…

My reply to you was not arrogant, I very nicelly have suggested you to read the docs to understand how Frigate works and understand all components involved. Frigate can work as separate NVR without homeassistant or you can integrate it with homeassistant by installing Frigate Integration as a custom component in you have found in HACS. Your question is not clear what configuration you cannot find. If you read the docs I have suggested you will see where to place the config.yaml file to configure Frigate.

I had the same issue. It was cache.
Try to restart your home assistant.

I tried to clarify to myself what https://github.com/blakeblackshear/frigate-hass-integration installation instructions meaning…

It says (like I mentioned at my first post): " You must go to Configuration > Integrations and add Frigate after installing via HACS."

So my qurestion is: Am I missing something in my configuration (and I mean this integration). My frigate is working ok with config.yml what I have. Now I have visible Frigate integration.

Question is (at the moment) this " * Rich media browser with thumbnails and navigation" is missing…

As for the media browser, it only works for clips and recordings, not for snapshots (I also struggled with this)

Can someone explain to me why my video is shown with 5 pics /s? this si my config:
running on intel NUC i5 with coral but the camera stream is NEVER fluent :frowning: If I activate the stream compoennt i get the whole speed BUT delayed like hell.

detectors:
  coral:
    type: edgetpu
    device: pci
mqtt:
  host: 192.168.1.41
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: hass
  password: hass
ffmpeg:
  global_args:
  - "-hide_banner"
  - "-loglevel"
  - panic
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer
    - -flags
    - low_delay
    - -strict
    - experimental
    - -fflags
    - +genpts+discardcorrupt
    - -use_wallclock_as_timestamps
    - '1'
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for clips streams (default: shown below)
    clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for rtmp streams (default: shown below)
    rtmp: -c copy -f flv
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
#    - cat
#    - dog
    - car
    - bicycle
#    - bird
cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtsp://hass:[email protected]:88/videoMain
          roles:
            - detect
            - rtmp
            - clips
            - record
    width: 1280
    height: 720
    fps: 23
    record:
      enabled: true
      retain_days: 7
    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
#      height: 175
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    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: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    zones:
      parking:
        coordinates: '554,333,611,274,708,281,763,265,823,260,948,285,1021,341,1078,359,1102,387,1137,381,1154,417,1120,596,760,504,754,318'
      mailbox:
        coordinates: '416,454,434,401,387,346,336,395,337,446'
      main_door:
        coordinates: '1200,697,1159,699,1071,699,936,695,553,663,530,449,1280,420'
  porch:
    ffmpeg:
      inputs:
        - path: rtsp://hassio:[email protected]:554/stream1
          roles:
            - detect
            - rtmp
            - clips
            - record
    width: 1920
    height: 1080
    fps: 23
    record:
      enabled: true
      retain_days: 7
    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
#      height: 175
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    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: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    zones:
      door_porch_dining_room:
        coordinates: '1243,1080,1292,85,961,162,929,1080'


  garage:
    ffmpeg:
      inputs:
        - path: rtsp://40.40.40.220:554/media/stream1
          roles:
            - detect
            - rtmp
            - clips
            - record
    width: 1280
    height: 720
    fps: 23
    record:
      enabled: true
      retain_days: 7
    zones:
      garage_door:
        coordinates: 0,158,0,504,383,493,397,213
      refrigiator:
        coordinates: '1186,259,1159,665,1038,646,1070,259'
      table:
        coordinates: '269,486,0,486,0,720,142,720,592,720,256,482,145,720,376,720,588,720'
      window_front_house:
        coordinates: '599,265,605,419,507,418,514,250'
    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
#      height: 175
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    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: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
  garden:
    ffmpeg:
      inputs:
        - path: rtsp://40.40.40.14:554/media/stream1
          roles:
            - detect
            - rtmp
            - clips
            - record
    width: 1280
    height: 720
    fps: 23
    record:
      enabled: true
      retain_days: 7
    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
#      height: 175
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7
    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: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        objects:
          person: 7

The Frigate UI is for debugging, not for viewing full quality, max fps streams from your cameras - 5fps is hard-coded for the UI.

The fps: setting in your config file is applicable for the detect role only, and anything more than 5fps is only utilizing more system resources without increasing detection accuracy.

The stream component does introduce delays in the stream. There are a few things you can do to mitigate it, but the best way to look at your camera streams real-time at this point is still through directly connecting to the RTSP stream via VLC or another media player rather than a browser.

Does someone have an example yaml of a working config w/ reolink? Im trying to follow the guid ebut ym syntax is wrong somewhere, keep getting broken frame, then the container exits. Running on unraid

mqtt:
  host: 192.168.86.****
  port: 1883
  user: mqtt1
  password: *********
cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtmp://192.168.xx.xx/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=PASSWORD
          roles:
            - detect
            - rtmp
    width: 2560
    height: 1920
    fps: 5

ffmpeg: 
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1
  hwaccel_args: 
    - "-hwaccel"
    - vaapi
    - "-hwaccel_device"
    - /dev/dri/renderD128
    - "-hwaccel_output_format"
    - yuv420p

Have you checked the docs? It has a Reolink example.

That’s a pity somehow. Would like to see my stream also in the front end without delay. I gues there’s no way to make it fluent without a streaming component right? Well , then I stick to the current 5 fps solution as it seems the most accurate with the ledd delay possible. Thanks to clarify that :slight_smile:

The limitation is really in Home Assistant and the way streaming is done, not directly with Frigate. Check out this thread for a deeper dive.

yes, as you can see I have the arguments from that doc in my config, however, I am still getting broken frames. This is why I believe it is a syntax issue on my part.

I also have these cams in blue iris, is it possible to use the blue iris API url?

You might want to start by removing the hwaccel args and seeing if your problem goes away. You can also enable ffmpeg debugging per this post.

With docker Frigate & Frigate integration -> is it possible to get frigate link to the side panel (like when using addon)?

You could try to add an iframe panel with your Frigate url (eg. http(s)://[your frigate ip]:5000)

After you install Frigate Integration from HACS, restart homeassistant and go to Integrations in HA and click Add, search for Frigate, it should be in the list.

I’m still struggeling with getting the Reolink Lumus Cameras to work via Neolink “translator” for the RTSP protocol.
Can someone give me an example how to properly specify the output parameters for ffmpeg when using inside HA? Will those parameters show up in the debug info I can get from the UI? Tried to specify them in different ways, but they never show up in the debug view.
Is there an option to retrieve the full Frigate Logfile from the filesystem? Not just the part of the log that is displayed in the UI.

Does anyone know if there is a program which will assemble all of the 1 minute recording videos from frigate into a long stream that I can fast forward through? Blue Iris 24/7 recording does this well but I don’t have a solution to do this as well in frigate, so many little clips is very tedious to navigate through to try to find a short event when you don’t know when it happened.