question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doorbird doorbell problems, but Amcrest working great!

See original GitHub issue

Describe the bug

First of all I would like to thank you for creating this superb product - I have loved using it! I have a Doorbird doorbell camera connected to Frigate. It works well for a few hours recording smooth clips, but then the fps drops dramatically, causing the live stream and any clips to become very jerky, with many missed frames and missing person detection. After a few hours of this, the stream stops working completely. If I reboot the Doorbird, Frigate resumes normal operation for a few hours, but then gradually deteriorates again

Version of frigate Output from /api/version 0.8.4-5043040

Config file Include your full config file wrapped in triple back ticks.

detectors:
  coral:
    type: edgetpu
    device: 'usb:0'
mqtt:
  host: core-mosquitto.local.hass.io
  user: mqttuser
  password: <password>
ffmpeg:
  global_args:
    - '-hide_banner'
    - '-loglevel'
    - panic
  hwaccel_args:
    - '-c:v'
    - h264_v4l2m2m
  input_args:
    - '-avoid_negative_ts'
    - make_zero
    - '-fflags'
    - nobuffer
    - '-flags'
    - low_delay
    - '-strict'
    - experimental
    - '-fflags'
    - +genpts+discardcorrupt
    - '-rtsp_transport'
    - tcp
    - '-stimeout'
    - '5000000'
    - '-use_wallclock_as_timestamps'
    - '1'
  output_args:
    detect: '-f rawvideo -pix_fmt yuv420p'
    record: >-
      -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1
      -strftime 1 -c copy -an
    clips: >-
      -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1
      -strftime 1 -c copy -an
    rtmp: '-c copy -f flv'
cameras:
  amcrest2front:
    ffmpeg:
      inputs:
        - path: >-
            rtsp://admin:<password>@192.168.1.26:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - record
        - path: >-
            rtsp://admin:<password>@192.168.1.26:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
            - rtmp
    width: 640
    height: 480
    fps: 5
    clips:
      enabled: true
      pre_capture: 5
      post_capture: 5
      objects:
        - person

      retain:
        default: 10
        objects:
          person: 14
    objects:
      track:
        - person
         
      filters:
        person:
          threshold: 0.65

          min_score: 0.5          
          
          
          
          
    motion:
      threshold: 15    
      mask: '4,98,3,2,638,2,639,107,435,67,413,31,174,45'
    record:
      enabled: true
      retain_days: 30
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: false
  amcrest3front:
    ffmpeg:
      inputs:
        - path: >-
            rtsp://admin:<password>@192.168.1.22:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - record
        - path: >-
            rtsp://admin:<password>@192.168.1.22:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
            - rtmp
    width: 640
    height: 480
    fps: 5
    clips:
      enabled: true
      pre_capture: 5
      post_capture: 5
      objects:
        - person

      retain:
        default: 10
        objects:
          person: 14
    objects:
      track:
        - person

      mask: 400,289,438,238,520,480,396,480  
      
      filters:
        person:
          threshold: 0.50

          min_score: 0.72         
      
    record:
      enabled: true
      retain_days: 30
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: false
    motion:
      threshold: 15    
      mask:
        - '231,64,222,0,0,0,0,429'
        - '506,380,640,329,640,93,640,0,348,0,475,47,548,47,426,227'
        
     
        
  amcrest1back:
    ffmpeg:
      inputs:
        - path: >-
            rtsp://admin:<password>@192.168.1.25:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - record
        - path: >-
            rtsp://admin:<password>@192.168.1.25:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
            - rtmp
    width: 640
    height: 480
    fps: 5
    clips:
      enabled: true
      pre_capture: 5
      post_capture: 5
      objects:
        - person

      retain:
        default: 10
        objects:
          person: 14
    objects:
      track:
        - person

      filters:
        person:
          min_area: 2000
          min_score: 0.59
          threshold: 0.67
    record:
      enabled: true
      retain_days: 30
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: false
    motion:
      threshold: 10
      delta_alpha: 0.3     
      mask:
        - >-
          0,480,0,0,640,0,640,190,538,70,296,59,203,100,109,160,16,204,33,319,164,480
        - '440,361,434,245,376,229,322,284,347,391,403,430'
  doorbird:
    fps: 5
    record:
      enabled: true
      retain_days: 30
    ffmpeg:
      inputs:
        - path: 'rtsp://ghipav0005:<password>@192.168.20.41:554/mpeg/media.amp'
          roles:
            - detect
            - record
            - clips
    width: 1280
    height: 720
    clips:
      enabled: true
      pre_capture: 5
      post_capture: 5
      objects:
        - person

      retain:
        default: 10
        objects:
          person: 14
    objects:
      track:
        - person
        
    motion:
      mask: >-
        4,305,9,2,1279,0,1275,718,922,704,917,366,453,354,397,325,295,325,255,356,133,343,138,713,2,718
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: false

