Local realtime person detection for RTSP cameras

Thank you for pointers.
In container homeassistant and supervisor everything is fine, mounting as should be.
When i see /mnt/data/supervisor/media this should mean that the media folder is in the supervisor container but it isnt :-/ each time i mount and run the frigate, it just making his own folder again. Not putting to /mnt/data/supervisor/media
The problem now is only inside the frigate, i have no idea why i cant mount from within it. smb read only problem and with nfs saying no permission or what.
Still trying further what i can doā€¦
P.S. as i have hassos i might not have the same access as normaly seperated dockers and run. If i will not figure it out the last resort is to make regular dockers on some linux machine

To be clear, in media browser i see network mounted folder,everything is fine with that, but only after i run frigate, its just making his own writes wherever he wants :stuck_out_tongue:

I even tryed to create a folder in supervisor in config, it apears in frigate config folder, i mounted in supervisor the network share and i see the files,but in frigate container its emptyā€¦hmmmmm

Yeah so its come to that i need to mount it not in the container as i am not allowed but in the HASSOS itself in the path /mnt/data/supervisor/media as mension in docker bindsā€¦

Would allow you to see the various parameters that the container is run with, so that you could then blow it away, re-run with a modified set to point to your own media folderā€¦ but, I would imagine itā€™s not going to survive a restart of HA.

I think, you might be better off with a Supervised install, I think it is ā€˜supportedā€™ on Debian 10ā€¦ would give you more flexibility, if youā€™re reasonably comfortable managing Linux.

Hi Jokerigno,
Have you set the retain properties in your config?

Hi Karl,

Question 2, it appears as though bugger all browsers support h265.
See this: HEVC/H.265 video format | Can I use... Support tables for HTML5, CSS3, etc

Question 3, see this: Camera Configuration | Frigate

check to make sure your camera feed is h264 with AAC audio. If your camera doesnā€™t support a compatible format for RTMP, you can use the ffmpeg args to re-encode it on the fly at the expense of increased CPU utilization.

Question 4, this sounds like your sub-stream is outputting a 4:3 image. Can you check by streaming it in VLC and see what resolution it is. VLC tools menu bar item ā†’ Codec Information.

Youā€™re right! thank you!

So i gave up.
after adding/changing the addon.json in the frigate part

  "privileged": [
    "NET_ADMIN",
    "SYS_ADMIN",
    "SYS_RAWIO",
    "SYS_TIME",
    "SYS_NICE",
    "DAC_READ_SEARCH",
    "SYS_MODULE"
  ],

Now giving new error

root@ccab4aaf-frigate:/opt/frigate# mount -vvv -t cifs -o username=xxx,password=xxx,domain=WORKGROUP  //192.168.x.x/3_hass /opt/frigate/test
mount.cifs kernel mount options: ip=192.168.x.x,unc=\\192.168.x.x\3_hass,user=xxx,domain=WORKGROUP,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
root@ccab4aaf-frigate:/opt/frigate# 

Hi @asherw83
Thanks for replying.

Nothing supporting h265 is really frustrating more than anything else, but I suppose Iā€™ll just have to wait for it to be supported. I get the same error in safari, which according to the chart you linked should work, no?

I did have a look at the rtmp streams, but for the life of me couldnā€™t figure out how to re-encode on the fly, as I kept seeing errors, or even crashes. Iā€™m sure it wonā€™t make a difference, but Iā€™m running docker in unraid. Like I said some of the cameras will only output in h265, so re-encoding might have to be the option.

The sub stream is 4:3 but I was hoping I could force the view to be 16:9, the full stream is 16:9 but being a 4k image, I donā€™t really want to do motion detection on that.

ffmpeg.SideGate.clips_rtmp ERROR : Guessed Channel Layout for Input Stream #0.1 : mono

ffmpeg.SideGate.clips_rtmp ERROR : [flv @ 0x55c000c74e80] Video codec hevc not compatible with flv

ffmpeg.SideGate.clips_rtmp ERROR : Could not write header for output file #1 (incorrect codec parameters ?): Function not implemented

ffmpeg.SideGate.clips_rtmp ERROR 

Thanks ukro. I am running frigate in docker on jetson nano and pointing HA frigate integration to the Nano instance. The NFS mount happens on the jetson nano (not inside frigate docker container). Here is my fstab entry. I think I had to install some additional modules on jetson nano to enable NFS on nano and may only support NFS v3 (not v4 - I had to enable v3 on my QNAP NAS). Unfortunately I didnā€™t remember or document what I did to make NFS work on nano. The NFS mounted directory is then passed to docker instance with -v /mynfs/media:/media/frigate

