blakeblackshear / frigate

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

[Support]: Very high CPU usage with Coral GPU #4467

Closed COUBOT closed 1 year ago

COUBOT commented 1 year ago

Describe the problem you are having

Hey

I have a lot of problems setting up Frigate correctly.

I have two different Reolink cameras and the Coral GPU. I thought I had everything set up correctly, but apparently not.

I have enabled hardware acceleration, set detection size to the size seen in VLC and have set up motion masks for bushes etc. .

But the CPU usage is extremly high and Homeassistant crashes often. image

Can you help me?

Version

0.11.1-2EADA21

Frigate config file

detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: 192.168.178.67
  user: mqtt-user
  password: [PW]

birdseye:
  enabled: True
  mode: continuous

ffmpeg:
      hwaccel_args: -c:v h264_v4l2m2m
cameras:
  Vordergarten_Frigate:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - +genpts+discardcorrupt
        - -flags
        - low_delay
        - -strict
        - experimental
        - -analyzeduration
        - 1000M
        - -probesize
        - 1000M
        - -rw_timeout
        - "5000000"
      inputs:
        - path: http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=[PW]
          roles:
            - record
            - rtmp
        - path: http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=[PW]
          roles:
            - detect
    rtmp:
        enabled: False
    detect:
      width: 640
      height: 368
      fps: 5
    objects:
        track:
            - person
            - cat
            - bicycle

            - bird
    snapshots:
        enabled: true
        timestamp: false
        bounding_box: true
        retain:
            default: 5
        required_zones:
                - Vordergarten
    record:
        enabled: true
        events:
            required_zones:
                - Vordergarten
            retain:
                default: 5
    motion:
      mask:
        - 0,368,600,368,582,309,570,253,518,222,473,239,457,283,475,327,419,311,379,268,344,233,311,216,264,230,234,228,207,305,168,298,111,293,67,235,22,153,0,69
        - 410,0,411,23,224,23,223,0
    zones:
      Vordergarten:
        coordinates: 106,297,196,298,230,216,354,218,448,332,462,251,513,221,640,368,640,45,588,56,407,78,341,82,278,91,193,106,127,123,83,128,92,158,33,175
        objects:
        - person
        - cat

  Hintergarten_Frigate:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - +genpts+discardcorrupt
        - -flags
        - low_delay
        - -strict
        - experimental
        - -analyzeduration
        - 1000M
        - -probesize
        - 1000M
        - -rw_timeout
        - "5000000"
      inputs:
        - path: http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=[PW]
          roles:
            - record
            - rtmp
        - path: http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=[PW]
          roles:
            - detect
    rtmp:
        enabled: False
    detect:
      width: 640
      height: 368
      fps: 5
    objects:
        track:
            - person
            - cat
            - bicycle
            - bird
    snapshots:
        enabled: true
        timestamp: false
        bounding_box: true
        retain:
            default: 5

    record:
        enabled: true
        events:
            required_zones:
                - Vordergarten
            retain:
                default: 5

Relevant log output

-

FFprobe output from your camera

-