database:
  path: /media/frigate/clips/frigate.db
clips:
  max_seconds: 300
  retain:
    default: 10
    objects:
      person: 14



Frigate container logs

watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
watchdog.doorbird              INFO    : FFmpeg didnt exit. Force killing...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. PyMemoryView_FromBuffer(): info->buf must not be NULL
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55aa142c10] moov atom not found
/tmp/cache/doorbird-20210530053807.mp4: Invalid data found when processing input
frigate.events                 INFO    : bad file: doorbird-20210530053807.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5586941c10] moov atom not found
/media/frigate/recordings/doorbird-20210530053807.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530053807.mp4
[h264 @ 0x55845410f0] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[h264 @ 0x55cd6840f0] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
watchdog.doorbird              INFO    : No frames received from doorbird in 20 seconds. Exiting ffmpeg...
watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559dbd0c10] moov atom not found
/media/frigate/recordings/doorbird-20210530061702.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530061702.mp4
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
watchdog.doorbird              INFO    : No frames received from doorbird in 20 seconds. Exiting ffmpeg...
watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559ad5bc10] moov atom not found
/media/frigate/recordings/doorbird-20210530062442.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530062442.mp4
watchdog.doorbird              INFO    : No frames received from doorbird in 20 seconds. Exiting ffmpeg...
watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. PyMemoryView_FromBuffer(): info->buf must not be NULL
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55619bec10] moov atom not found
/media/frigate/recordings/doorbird-20210530062513.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530062513.mp4
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
watchdog.doorbird              INFO    : No frames received from doorbird in 20 seconds. Exiting ffmpeg...
watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
watchdog.doorbird              INFO    : FFmpeg didnt exit. Force killing...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557c1b8c10] moov atom not found
/media/frigate/recordings/doorbird-20210530062850.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530062850.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55adab7c10] moov atom not found
/tmp/cache/doorbird-20210530062850.mp4: Invalid data found when processing input
frigate.events                 INFO    : bad file: doorbird-20210530062850.mp4
[h264 @ 0x559494b0f0] no frame!
[h264 @ 0x55a504b0f0] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
watchdog.doorbird              INFO    : No frames received from doorbird in 20 seconds. Exiting ffmpeg...
watchdog.doorbird              INFO    : Waiting for ffmpeg to exit gracefully...
watchdog.doorbird              INFO    : FFmpeg didnt exit. Force killing...
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a33d8c10] moov atom not found
/tmp/cache/doorbird-20210530070314.mp4: Invalid data found when processing input
frigate.events                 INFO    : bad file: doorbird-20210530070314.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55cc823c10] moov atom not found
/media/frigate/recordings/doorbird-20210530070314.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: doorbird-20210530070314.mp4
[h264 @ 0x55b1bb90f0] no frame!
[h264 @ 0x55945530f0] no frame!
[h264 @ 0x55a45f30f0] no frame!
[h264 @ 0x55b65f00f0] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[h264 @ 0x55961470f0] no frame!
[h264 @ 0x5590254140] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
[h264 @ 0x558d1130f0] no frame!
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...

Frigate stats

