blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.94k stars 1.73k forks source link

Doorbird doorbell problems, but Amcrest working great! #1157

Closed dredzed closed 3 years ago

dredzed commented 3 years ago

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

Camera Info:

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.

blakeblackshear commented 3 years ago

Try using the default input_args rather than overriding them. FFmpeg may be pulling the feed to aggressively with what you have specified.

dredzed commented 3 years ago

Thanks for the quick response!

I tried default input args: input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1

but I still get the same low fps (1 or 2 frames every 3 seconds now). If I restart Doorbird, this will clear up for a few hours

blakeblackshear commented 3 years ago

If you use the default global_args instead of custom ones, you should get some logs from ffmpeg when it needs to be restarted.

dredzed commented 3 years ago

Using default global_args now: ffmpeg: global_args: -hide_banner -loglevel warning After rebooting Doorbird doorbell, worked well for a few hours, then frame rate dropped - here are logs:


frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x5586387210] missing picture in access unit with size 49854
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...
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55b42e2210] missing picture in access unit with size 29
ffmpeg.doorbird.detect         ERROR   : [segment @ 0x55b4316f30] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.doorbird.detect         ERROR   : [segment @ 0x55b4300840] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55b42e2210] missing picture in access unit with size 51834
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55b42e2210] missing picture in access unit with size 48898
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...
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55843ad210] missing picture in access unit with size 2260
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55843ad210] missing picture in access unit with size 1755
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55843ad210] missing picture in access unit with size 50398
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
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...
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...
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558de83210] missing picture in access unit with size 50482
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558de83210] missing picture in access unit with size 50341
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558de83210] missing picture in access unit with size 2853
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558de83210] missing picture in access unit with size 91
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...
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...
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] missing picture in access unit with size 29
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] no frame!
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] missing picture in access unit with size 986
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x55ca5ac210] no frame!
[h264 @ 0x55b9e8e0f0] 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...
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558876d210] missing picture in access unit with size 49696
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558876d210] missing picture in access unit with size 1185
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558876d210] missing picture in access unit with size 48324
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x558876d210] missing picture in access unit with size 3924
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...
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...
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x55781f6210] missing picture in access unit with size 9916
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
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...
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x557ec0b210] missing picture in access unit with size 49779
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x557ec0b210] missing picture in access unit with size 421
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. 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...
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
ffmpeg.doorbird.detect         ERROR   : [NULL @ 0x559fde0210] missing picture in access unit with size 4132
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
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...
ffmpeg.doorbird.detect         ERROR   : More than 1000 frames duplicated
[h264 @ 0x55a70510f0] no frame!```
blakeblackshear commented 3 years ago

Looks like the doorbird stops sending data after a while when under continuous load. Is it overheating or something? I have 2 of the wired doorbird devices and they work fine with the default settings.

dredzed commented 3 years ago

I think that with your help I might have solved it - on the Doorbird I have extra users for Home Assistant, motioneye and a couple of family members. Last night I disabled the Home Assistant user on Doorbird, and it is now running smoothly on Frigate, with a constant 5fps 😊 I will continue to monitor this, but maybe the doorbell was working too hard with all of the extra users?? Out of interest, do you use the Home Assistant integration on your Doorbird as well as Frigate?

blakeblackshear commented 3 years ago

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.

dredzed commented 3 years ago

Oops - spoke too soon. Problem recurred, but was working for longer this time! Here are the logs:


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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x559c7ebed0] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x55ba099d10] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtsp @ 0x55a811fea0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
ffmpeg.doorbird.detect         ERROR   : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.doorbird.detect         ERROR   : Output file #0 does not contain any stream
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. read of closed file
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...
ffmpeg.doorbird.detect         ERROR   : [segment @ 0x55a067c3e0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.doorbird.detect         ERROR   : [segment @ 0x55a069a6e0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.doorbird.detect         ERROR   : [flv @ 0x55a0694ac0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
ffmpeg.doorbird.detect         ERROR   : [flv @ 0x55a0694ac0] Failed to update header with correct duration.
ffmpeg.doorbird.detect         ERROR   : [flv @ 0x55a0694ac0] Failed to update header with correct filesize.
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x5587c126d0] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x55a63bed20] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x55827f96c0] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtsp @ 0x55bac99ea0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
ffmpeg.doorbird.detect         ERROR   : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.doorbird.detect         ERROR   : Output file #0 does not contain any stream
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x559ffc1060] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtsp @ 0x55882c7ea0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
ffmpeg.doorbird.detect         ERROR   : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.doorbird.detect         ERROR   : Output file #0 does not contain any stream
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...
ffmpeg.doorbird.detect         ERROR   : [rtsp @ 0x556f7b5ea0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
ffmpeg.doorbird.detect         ERROR   : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.doorbird.detect         ERROR   : Output file #0 does not contain any stream
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...
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] missing picture in access unit with size 17836
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
ffmpeg.doorbird.detect         ERROR   : [h264 @ 0x558b832400] no frame!
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x558b95f560] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x556be1be90] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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. read of closed file
frigate.video                  INFO    : doorbird: ffmpeg process is not running. exiting capture thread...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x55922128a0] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested
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...
ffmpeg.doorbird.detect         ERROR   : [rtmp @ 0x559207ae90] Cannot open connection tcp://127.0.0.1:1935
ffmpeg.doorbird.detect         ERROR   : rtmp://127.0.0.1/live/doorbird: Immediate exit requested```
dredzed commented 3 years ago

I’ve noticed that the stream works well during the day, and only starts causing problems when it starts to get dark. You’re probably aware that Doorbird D101 cameras have a notoriously noisy and grainy low light camera, so I wondered if this could cause ffmpeg problems in low light. The image quality is improved if the IR light is switched on. So I sent a Doorbird API request every 2 mins last night to the Doorbird to switch on the IR light (it automatically turns off after 3 mins), and for the first time, the stream stayed working overnight (although it kept dropping frames). Could this bad image quality in low light be affecting frigate in some way?

blakeblackshear commented 3 years ago

I don't think so, but "causing problems" doesn't mean much. Is it the same behavior you saw before? I don't have any issues at night with mine.

dredzed commented 3 years ago

It is exactly the same problem, I haven't solved it yet. At night time, the 24 hour recordings from Doorbird get shorter (maybe 4 or 5 seconds, not 60 second clips), and then completely stop. 24 hour recordings on my Amcrest cameras continue as normal. I'm not at home, but I will try to get some more logs if they might be useful. Once I switched on the IR camera all night, recordings and clips continued all night, albeit with dropped frames.

dredzed commented 3 years ago

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.