Local realtime person detection for RTSP cameras

Try putting those on each specific ffmpeg input stream

From the docs

cameras:
  # Required: name of the camera
  back:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
          # Required: list of roles for this stream. valid values are: detect,record,clips,rtmp
          roles:
            - detect
            - rtmp
          # Optional: stream specific input args (default: inherit)
          input_args:

Actually I just edited my post to include my config while you were replyingā€¦ does it look right?

Are you sure youā€™re running the latest release? This would make it seem like youā€™re still running the 0.7.x version.

Actually that did cross my mind however Iā€™ve double checked with a docker pull and below is my run command

screen -S frigate -d -m docker run --rm \
--name frigate \
--privileged \
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
-v /dev/bus/usb:/dev/bus/usb \
-v /docker/frigate/clips:/media/frigate/clips \
-v /docker/frigate/recordings:/media/frigate/recordings \
-v /docker/frigate/config:/config:ro \
-v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='***' \
-p 5000:5000 \
-p 1935:1935 \
blakeblackshear/frigate:0.8.0-amd64

also another case of ambiguity Iā€™ve foundā€¦ the install instructions for the new HA integration read " 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"

I installed it via hass and I was not asked anything?!?!? not on the github page or the official docs can I find the specifics on how I configure the HA integration?!?!?

For clips, you are adding global clips options at the camera level. Some of those are global only options.

For your input_args, those either need to be indented one level up (they would apply to all inputs for the camera), or one level down (they would just apply to the one input). This is how they would be indented one level up.

  rear:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.249:554/onvif1
          roles:
            - detect
            - clips
          input_args:
            - -rtsp_transport
            - udp
1 Like

HACS adds the integration so its available under Configuration > Integrations > Add like a normal integration. HACS does not setup the integration for you.

1 Like

blakeblackshear Iā€™ve actually been using HA for over a year now lol

Both your suggested fixes have workedā€¦ many thanks for your help and sorry as it seems Iā€™m having a bad day here, I should of spotted both those issues

1G to each container, I believe. Iā€™m in the same boat as you with regards to familiarity with docker, and spent ages looking for a solution to the shm issue. I really donā€™t think that this can be the best way to do it, but it seems simple and works flawlessly (for me at least).

Perhaps someone could advise the best way to increase the shm-size for the Frigate add-on running on supervised HASSIO (in Debian/Ubuntu etc), and we could add it to the new docs site for others who are having trouble?

I love all the new additions to Frigate by the way - the new UI, docs, config changes etc. Itā€™s super work by all involved!

I love this project to much just to let it goā€¦ :wink:
Im currently running ZoneMinder with zmevent notfication server.
As this ā€œprojectā€ moves on I see the potential to drop ZM for Frigate. :slight_smile:

A BIG THANKS to the authors/author for this wonderful project!
A questionā€¦ Im still waiting for my coral to arrive and was thinking of reducing the overhead from my cams. As of today im running ZM (9 cams) and Frigate (4 cams).

I would like to use the url from ZM but have no luck as its mjpeg and starts with httpā€¦
Have anyone had any success with the stream from ZM in Frigate? If so, please share your configā€¦

I currently use Frigate behind Zoneminder (still on Frigate 0.7.3) as there are still some features that I prefer with the setup above what I can get with 0.8.0. Frigate will eventually mature (likely by 0.9.0) for me to be able to make the transition away from ZM completely.

But I use ZM camera (mjpeg) streams in Frigate easily since ffmpeg processes them without issue. Just use this as your input into Frigate:

https://<zm ip address>:8443/zm/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=50&maxfps=3

Obviously youā€™ll need to adjust your IP address, monitor number, and optional scaling and max FPS. But that works pretty well for me.

The path to the jpg stream works in VLC but I cant seem to make it work in frigate.

Trowns tons of errors as these:

frigate.video                  INFO    : frigate_pathway: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55bff8575140] moov atom not found
/tmp/cache/frigate_pathway-20210127220819.mp4: Invalid data found when processing input
frigate.events                 INFO    : bad file: frigate_pathway-20210127220819.mp4
frigate.video                  INFO    : frigate_pathway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures

How have you configured FFMPEG settings in your setup?

Yep. Iā€™ve overridden the input_args with:

-avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1

There may be other parameters used by 0.8.0 but for 0.7, Iā€™m pretty sure I just removed -rtsp_transport tcp -stimeout 5000000 from the parameters.

Damn, cant get to work when using these params.

How to set these input_args for only 1 camera?

It depends if you are using Frigate 0.7 or 0.8. In 0.8, the docs give info on how to set parameters for each camera or each role:

Using 0.8.0-rc6

Error parsing config: extra keys not allowed @ data['cameras']['frigate_pathway']['ffmpeg']['input_args']

Dont get itā€¦ Must bee tired ā€¦ :stuck_out_tongue:

Iā€™d recommend starting with a simple config and building it out from there. Indentation matters, and itā€™s easy to lose track of the correct indentation necessary for each part if your config is already pretty large.

Okey, found the right indentationā€¦ Damn itā€™s hard to get used to YAML ā€¦ :slight_smile:

But the stream is still ā€œgreenā€ ā€¦ :frowning:

Are you using hardware acceleration? Try turning that off. Also make sure your width/height is correct.

Thanks! That solved itā€¦ Changed the hw_args and now it worksā€¦