Frigate stats

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "continuous",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "Hintergarten_Frigate": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": true,
        "mode": "continuous"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 368,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 640
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": "-c:v h264_v4l2m2m",
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-flags",
          "low_delay",
          "-strict",
          "experimental",
          "-analyzeduration",
          "1000M",
          "-probesize",
          "1000M",
          "-rw_timeout",
          "5000000"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456",
            "roles": [
              "record",
              "rtmp"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456",
            "roles": [
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -c:v h264_v4l2m2m -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Hintergarten_Frigate-%Y%m%d%H%M%S.mp4",
          "roles": [
            "record",
            "rtmp"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -c:v h264_v4l2m2m -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456 -r 5 -s 640x368 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": "",
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "Hintergarten_Frigate",
      "objects": {
        "filters": {
          "bicycle": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "bird": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "cat": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "cat",
          "bicycle",
          "bird"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [
            "Vordergarten"
          ],
          "retain": {
            "default": 5,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 5,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {}
    },
    "Vordergarten_Frigate": {
      "best_image_timeout": 60,
      "birdseye": {
        "enabled": true,
        "mode": "continuous"
      },
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 368,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 640
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": "-c:v h264_v4l2m2m",
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-flags",
          "low_delay",
          "-strict",
          "experimental",
          "-analyzeduration",
          "1000M",
          "-probesize",
          "1000M",
          "-rw_timeout",
          "5000000"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=123456",
            "roles": [
              "record",
              "rtmp"
            ]
          },
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=123456",
            "roles": [
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -c:v h264_v4l2m2m -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=123456 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Vordergarten_Frigate-%Y%m%d%H%M%S.mp4",
          "roles": [
            "record",
            "rtmp"
          ]
        },
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -c:v h264_v4l2m2m -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000 -i http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=123456 -r 5 -s 640x368 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 30,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 50,
        "improve_contrast": false,
        "mask": [
          "0,368,600,368,582,309,570,253,518,222,473,239,457,283,475,327,419,311,379,268,344,233,311,216,264,230,234,228,207,305,168,298,111,293,67,235,22,153,0,69",
          "410,0,411,23,224,23,223,0"
        ],
        "mqtt_off_delay": 30,
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "Vordergarten_Frigate",
      "objects": {
        "filters": {
          "bicycle": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "bird": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "cat": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "person": {
            "mask": null,
            "max_area": 24000000,
            "max_ratio": 24000000,
            "min_area": 0,
            "min_ratio": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person",
          "cat",
          "bicycle",
          "bird"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [
            "Vordergarten"
          ],
          "retain": {
            "default": 5,
            "mode": "motion",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [
          "Vordergarten"
        ],
        "retain": {
          "default": 5,
          "mode": "motion",
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "ui": {
        "dashboard": true,
        "order": 0
      },
      "zones": {
        "Vordergarten": {
          "coordinates": "106,297,196,298,230,216,354,218,448,332,462,251,513,221,640,368,640,45,588,56,407,78,341,82,278,91,193,106,127,123,83,128,92,158,33,175",
          "filters": {},
          "objects": [
            "person",
            "cat"
          ]
        }
      }
    }
  },
  "database": {
    "path": "/media/frigate/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": null,
    "stationary": {
      "interval": 0,
      "max_frames": {
        "default": null,
        "objects": {}
      },
      "threshold": null
    },
    "width": 1280
  },
  "detectors": {
    "coral": {
      "device": "usb",
      "num_threads": 3,
      "type": "edgetpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": [
      "-hide_banner",
      "-loglevel",
      "warning"
    ],
    "hwaccel_args": "-c:v h264_v4l2m2m",
    "input_args": [
      "-avoid_negative_ts",
      "make_zero",
      "-fflags",
      "+genpts+discardcorrupt",
      "-rtsp_transport",
      "tcp",
      "-timeout",
      "5000000",
      "-use_wallclock_as_timestamps",
      "1"
    ],
    "output_args": {
      "detect": [
        "-f",
        "rawvideo",
        "-pix_fmt",
        "yuv420p"
      ],
      "record": [
        "-f",
        "segment",
        "-segment_time",
        "10",
        "-segment_format",
        "mp4",
        "-reset_timestamps",
        "1",
        "-strftime",
        "1",
        "-c",
        "copy",
        "-an"
      ],
      "rtmp": [
        "-c",
        "copy",
        "-f",
        "flv"
      ]
    }
  },
  "live": {
    "height": 720,
    "quality": 8
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "192.168.178.67",
    "password": "2883",
    "port": 1883,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": "mqtt-user"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "plus": {
    "enabled": false
  },
  "record": {
    "enabled": false,
    "events": {
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 10,
        "mode": "motion",
        "objects": {}
      }
    },
    "expire_interval": 60,
    "retain": {
      "days": 0,
      "mode": "all"
    },
    "retain_days": null
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": false,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 10,
      "mode": "motion",
      "objects": {}
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  },
  "ui": {
    "use_experimental": false
  }
}

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Reolink RLC-811A and Reolink Duo 2 PoE

Any other information that may be helpful

I'm running Home Assistant OS on an Rasbperry Pi 4 2GB

NickM-27 commented 1 year ago

It'll be helpful if you can use top inside of the frigate container docker exec -it addon_ccab4aaf_frigate-fa top so we can see what processes are using high amounts of CPU.

NickM-27 commented 1 year ago

also please include logs after frigate has run for a bit

COUBOT commented 1 year ago

It'll be helpful if you can use top inside of the frigate container docker exec -it addon_ccab4aaf_frigate-fa top so we can see what processes are using high amounts of CPU.

Thanks for the quick reply. But I'm pretty new with this kind of stuff and have no clue where to put "docker exec -it addon_ccab4aaf_frigate-fa top".

NickM-27 commented 1 year ago

You need a shell in HA OS whether that is local or via SSH / terminal

COUBOT commented 1 year ago

I got this: image

NickM-27 commented 1 year ago

Okay do

docker exec -it addon_ccab4aaf_frigate-fa apt-get update docker exec -it addon_ccab4aaf_frigate-fa apt-get install -y procps docker exec -it addon_ccab4aaf_frigate-fa top

COUBOT commented 1 year ago

Okay do

docker exec -it addon_ccab4aaf_frigate-fa apt-get update docker exec -it addon_ccab4aaf_frigate-fa apt-get install -y procps docker exec -it addon_ccab4aaf_frigate-fa top

this worked: image

NickM-27 commented 1 year ago

Is there more to the screenshot or can you scroll it to the right? The first ffmpeg process is using a lot of CPU. also please include logs from frigate.

COUBOT commented 1 year ago

No, there is nothing more to see on the screenshot.

Here is the log: [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. [2022-11-21 23:43:31] frigate.app INFO : Starting Frigate (0.11.1-2eada21) [2022-11-21 23:43:31] frigate.app INFO : Creating directory: /tmp/cache Starting migrations [2022-11-21 23:43:31] peewee_migrate INFO : Starting migrations There is nothing to migrate [2022-11-21 23:43:31] peewee_migrate INFO : There is nothing to migrate [2022-11-21 23:43:31] frigate.app INFO : Output process started: 218 [2022-11-21 23:43:31] detector.coral INFO : Starting detection process: 217 [2022-11-21 23:43:31] frigate.edgetpu INFO : Attempting to load TPU as usb [2022-11-21 23:43:31] frigate.app INFO : Camera processor started for Vordergarten_Frigate: 221 [2022-11-21 23:43:31] frigate.app INFO : Camera processor started for Hintergarten_Frigate: 223 [2022-11-21 23:43:31] frigate.app INFO : Capture process started for Vordergarten_Frigate: 224 [2022-11-21 23:43:31] ws4py INFO : Using epoll [2022-11-21 23:43:31] frigate.app INFO : Capture process started for Hintergarten_Frigate: 228 [2022-11-21 23:43:31] ws4py INFO : Using epoll [2022-11-21 23:43:34] frigate.edgetpu INFO : TPU found [2022-11-21 23:45:00] ws4py INFO : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:49092] [2022-11-21 23:45:06] ws4py INFO : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:49092] [2022-11-21 23:58:41] ffmpeg.Vordergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:58:41] watchdog.Vordergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:58:41] watchdog.Vordergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:58:41] ffmpeg.Hintergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:58:41] watchdog.Hintergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:58:41] watchdog.Hintergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:58:51] ffmpeg.Vordergarten_Frigate.record_rtmp ERROR : [tcp @ 0x55a8a885e0] Connection to tcp://192.168.178.50:80 failed: Connection timed out [2022-11-21 23:58:51] ffmpeg.Vordergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:58:51] watchdog.Vordergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:58:51] watchdog.Vordergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:58:51] ffmpeg.Hintergarten_Frigate.record_rtmp ERROR : [tcp @ 0x559520a5e0] Connection to tcp://192.168.178.50:80 failed: Connection timed out [2022-11-21 23:58:51] ffmpeg.Hintergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:58:51] watchdog.Hintergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:58:51] watchdog.Hintergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:59:01] ffmpeg.Vordergarten_Frigate.record_rtmp ERROR : [tcp @ 0x557d7c15e0] Connection to tcp://192.168.178.50:80 failed: Connection timed out [2022-11-21 23:59:01] ffmpeg.Vordergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:59:01] watchdog.Vordergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:59:01] watchdog.Vordergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:59:01] ffmpeg.Hintergarten_Frigate.record_rtmp ERROR : [tcp @ 0x55b4c755e0] Connection to tcp://192.168.178.50:80 failed: Connection timed out [2022-11-21 23:59:01] ffmpeg.Hintergarten_Frigate.record_rtmp ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:59:01] watchdog.Hintergarten_Frigate INFO : Terminating the existing ffmpeg process... [2022-11-21 23:59:01] watchdog.Hintergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:59:15] frigate.video ERROR : Vordergarten_Frigate: Unable to read frames from ffmpeg process. [2022-11-21 23:59:15] frigate.video ERROR : Vordergarten_Frigate: ffmpeg process is not running. exiting capture thread... [2022-11-21 23:59:21] watchdog.Vordergarten_Frigate ERROR : Ffmpeg process crashed unexpectedly for Vordergarten_Frigate. [2022-11-21 23:59:21] watchdog.Vordergarten_Frigate ERROR : The following ffmpeg logs include the last 100 lines prior to exit. [2022-11-21 23:59:21] ffmpeg.Vordergarten_Frigate.detect ERROR : [flv @ 0x5596329c80] Packet corrupt (stream = 0, dts = 895132), dropping it. [2022-11-21 23:59:21] ffmpeg.Vordergarten_Frigate.detect ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:59:21] ffmpeg.Vordergarten_Frigate.detect ERROR : Last message repeated 6 times [2022-11-21 23:59:21] watchdog.Hintergarten_Frigate INFO : No frames received from Hintergarten_Frigate in 20 seconds. Exiting ffmpeg... [2022-11-21 23:59:21] watchdog.Hintergarten_Frigate INFO : Waiting for ffmpeg to exit gracefully... [2022-11-21 23:59:27] frigate.video ERROR : Hintergarten_Frigate: Unable to read frames from ffmpeg process. [2022-11-21 23:59:27] frigate.video ERROR : Hintergarten_Frigate: ffmpeg process is not running. exiting capture thread... [2022-11-21 23:59:37] watchdog.Hintergarten_Frigate ERROR : Ffmpeg process crashed unexpectedly for Hintergarten_Frigate. [2022-11-21 23:59:37] watchdog.Hintergarten_Frigate ERROR : The following ffmpeg logs include the last 100 lines prior to exit. [2022-11-21 23:59:37] ffmpeg.Hintergarten_Frigate.detect ERROR : More than 1000 frames duplicated [2022-11-21 23:59:37] ffmpeg.Hintergarten_Frigate.detect ERROR : [flv @ 0x55cd601c80] Packet corrupt (stream = 0, dts = 882160), dropping it. [2022-11-21 23:59:37] ffmpeg.Hintergarten_Frigate.detect ERROR : http://192.168.178.50/flv?port=1935&app=bcs&stream=channel1_sub.bcs&user=admin&password=123456: Connection timed out [2022-11-21 23:59:37] ffmpeg.Hintergarten_Frigate.detect ERROR : Last message repeated 2 times [2022-11-21 23:59:38] ws4py INFO : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:55602] [2022-11-21 23:59:41] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:33116] [2022-11-21 23:59:44] ws4py INFO : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:55602] [2022-11-21 23:59:44] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:33116]

