blakeblackshear / frigate

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

[Support]: HomeAssistant camera entity live stream blank, birdseye blank screen with frigate logo #2649

Closed Ming-A closed 2 years ago

Ming-A commented 2 years ago

Describe the problem you are having

After setting up a reverse proxy (traefik) with frigate on docker-compose, the addon on home assistant doesn't show the live stream when clicked into the entity like before, it just shows up a grey screen, but the display/image does update every few minutes.

Besides that, as for the zones, both has only been detecting person and no cars or motorcycle along with birdseye just being a black screen with frigate logo in the middle.

Version

0.9.4-26AE608

Frigate config file

mqtt:
  host: IP
  user: USER
  password: PASSWORD
database:
  path: /media/frigate/database/frigate.db
birdseye:
  enabled: True
detect:
  width: 1920
  height: 1080
  fps: 5
  enabled: True
record:
  enabled: True
  retain_days: 28
  events:
    max_seconds: 300
    # Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
    required_zones: []
    # Optional: Retention settings for recordings of events
    retain:
      # Required: Default retention days (default: shown below)
      default: 10
snapshots:
  enabled: True
  # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
  required_zones: []
  retain:
    # Required: Default retention days (default: shown below)
    default: 10
cameras:
    carport-front:
        ffmpeg:
          inputs:
            - path: rtsp://[]:[]@10.69.25.10:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1
              roles:
                - detect
                - rtmp
        zones:
          insidecarport:
            coordinates: 1920,1080,1920,933,1841,747,1704,495,1351,257,0,276,0,1080
            objects:
              - person
              - motorcycle
          outsidecarport:
            coordinates: 713,260,1255,240,1684,436,1920,866,1920,0,0,0,0,346
            objects:
              - car
              - person
              - motorcycle

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-01-14 03:01:36] frigate.app                    INFO    : Starting Frigate (0.9.4-26ae608)
[2022-01-14 03:01:36] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-01-14 03:01:36] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-01-14 03:01:36] peewee_migrate                 INFO    : There is nothing to migrate
[2022-01-14 03:01:37] detector.cpu1                  INFO    : Starting detection process: 216
[2022-01-14 03:01:37] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-01-14 03:01:37] detector.cpu2                  INFO    : Starting detection process: 218
[2022-01-14 03:01:37] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-01-14 03:01:37] ws4py                          INFO    : Using epoll
[2022-01-14 03:01:37] frigate.app                    INFO    : Output process started: 220
[2022-01-14 03:01:37] frigate.mqtt                   INFO    : MQTT connected
[2022-01-14 03:01:37] frigate.app                    INFO    : Camera processor started for carport-front: 227
[2022-01-14 03:01:37] frigate.app                    INFO    : Capture process started for carport-front: 230
[2022-01-14 03:01:37] ws4py                          INFO    : Using epoll
[2022-01-14 03:02:05] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:50904]
[2022-01-14 03:02:06] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:43350]
[2022-01-14 03:02:07] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:43350]
[2022-01-14 03:02:08] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:43364]
[2022-01-14 03:02:09] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:43364]
Exception in thread recording_cleanup:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/opt/frigate/frigate/record.py", line 310, in run
    self.expire_files()
  File "/opt/frigate/frigate/record.py", line 280, in expire_files
    oldest_timestamp = p.stat().st_mtime - 1
  File "/usr/lib/python3.8/pathlib.py", line 1198, in stat
    return self._accessor.stat(self)
