blakeblackshear / frigate

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

[Support]: Frigate detecting events and creating snapshot but not recording video #3041

Closed HSB-collab closed 2 years ago

HSB-collab commented 2 years ago

Describe the problem you are having

This issue is similar to #3033 but different so I have started a new issue. I really hope someone can help me because it is driving me crazy!

I have a Home-Assistant and Frigate setup which works perfectly so I decided to replicate the setup on a new machine for a relative who wants to run HA. The new setup is almost identical in every way. I am testing it on the same cameras. The original setup works perfectly - it detects events, produces snapshots and records clips when an event is detected.

My new setup detects events, produces snapshots but I cannot get it to record clips when an event is detected.

The setup is as follows: PC running a Core-i3 (2nd generation - that is one of 2 differences with the original setup which has a 3rd generation core-i3); 8Gbyte RAM, 500Mbyte hard disk (this is the other difference with the original setup which has a 120Gbyte SSD).

Both machines are running Lubuntu 20.04.

Both machines are running Home-Assistant Supervised in a Virtualbox VM.

Both machines are running Frigate 0.10.1-amd64 inside a Docker container. Both machines launch Frigate with the same docker-composer frigate.yaml file. Both machines have identical config.yml files for the Frigate Docker container. Both machines give identical outputs from ffprobe on the cameras.

Version

0.10.1-83481AF

Frigate config file

mqtt:
  host: 10.0.0.241
  user: *****
  password: *******
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  global_args: -hide_banner -loglevel debug    
logger:
  default: info
  logs:
    frigate.event: debug
cameras:
# Name of your camera
  Camera1:
    ffmpeg:
      inputs:
        - path: rtsp://*****:******@10.0.0.124/live
          roles:
            - detect
            - rtmp
            - record
    detect:
      enabled: False
      width: 1920
      height: 1080
      fps: 5
    objects:
      track:
        - person
    record:
      enabled: False
#      retain_days: 0   #deprecated after release 0.10.0 -use mode under retain
      events:
        max_seconds: 60
        retain:
          default: 10
          mode: active_objects
    snapshots:
      enabled: True
      crop: True
      height: 500
# Name of your camera
  Camera2:
    ffmpeg:
      inputs:
        - path: rtsp://*****:******@10.0.0.125/live
          roles:
            - detect
            - rtmp
            - record
    detect:
      enabled: False
      width: 1920
      height: 1080
      fps: 5
#    motion:
#      mask:
#        - 449,925,880,604,774,55,360,199,0,354,0,500
    objects:
      track:
        - person
    record:
      enabled: False
#      retain_days: 0   #deprecated after release 0.10.0 -use mode under retain
      events:
        max_seconds: 60
        retain:
          default: 10
          mode: active_objects
    snapshots:
      enabled: True
      crop: True
      height: 500
# Name of your camera
  Camera3:
    ffmpeg:
      inputs:
        - path: rtsp://*****:******@10.0.0.126/live
          roles:
            - detect
            - rtmp
            - record
    detect:
      enabled: False
      width: 1920
      height: 1080
      fps: 5
    objects:
      track:
        - person
    record:
      enabled: False
#      retain_days: 0   #deprecated after release 0.10.0 -use mode under retain
      events:
        max_seconds: 60
        retain:
          default: 10
          mode: active_objects
    snapshots:
      enabled: True
      crop: True
      height: 500

detectors:
#  cpu:
#    type: cpu
  coral:
    type: edgetpu
    device: pci

Relevant log output