{
  "amcrest1back": {
    "camera_fps": 5.1, 
    "capture_pid": 49, 
    "detection_fps": 0.0, 
    "pid": 44, 
    "process_fps": 5.1, 
    "skipped_fps": 0.0
  }, 
  "amcrest2front": {
    "camera_fps": 5.0, 
    "capture_pid": 47, 
    "detection_fps": 3.3, 
    "pid": 40, 
    "process_fps": 5.1, 
    "skipped_fps": 0.0
  }, 
  "amcrest3front": {
    "camera_fps": 5.1, 
    "capture_pid": 48, 
    "detection_fps": 0.0, 
    "pid": 42, 
    "process_fps": 5.1, 
    "skipped_fps": 0.0
  }, 
  "detection_fps": 3.3, 
  "detectors": {
    "coral": {
      "detection_start": 0.0, 
      "inference_speed": 15.32, 
      "pid": 37
    }
  }, 
  "doorbird": {
    "camera_fps": 4.8, 
    "capture_pid": 51, 
    "detection_fps": 0.0, 
    "pid": 45, 
    "process_fps": 4.8, 
    "skipped_fps": 0.0
  }, 
  "service": {
    "storage": {
      "/dev/shm": {
        "free": 1985.2, 
        "mount_type": "tmpfs", 
        "total": 1989.8, 
        "used": 4.6
      }, 
      "/media/frigate/clips": {
        "free": 1260214.3, 
        "mount_type": "ext4", 
        "total": 1968255.7, 
        "used": 628029.1
      }, 
      "/media/frigate/recordings": {
        "free": 1260214.3, 
        "mount_type": "ext4", 
        "total": 1968255.7, 
        "used": 628029.1
      }, 
      "/tmp/cache": {
        "free": 1862.7, 
        "mount_type": "tmpfs", 
        "total": 1989.8, 
        "used": 127.2
      }
    }, 
    "uptime": 46781, 
    "version": "0.8.4-5043040"
  }
}

FFprobe from your camera

Run the following command and paste output below

ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[h264 @ 0x557125e4eac0] missing picture in access unit with size 38
[h264 @ 0x557125e4eac0] missing picture in access unit with size 46
Input #0, rtsp, from 'rtsp://ghipav0005:<password>@192.168.20.41:554/mpeg/media.amp':
  Metadata:
    title           : RTSP/RTP stream from DoorBird
    comment         : mpeg/720p/media.amp
  Duration: N/A, start: 3.295933, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, progressive), 1280x720, 30 fps, 30 tbr, 90k tbn, 60 tbc

Screenshots If applicable, add screenshots to help explain your problem.

Screen Shot 2021-05-30 at 8 35 22 am

I restarted Doorbird about 8pm last night, which improved things for a few hours.

Computer Hardware

  • OS: [e.g. Ubuntu, Windows] Home Assistant OS 5.13 on RPi4 4GB
  • Install method: [e.g. Addon, Docker Compose, Docker Command]
  • Addon
  • Virtualization: [e.g. Proxmox, Virtualbox]
  • Coral Version: [e.g. USB, PCIe, None]
  • USB
  • Network Setup: [e.g. Wired, WiFi]
  • Wired ethernet

Camera Info:

  • Manufacturer: [e.g. Dahua]’
  • Doorbird
  • Model: [e.g. IPC-HDW5231R-ZE]
  • D101S
  • Resolution: [e.g. 720p]
  • 720p
  • FPS: [e.g. 5]

Additional context Add any other context about the problem here. I have 3 Amcrest cameras setup with 2 streams each (low and high res), which work brilliantly with Frigate.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
blakeblackshearcommented, Jun 1, 2021

Now that you mention it, I had the same issue. Frigate restreams the camera feed in RTMP, so you can just have 1 connection to the camera if you have other uses. That’s how frigate’s camera entities work for HA.

I use the doorbird integration because I have one with relays. I don’t use anything else from it. I found most of the entities to be unreliable.

0reactions
dredzedcommented, Jun 12, 2021

Closing this issue, as I’m happy with recordings and clips with IR enabled. Still no idea why ffmpeg would shut down at night without IR light enabled on the camera.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Amcrest Doorbell Won't Connect To Wifi and How To Fix It
To do this, hold down the orange button on the back of the camera for five seconds until it completes the reset process....
Read more >
Amcrest Doorbell - Page 21 - Amcrest Forum
As for the other three problems, I'm sorry but there is no way to show what I'm ... iOS, however, has echo cancellation...
Read more >
Amcrest vs Doorbird video doorbells: first impressions - Reddit
The Amcrest has a microsd card slot, the Doorbird doesn't. You can view microsd recordings from anywhere you have an internet connection, but ......
Read more >
Doorbird Camera - horribble quality | Page 2 - IP Cam Talk
Wifi will eventually drop, and at the worst time. ... a ton of problems with Amcrest POE cameras dropping due to some odd...
Read more >
Customer reviews: Amcrest 1080P Video Doorbell ... - Amazon.com
Everything was up and working great. Amcrest... Don't ever turn your back on the value you offer in this space... This is 100%...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found