Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support]: Delay/lag with Amcrest IP4M-1051 #2379

Closed
CZonin opened this issue Dec 4, 2021 · 6 comments
Closed

[Support]: Delay/lag with Amcrest IP4M-1051 #2379

CZonin opened this issue Dec 4, 2021 · 6 comments

Comments

@CZonin
Copy link
Contributor

CZonin commented Dec 4, 2021

Describe the problem you are having

I recently replaced my cameras with an Amcrest AD410 and IP4M-1051. They are the only 2 cameras I have integrated into Home Assistant/Frigate running on a Pi 4 with a Coral USB Accelerator. The live stream from the AD410 seems to be working great, but the IP4M-1051 is constantly refreshing pretty slow, followed by fast forwarding to catch up (ie. 1 second on the cameras built in timestamp takes about 5 seconds). I loaded the rtsp stream in VLC to see if it has the same delay, but it's working perfectly there.

Version

0.9.4-26AE608

Frigate config file

# frigate.yml
mqtt:
  host: removed
  port: removed
  user: removed
  password: removed

cameras:
  front_doorbell:
    objects:
      track:
        - person
        - car
        - motorcycle
    ffmpeg:
      inputs:
        - path: removed
          roles: 
            - detect
            - rtmp
    detect:
      width: 2560
      height: 1920
      fps: 5
    motion:
      mask:
        - 2352,623,2385,1009,2303,1619,2560,1812,2560,0,1880,0,2171,102
        - 1804,0,299,0,347,411,1110,277,1702,287
    zones:
      my_driveway:
        coordinates: 2162,1371,2028,1337,2011,1322,2011,1252,2038,1187,2083,1159,2176,1114,2372,1091,2335,1378
        objects:
          - person
          - motorcycle
      neighbor_driveway_1:
        coordinates: 1734,1187,1677,1133,1621,1072,1494,1075,1517,1125,1568,1196
        objects:
          - person
          - motorcycle
      neighbor_driveway_2:
        coordinates: 2052,1136,1949,1063,1891,1057,1767,1052,1694,1117,1897,1179
        objects:
          - person
          - motorcycle
      doorway:
        coordinates: 1506,1920,1393,415,260,437,249,1920
  den:
    objects:
      track:
        - person
    ffmpeg:
      inputs:
        - path: removed
          roles: 
            - detect
            - rtmp
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
    detect:
      width: 2304
      height: 1296
      fps: 5
    motion:
      mask:
        - 0,0,2304,0,2304,276,1852,190,1423,159,813,152,67,230,0,195
        - 0,1296,368,1296,298,1151,195,883,107,510,88,572,0,537
      
record:
  enabled: true
  retain_days: 0
  events:
    max_seconds: 120
    pre_capture: 2
    post_capture: 2
    retain:
      default: 1
    
snapshots:
  enabled: true
  timestamp: true
  retain:
    default: 1
     
birdseye:
  enabled: false
    
detectors: 
  coral:
    type: edgetpu
    device: usb

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-12-03 23:55:52] frigate.app                    INFO    : Starting Frigate (0.9.4-26ae608)
[2021-12-03 23:55:52] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-12-03 23:55:52] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-12-03 23:55:52] peewee_migrate                 INFO    : There is nothing to migrate
[2021-12-03 23:55:52] frigate.mqtt                   INFO    : MQTT connected
[2021-12-03 23:55:52] frigate.app                    INFO    : Output process started: 218
[2021-12-03 23:55:52] frigate.app                    INFO    : Camera processor started for front_doorbell: 222
[2021-12-03 23:55:52] frigate.app                    INFO    : Camera processor started for den: 225
[2021-12-03 23:55:52] ws4py                          INFO    : Using epoll
[2021-12-03 23:55:52] frigate.app                    INFO    : Capture process started for front_doorbell: 229
[2021-12-03 23:55:52] frigate.app                    INFO    : Capture process started for den: 230
[2021-12-03 23:55:52] ws4py                          INFO    : Using epoll
[2021-12-03 23:55:52] detector.coral                 INFO    : Starting detection process: 217
[2021-12-03 23:55:52] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-12-03 23:55:55] frigate.edgetpu                INFO    : TPU found
[2021-12-03 23:56:52] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48260]
[2021-12-03 23:57:04] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48260]
[2021-12-03 23:59:31] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48536]
[2021-12-03 23:59:34] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58642]
[2021-12-03 23:59:41] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58642]
[2021-12-03 23:59:42] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58664]
[2021-12-04 00:00:13] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58664]
[2021-12-04 00:00:13] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:48536]
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create jpg because frame 1638623025.718946 is not in the cache
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to save snapshot for 1638623016.586915-y9daqr.
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create clean png because frame 1638623025.718946 is not in the cache
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to save clean snapshot for 1638623016.586915-y9daqr.
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create jpg because frame 1638623025.718946 is not in the cache
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create jpg because frame 1638623028.471937 is not in the cache
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to save snapshot for 1638623016.586915-1tqh8m.
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create clean png because frame 1638623028.471937 is not in the cache
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to save clean snapshot for 1638623016.586915-1tqh8m.
[2021-12-04 08:03:53] frigate.object_processing      WARNING : Unable to create jpg because frame 1638623028.471937 is not in the cache
[2021-12-04 08:19:58] frigate.record                 WARNING : Discarding a corrupt recording segment: den-20211204081958.mp4
[2021-12-04 08:41:55] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56846]
[2021-12-04 08:42:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38730]
[2021-12-04 08:42:36] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38730]
[2021-12-04 08:42:36] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38778]
[2021-12-04 08:42:43] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:38778]
[2021-12-04 08:42:43] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56846]
[2021-12-04 08:44:31] frigate.object_processing      WARNING : Unable to create jpg because frame 1638625463.441594 is not in the cache
[2021-12-04 08:44:31] frigate.object_processing      WARNING : Unable to save snapshot for 1638625457.103002-54758u.
[2021-12-04 08:44:31] frigate.object_processing      WARNING : Unable to create clean png because frame 1638625463.441594 is not in the cache
[2021-12-04 08:44:31] frigate.object_processing      WARNING : Unable to save clean snapshot for 1638625457.103002-54758u.
[2021-12-04 08:44:31] frigate.object_processing      WARNING : Unable to create jpg because frame 1638625463.441594 is not in the cache
[2021-12-04 08:53:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57952]
[2021-12-04 08:53:04] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:57952]
[2021-12-04 08:54:14] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58098]
[2021-12-04 08:54:16] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:39980]
[2021-12-04 08:54:39] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:39980]
[2021-12-04 08:54:39] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:40022]
[2021-12-04 08:54:43] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:40022]
[2021-12-04 08:54:43] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:40026]
[2021-12-04 08:55:13] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:40026]
[2021-12-04 08:55:31] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58098]
[2021-12-04 08:55:31] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58248]
[2021-12-04 08:55:33] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:58248]