2022-04-01T06:46:14.987133925Z [2022-04-01 17:46:14] frigate.video                  ERROR   : Camera2: Unable to read frames from ffmpeg process.
2022-04-01T06:46:14.987332436Z [2022-04-01 17:46:14] frigate.video                  ERROR   : Camera2: ffmpeg process is not running. exiting capture thread...
2022-04-01T06:46:15.786798338Z [2022-04-01 17:46:15] watchdog.Camera2               ERROR   : Ffmpeg process crashed unexpectedly for Camera2.
2022-04-01T06:46:15.791553097Z [2022-04-01 17:46:15] watchdog.Camera2               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2022-04-01T06:46:15.791608454Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000016.
2022-04-01T06:46:15.791619942Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] nal_unit_type: 5(IDR), nal_ref_idc: 3
2022-04-01T06:46:15.791628840Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Param buffer (type 0, 672 bytes) is 0x8000004.
2022-04-01T06:46:15.791637972Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Param buffer (type 1, 240 bytes) is 0x8000003.
2022-04-01T06:46:15.791661469Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Slice 0 param buffer (3128 bytes) is 0x8000001.
2022-04-01T06:46:15.791671768Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Slice 0 data buffer (89794 bytes) is 0x8000002.
2022-04-01T06:46:15.791680731Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Decode to surface 0x4000018.
2022-04-01T06:46:15.791689079Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000016.
2022-04-01T06:46:15.791697003Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 526 from stream 0 at ts 524
2022-04-01T06:46:15.791704431Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1531 fps= 15 q=-1.0 q=-0.0 size=   12372kB time=00:01:46.21 bitrate= 954.3kbits/s dup=11 drop=1011 speed=1.01x    
2022-04-01T06:46:15.791713236Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000015.
2022-04-01T06:46:15.791721621Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.791738828Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Param buffer (type 0, 672 bytes) is 0x8000002.
2022-04-01T06:46:15.791747155Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Param buffer (type 1, 240 bytes) is 0x8000001.
2022-04-01T06:46:15.791777673Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Slice 0 param buffer (3128 bytes) is 0x8000003.
2022-04-01T06:46:15.791788240Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Slice 0 data buffer (3399 bytes) is 0x8000004.
2022-04-01T06:46:15.791796615Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Decode to surface 0x4000017.
2022-04-01T06:46:15.791804599Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000015.
2022-04-01T06:46:15.791813899Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 526 from stream 0 at ts 524
2022-04-01T06:46:15.791822001Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000013.
2022-04-01T06:46:15.791830090Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.791837879Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] Param buffer (type 0, 672 bytes) is 0x8000004.
2022-04-01T06:46:15.791846419Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] Param buffer (type 1, 240 bytes) is 0x8000003.
2022-04-01T06:46:15.791855283Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] Slice 0 param buffer (3128 bytes) is 0x8000001.
2022-04-01T06:46:15.791868119Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] Slice 0 data buffer (1020 bytes) is 0x8000002.
2022-04-01T06:46:15.791923953Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3835880] Decode to surface 0x4000016.
2022-04-01T06:46:15.792059114Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000013.
2022-04-01T06:46:15.792288663Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 526 from stream 0 at ts 524
2022-04-01T06:46:15.792404936Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000014.
2022-04-01T06:46:15.792507326Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.792610995Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] Param buffer (type 0, 672 bytes) is 0x8000002.
2022-04-01T06:46:15.792690839Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] Param buffer (type 1, 240 bytes) is 0x8000001.
2022-04-01T06:46:15.792798993Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] Slice 0 param buffer (3128 bytes) is 0x8000003.
2022-04-01T06:46:15.792895235Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] Slice 0 data buffer (17452 bytes) is 0x8000004.
2022-04-01T06:46:15.792984126Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e37ea380] Decode to surface 0x4000015.
2022-04-01T06:46:15.793088181Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000014.
2022-04-01T06:46:15.793192919Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 526 from stream 0 at ts 524
2022-04-01T06:46:15.793271863Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000018.
2022-04-01T06:46:15.793371948Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.793468353Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] Param buffer (type 0, 672 bytes) is 0x8000004.
2022-04-01T06:46:15.793574581Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] Param buffer (type 1, 240 bytes) is 0x8000003.
2022-04-01T06:46:15.793680281Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] Slice 0 param buffer (3128 bytes) is 0x8000001.
2022-04-01T06:46:15.793767520Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] Slice 0 data buffer (837 bytes) is 0x8000002.
2022-04-01T06:46:15.793870029Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e3806c40] Decode to surface 0x4000014.
2022-04-01T06:46:15.793958776Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000018.
2022-04-01T06:46:15.794062508Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 526 from stream 0 at ts 524
2022-04-01T06:46:15.794160539Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000017.
2022-04-01T06:46:15.794265183Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.794364737Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Param buffer (type 0, 672 bytes) is 0x8000002.
2022-04-01T06:46:15.794459905Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Param buffer (type 1, 240 bytes) is 0x8000001.
2022-04-01T06:46:15.794564245Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Slice 0 param buffer (3128 bytes) is 0x8000003.
2022-04-01T06:46:15.794660095Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Slice 0 data buffer (13160 bytes) is 0x8000004.
2022-04-01T06:46:15.794751937Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e389be00] Decode to surface 0x4000013.
2022-04-01T06:46:15.794832513Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000017.
2022-04-01T06:46:15.794941791Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** 4 dup!
2022-04-01T06:46:15.795066573Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
2022-04-01T06:46:15.795164232Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000016.
2022-04-01T06:46:15.795277235Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Param buffer (type 0, 672 bytes) is 0x8000004.
2022-04-01T06:46:15.795395630Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Param buffer (type 1, 240 bytes) is 0x8000003.
2022-04-01T06:46:15.795502671Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Slice 0 param buffer (3128 bytes) is 0x8000001.
2022-04-01T06:46:15.795593848Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Slice 0 data buffer (8653 bytes) is 0x8000002.
2022-04-01T06:46:15.795699410Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [h264 @ 0x5590e380dbc0] Decode to surface 0x4000018.
2022-04-01T06:46:15.795769011Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000016.
2022-04-01T06:46:15.795880697Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000015.
2022-04-01T06:46:15.795965793Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000015.
2022-04-01T06:46:15.796083135Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 14 q=-1.0 q=-0.0 size=   12397kB time=00:01:46.60 bitrate= 952.7kbits/s dup=14 drop=1015 speed=0.966x    
2022-04-01T06:46:15.796159508Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000014.
2022-04-01T06:46:15.796246774Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000014.
2022-04-01T06:46:15.796333971Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 13 q=-1.0 q=-0.0 size=   12397kB time=00:01:46.80 bitrate= 950.9kbits/s dup=14 drop=1015 speed=0.925x    
2022-04-01T06:46:15.796435645Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000013.
2022-04-01T06:46:15.796511920Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000013.
2022-04-01T06:46:15.796603987Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 13 q=-1.0 q=-0.0 size=   12397kB time=00:01:46.80 bitrate= 950.9kbits/s dup=14 drop=1015 speed=0.886x    
2022-04-01T06:46:15.796684355Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Map surface 0x4000018.
2022-04-01T06:46:15.796768601Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVHWFramesContext @ 0x7f6a90046f00] Unmap surface 0x4000018.
2022-04-01T06:46:15.796855006Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : *** dropping frame 534 from stream 0 at ts 532
2022-04-01T06:46:15.796939668Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 12 q=-1.0 q=-0.0 size=   12397kB time=00:01:47.00 bitrate= 949.1kbits/s dup=14 drop=1016 speed=0.851x    
2022-04-01T06:46:15.797030776Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 12 q=-1.0 q=-0.0 size=   12397kB time=00:01:47.00 bitrate= 949.1kbits/s dup=14 drop=1016 speed=0.818x    
2022-04-01T06:46:15.797111623Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [out_1_0 @ 0x5590e3838a40] EOF on sink link out_1_0:default.
2022-04-01T06:46:15.797199207Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 11 q=-1.0 q=-0.0 size=   12397kB time=00:01:47.00 bitrate= 949.1kbits/s dup=14 drop=1016 speed=0.787x    
2022-04-01T06:46:15.797283886Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : No more output streams to write to, finishing.
2022-04-01T06:46:15.797368722Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [flv @ 0x5590e37a3180] Failed to update header with correct duration.
2022-04-01T06:46:15.797454159Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [flv @ 0x5590e37a3180] Failed to update header with correct filesize.
2022-04-01T06:46:15.797538849Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : frame= 1537 fps= 11 q=-1.0 Lq=-0.0 size=   12418kB time=00:01:47.00 bitrate= 950.7kbits/s dup=14 drop=1016 speed=0.787x    
2022-04-01T06:46:15.797635739Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : video:1636623kB audio:818kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2022-04-01T06:46:15.797713012Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : Input file #0 (rtsp://****:****@10.0.0.124/live):
2022-04-01T06:46:15.797798812Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Input stream #0:0 (video): 1566 packets read (11959249 bytes); 1537 frames decoded; 
2022-04-01T06:46:15.797883095Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Input stream #0:1 (audio): 654 packets read (837120 bytes); 
2022-04-01T06:46:15.797967979Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Total: 2220 packets (12796369 bytes) demuxed
2022-04-01T06:46:15.798052862Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : Output file #0 (rtmp://127.0.0.1/live/Camera2):
2022-04-01T06:46:15.798139059Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Output stream #0:0 (video): 1537 packets muxed (11837462 bytes); 
2022-04-01T06:46:15.798258134Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Output stream #0:1 (audio): 654 packets muxed (837120 bytes); 
2022-04-01T06:46:15.798421986Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Total: 2191 packets (12674582 bytes) muxed
2022-04-01T06:46:15.798533527Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : Output file #1 (pipe:):
2022-04-01T06:46:15.798643094Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Output stream #1:0 (video): 535 frames encoded; 535 packets muxed (1664064000 bytes); 
2022-04-01T06:46:15.798757677Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   :   Total: 535 packets (1664064000 bytes) muxed
2022-04-01T06:46:15.798853078Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : 1537 frames successfully decoded, 0 decoding errors
2022-04-01T06:46:15.798988697Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVIOContext @ 0x5590e387f9c0] Statistics: 0 seeks, 2304 writeouts
2022-04-01T06:46:15.799093164Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [rtmp @ 0x5590e3787c40] UnPublishing stream...
2022-04-01T06:46:15.799196342Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [rtmp @ 0x5590e3787c40] Deleting stream...
2022-04-01T06:46:15.799330201Z [2022-04-01 17:46:15] ffmpeg.Camera2.detect          ERROR   : [AVIOContext @ 0x5590e37a7e80] Statistics: 0 seeks, 50825 writeouts
2022-04-01T06:46:36.824793631Z [2022-04-01 17:46:36] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:49594]
2022-04-01T06:46:42.567407073Z [2022-04-01 17:46:42] frigate.http                   ERROR   : No recordings found for the requested time range
2022-04-01T06:46:51.668879042Z [2022-04-01 17:46:51] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:49594]
2022-04-01T06:46:57.774663685Z [2022-04-01 17:46:57] frigate.mqtt                   INFO    : Turning on detection for Camera1 via mqtt
2022-04-01T06:46:57.788166962Z [2022-04-01 17:46:57] frigate.mqtt                   INFO    : Turning on recordings for Camera1 via mqtt
2022-04-01T06:47:00.552386371Z [2022-04-01 17:47:00] frigate.mqtt                   INFO    : Turning off detection for Camera1 via mqtt
2022-04-01T06:47:00.561877614Z [2022-04-01 17:47:00] frigate.mqtt                   INFO    : Turning off recordings for Camera1 via mqtt
2022-04-01T06:47:01.398768978Z [2022-04-01 17:47:01] frigate.mqtt                   INFO    : Turning on detection for Camera2 via mqtt
2022-04-01T06:47:01.445665405Z [2022-04-01 17:47:01] frigate.mqtt                   INFO    : Turning on recordings for Camera2 via mqtt
hugh@JamesHA:~$

FFprobe output from your camera

~$ ffprobe rtsp://****:*****@10.0.0.124/live | tee ffprobe.txt
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=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-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://****:******@10.0.0.124/live':
  Metadata:
    title           : Session streamed by the WYZE Media Server
    comment         : live
  Duration: N/A, start: 0.000500, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, 15 fps, 15 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Frigate stats

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "Camera1": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": false,
        "fps": 5,
        "height": 1080,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1920
      },
      "ffmpeg": {
        "global_args": "-hide_banner -loglevel debug",
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128",
          "-hwaccel_output_format",
          "yuv420p"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://*****:******@10.0.0.120/img/video.sav",
            "roles": [
              "record",
              "rtmp",
              "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 debug -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://*****:******@10.0.0.120/img/video.sav -c copy -f flv rtmp://127.0.0.1/live/Camera1 -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "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": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "Camera1",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": false,
        "events": {
          "max_seconds": 60,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": true,
        "enabled": true,
        "height": 500,
        "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
      },
      "zones": {}
    },
    "Camera2": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 1080,
        "max_disappeared": 25,
        "stationary": {
          "interval": 0,
          "max_frames": {
            "default": null,
            "objects": {}
          },
          "threshold": 50
        },
        "width": 1920
      },
      "ffmpeg": {
        "global_args": "-hide_banner -loglevel debug",
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128",
          "-hwaccel_output_format",
          "yuv420p"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://*****:******@10.0.0.124/live",
            "roles": [
              "record",
              "rtmp",
              "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 debug -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://*****:******@10.0.0.124/live -c copy -f flv rtmp://127.0.0.1/live/Camera2 -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "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": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "Camera2",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 60,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": true,
        "enabled": true,
        "height": 500,
        "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
      },
      "zones": {}
    }
  },
  "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": "pci",
      "num_threads": 3,
      "type": "edgetpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": "-hide_banner -loglevel debug",
    "hwaccel_args": [
      "-hwaccel",
      "vaapi",
      "-hwaccel_device",
      "/dev/dri/renderD128",
      "-hwaccel_output_format",
      "yuv420p"
    ],
    "input_args": [
      "-avoid_negative_ts",
      "make_zero",
      "-fflags",
      "+genpts+discardcorrupt",
      "-rtsp_transport",
      "tcp",
      "-stimeout",
      "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": {
      "frigate.event": "debug"
    }
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "10.0.0.241",
    "password": "jC63!S2G",
    "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_user2"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": false,
    "events": {
      "max_seconds": 300,
      "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
  }
}

Operating system

Debian

Install method

Docker Compose

Coral version

PCIe

Network connection

Wired

Camera make and model

Wyze Camera v2, Wyze Camera Pan, Sercomm iCamera2

Any other information that may be helpful

I have 3 different types of camera - all exhibit the same issue, namely I get recordings in the original setup but not in the new one.

In the setup that is failing to record I have a ton of hard disk space (500Gbyte) so I am not running out of free disk space.

Could the fact that the original setup runs on an SSD and the new one on a mechanical drive make a difference?

blakeblackshear commented 2 years ago

You have record disabled in your config. It's not going to record any video when recording is disabled.

HSB-collab commented 2 years ago

Thanks for the prompt reply @blakeblackshear. I am afraid I copied the whole debug stats and did not make it clear above that I had 2 cameras and had only enabled one of them to record (Camera2). The first camera (Camera1) is not enabled which is what you have correctly picked up but I was doing my testing on the 2nd camera (Camera2) which you can see from the above debug stats is enabled. The excerpt from the debug stats is below.

Do you have any other suggestions? Thanks in anticipation (I really do appreciate the help you give on this amazing project).

      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 60,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "mode": "active_objects",
            "objects": {}
          }
        },
        "expire_interval": 60,
        "retain": {
          "days": 0,
          "mode": "all"
        },
        "retain_days": null
      },