NickM-27 commented 1 year ago

You should be able to run top and use the right arrow key to move the row to the right and see which ffmpeg process that is.

Otherwise, a screenshot of the debug page will be helpful and the output from /API/stats

COUBOT commented 1 year ago

That's the whole page I'm seeing. If I press the right arrow key, the table moves and hides in the left. image And the Debug Page: image

NickM-27 commented 1 year ago

Ah that's only a feature of htop.

If you can go to `/API/stats and paste the output here that should give what I need to know which camera it is.

COUBOT commented 1 year ago

Yeah, HA just crashed. I need a bit. Is `/API/stats also in SSH?

NickM-27 commented 1 year ago

Do that in the browser. Like if you're looking at /debug replace /debug with /API/stats

COUBOT commented 1 year ago

I'm sorry but I can't find it. Do you mean the SCS Server Browser?

NickM-27 commented 1 year ago

No I mean web browser

COUBOT commented 1 year ago

So http://homeassistant.local:8123/api/stats?

NickM-27 commented 1 year ago

I don't think so, where do you view the frigate UI?

COUBOT commented 1 year ago

like this http://homeassistant.local:8123/ccab4aaf_frigate-fa/dashboard

NickM-27 commented 1 year ago

maybe try http://homeassistant.local:8123/ccab4aaf_frigate-fa/dashboard/api/stats otherwise you'd need to do http://homeassistant.local:5000/api/stats but that would require enabled the 5000 port mapping in frigate addon options

