blakeblackshear / frigate

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

Camera feed green + several other errors. Please help? #348

Closed asemev closed 3 years ago

asemev commented 3 years ago

First of all, big thank you for making this! I have been dreaming of such a solution for 2 years now and finally you did it! 👍 I would be eternally grateful if you can help me out. Thank you Blake!

Describe the bug I have experienced several issues:

  1. When i use my Samsung Hanwha Techwin camera, the video feed is green. So when i check the URL http://192.168.178.84:5000/Garage, i just see green screen. Ps see attached screenshot below. With my ezviz camera it works very well. So it must be some camera codec issue with the HANWHA camera perhaps?

  2. In general, the ffmepg HW acceleration or any of the global parameters always cause errors. so i removed them all. Also the frigate logs showed error with your default config version because perhaps the ffmpeg arguments have double entries (one in the upper part in the ffmpeg's own config section and then again in the camera section). Removing all these made the frigate work. I just cannot get the ffmpeg HW acceleration working. Tried it with the Raspi3/4 64bit version.

  3. I made frigate detection work with another camera (EZVIZ CTQ3W) but i constantly get over 100% CPU even though i'm using the Coral accelerator. Is this normal?

  4. The logs always show the following error everytime it starts. "Fontconfig error: Cannot load default config file". Is this normal?

  5. I also continuously get "On connect called" but i dont see the docker container running multiple times.

Version of frigate 1.3

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

detectors:
  coral:
    type: edgetpu
    device: usb
save_clips:
  clips_dir: /media/frigate
mqtt:
  host: core-mosquitto.local.hass.io
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: **XXXXXXX**
  password: **XXXXXXXX**
ffmpeg: {}
cameras:
  Garage:
    ffmpeg:
      input: 'rtsp://192.168.178.234/profile1/media.smp'
    height: 1080
    width: 1920
    fps: 5
    best_image_timeout: 60
    mqtt:
      crop_to_region: true
      snapshot_height: 300
    save_clips:
      enabled: false
      pre_capture: 30
      objects:
        - person
    snapshots:
      show_timestamp: true
      draw_zones: false
      draw_bounding_boxes: true
    objects:
      track:
        - person
        - car
      filters:
        person:
          min_area: 5000
          max_area: 100000
          min_score: 0.5
          threshold: 0.85

Logs Fontconfig error: Cannot load default config file Starting detection process: 16 Attempting to load TPU as usb Camera capture process started for Garage: 17 Camera process started for Garage: 19 Creating ffmpeg process... ffmpeg -hide_banner -loglevel panic -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 -i rtsp://192.168.178.234/profile1/media.smp -r 5 -f rawvideo -pix_fmt yuv420p pipe:

FFprobe from your camera This camera has 3 profiles. Did ffprobe for all 3 profiles below.

ubuntu@ubuntu:~$ ffprobe rtsp://192.168.178.234/profile1/media.smp 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://192.168.178.234/profile1/media.smp': Metadata: title : Media Presentation comment : samsung Duration: N/A, start: 0.052144, bitrate: N/A Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 640x360 [SAR 1:1 DAR 16:9], 5 tbr, 90k tbn, 90k tbc Stream #0:1: Data: none Unsupported codec with id 0 for input stream 1

ubuntu@ubuntu:~$ ffprobe rtsp://192.168.178.234/profile2/media.smp 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://192.168.178.234/profile2/media.smp': Metadata: title : Media Presentation comment : samsung Duration: N/A, start: 0.013000, bitrate: N/A Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720, 20 tbr, 90k tbn, 180k tbc Stream #0:1: Data: none Unsupported codec with id 0 for input stream 1

ubuntu@ubuntu:~$ ffprobe rtsp://192.168.178.234/profile3/media.smp 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://192.168.178.234/profile3/media.smp': Metadata: title : Media Presentation comment : samsung Duration: N/A, start: 0.025000, bitrate: N/A Stream #0:0: Video: hevc (Main), yuv420p(tv), 2592x1520, 20 fps, 20 tbr, 90k tbn, 90k tbc Stream #0:1: Data: none Unsupported codec with id 0 for input stream 1

Screenshots

image

image

image

image

Computer Hardware

Camera Info:

Thank you very much in advance! :) EMRE

blakeblackshear commented 3 years ago

You may be able to turn up your logging in homeassistant to see if you see the request to fetch the image after the notification is sent. I wonder if you have some kind of formatting error in your notification yaml.

asemev commented 3 years ago

Thanks. Which logging specifically i should turn on?

Here is the full yaml for the notification automation:

alias: Notify Person Detection
description: ''
trigger:
  - platform: mqtt
    topic: frigate/events
condition: []
action:
  - service: notify.notify
    data_template:
      message: 'A {{trigger.payload_json["after"]["label"]}} was detected.'
      data:
        image: >-
          "http://asemev.duckdns.org/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}.jpg?format=android"
        tag: '{{trigger.payload_json["after"]["id"]}}'
mode: single
asemev commented 3 years ago

copy/paste made it look weird. how can i properly copy all the formatting and paste properly? I've seen you do it before when you corrected my config file...

asemev commented 3 years ago

image

- id: '1607797467001'
  alias: Notify Person Detection
  description: ''
  trigger:
  - platform: mqtt
    topic: frigate/events
  condition: []
  action:
  - service: notify.notify
    data_template:
      message: A {{trigger.payload_json["after"]["label"]}} was detected.
      data:
        image: '"http://asemev.duckdns.org/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}.jpg?format=android"'
        tag: '{{trigger.payload_json["after"]["id"]}}'
  mode: single
blakeblackshear commented 3 years ago

Edit your previous comment to see. Maybe try changing it to https.

asemev commented 3 years ago

Oh that url was always with https. i had changed it temporarily to http + my local ip address to see if the picture was attaching and showing inside my LAN.

changed it to https and restarted automations, and still no picture attachments. :(

blakeblackshear commented 3 years ago

I don't think this is a frigate issue. Try putting a test file at www/test.jpg in our config folder and updating your url to https://asemev.duckdns.org/local/test.jpg to see if that works.

blakeblackshear commented 3 years ago

image Those extra quotes around the image property look off.

asemev commented 3 years ago

It works!!! You're a genious. It was those extra quotes :) Thanks a million Blake!

image

I'm so sorry i wasted so much of your time! I think we can close this thread...