blakeblackshear / frigate

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

Person detection fails on one camera only #354

Closed dcgrove closed 3 years ago

dcgrove commented 3 years ago

Describe the bug Hello, I have three cameras (2x wyzeV2 with RTSP firmware and 1x Reolink RLC410-5mp) set up. All three are being scanned for the objects set up in the config.yaml below. The reolink (driveway) camera has not sent an MQTT message for person detection in two days despite numerous people in the detection zone.. Last person screenshot for the reolink is below. car/truck detection for this camera is working as expected, and person/cat detection for the wyze camera's are working as expected.

Version of frigate 0.7.3

Config file

detectors:
  coral:
    type: edgetpu
    device: usb
save_clips:
  clips_dir: /clips
  max_seconds: 300
  pre_capture: 5

mqtt:
  host: 192.168.1.76
  port: 1883
  user: XXXXXX
  password: XXXXX
ffmpeg:
  hwaccel_args:
    - '-hwaccel'
    - vaapi
    - '-hwaccel_device'
    - /dev/dri/renderD128
    - '-hwaccel_output_format'
    - yuv420p
objects:
  track:
    - person
    - car
    - truck
    - bicycle
    - motorcycle
    - cat
    - dog
    - bird
  filters:
    person:
      threshold: 0.90
cameras:
  family_livingroom:
    ffmpeg:
      input: 'rtsp://FamLr:XXXX@192.168.1.189/live'
    # Optional: height of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    #height: 480
    # Optional: width of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    #width: 640
    # Optional: desired fps for your camera
    # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
    #       Frigate will attempt to autodetect if not specified.
    #fps: 7
    #mask: 'poly,1,124,99,87,505,113,640,337,640,479,4,479'
    save_clips:
      # Required: enables clips for the camera (default: shown below)
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 5
      # Optional: Objects to save clips for. (default: all tracked objects)
    # Optional: Configuration for the snapshots in the debug view and mqtt
    snapshots:
      # Optional: print a timestamp on the snapshots (default: shown below)
      show_timestamp: True
      # Optional: draw zones on the debug mjpeg feed (default: shown below)
      draw_zones: True
      # Optional: draw bounding boxes on the mqtt snapshots (default: shown below)
      draw_bounding_boxes: True
  formal_livingroom:
    ffmpeg:
      input: 'rtsp://XXXX:XXXXX192.168.1.142/live'
    # Optional: height of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    #height: 480
    # Optional: width of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    #width: 640
    # Optional: desired fps for your camera
    # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
    #       Frigate will attempt to autodetect if not specified.
    #fps: 7
    #mask: 'poly,1,124,99,87,505,113,640,337,640,479,4,479'
    save_clips:
      # Required: enables clips for the camera (default: shown below)
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 5
      # Optional: Objects to save clips for. (default: all tracked objects)
 # Optional: Configuration for the snapshots in the debug view and mqtt
    snapshots:
      # Optional: print a timestamp on the snapshots (default: shown below)
      show_timestamp: True
      # Optional: draw zones on the debug mjpeg feed (default: shown below)
      draw_zones: True
      # Optional: draw bounding boxes on the mqtt snapshots (default: shown below)
      draw_bounding_boxes: True

  driveway:
    ffmpeg:
      input: 'rtsp://XXXXXX:XXXXX@192.168.1.19:554//h264Preview_01_sub'
      input_args:
        - '-avoid_negative_ts'
        - make_zero
        - '-fflags'
        - nobuffer
        - '-flags'
        - low_delay
        - '-strict'
        - experimental
        - '-fflags'
        - +genpts+discardcorrupt
        - '-use_wallclock_as_timestamps'
        - '1'
        - '-an'
        - '-dn'
        - '-flags'
        - '-global_header'
    # Optional: height of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    height: 480
    # Optional: width of the frame
    # NOTE: Recommended to set this value, but frigate will attempt to autodetect.
    width: 640
    # Optional: desired fps for your camera
    # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
    #       Frigate will attempt to autodetect if not specified.
    fps: 7
    mask: 'poly,1,112,80,86,238,85,380,103,513,366,639,374,640,477,3,478'
    save_clips:
      # Required: enables clips for the camera (default: shown below)
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 5
      # Optional: Objects to save clips for. (default: all tracked objects)
  # Optional: Configuration for the snapshots in the debug view and mqtt
    snapshots:
      # Optional: print a timestamp on the snapshots (default: shown below)
      show_timestamp: True
      # Optional: draw zones on the debug mjpeg feed (default: shown below)
      draw_zones: True
      # Optional: draw bounding boxes on the mqtt snapshots (default: shown below)
      draw_bounding_boxes: True