COUBOT commented 1 year ago

the last one worked:

{"Hintergarten_Frigate":{"camera_fps":0.0,"capture_pid":232,"detection_fps":0.0,"pid":226,"process_fps":0.0,"skipped_fps":0.0},"Vordergarten_Frigate":{"camera_fps":0.0,"capture_pid":228,"detection_fps":0.0,"pid":225,"process_fps":0.0,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":10.0,"pid":216}},"service":{"latest_version":"0.11.1","storage":{"/dev/shm":{"free":875.8,"mount_type":"tmpfs","total":876.2,"used":0.4},"/media/frigate/clips":{"free":206984.6,"mount_type":"ext4","total":235527.2,"used":18931.5},"/media/frigate/recordings":{"free":206984.6,"mount_type":"ext4","total":235527.2,"used":18931.5},"/tmp/cache":{"free":876.2,"mount_type":"tmpfs","total":876.2,"used":0.0}},"temperatures":{},"uptime":1,"version":"0.11.1-2eada21"}}

NickM-27 commented 1 year ago

Thanks for that, that is helpful. Can you show a screenshot of the VLC resolution output for each camera subsream

COUBOT commented 1 year ago

Of course

The First one: image And the second one: image

COUBOT commented 1 year ago

I just saw I copy pasted wrong resolutions.

NickM-27 commented 1 year ago

Yes, that looks to be the issue. Should be 640x360 and 1536x576

COUBOT commented 1 year ago

image Thats sooooo awkward

But thank you very much for your patience

NickM-27 commented 1 year ago

Awesome that's much better. I'll go ahead and close this then 👍