blakeblackshear / frigate

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

Support: KeyError 'input' on connect called - on launch #798

Closed firefly2442 closed 3 years ago

firefly2442 commented 3 years ago

Describe the bug

I'm getting errors upon launching Frigate.

$ docker logs -f 39

Fontconfig error: Cannot load default config file
On connect called
Traceback (most recent call last):
  File "detect_objects.py", line 441, in <module>
    main()
  File "detect_objects.py", line 196, in main
    ffmpeg_input = get_ffmpeg_input(ffmpeg['input'])
KeyError: 'input'
On connect called
Traceback (most recent call last):
  File "detect_objects.py", line 441, in <module>
    main()
  File "detect_objects.py", line 196, in main
    ffmpeg_input = get_ffmpeg_input(ffmpeg['input'])
KeyError: 'input'
On connect called

These continue and after a few seconds the Docker container restarts.

The troubleshooting page says the "on connect" message may be related to multiple Frigate instances trying to connect to MQTT. However, this is the only one I've launched.

Nothing else is using port 5000, verified with netstat. docker ps only shows the single container running.

Loading the RTSP stream in VLC works fine.

docker-compose.yml

version: '3.6'
services:
  frigate:
    container_name: frigate
    restart: unless-stopped
    privileged: true
    image: blakeblackshear/frigate:stable-aarch64
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /etc/localtime:/etc/localtime:ro
      - ./config:/config
      - ./clips:/media/frigate/clips
      - ./recordings:/media/frigate/recordings
    ports:
      - 5000:5000/tcp # web-interface
      - 1935:1935/tcp # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: 'frigate'
      RTSP_PASSWORD: 'password with ! in it'

I thought perhaps the RTSP password didn't like the ! so I changed the password, still the same issue.

I've pruned the config.yml file down to just the essentials from the example.

# https://blakeblackshear.github.io/frigate/configuration/index#mqtt
mqtt:
  host: 192.168.1.226
  port: 1883
# https://blakeblackshear.github.io/frigate/configuration/index#cameras
cameras:
  back:
    ffmpeg:
      global_args:
        - -hide_banner
        - -loglevel
        - info
      # https://blakeblackshear.github.io/frigate/configuration/optimizing
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m
      inputs:
        # sub-stream, lower quality and FPS
        - path: 'rtsp://admin:{RTSP_PASSWORD}@192.168.1.111:554/cam/realmonitor?channel=1&subtype=1'
          roles:
            - detect
        # full 4k stream
        # - path: 'rtsp://admin:{RTSP_PASSWORD}@192.168.1.111:554/cam/realmonitor?channel=1&subtype=0'
        #   roles:
        #     - clips
    # detect on the sub-stream for improved performance
    width: 640
    height: 480
    fps: 5
    # objects:
    #   track:
    #     - person

I've also run the YAML through two validators online to check indentation.

I have also tested connecting and posting to MQTT from the device.

$ mosquitto_pub -h 192.168.1.226 -d -t homeassistant -m "Hello world!"
Client mosq-7y4PAqdduKJZhuAGAY sending CONNECT
Client mosq-7y4PAqdduKJZhuAGAY received CONNACK (0)
Client mosq-7y4PAqdduKJZhuAGAY sending PUBLISH (d0, q0, r0, m1, 'homeassistant', ... (12 bytes))
Client mosq-7y4PAqdduKJZhuAGAY sending DISCONNECT
$ mosquitto_sub -h 192.168.1.226 -t homeassistant
Hello world!

Version of frigate https://hub.docker.com/layers/blakeblackshear/frigate/stable-aarch64/images/sha256-2ff9e5ea84ee1d4613e4b974e44596f6e231c8f21a1b1bb878c1bf458c15986a?context=explore

FFprobe from your camera

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rtsp, from 'rtsp://admin:secret@192.168.1.111:554/cam/realmonitor?channel=1&subtype=1':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 1.200000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 640x480 [SAR 126:95 DAR 168:95], 5 fps, 5 tbr, 90k tbn, 10 tbc

Computer Hardware

Camera Info:

firefly2442 commented 3 years ago

Switched to the more recent blakeblackshear/frigate:0.8.1-aarch64 version and was able to get it working. I didn't realize blakeblackshear/frigate:stable-aarch64 is like 4 months old. Maybe time to update the docs?