NickM-27 commented 2 years ago

@HSB-collab It is still disabled in your config that you originally posted:

 Camera2:
    ffmpeg:
      inputs:
        - path: rtsp://*****:******@10.0.0.125/live
          roles:
            - detect
            - rtmp
            - record
    detect:
      enabled: False
      width: 1920
      height: 1080
      fps: 5
#    motion:
#      mask:
#        - 449,925,880,604,774,55,360,199,0,354,0,500
    objects:
      track:
        - person
    record:
      enabled: False
#      retain_days: 0   #deprecated after release 0.10.0 -use mode under retain
      events:
        max_seconds: 60
        retain:
          default: 10
          mode: active_objects
    snapshots:
      enabled: True
      crop: True
      height: 500

it must be enabled in the config. If you have it disabled in the config the UI and MQTT will not fix this.

NickM-27 commented 2 years ago

@blakeblackshear I wonder if it would be a good idea to have the UI button disabled and MQTT throw an error if the recording is attempted to be enabled for a camera with it disabled in the original config?

HSB-collab commented 2 years ago

THANK YOU! @NickM-27 you were correct. I had assumed that recording was disabled in the config file and then enabled via MQTT which is what I did. Now that I have enabled recording in the config file, it is working. Thanks so much - it was driving me crazy. Your suggestion of an error message would certainly have saved me a lot of time.

blakeblackshear commented 2 years ago

The way this is handled in config parsing makes it difficult to know at runtime whether or not record was disabled at startup. At the very least, there could be some info about this in the example config docs.

HSB-collab commented 2 years ago

Maybe if you put something in the documentation (which I went through carefully) to explain how to record active objects that would be good. Or in the documentation where you explain the configuration file and have the comment "# active_objects - save all recording segments with active/moving objects" mention that you still need to enable record in the config.yml file.

NickM-27 commented 2 years ago

I'll take a stab at it and see if I can get it to work well figuring out if record is disabled in the file and I'll update the docs either way.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

metaphorLion commented 2 years ago

This project just send snapshots to a discord using a bot --> https://github.com/vibin18/go-mqtt-discord