FFprobe output from your camera

Not sure how to do this. Can provide it if someone can help me out.

Frigate stats

Not sure how to do this. Can provide it if someone can help me out.

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest IP4M-1051

Any other information that may be helpful

Some info from the camera itself if it helps:

Encode: H264
Resolution: 1920x1080
Framerate: 30
Bitrate: 4096

@stale
Copy link

stale bot commented Jan 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 3, 2022
@stale stale bot closed this as completed Jan 7, 2022
@hack2spider
Copy link

hmm it appears I have the same issue ... but Im running frigate in a container however this shouldnt make any difference ...

I`m feeding my home assistant with .jpg from frigate in order to do rooom presence with double-take ...

In the logs bellow its not clear which camera is having problems with the object_proccessing however I think it is a wyze v2 simply because this is the only one that wont show a snapshot in home assistant.

Maybe some settings ? it was working before ..

Logs bellow ..

[2022-01-10 10:23:07] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:09] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44914]

[2022-01-10 10:23:09] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44936]

[2022-01-10 10:23:09] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:09] frigate.object_processing WARNING : Unable to save snapshot for 1641810179.330937-iq7iv4.

[2022-01-10 10:23:09] frigate.object_processing WARNING : Unable to create clean png because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:09] frigate.object_processing WARNING : Unable to save clean snapshot for 1641810179.330937-iq7iv4.

[2022-01-10 10:23:09] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:10] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:10] frigate.object_processing WARNING : Unable to send mqtt snapshot for 1641810179.330937-iq7iv4.

[2022-01-10 10:23:13] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44936]

[2022-01-10 10:23:14] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44950]

[2022-01-10 10:23:16] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44950]

[2022-01-10 10:23:16] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

[2022-01-10 10:23:16] frigate.object_processing WARNING : Unable to send mqtt snapshot for 1641810179.330937-iq7iv4.

[2022-01-10 10:23:16] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44958]

[2022-01-10 10:23:23] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44958]

[2022-01-10 10:23:23] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:44994]

[2022-01-10 10:23:38] frigate.object_processing WARNING : Unable to create jpg because frame 1641810213.936492 is not in the cache

[2022-01-10 10:24:31] frigate.object_processing WARNING : Unable to create jpg because frame 1641810184.543911 is not in the cache

@LordNex
Copy link

LordNex commented Jan 10, 2022

My problem is somewhat similar but I have a feeling it's due to decoding. I'm able to get the AD410 into Frigate and the debug shows it processing at 5fps but when I try to view the camera through Frigate or the Home Assistant Frigate Card, it's very delayed (by almost 30 seconds or more) and stuttering. All my other cameras(Wyze Pan, ReoLink RLC520A) seem to do ok and show the same fps in debug. Any suggestions?

Oh and I'm running on a RPi4 8gig with a coral usb

@hack2spider
Copy link

right ...

I don`t quite have such issues ... with fps delays ... or at least not 30 seconds ..

Is this a wireles camera or wired ? usually all wireless cams are useless and loose lots of fps.

@LordNex
Copy link

LordNex commented Jan 10, 2022

right ...

I don`t quite have such issues ... with fps delays ... or at least not 30 seconds ..

Is this a wireles camera or wired ? usually all wireless cams are useless and loose lots of fps.

All of my cams are wireless except the ReoLinks. I have Wyze cams on beta RSTP that don't do this. From looking through the logs it looks to be something with the deciding. I was finally able to get the Raspian OS into true 64 bit mode and update the firmware and kernel. But even with a TPU if I run htop the CPU cores look maxed. Yet it's only using 1.7 gigs of ram.

I'm probably going to have to play with the input and output args and hopefully get better results. If not I'll just display that camera through WebRTC and use the Frigate card as a still image and clip review. Was just hoping I could get the live restream from frigate. I've tried but never successfully gotten RTMP working. Everything is storing in a OpenMediaVault NAS share except the frigate DB and config files. With that, DeepStack on a Jetson Nano, and Double Take. It's been working pretty well. Just got to tweek things out which is a pain

@thinkjk
Copy link

thinkjk commented Mar 20, 2023

Did anyone get this resolved/figured out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants