blakeblackshear / frigate

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

[Config Support]: Reolink Doorbell 2K #9202

Closed Dinth closed 10 months ago

Dinth commented 10 months ago

Describe the problem you are having

Ive got a problem with Reolink Doorbell 2K camera. Since i have added it to Frigate (and normally it showing up fine) two things happen:

  1. Im constantly getting an error as bellow flooding my logs ("new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...")
  2. After running Frigate for a few days cameras (mainly Doorbell, but other random ones) are randomly dropping off (Showing "No frames have been received..." error in the UI). In the log below its "front_garden2" camera.

I guess that the problem may lay in lack of reolink stream options passed to ffmpeg, but while its easy with normal camera config, im using go2rtc.

Version

0.12.1-367d724

Frigate config file

go2rtc:
  streams:
    reolink_doorbell: 
      - "ffmpeg:https://10.10.25.12/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=****!#video=copy#audio=copy#audio=opus"
      - rtsp://admin:****@10.10.25.12:554/h264Preview_01_sub
cameras:
 reolink_doorbell:
    enabled: True
    objects:
      track:
      - person
    ffmpeg:
      inputs:
        - path: rtsp://localhost:8443/reolink_doorbell
          roles:
            - record
          input_args: preset-rtsp-restream
        - path: rtsp://admin:****@10.10.25.12:554/h264Preview_01_sub
          roles:
            - detect

Relevant log output

2024-01-04 10:21:30.651308854  [2024-01-04 10:21:30] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:21:30.651510821  [2024-01-04 10:21:30] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:21:31.996553320  [2024-01-04 10:21:31] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:21:39.996275007  [2024-01-04 10:21:39] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:21:40.676695075  [2024-01-04 10:21:40] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 10:21:40.676925489  [2024-01-04 10:21:40] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:21:40.677211670  [2024-01-04 10:21:40] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:21:47.993684490  [2024-01-04 10:21:47] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:21:50.697481288  [2024-01-04 10:21:50] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 10:21:50.697744729  [2024-01-04 10:21:50] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:21:50.697950402  [2024-01-04 10:21:50] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:21:56.178469468  [2024-01-04 10:21:56] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:22:00.724367783  [2024-01-04 10:22:00] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 10:22:00.732654220  [2024-01-04 10:22:00] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:22:00.732792351  [2024-01-04 10:22:00] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:22:03.997013066  [2024-01-04 10:22:03] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:22:08.588739813  [2024-01-04 10:22:08] frigate.events                 DEBUG   : Event received: update front_garden2 1704355172.488411-bm69jy
2024-01-04 10:22:10.746695434  [2024-01-04 10:22:10] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 10:22:10.746896687  [2024-01-04 10:22:10] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:22:10.747097897  [2024-01-04 10:22:10] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:22:11.996513120  [2024-01-04 10:22:11] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:22:16.127105340  [2024-01-04 10:22:16] frigate.events                 DEBUG   : Event received: update front_garden2 1704355172.488411-bm69jy
2024-01-04 10:22:19.998625942  [2024-01-04 10:22:19] asyncio                        DEBUG   : Using selector: EpollSelector
2024-01-04 10:22:20.767863024  [2024-01-04 10:22:20] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 10:22:20.768198200  [2024-01-04 10:22:20] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 10:22:20.768452690  [2024-01-04 10:22:20] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 10:22:27.995365450  [2024-01-04 10:22:27] asyncio                        DEBUG   : Using selector: EpollSelector

Frigate stats

baby_room   
camera_fps  5.1
capture_pid 1035
detection_enabled   1
detection_fps   0
ffmpeg_pid  100013
pid 1019
process_fps 5.1
skipped_fps 0
backyard_left   
camera_fps  5.1
capture_pid 1039
detection_enabled   1
detection_fps   0
ffmpeg_pid  101905
pid 1021
process_fps 5.1
skipped_fps 0
cpu_usages  
1   
cpu "0.0"
mem "0.0"
15  
cpu "0.0"
mem "0.0"
18  
cpu "0.0"
mem "0.0"
24  
cpu "0.0"
mem "0.0"
25  
cpu "0.0"
mem "0.0"
26  
cpu "0.0"
mem "0.0"
27  
cpu "0.0"
mem "0.0"
28  
cpu "0.0"
mem "0.0"
29  
cpu "0.0"
mem "0.0"
30  
cpu "0.0"
mem "0.0"
31  
cpu "0.0"
mem "0.0"
32  
cpu "0.0"
mem "0.0"
40  
cpu "0.0"
mem "0.0"
42  
cpu "0.0"
mem "0.0"
79  
cpu "0.0"
mem "0.0"
80  
cpu "0.0"
mem "0.0"
82  
cpu "0.0"
mem "0.0"
89  
cpu "38.2"
mem "0.0"
97  
cpu "0.0"
mem "0.0"
98  
cpu "4.7"
mem "0.5"
111 
cpu "0.0"
mem "0.0"
134 
cpu "0.0"
mem "0.0"
135 
cpu "0.0"
mem "0.0"
136 
cpu "0.0"
mem "0.0"
137 
cpu "0.0"
mem "0.0"
146 
cpu "0.0"
mem "0.0"
160 
cpu "0.0"
mem "0.0"
180 
cpu "0.0"
mem "0.0"
207 
cpu "0.0"
mem "0.0"
244 
cpu "0.0"
mem "0.0"
298 
cpu "0.0"
mem "0.0"
370 
cpu "0.0"
mem "0.0"
406 
cpu "0.0"
mem "0.0"
436 
cpu "0.0"
mem "0.0"
474 
cpu "0.0"
mem "0.0"
519 
cpu "0.0"
mem "0.0"
558 
cpu "0.0"
mem "0.0"
598 
cpu "0.0"
mem "0.0"
621 
cpu "0.0"
mem "0.0"
641 
cpu "0.0"
mem "0.0"
668 
cpu "0.0"
mem "0.0"
709 
cpu "0.0"
mem "0.0"
741 
cpu "0.0"
mem "0.0"
779 
cpu "0.0"
mem "0.0"
817 
cpu "0.0"
mem "0.0"
1002    
cpu "0.0"
mem "0.1"
1008    
cpu "1.0"
mem "0.0"
1010    
cpu "3.7"
mem "0.1"
1014    
cpu "1.3"
mem "0.1"
1015    
cpu "0.0"
mem "0.0"
1019    
cpu "1.0"
mem "0.1"
1020    
cpu "0.0"
mem "0.0"
1021    
cpu "1.0"
mem "0.1"
1022    
cpu "0.0"
mem "0.1"
1023    
cpu "0.0"
mem "0.0"
1024    
cpu "2.3"
mem "0.1"
1025    
cpu "1.0"
mem "0.1"
1026    
cpu "0.0"
mem "0.0"
1027    
cpu "1.3"
mem "0.1"
1028    
cpu "1.3"
mem "0.1"
1029    
cpu "1.0"
mem "0.1"
1030    
cpu "0.0"
mem "0.0"
1031    
cpu "3.7"
mem "0.1"
1034    
cpu "0.0"
mem "0.0"
1035    
cpu "3.7"
mem "0.1"
1039    
cpu "3.3"
mem "0.1"
1040    
cpu "0.0"
mem "0.0"
1045    
cpu "3.3"
mem "0.1"
1048    
cpu "0.0"
mem "0.0"
1053    
cpu "3.0"
mem "0.1"
1057    
cpu "0.0"
mem "0.0"
1059    
cpu "3.7"
mem "0.1"
1065    
cpu "3.7"
mem "0.2"
1068    
cpu "0.0"
mem "0.0"
1086    
cpu "3.3"
mem "0.1"
1092    
cpu "3.3"
mem "0.1"
99045   
cpu "0.0"
mem "0.0"
99046   
cpu "0.0"
mem "0.4"
99492   
cpu "3.3"
mem "0.0"
99493   
cpu "1.3"
mem "0.0"
99495   
cpu "0.3"
mem "0.0"
99626   
cpu "8.3"
mem "0.1"
99627   
cpu "8.6"
mem "0.1"
99629   
cpu "5.6"
mem "0.1"
99630   
cpu "6.0"
mem "0.1"
100013  
cpu "24.3"
mem "0.1"
101889  
cpu "3.0"
mem "0.0"
101905  
cpu "15.0"
mem "0.1"
106843  
cpu "3.3"
mem "0.0"
106857  
cpu "13.3"
mem "0.1"
107190  
cpu "9.0"
mem "0.1"
107192  
cpu "1.7"
mem "0.0"
127147  
cpu "3.3"
mem "0.0"
127185  
cpu "8.0"
mem "0.1"
138099  
cpu "0.0"
mem "0.0"
138119  
cpu "0.0"
mem "0.0"
138129  
cpu "0.3"
mem "0.0"
138130  
cpu "0.3"
mem "0.0"
138131  
cpu "66.7"
mem "0.0"
%Cpu(s):    
cpu "id,"
mem "1.6"
MiB 
cpu "64919.5"
mem "avail"
PID 
cpu "%CPU"
mem "%MEM"
Tasks:  
cpu "stopped,"
mem "2"
top 
cpu "users,"
mem "load"
detection_fps   0.2
detectors   
detector_name   
detection_start 0
inference_speed 170433503551.56
pid 99046
front_garden    
camera_fps  5.1
capture_pid 1045
detection_enabled   1
detection_fps   0
ffmpeg_pid  106857
pid 1022
process_fps 5.1
skipped_fps 0
front_garden2   
camera_fps  5.1
capture_pid 1053
detection_enabled   1
detection_fps   0.2
ffmpeg_pid  107190
pid 1024
process_fps 0.2
skipped_fps 0
living_room 
camera_fps  5.1
capture_pid 1065
detection_enabled   1
detection_fps   0
ffmpeg_pid  127185
pid 1027
process_fps 5.1
skipped_fps 0
living_room2    
camera_fps  5.1
capture_pid 1059
detection_enabled   1
detection_fps   0
ffmpeg_pid  99627
pid 1025
process_fps 5.1
skipped_fps 0
loft    
camera_fps  5.1
capture_pid 1092
detection_enabled   1
detection_fps   0
ffmpeg_pid  99629
pid 1029
process_fps 5.1
skipped_fps 0
reolink_doorbell    
camera_fps  5.1
capture_pid 1031
detection_enabled   1
detection_fps   0
ffmpeg_pid  99626
pid 1014
process_fps 5.1
skipped_fps 0
service 
last_updated    1704363606
latest_version  "0.12.1"
storage 
/dev/shm    
free    490.5
mount_type  "tmpfs"
total   536.9
used    46.3
/media/frigate/clips    
free    16602.2
mount_type  "ext4"
total   211280.1
used    186029.2
/media/frigate/recordings   
free    4851127.6
mount_type  "ext4"
total   5952436.2
used    1101291.8
/tmp/cache  
free    16602.2
mount_type  "overlay"
total   211280.1
used    186029.2
temperatures    {}
uptime  92513
version "0.12.1-367d724"
upper_landing   
camera_fps  5
capture_pid 1086
detection_enabled   1
detection_fps   0
ffmpeg_pid  99630
pid 1028
process_fps 5
skipped_fps 0

