Local realtime person detection for RTSP cameras

Hello,
i check stream specs fist camera is 1280x960
secound camera is 1920x1080
i change them but still green sold ?

Are they both H264 streams

one yes and the another one no see:
camera1
camera2

Is it the bottom feed that causes the issue?

Try w 1920 h 1088

** ahh it’s MJPEG feed. That’s the issue I think, need to search for args to make it compatible?

what yo mean by args to make it compatible ?

I try w 1920 h 1088 but not working

1 Like

thank you
it work with me now
for first camera i add this

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

done

for secound camera i add
for MJPEG feed camera i add this

      input_args: -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
        rtmp: -c:v libx264 -an -f flv

and in role i add -rtmp

work for me

thank you very much

I’ve disable RTMP now and things are better. I’m thinking it might be time to upgrade cameras - the Hikvision ones have now are 4k, but they only have one substream (a 480p one), which is spotty with detection in certain scenarios. Need to do some digging to find some good camera options with a third (720/1080p) stream.

Look at Amcrest. Cheap cameras and low light is amazing. Just turn off led at night and turn on Color at night, basically 24/7 daytime. I look at my cameras at night and honestly it look like just before sundown. This is in country with no street lights and closest light (bulb on house nothing huge) 400’ away. Moon is enough.

Hi folks…
Came up with an idea…
I want to count number or persons passing by in a zone.
How would you make an automation to create a counter/sensor that counts number of passing peoples in a zone?

The zone I want to count is named: street_area and i’ve set up an counter witch increments every time a MQTT (frigate/street_area/person) is triggerd. But there seems that this is triggerd every time Frigate finds a new person. I’ve seen in the MQTT message that there is an person counter. image
This would be great to use if I just can use this as an increment value to add to the counter…
I’m new to this counter and helper stuff… :slight_smile:

How would you do?

//Minglarn…

Hello,

I tried searching for this with no results, apologies if it has been asked before. How could I monitor the Frigate log and get notified in the event of an error? Couple times, Frigate has stopped working and the only solution was to restart the addon. I’m perfectly fine with this, but I’d like to know when it happens as soon as possible so I can manually restart it.

Thanks in advance.

Holy crap. Recently moved from an older xeon server to a Chromebox flashed with homeassistant OS.

Kept my original config for the first month or so. Noticed the CPU usage was quite high.

It’s an older 4th gen i3 4010u but I knew it had quicksync so looked at the hardware acceleration options and turned them on.

I’ve got from 80%+ CPU usage to 18% for my whole homeassistant setup.

Just one camera in frigate but very happy to see that change. Thank you.

I’m using the MSI Cubi N 8GL-001BEU Celeron N4000 myself but it’s EOL now and hard to find. It was a steal around £109 when I got it. You will need RAM and a SSD on top of that though. They have a newer version the MSI Cubi N JSL-001BEU - Pentium Silver N6000, slightly better spec but more expensive too. The cubi N’s have plenty of options with a SATA 2.5" bay and a m.2 2280 key slot. The one I have also has a m.2 2230 Key E slot for the onboard WiFi which I used with the Coral 2230 PCB. WiFi isn’t a great idea with a DVR anyway! Finding systems which support the smaller 2230 slots can be tricky, try find images of the boards themselves and if it has a card slot for the WiFi it tends to be m.2 these days.

Alternatives that are in RPi price territory are thin on the ground, if anyone knows of any, let me know! I just found this MSI PRO DP20Z 5M-001BEU AMD Barebone Mini PC which uses AMD Ryzen and has 2 X m.2 slots but the CPU isn’t included which makes it more expensive.

I’ve been meaning to try the JK01 Windows 10 Mini PC Intel N5095 from AliExpress as well as it’s fairly cheap and a good CPU.

Is it possible to train frigate to notice frequent vehicle types?
for example a mail carrier… since the truck is always the same (at least in my area)

You need to use a Custom model

I never tried this but now I am curious so I may try

I see this in my logs (the first three lines are replicated A LOT):

[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. read of closed file
[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. read of closed file,
[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. read of closed file,
[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...
[2022-01-16 02:31:00] frigate.record                 WARNING : Discarding a corrupt recording segment: front_door-20220116023001.mp4,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : More than 10000 frames duplicated,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : More than 1000 frames duplicated,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : FFMPEG process crashed unexpectedly for front_door.,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : You may have invalid args defined for this camera.,
[2022-01-16 02:31:10] watchdog.front_door            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 397034914, current: 397034912; changing to 397034915. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 2119720610, current: 2119720608; changing to 2119720611. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 5529265490, current: 5529265488; changing to 5529265491. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 3124322690, current: 3124322688; changing to 3124322691. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 7583307570, current: 7583307568; changing to 7583307571. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 8434589698, current: 8434589696; changing to 8434589699. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:10] ffmpeg.front_door.detect       ERROR   : [segment @ 0x560d346dfdc0] Non-monotonous DTS in output stream 0:1; previous: 8218528130, current: 8218528128; changing to 8218528131. This may result in incorrect timestamps in the output file.,
[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg process is not running. exiting capture thread...,
[2022-01-16 02:31:00] frigate.record                 WARNING : Discarding a corrupt recording segment: front_door-20220116023001.mp4,
[2022-01-16 02:31:00] frigate.video                  INFO    : front_door: ffmpeg sent a broken frame. read of closed file

It appears that the camera recovered eventually. Is this something I can resolve with configuration changes or did the camera just glitch out? I’m using RLC-520 for this front_door.

Thanks,
-Greg

Ludwig, how are you passing the m.2 card to the lxc container? Can you post please your lxc config when you get a chance, think this will helpful for a lot of people. Thanks

Hi,

in the conf of the LXC Container i use this (dont remember what is for the m2 and what is for the h264 decoder of the cpu)

arch: amd64
cores: 8
features: nesting=1
hostname: frigate
memory: 8192
mp0: mainstorage:subvol-107-disk-0,mp=/var/lib/docker,backup=1,size=1536G
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=DE:9D:AB:08:xx:xx,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-107-disk-0,size=64G
startup: order=5
swap: 8192
unprivileged: 0
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.cgroup2.devices.allow: c 120:* rwm
lxc.cgroup2.devices.allow: a
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
lxc.mount.entry: /dev/apex_0 dev/apex_0 none bind,optional,create=file 0, 0
lxc.apparmor.profile: unconfined
lxc.cap.drop: 
lxc.mount.auto: cgroup:rw

in frigate its only:

detectors:
  coral1:
    type: edgetpu
    device: pci

1 Like

I’m thinking about replacing my main camera (it has a single rtsp stream which isn’t configurable) with something that has more configuration options.

I’m trying the IMOU Bullet 2 4MP ipc-f42fe

Does anyone have this camera and if so, could you share your settings?

Hi All i just finish with the installation and been reading for the last 5 hours on how to get the ffmpeg configruation correct. But can someone explain to me for the love of god… what the hell is all these thing your all adding on to the ffmpeg mean? where to get those information off my camera? and which one to choice?

I have 6 dahua cameras every single one come back with FFMPEG process crashed unexpectedly, …You may have invalid args defined for this camera… I mean hell is there like a table, program, compatible sheet we can get spec from?

FYI currently I’m not even using for recording or detection (at least not until i get a coral HW) I just want to use it for streaming as it does have much lower lag them any addon I tested. Will webRTC is like 500ms faster but its PIA to get it working on WAN.