Logs

2020-12-10T19:11:11.105631046Z ffprobe -v panic -show_error -show_streams -of json "rtsp://FamLr:XXXXXX@192.168.1.189/live"

2020-12-10T19:11:11.124344640Z Starting detection process: 15

2020-12-10T19:11:11.124472474Z Attempting to load TPU as usb

2020-12-10T19:11:11.236761714Z On connect called

2020-12-10T19:11:13.304261576Z {'streams': [{'index': 0, 'codec_name': 'h264', 'codec_long_name': 'unknown', 'profile': '77', 'codec_type': 'video', 'codec_time_base': '1/30', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 1920, 'height': 1080, 'coded_width': 1920, 'coded_height': 1088, 'closed_captions': 0, 'has_b_frames': 0, 'pix_fmt': 'yuv420p', 'level': 40, 'chroma_location': 'left', 'field_order': 'progressive', 'refs': 1, 'is_avc': 'false', 'nal_length_size': '0', 'r_frame_rate': '15/1', 'avg_frame_rate': '15/1', 'time_base': '1/90000', 'start_pts': 35999, 'start_time': '0.399989', 'bits_per_raw_sample': '8', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}, {'index': 1, 'codec_name': 'pcm_alaw', 'codec_long_name': 'unknown', 'codec_type': 'audio', 'codec_time_base': '1/8000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16', 'sample_rate': '8000', 'channels': 1, 'bits_per_sample': 8, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/8000', 'start_pts': 16, 'start_time': '0.002000', 'bit_rate': '64000', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}]}

2020-12-10T19:11:13.305487225Z ffprobe -v panic -show_error -show_streams -of json "rtsp://XXXXXX:XXXXXX@192.168.1.142/live"

2020-12-10T19:11:13.782971861Z TPU found

2020-12-10T19:11:15.207531326Z {'streams': [{'index': 0, 'codec_name': 'h264', 'codec_long_name': 'unknown', 'profile': '77', 'codec_type': 'video', 'codec_time_base': '1/30', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 1920, 'height': 1080, 'coded_width': 1920, 'coded_height': 1088, 'closed_captions': 0, 'has_b_frames': 0, 'pix_fmt': 'yuv420p', 'level': 40, 'chroma_location': 'left', 'field_order': 'progressive', 'refs': 1, 'is_avc': 'false', 'nal_length_size': '0', 'r_frame_rate': '15/1', 'avg_frame_rate': '15/1', 'time_base': '1/90000', 'start_pts': 36000, 'start_time': '0.400000', 'bits_per_raw_sample': '8', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}, {'index': 1, 'codec_name': 'pcm_alaw', 'codec_long_name': 'unknown', 'codec_type': 'audio', 'codec_time_base': '1/8000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16', 'sample_rate': '8000', 'channels': 1, 'bits_per_sample': 8, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/8000', 'start_pts': 12, 'start_time': '0.001500', 'bit_rate': '64000', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}]}

2020-12-10T19:11:15.211557148Z Camera capture process started for family_livingroom: 28

2020-12-10T19:11:15.213483280Z Camera process started for family_livingroom: 29

2020-12-10T19:11:15.215405622Z Camera capture process started for formal_livingroom: 31

2020-12-10T19:11:15.217662666Z Camera process started for formal_livingroom: 32

2020-12-10T19:11:15.218176861Z Creating ffmpeg process...

2020-12-10T19:11:15.218194428Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://FamLr:XXXXXX@192.168.1.189/live -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/family_livingroom-%Y%m%d%H%M%S.mp4 -f rawvideo -pix_fmt yuv420p pipe:

2020-12-10T19:11:15.221217893Z Camera capture process started for driveway: 33

2020-12-10T19:11:15.221441589Z Creating ffmpeg process...Camera process started for driveway: 35

2020-12-10T19:11:15.221498090Z 

2020-12-10T19:11:15.221557761Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1 -an -dn -flags -global_header -i rtsp://XXXXXX:XXXXX@192.168.1.19:554//h264Preview_01_sub -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/driveway-%Y%m%d%H%M%S.mp4 -r 7 -f rawvideo -pix_fmt yuv420p pipe:

2020-12-10T19:11:15.226375757Z Creating ffmpeg process...

2020-12-10T19:11:15.226448285Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://XXXXXX:XXXX@192.168.1.142/live -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/formal_livingroom-%Y%m%d%H%M%S.mp4 -f rawvideo -pix_fmt yuv420p pipe:

2020-12-10T19:11:15.237927944Z  * Serving Flask app "detect_objects" (lazy loading)

2020-12-10T19:11:15.238152040Z  * Environment: development

2020-12-10T19:11:15.238255286Z  * Debug mode: off

Frigate debug stats

{"detection_fps":11.9,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.22,"pid":15}},"driveway":{"camera_fps":7.2,"capture_pid":33,"detection_fps":11.9,"frame_info":{"detect":1607629360.485369,"process":0.0},"pid":35,"process_fps":6.6,"skipped_fps":0.0},"family_livingroom":{"camera_fps":15.2,"capture_pid":28,"detection_fps":0.0,"frame_info":{"detect":1607629360.888191,"process":0.0},"pid":29,"process_fps":15.2,"skipped_fps":0.0},"formal_livingroom":{"camera_fps":15.2,"capture_pid":31,"detection_fps":0.0,"frame_info":{"detect":1607629360.866073,"process":0.0},"pid":32,"process_fps":15.2,"skipped_fps":0.0}}

FFprobe from your camera

Run the following command and paste output below

XXXXXX@bigserver:~$ ffprobe rtsp://XXXXXX:XXXXX@192.168.1.19:554//h264Preview                                                                                                                               _01_sub
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/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=                                                                                                                               amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resa                                                                                                                               mple --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-                                                                                                                               libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --e                                                                                                                               nable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --                                                                                                                               enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libm                                                                                                                               p3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libo                                                                                                                               pus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine                                                                                                                                --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-l                                                                                                                               ibtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-lib                                                                                                                               vpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --ena                                                                                                                               ble-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-                                                                                                                               openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable                                                                                                                               -libdrm --enable-libiec61883 --enable-nvenc --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://XXXXXX:XXXXX6@192.168.1.19: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 (High), yuv420p(progressive), 640x480, 30 tbr, 90k                                                                                                                                tbn, 180k tbc
    Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Screenshots frigate mjpeg IMG_0541 IMG_0540

Computer Hardware

Camera Info:

dcgrove commented 3 years ago

So I am not sure why it works, but I changed the config of my reolink camera from the sub stream to the higher resolution main stream and restarted the container. Then changed the config back to the sub stream and restarted the container again and now person detection is working as it should.

jamos77 commented 3 years ago

Not sure you are aware but you might want to remove your logs as your rtsp usernames and passwords are listed in it .

dcgrove commented 3 years ago

Not sure you are aware but you might want to remove your logs as your rtsp usernames and passwords are listed in it .

Good call. Thanks for the heads up.

dcgrove commented 3 years ago

Well it stopped working shortly after I posted this. 😤

blakeblackshear commented 3 years ago

What does it look like when you view the mjpeg feed from the camera in frigate after it stops working? Is that still showing a live view?

dcgrove commented 3 years ago

What does it look like when you view the mjpeg feed from the camera in frigate after it stops working? Is that still showing a live view?

The mjpeg camera works, but does not show any person detection. The car detection works as it should. image

blakeblackshear commented 3 years ago

I can't think of a reason why it would stop working for a single object type. Tensorflow looks for all objects in a single pass, so there is nothing person specific about the detection pipeline. The only thing I can think of is that the person scores are just too low to meet the threshold value you have set. You should still see bounding boxes for person objects even if they are lower than the threshold. You could try lowering the threshold to see if that's the issue.

dcgrove commented 3 years ago

Here is a screen recording of the mjpeg camera when my daughter took the trash out. As you can see the bounding boxes for the car works, but there is no person detection.

https://share.icloud.com/photos/0q1RSEJP93BVReSt5adfsAC4g

blakeblackshear commented 3 years ago

Can you try removing the car from the tracked objects list to see if it works with person only?

dcgrove commented 3 years ago

Hello, person is the only object I have set up to detect, the link below is a screen recording of the mjpeg camera. No detection occurred.

https://share.icloud.com/photos/0L6chola6lg3nhWxhZRAt0ohQ

Here is my object config.

objects:
  track:
    - person
    #- car
    #- truck
    #- bicycle
    #- motorcycle
    #- cat
    #- dog
    #- bird
  #filters:
    #person:
      #threshold: 0.90
dcgrove commented 3 years ago

I recreated the container in Portainer and tested it again and person detection worked albeit rather slowly. Video and log files from portainer below.

https://share.icloud.com/photos/07Rg24hz9aRwDpuvEKHEZLfDA

2020-12-11T14:13:07.769669740Z Fontconfig error: Cannot load default config file,
2020-12-11T14:13:08.068115068Z ffprobe -v panic -show_error -show_streams -of json "rtsp://FamLr:XXXXXX@192.168.1.189/live",
2020-12-11T14:13:08.068901271Z Starting detection process: 18,
2020-12-11T14:13:08.069065098Z Attempting to load TPU as usb,
2020-12-11T14:13:08.205983451Z On connect called,
2020-12-11T14:13:10.201036515Z {'streams': [{'index': 0, 'codec_name': 'h264', 'codec_long_name': 'unknown', 'profile': '77', 'codec_type': 'video', 'codec_time_base': '1/30', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 1920, 'height': 1080, 'coded_width': 1920, 'coded_height': 1088, 'closed_captions': 0, 'has_b_frames': 0, 'pix_fmt': 'yuv420p', 'level': 40, 'chroma_location': 'left', 'field_order': 'progressive', 'refs': 1, 'is_avc': 'false', 'nal_length_size': '0', 'r_frame_rate': '15/1', 'avg_frame_rate': '15/1', 'time_base': '1/90000', 'start_pts': 36000, 'start_time': '0.400000', 'bits_per_raw_sample': '8', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}, {'index': 1, 'codec_name': 'pcm_alaw', 'codec_long_name': 'unknown', 'codec_type': 'audio', 'codec_time_base': '1/8000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16', 'sample_rate': '8000', 'channels': 1, 'bits_per_sample': 8, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/8000', 'start_pts': 2, 'start_time': '0.000250', 'bit_rate': '64000', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}]},
2020-12-11T14:13:10.205150293Z ffprobe -v panic -show_error -show_streams -of json "rtsp://Clayton:XXXXXX@192.168.1.142/live",
2020-12-11T14:13:10.742845887Z TPU found,
2020-12-11T14:13:12.432607371Z {'streams': [{'index': 0, 'codec_name': 'h264', 'codec_long_name': 'unknown', 'profile': '77', 'codec_type': 'video', 'codec_time_base': '1/20', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 1920, 'height': 1080, 'coded_width': 1920, 'coded_height': 1088, 'closed_captions': 0, 'has_b_frames': 0, 'pix_fmt': 'yuv420p', 'level': 40, 'chroma_location': 'left', 'field_order': 'progressive', 'refs': 1, 'is_avc': 'false', 'nal_length_size': '0', 'r_frame_rate': '15/1', 'avg_frame_rate': '10/1', 'time_base': '1/90000', 'start_pts': 32999, 'start_time': '0.366656', 'bits_per_raw_sample': '8', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}, {'index': 1, 'codec_name': 'pcm_alaw', 'codec_long_name': 'unknown', 'codec_type': 'audio', 'codec_time_base': '1/8000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16', 'sample_rate': '8000', 'channels': 1, 'bits_per_sample': 8, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/8000', 'start_pts': 4, 'start_time': '0.000500', 'bit_rate': '64000', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}]},
2020-12-11T14:13:12.443941801Z Camera capture process started for family_livingroom: 31,
2020-12-11T14:13:12.447874890Z Creating ffmpeg process...Camera process started for family_livingroom: 32,
2020-12-11T14:13:12.448131161Z ,
2020-12-11T14:13:12.448169086Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://FamLr:XXXXXX@192.168.1.189/live -f rawvideo -pix_fmt yuv420p pipe:,
2020-12-11T14:13:12.452117335Z Camera capture process started for formal_livingroom: 34,
2020-12-11T14:13:12.455200215Z Camera process started for formal_livingroom: 36,
2020-12-11T14:13:12.458038880Z Camera capture process started for driveway: 37,
2020-12-11T14:13:12.463527445Z Camera process started for driveway: 38,
2020-12-11T14:13:12.466724667Z Creating ffmpeg process...,
2020-12-11T14:13:12.466903677Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://admin:XXXXXX@192.168.1.19:554/h264Preview_01_sub -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/driveway-%Y%m%d%H%M%S.mp4 -r 7 -f rawvideo -pix_fmt yuv420p pipe:,
2020-12-11T14:13:12.467489965Z Creating ffmpeg process...,
2020-12-11T14:13:12.467619425Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://Clayton:XXXXXX@192.168.1.142/live -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/formal_livingroom-%Y%m%d%H%M%S.mp4 -f rawvideo -pix_fmt yuv420p pipe:,
2020-12-11T14:13:12.489134052Z  * Serving Flask app "detect_objects" (lazy loading),
2020-12-11T14:13:12.489152433Z  * Environment: development,
2020-12-11T14:13:12.489155351Z  * Debug mode: off,
2020-12-11T14:13:17.492707882Z driveway: ffmpeg sent a broken frame. something is wrong.,
2020-12-11T14:13:17.492743575Z driveway: ffmpeg process is not running. exiting capture thread...,
2020-12-11T14:13:22.477346265Z Creating ffmpeg process...,
2020-12-11T14:13:22.477396681Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://admin:XXXXXX@192.168.1.19:554/h264Preview_01_sub -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/driveway-%Y%m%d%H%M%S.mp4 -r 7 -f rawvideo -pix_fmt yuv420p pipe:,
2020-12-11T14:13:25.592244320Z driveway: ffmpeg sent a broken frame. something is wrong.,
2020-12-11T14:13:25.592319892Z driveway: ffmpeg process is not running. exiting capture thread...,
2020-12-11T14:13:32.494965708Z Creating ffmpeg process...,
2020-12-11T14:13:32.495005114Z ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://admin:XXXXXX@192.168.1.19:554/h264Preview_01_sub -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -map 0 /cache/driveway-%Y%m%d%H%M%S.mp4 -r 7 -f rawvideo -pix_fmt yuv420p pipe:,
blakeblackshear commented 3 years ago

Try a simpler set of input args for the driveway camera:

driveway:
    ffmpeg:
      input: 'rtsp://XXXXXX:XXXXX@192.168.1.19:554//h264Preview_01_sub'
      input_args:
        - '-avoid_negative_ts'
        - make_zero
        - '-fflags'
        - +genpts+discardcorrupt
        - '-use_wallclock_as_timestamps'
        - '1'
        - '-an'
        - '-dn'
        - '-flags'
        - '-global_header'
dcgrove commented 3 years ago

With updated input args. It detected me after some time once, but failed to detect me again. This was all taken on one continuous recording.

https://share.icloud.com/photos/0D3k-jcLPrzZr2e5qaY9oLMNQ

blakeblackshear commented 3 years ago

Can you try removing your mask?

dcgrove commented 3 years ago

That did it! I don't know why the mask is the issue though. I followed the steps outlined in the docs to generate the image points. Do you know of a tool that can reverse the process to identify the polygon in an image based on points you feed it?

blakeblackshear commented 3 years ago

The best way to test in this version is to add the mask coordinates as a zone for the camera to see the polygon drawn on the preview feed.

dcgrove commented 3 years ago

Here is the zone drawn on the preview feed. zone

blakeblackshear commented 3 years ago

The mask is going to ignore any motion inside that polygon. Your mask needs to be the opposite.

dcgrove commented 3 years ago

Closing as this was user error. I appreciate the assistance getting this sorted out!