Operating system

Debian

Install method

Docker CLI

Coral version

USB

Any other information that may be helpful

No response

NickM-27 commented 10 months ago

Please use the recommended reolink config from the docs https://docs.frigate.video/configuration/camera_specific#reolink-cameras

Dinth commented 10 months ago

I have updated it to match the reolink config in the doc:

go2rtc:
  streams:
    reolink_doorbell: 
      - "ffmpeg:https://10.10.25.12/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=***#video=copy#audio=copy#audio=opus"
    reolink_doorbell_sub: 
      - "ffmpeg:https://10.10.25.12/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=***"
cameras:
  reolink_doorbell:
    enabled: True
    objects:
      track:
      - person
    ffmpeg:
      inputs:
        - path: rtsp://localhost:8443/reolink_doorbell?video=copy&audio=aac
          roles:
            - record
          input_args: preset-rtsp-restream
        - path: rtsp://localhost:8443/reolink_doorbell_sub?video=copy
          roles:
            - detect
          input_args: preset-rtsp-restream

but somehow it only made things worse, now im constantly getting "No frames have been received" (at least from the substream, the main one seems to work ok). The log file shows a "Cannot assign requested address" errors now.


2024-01-04 19:02:07.695895990  [2024-01-04 19:02:07] watchdog.reolink_doorbell      ERROR   : Ffmpeg process crashed unexpectedly for reolink_doorbell.
2024-01-04 19:02:07.696183582  [2024-01-04 19:02:07] watchdog.reolink_doorbell      ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-01-04 19:02:07.696466747  [2024-01-04 19:02:07] ffmpeg.reolink_doorbell.detect ERROR   : [tcp @ 0x565408b07e40] Connection to tcp://localhost:8443?timeout=5000000 failed: Cannot assign requested address
2024-01-04 19:02:07.696691734  [2024-01-04 19:02:07] ffmpeg.reolink_doorbell.detect ERROR   : rtsp://localhost:8443/reolink_doorbell_sub?video=copy: Cannot assign requested address
2024-01-04 19:02:07.714521819  [2024-01-04 19:02:07] watchdog.reolink_doorbell      ERROR   : No new recording segments were created for reolink_doorbell in the last 120s. restarting the ffmpeg record process...
2024-01-04 19:02:07.714798446  [2024-01-04 19:02:07] watchdog.reolink_doorbell      INFO    : Terminating the existing ffmpeg process...
2024-01-04 19:02:07.715026155  [2024-01-04 19:02:07] watchdog.reolink_doorbell      INFO    : Waiting for ffmpeg to exit gracefully...
2024-01-04 19:02:07.725465847  [2024-01-04 19:02:07] frigate.video                  ERROR   : reolink_doorbell: Unable to read frames from ffmpeg process.
2024-01-04 19:02:07.726412652  [2024-01-04 19:02:07] frigate.video                  ERROR   : reolink_doorbell: ffmpeg process is not running. exiting capture thread...
NickM-27 commented 10 months ago

localhost:8443 is incorrect, should be 8554

Dinth commented 10 months ago

Thanks! I dont know how this happened or where the 8443 came from :(