blakeblackshear / frigate

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

Distorted/Green screen when 2 cameras of the same type are added #1381

Closed reimerm closed 3 years ago

reimerm commented 3 years ago

Describe the bug When adding another IP camera of the same make/model (Reolink E1 Pro) the first camera gets distorted. Removing the 2nd camera from the config restores screen for the first and vice versa - this seems to some kind of interaction between frigate and the camera as reboot the one affected camera seems to work too though in other CCTV software (see additional comments) it works fine

Version of frigate 0.8.4-5043040

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

  host: somehost
  user: MQTT
  password: xxx
cameras:
  livingroom:
    ffmpeg:
      inputs:
        - path: rtsp://frigate:xxx!@192.168.4.91:554//h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://frigate:xxx!@192.168.4.91:554//h264Preview_01_main
          roles:
            - clips
    width: 640
    height: 352
    fps: 7
  spare:
    ffmpeg:
      inputs:
        - path: rtsp://frigate:xxx!@192.168.4.92:554//h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://frigate:xxx!@192.168.4.92:554//h264Preview_01_main
          roles:
            - clips
    width: 640
    height: 352
    fps: 7
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
detectors:
  coral:
    type: edgetpu
    device: usb
clips:
  max_seconds: 300
  tmpfs_cache_size: 512m
  retain:
    default: 10
    objects:
      person: 15

Frigate container logs

[h264 @ 0x561d6c860e00] error while decoding MB 136 11, bytestream -15

[h264 @ 0x561d6c860e00] cabac decode of qscale diff failed at 147 2

[h264 @ 0x561d6c860e00] error while decoding MB 147 2, bytestream 427274

[h264 @ 0x561d6c860e00] error while decoding MB 89 55, bytestream -7

[h264 @ 0x55b383300e00] error while decoding MB 0 55, bytestream -7

[h264 @ 0x55abaf8d3e00] error while decoding MB 51 18, bytestream -21

[h264 @ 0x55abaf8d3e00] cabac decode of qscale diff failed at 99 1

[h264 @ 0x55abaf8d3e00] error while decoding MB 99 1, bytestream 423591

[h264 @ 0x55abaf8d3e00] error while decoding MB 26 51, bytestream -7

[h264 @ 0x5650b596de00] error while decoding MB 21 6, bytestream -5

[h264 @ 0x5650b596de00] left block unavailable for requested intra mode
[h264 @ 0x5650b596de00] error while decoding MB 0 2, bytestream 494267

[h264 @ 0x55c5b120ee00] error while decoding MB 81 40, bytestream -7

[h264 @ 0x55c5b120ee00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x55c5b120ee00] error while decoding MB 0 2, bytestream 282167

[h264 @ 0x55c5b120ee00] top block unavailable for requested intra mode -1
[h264 @ 0x55c5b120ee00] error while decoding MB 40 0, bytestream 57683

[h264 @ 0x55c5b120ee00] error while decoding MB 132 51, bytestream -9

[h264 @ 0x55c5b120ee00] error while decoding MB 155 43, bytestream -7

[h264 @ 0x55b8634dee00] error while decoding MB 85 18, bytestream -5

[h264 @ 0x55b8634dee00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x55b8634dee00] error while decoding MB 0 2, bytestream 400084

[h264 @ 0x55b8634dee00] error while decoding MB 74 36, bytestream -7

[h264 @ 0x562068156e00] error while decoding MB 37 52, bytestream -29

[h264 @ 0x55d218039e00] error while decoding MB 22 7, bytestream -21

[h264 @ 0x55d218039e00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x55d218039e00] error while decoding MB 0 2, bytestream 466101

[h264 @ 0x55d218039e00] error while decoding MB 26 31, bytestream -5

[h264 @ 0x55d218039e00] error while decoding MB 137 27, bytestream -5

[h264 @ 0x55d218039e00] error while decoding MB 159 38, bytestream -5

[h264 @ 0x561e05a15e00] error while decoding MB 146 10, bytestream -19

[h264 @ 0x561e05a15e00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x561e05a15e00] error while decoding MB 0 3, bytestream 404146

[h264 @ 0x55eb5f376e00] error while decoding MB 146 23, bytestream -13

[h264 @ 0x55eb5f376e00] left block unavailable for requested intra mode
[h264 @ 0x55eb5f376e00] error while decoding MB 0 2, bytestream 392906

[h264 @ 0x55eb5f376e00] error while decoding MB 141 60, bytestream -5

[h264 @ 0x55cf21ff9e00] error while decoding MB 129 11, bytestream -13

[h264 @ 0x55cf21ff9e00] left block unavailable for requested intra mode
[h264 @ 0x55cf21ff9e00] error while decoding MB 0 2, bytestream 466977

[h264 @ 0x55cf21ff9e00] error while decoding MB 144 52, bytestream -5

[h264 @ 0x55cf21ff9e00] error while decoding MB 118 55, bytestream -5

[h264 @ 0x5629e501de00] error while decoding MB 19 13, bytestream -7

[h264 @ 0x5629e501de00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x5629e501de00] error while decoding MB 0 2, bytestream 301361

[h264 @ 0x55fd7e1aae00] left block unavailable for requested intra mode
[h264 @ 0x55fd7e1aae00] error while decoding MB 0 14, bytestream 16378