# /etc/fstab: static file system information.
#
# <file system> <mount point>             <type>          <options>                               <dump> <pass>
192.168.1.1:/FrigateData /mnt/qnap nfs rw,hard,intr,_netdev,x-systemd.after=network-online.target 0 0

1 Like

Ohh man, so you are saying that you have HASSOS? or just all the neccesary dockers on some host OS? Please please tell me one thing, how did you manage to point HA frigate integration to the nano instance? That would be a live changer if you can set the IP for that :open_mouth:
Everything else what you said i fully understood and today i can confirm,many hours waisted and yeah main thing to mount on the host afterward everybody else just take it
Unfortunately on HASSOS itself its not possible to mountā€¦

Hi there! Really appreciate if you can share your config to get detection in sub stream and clips from the main one!

Iā€™m trying with my new reolink 820A and still no luck wondering how to do it.

I am running HASSOS supervised installed on Intel NUC. The frigate install is completely separate on a jetson nano. When you install the frigate integration on HASS, you are asked for the IP and port of the frigate instance per the official document:

Blockquote
The best way to integrate with HomeAssistant is to use the official integration. When configuring the integration, you will be asked for the Host of your frigate instance. This value should be the url you use to access Frigate in the browser and will look like http://<host>:5000/ . If you are using HassOS with the addon, the host should be http://ccab4aaf-frigate:5000 (or http://ccab4aaf-frigate-beta:5000 if your are using the beta version of the addon). HomeAssistant needs access to port 5000 (api) and 1935 (rtmp) for all features.

1 Like

Sure happy to try and help. See the relevant bits of my config below. This running on a Raspberry Pi 4B without a coral TPU mindā€¦

ffmpeg:
  hwaccel_args:
    - -c:v
    - h264_v4l2m2m

detectors:
  cpu1:
    type: cpu
    num_threads: 4

cameras:
  front-camera:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -rw_timeout
        - '5000000'
        - -use_wallclock_as_timestamps
        - '1'
      inputs:
        - path: rtmp://[CAMERA_IP]/bcs/channel0_sub.bcs?channel=0&stream=0&user=[USER]&password=[PASSWORD]
          roles:
            - detect
            - record
            - rtmp
        - path: rtmp://CAMERA_IP]/bcs/channel0_main.bcs?channel=0&stream=0&user=[USER]&password=[PASSWORD]
          roles:
            - clips
    width: 640
    height: 480
    fps: 5
1 Like

OHHHH MYYY GOOOOD man!! will try it, thank you very much!!!

Yo so it seems that iā€™m going to do the proxmox LXC, any luck? I am just starting with it.

Using this tutorials
https://steamforge.net/wiki/index.php/How_to_mount_a_Network_Share_in_a_Linux_Container_under_Proxmox
https://www.reddit.com/r/Proxmox/comments/glog5j/lxc_gpu_passthrough/

Now iā€™m going install it somehow ))

I tested:

  • double-take and DeepStack on Jetson Nano 4GB
  • frigate on Raspberry Pi4 -Coral Usb.
    After a little train (you can train not-matched faces via double-take web ui), it works.
    Great.
    I only report some instability issues (Frigate rarely crashes, but it is a known issue that the author is working on).

Okay so the problem was CACHE in chrome :))) cleared, continue to setup again much thanks !

Hi hoping for some assistance - Frigate up and running in home assistant as add on
Running on VM

  • have snapshot & clips in UI
    mqtt broker all good.
    Everything seems to work properly.
    Just can not get telegram notification to work
2021-04-24 13:10:11 ERROR (MainThread) [homeassistant.components.automation.notify_of_events] Notify of events: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
2021-04-24 13:10:11 ERROR (MainThread) [homeassistant.components.automation.notify_of_events] Error while executing automation automation.notify_of_events: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'

This what Iā€™m seeing in the logs - the automation is from the documentation.

  - alias: Notify of events
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - service: notify.telegram_full
        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'

Thanks for any assistance

Hi Karl,
What model camera do you have?

On a side note, today I connected a camera that could do h265ā€¦ I couldnā€™t for the life of me figure out how to get ffmpeg to convert to h264ā€¦ feels like I got close but just couldnā€™t get the right parametersā€¦