FileNotFoundError: [Errno 2] No such file or directory: '/media/frigate/recordings/2022-01/03/08/carport-front/06.26.mp4'
[2022-01-14 03:03:49] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:50904]
[2022-01-14 03:13:50] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:52012]
[2022-01-14 03:15:50] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:52012]
[2022-01-15 00:37:59] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:55048]
[2022-01-15 00:38:03] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:55048]
[2022-01-15 01:07:20] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56988]
[2022-01-15 01:07:25] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49450]
[2022-01-15 01:07:27] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49450]
[2022-01-15 01:07:58] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49576]
[2022-01-15 01:07:59] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49576]
[2022-01-15 01:07:59] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49582]
[2022-01-15 01:08:04] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49582]
[2022-01-15 01:08:31] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49718]
[2022-01-15 01:08:33] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49718]
[2022-01-15 01:08:54] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49848]
[2022-01-15 01:08:55] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:49848]
[2022-01-15 01:09:00] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56988]
[2022-01-15 15:23:53] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39744]
[2022-01-15 15:23:56] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:60424]
[2022-01-15 15:24:00] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:60424]
[2022-01-15 15:24:00] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39744]
[2022-01-15 15:24:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39762]
[2022-01-15 15:24:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:60438]
[2022-01-15 15:25:45] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39762]
[2022-01-15 15:33:58] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:60438]
[2022-01-15 15:37:42] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:40560]
[2022-01-15 15:38:46] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:40560]
[2022-01-15 22:55:14] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:38650]
[2022-01-15 22:55:26] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59344]
[2022-01-15 22:55:28] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59344]
[2022-01-15 22:57:10] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:38650]
[2022-01-15 22:59:21] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59670]
[2022-01-15 22:59:23] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59670]
[2022-01-15 22:59:29] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59684]
[2022-01-15 22:59:30] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:59684]

FFprobe output from your camera

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://[]:[]@10.69.25.10:554/Streaming/Channels/101?transportmode=unicast':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.080000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 1920x1080, 25 tbr, 90k tbn, 180k tbc

Frigate stats

No response

Operating system

Other

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

HIKVISION DS-2CD1023G0E-I(L)

Any other information that may be helpful

Docker-Compose:



services:
  frigate:
    image: blakeblackshear/frigate:stable-amd64
    container_name: frigate2
    privileged: true
    shm_size: "64mb"
    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    environment:
      FRIGATE_RTSP_PASSWORD: "password"
      - TZ=Asia/Kuala_Lumpur
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    volumes:
      - /etc/localtime:/etc/localtime
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /mnt/CCTV/frigate/clips:/media/frigate/clips
      - /home/mingsoonang/frigate/database:/media/frigate/database
      - /mnt/CCTV/frigate/recordings:/media/frigate/recordings
      - /home/mingsoonang/frigate/config:/config
      - /mnt/CCTV:/media/frigate

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.frigate.entrypoints=http"
      - "traefik.http.routers.frigate.rule=Host(`LINK`)"
      - "traefik.http.middlewares.frigate-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.frigate.middlewares=frigate-https-redirect"
      - "traefik.http.routers.frigate-secure.entrypoints=https"
      - "traefik.http.routers.frigate-secure.rule=Host(`LINK`)"
      - "traefik.http.routers.frigate-secure.tls=true"
      - "traefik.http.routers.frigate-secure.service=frigate"
      - "traefik.http.services.frigate.loadbalancer.server.port=5000"
      - "traefik.docker.network=proxy"

networks:
  proxy:
    external: true
NickM-27 commented 2 years ago

Not sure about your other issues, but for the car and motorcyle, as per the docs you need to also define the objects you are tracking for in the objects list of the camera, not just the zone level. The zone level is for filtering out the ones that are set to be tracked at the camera / global level.

Ming-A commented 2 years ago

Not sure about your other issues, but for the car and motorcyle, as per the docs you need to also define the objects you are tracking for in the objects list of the camera, not just the zone level. The zone level is for filtering out the ones that are set to be tracked at the camera / global level.

I have added objects and I see them under tracked objects now, thank you :)

NickM-27 commented 2 years ago

@Ming-A Glad that worked! Also as per the docs, for the birdseye view, cameras will only show up if they have tracked an object in the last 30 seconds. If you want the birdseye to show all cameras continuously then you will need to adjust your configuration file.

# Optional: birdseye configuration
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # Optional: Width of the output resolution (default: shown below)
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  # Optional: Mode of the view. Available options are: objects, motion, and continuous
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: objects
Ming-A commented 2 years ago

@Ming-A Glad that worked! Also as per the docs, for the birdseye view, cameras will only show up if they have tracked an object in the last 30 seconds. If you want the birdseye to show all cameras continuously then you will need to adjust your configuration file.

# Optional: birdseye configuration
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # Optional: Width of the output resolution (default: shown below)
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  # Optional: Mode of the view. Available options are: objects, motion, and continuous
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: objects

I see, seems like I missed some stuff out, changed the mode to continuous, and its working now :) as for my home assistant issue, its prob cause of the port 1935 for RTMP feeds, if I get that fixed in my docker-compose then all should be good.

Thanks again for helping out, much appreciated

edit: got it working finally, just had to fix some port issues