[h264 @ 0x55950d9aee00] error while decoding MB 16 4, bytestream -17

[h264 @ 0x560664eaae00] error while decoding MB 121 18, bytestream -7

[h264 @ 0x562564c5ae00] error while decoding MB 22 35, bytestream -25

[h264 @ 0x55b9e8560e00] error while decoding MB 121 43, bytestream -17

[h264 @ 0x55b9e8560e00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x55b9e8560e00] error while decoding MB 0 2, bytestream 451024

[h264 @ 0x55b9e8560e00] error while decoding MB 111 52, bytestream -7

[h264 @ 0x55af8683ae00] error while decoding MB 19 4, bytestream -25

[h264 @ 0x55d2b72a8e00] error while decoding MB 119 8, bytestream -7

[h264 @ 0x55d2b72a8e00] cabac decode of qscale diff failed at 102 1

[h264 @ 0x55d2b72a8e00] error while decoding MB 102 1, bytestream 391598

[h264 @ 0x56488814ee00] error while decoding MB 126 7, bytestream -5

[h264 @ 0x5575530f7e00] error while decoding MB 81 5, bytestream -15

[h264 @ 0x5575530f7e00] left block unavailable for requested intra mode
[h264 @ 0x5575530f7e00] error while decoding MB 0 2, bytestream 370906

[h264 @ 0x55a6516a9e00] error while decoding MB 35 18, bytestream -17

[h264 @ 0x558f62113e00] error while decoding MB 85 8, bytestream -21

[h264 @ 0x558f62113e00] left block unavailable for requested intra mode
[h264 @ 0x558f62113e00] error while decoding MB 0 84, bytestream 48499

[h264 @ 0x55660b666e00] error while decoding MB 101 1, bytestream -13

[h264 @ 0x55660b666e00] left block unavailable for requested intra mode
[h264 @ 0x55660b666e00] error while decoding MB 0 2, bytestream 410388

[h264 @ 0x55a5661c7e00] error while decoding MB 149 16, bytestream -17

[h264 @ 0x55d2dc342e00] error while decoding MB 51 13, bytestream -7

[h264 @ 0x55d2dc342e00] cabac decode of qscale diff failed at 95 1

[h264 @ 0x55d2dc342e00] error while decoding MB 95 1, bytestream 340712

[h264 @ 0x561595d62e00] error while decoding MB 37 23, bytestream -11

[h264 @ 0x55e36c86de00] error while decoding MB 63 1, bytestream -7

Frigate stats

{
  "spare": {
    "camera_fps": 7.2, 
    "capture_pid": 53, 
    "detection_fps": 0.0, 
    "pid": 43, 
    "process_fps": 7.2, 
    "skipped_fps": 0.0
  }, 
  "detection_fps": 14.6, 
  "detectors": {
    "coral": {
      "detection_start": 0.0, 
      "inference_speed": 7.86, 
      "pid": 36
    }
  }, 
  "livingroom": {
    "camera_fps": 107.1, 
    "capture_pid": 44, 
    "detection_fps": 14.6, 
    "pid": 39, 
    "process_fps": 16.8, 
    "skipped_fps": 0.0
  }, 
  "service": {
    "storage": {
      "/dev/shm": {
        "free": 5366.4, 
        "mount_type": "tmpfs", 
        "total": 5368.7, 
        "used": 2.3
      }, 
      "/media/frigate/clips": {
        "free": 2347459.4, 
        "mount_type": "fuse.shfs", 
        "total": 8001563.2, 
        "used": 5654582.9
      }, 
      "/media/frigate/recordings": {
        "free": 2347459.4, 
        "mount_type": "fuse.shfs", 
        "total": 8001563.2, 
        "used": 5654582.9
      }, 
      "/tmp/cache": {
        "free": 6993.5, 
        "mount_type": "rootfs", 
        "total": 8263.9, 
        "used": 1270.4
      }
    }, 
    "uptime": 410, 
    "version": "0.8.4-5043040"
  }, 
}

FFprobe from your camera

Run the following command and paste output below camera 1

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://frigate:xxx!@192.168.4.91:554//h264Preview_01_sub':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_sub
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 640x352, 12 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp

camera 2

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://frigate:xxx!@192.168.4.92:554//h264Preview_01_sub':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_sub
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 640x352, 120 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp

Screenshots image

Computer Hardware

Camera Info:

Additional Comments: Cams themself as they are WiFi but work fine in VLC, Blue Iris, Reolink App, Shinobi, iSpycam etc. and rebooting the cameras seems to remediate the issue until container restarts.

blakeblackshear commented 3 years ago

The capture fps is very high on one of your cameras. Have you tried the recommended parameters with the rtmp feeds for Reolink?

reimerm commented 3 years ago

updated the comments as a reboot of the camera fixed it again. the fps itself of camera should be 7 - also saw the fps in ffprobe and was wondering how that could have happend. Before rebooting check it in VLC and reolink in this instance and both streams were fine.

image

blakeblackshear commented 3 years ago

This issue may be helpful: https://github.com/blakeblackshear/frigate/issues/1249#issuecomment-864394891

reimerm commented 3 years ago

Fixed it for now by restarting the cameras daily