blakeblackshear / frigate

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

[Camera Support]: Reoling Wifi Doorbell crashing #6959

Closed Medic97 closed 1 year ago

Medic97 commented 1 year ago

Describe the problem you are having

My Reolink Wifi doorbell keeps crashing and my log is flooded with errors.

Version

Frigate (0.12.1-367d724)

Frigate config file

ui:
  live_mode: mse

mqtt:
  host: 192.168.##.##
  port: 1883
  user: #####
  password: ######

birdseye:
  enabled: False

go2rtc:
  streams:
    girls_cam:
      - rtsp://######:######@192.168.##.##:554/h264Preview_01_main
      # - http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=####&password=####
      # - "ffmpeg:http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=#####&password=####video=copy#audio=copy"
    doorbell:
      # - rtsp://######:######@192.168.##.##:554/h264Preview_01_main
      - http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=######&password=######
      # - "ffmpeg:http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=######&password=#######video=copy#audio=copy"
  webrtc:
    candidates:
      - 192.168.##.##:8555
      - stun:8555

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: True
  retain:
    mode: all
  events:
    pre_capture: 10
    post_capture: 10
    retain:
      default: 30
      mode: motion

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  bounding_box: True
  retain:
    default: 14

cameras:
  girls_cam:
    detect:
      width: 640
      height: 360
      fps: 7  
    ffmpeg:
      output_args:
          record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://######:######@192.168.##.##:554/h264Preview_01_main
          roles:
            - record
        - path: rtsp://######:######@192.168.##.##:554/h264Preview_01_sub
          roles:
            - detect

  doorbell:
    detect:
      width: 640
      height: 480
      fps: 7
    ffmpeg:
      output_args:
          record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://######:######@192.168.##.##:554/h264Preview_01_main
        # - path: rtsp://127.0.0.1:8554/doorbell?video=copy&audio=copy
          roles:
            - record
        - path: rtsp://######:######@192.168.##.##:554/h264Preview_01_sub
        # - path: rtsp://127.0.0.1:8554/doorbell_sub?video=copy
          roles:
            - detect

Relevant log output

2023-06-29 21:13:39.440950851  [2023-06-29 17:13:36] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-06-29 21:13:39.449787066  [2023-06-29 17:13:39] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-06-29 21:14:56.924818549  [2023-06-29 17:14:56] ffmpeg.doorbell.record         ERROR   : [segment @ 0x56179d9a77c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2023-06-29 21:14:56.926652235  [2023-06-29 17:14:56] ffmpeg.doorbell.record         ERROR   : [segment @ 0x56179d9a77c0] Non-monotonous DTS in output stream 0:0; previous: 6562, current: 6562; changing to 6563. This may result in incorrect timestamps in the output file.
____________
ffmpeg.doorbell.record         ERROR   : [rtsp @ 0x56179d985f00] CSeq 6 expected, 0 received.
2023-06-29 21:14:57.022004400  [2023-06-29 17:14:56] ffmpeg.doorbell.record         ERROR   :     Last message repeated 3 times
______________
ffmpeg.doorbell.record         ERROR   : rtsp://*:*@192.168.1.30:554/h264Preview_01_main: Connection timed out
2023-06-29 21:14:57.028256540  [2023-06-29 17:14:56] watchdog.doorbell              INFO    : Terminating the existing ffmpeg process...
2023-06-29 21:14:57.028260350  [2023-06-29 17:14:56] watchdog.doorbell              INFO    : Waiting for ffmpeg to exit gracefully...
2023-06-29 21:14:59.916620489  [2023-06-29 17:14:59] frigate.video                  ERROR   : doorbell: Unable to read frames from ffmpeg process.
2023-06-29 21:14:59.916792527  [2023-06-29 17:14:59] frigate.video                  ERROR   : doorbell: ffmpeg process is not running. exiting capture thread...
2023-06-29 21:15:07.024621539  [2023-06-29 17:15:07] watchdog.doorbell              ERROR   : Ffmpeg process crashed unexpectedly for doorbell.
2023-06-29 21:15:07.024757557  [2023-06-29 17:15:07] watchdog.doorbell              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-06-29 21:15:07.024952668  [2023-06-29 17:15:07] ffmpeg.doorbell.detect         ERROR   : [NULL @ 0x556c6064c240] missing picture in access unit with size 33
2023-06-29 21:15:07.025094159  [2023-06-29 17:15:07] ffmpeg.doorbell.detect         ERROR   : [h264 @ 0x556c607bfec0] no frame!
2023-06-29 21:15:07.025214690  [2023-06-29 17:15:07] ffmpeg.doorbell.detect         ERROR   : Error while decoding stream #0:0: Invalid data found when processing input
2023-06-29 21:15:07.036657272  [2023-06-29 17:15:07] ffmpeg.doorbell.record         ERROR   : rtsp://*:*@192.168.1.30:554/h264Preview_01_main: Invalid data found when processing input
2023-06-29 21:15:07.036779599  [2023-06-29 17:15:07] watchdog.doorbell              INFO    : Terminating the existing ffmpeg process...
2023-06-29 21:15:07.036916340  [2023-06-29 17:15:07] watchdog.doorbell              INFO    : Waiting for ffmpeg to exit gracefully...
2023-06-29 21:15:07.907018332  [2023-06-29 17:15:07] frigate.video                  ERROR   : doorbell: Unable to read frames from ffmpeg process.
2023-06-29 21:15:07.907107098  [2023-06-29 17:15:07] frigate.video                  ERROR   : doorbell: ffmpeg process is not running. exiting capture thread...
2023-06-29 21:15:17.044631627  [2023-06-29 17:15:17] watchdog.doorbell              ERROR   : Ffmpeg process crashed unexpectedly for doorbell.
2023-06-29 21:15:17.044752928  [2023-06-29 17:15:17] watchdog.doorbell              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-06-29 21:15:17.044910896  [2023-06-29 17:15:17] ffmpeg.doorbell.detect         ERROR   : [tcp @ 0x561b1c86b140] Connection to tcp://192.168.1.30:554?timeout=5000000 failed: Connection refused
2023-06-29 21:15:17.045040860  [2023-06-29 17:15:17] ffmpeg.doorbell.detect         ERROR   : rtsp://*:*@192.168.1.30:554/h264Preview_01_sub: Connection refused
2023-06-29 21:15:17.055924641  [2023-06-29 17:15:17] ffmpeg.doorbell.record         ERROR   : [tcp @ 0x558ced06b240] Connection to tcp://192.168.1.30:554?timeout=5000000 failed: Connection refused
2023-06-29 21:15:17.056042018  [2023-06-29 17:15:17] ffmpeg.doorbell.record         ERROR   : rtsp://*:*@192.168.1.30:554/h264Preview_01_main: Connection refused
2023-06-29 21:15:17.056178153  [2023-06-29 17:15:17] watchdog.doorbell              INFO    : Terminating the existing ffmpeg process...
2023-06-29 21:15:17.056304707  [2023-06-29 17:15:17] watchdog.doorbell              INFO    : Waiting for ffmpeg to exit gracefully...
2023-06-29 21:15:17.431587042  [2023-06-29 17:15:17] frigate.video                  ERROR   : doorbell: Unable to read frames from ffmpeg process.
2023-06-29 21:15:17.431731380  [2023-06-29 17:15:17] frigate.video                  ERROR   : doorbell: ffmpeg process is not running. exiting capture thread...
2023-06-29 21:15:27.063788322  [2023-06-29 17:15:27] watchdog.doorbell              ERROR   : Ffmpeg process crashed unexpectedly for doorbell.

FFprobe output from your camera

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"20/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":1920,"width":2560},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"7/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":480,"width":640},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}}]

Frigate stats

{"cpu_usages":{"1":{"cpu":"0.0","mem":"0.0"},"1000":{"cpu":"0.0","mem":"0.5"},"102":{"cpu":"0.0","mem":"0.6"},"1046":{"cpu":"0.0","mem":"0.5"},"1092":{"cpu":"0.0","mem":"0.5"},"1133":{"cpu":"0.0","mem":"0.5"},"1172":{"cpu":"0.0","mem":"0.5"},"1199":{"cpu":"0.0","mem":"0.5"},"1230":{"cpu":"0.0","mem":"0.5"},"1263":{"cpu":"0.0","mem":"0.5"},"1296":{"cpu":"0.0","mem":"0.5"},"1326":{"cpu":"0.0","mem":"0.5"},"134":{"cpu":"0.0","mem":"0.5"},"135":{"cpu":"0.0","mem":"0.5"},"1352":{"cpu":"0.0","mem":"0.5"},"136":{"cpu":"0.0","mem":"0.5"},"137":{"cpu":"0.0","mem":"0.6"},"139":{"cpu":"0.0","mem":"0.5"},"1391":{"cpu":"0.0","mem":"0.5"},"141":{"cpu":"0.0","mem":"0.6"},"143":{"cpu":"0.0","mem":"0.5"},"1441":{"cpu":"0.0","mem":"0.5"},"1486":{"cpu":"0.0","mem":"0.5"},"15":{"cpu":"0.0","mem":"0.0"},"150":{"cpu":"0.0","mem":"0.5"},"1521":{"cpu":"0.0","mem":"0.5"},"1553":{"cpu":"0.0","mem":"0.5"},"1586":{"cpu":"0.0","mem":"0.5"},"16":{"cpu":"0.0","mem":"0.0"},"1621":{"cpu":"0.0","mem":"0.5"},"1659":{"cpu":"0.0","mem":"0.5"},"166":{"cpu":"0.0","mem":"0.5"},"1696":{"cpu":"0.0","mem":"0.5"},"1727":{"cpu":"0.0","mem":"0.5"},"1757":{"cpu":"0.0","mem":"0.5"},"1784":{"cpu":"0.0","mem":"0.5"},"1811":{"cpu":"0.0","mem":"0.5"},"184":{"cpu":"0.0","mem":"0.5"},"1842":{"cpu":"0.0","mem":"0.5"},"1874":{"cpu":"0.0","mem":"0.5"},"1892":{"cpu":"0.0","mem":"0.5"},"1893":{"cpu":"0.0","mem":"0.5"},"1923":{"cpu":"0.0","mem":"0.5"},"1948":{"cpu":"0.0","mem":"0.5"},"1994":{"cpu":"0.0","mem":"0.5"},"2041":{"cpu":"0.0","mem":"0.5"},"2075":{"cpu":"0.0","mem":"0.5"},"213":{"cpu":"0.0","mem":"0.5"},"2131":{"cpu":"0.0","mem":"0.5"},"2185":{"cpu":"0.0","mem":"0.5"},"2237":{"cpu":"0.0","mem":"0.5"},"2271":{"cpu":"0.0","mem":"0.5"},"2307":{"cpu":"0.0","mem":"0.5"},"2341":{"cpu":"0.0","mem":"0.5"},"2375":{"cpu":"0.0","mem":"0.5"},"24":{"cpu":"0.0","mem":"0.0"},"246":{"cpu":"0.0","mem":"0.5"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"2708":{"cpu":"0.0","mem":"3.8"},"2714":{"cpu":"0.3","mem":"0.4"},"2715":{"cpu":"0.0","mem":"4.8"},"2716":{"cpu":"0.7","mem":"4.2"},"2720":{"cpu":"1.3","mem":"4.4"},"2723":{"cpu":"0.0","mem":"0.7"},"2725":{"cpu":"0.7","mem":"4.6"},"2726":{"cpu":"0.0","mem":"3.3"},"2727":{"cpu":"1.0","mem":"4.0"},"2733":{"cpu":"0.7","mem":"4.0"},"2735":{"cpu":"3.3","mem":"1.3"},"2743":{"cpu":"2.3","mem":"0.9"},"275":{"cpu":"0.0","mem":"0.5"},"28":{"cpu":"0.0","mem":"0.0"},"29":{"cpu":"0.0","mem":"0.0"},"297":{"cpu":"0.0","mem":"0.5"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"326":{"cpu":"0.0","mem":"0.5"},"360":{"cpu":"0.0","mem":"0.5"},"3751":{"cpu":"4.3","mem":"1.4"},"3753":{"cpu":"11.3","mem":"0.9"},"3798":{"cpu":"0.0","mem":"0.0"},"3808":{"cpu":"0.0","mem":"0.1"},"398":{"cpu":"0.0","mem":"0.5"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"447":{"cpu":"0.0","mem":"0.5"},"500":{"cpu":"0.0","mem":"0.5"},"542":{"cpu":"0.0","mem":"0.5"},"79":{"cpu":"0.0","mem":"0.0"},"790":{"cpu":"0.0","mem":"0.5"},"795":{"cpu":"0.0","mem":"0.5"},"796":{"cpu":"0.0","mem":"0.5"},"798":{"cpu":"0.0","mem":"0.5"},"800":{"cpu":"0.0","mem":"0.5"},"808":{"cpu":"0.0","mem":"0.5"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"827":{"cpu":"0.0","mem":"0.5"},"851":{"cpu":"0.0","mem":"0.5"},"88":{"cpu":"0.0","mem":"1.0"},"886":{"cpu":"0.0","mem":"0.5"},"913":{"cpu":"0.0","mem":"0.5"},"941":{"cpu":"0.0","mem":"0.5"},"967":{"cpu":"0.0","mem":"0.5"},"97":{"cpu":"0.0","mem":"0.1"},"98":{"cpu":"1.3","mem":"9.2"},"Tasks:":{"cpu":"stopped,","mem":"0.0"},"top":{"cpu":"average:","mem":"0.0"}},"detection_fps":0.8,"detectors":{"coral":{"detection_start":0.0,"inference_speed":38.86,"pid":2715}},"doorbell":{"camera_fps":7.0,"capture_pid":2733,"detection_enabled":1,"detection_fps":0.8,"ffmpeg_pid":3751,"pid":2725,"process_fps":7.2,"skipped_fps":0.0},"girls_cam":{"camera_fps":7.0,"capture_pid":2727,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":2735,"pid":2720,"process_fps":7.0,"skipped_fps":0.0},"service":{"last_updated":1688074407,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":2145.4,"mount_type":"tmpfs","total":2147.5,"used":2.1},"/media/frigate/clips":{"free":3833591.8,"mount_type":"zfs","total":3861705.1,"used":28113.4},"/media/frigate/recordings":{"free":3833591.8,"mount_type":"zfs","total":3861705.1,"used":28113.4},"/tmp/cache":{"free":388527.7,"mount_type":"zfs","total":388540.1,"used":12.5}},"temperatures":{},"uptime":1191,"version":"0.12.1-367d724"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Reolink Doorbell Wifi, Latest firmware.

Any other information that may be helpful

On TrueNAS Scale using TrueCharts Frigate app. I have a Coral passed through that seems to be working fine, no GPU.

I tried to limit to relevant logs since they repeat so much. I have 2 cameras an older C1-Pro which won't work with HTTP and the doorbell. As you can see from commented out lines I was testing many different configurations. Same log problems when switching between http and rtsp streams.

Already upgraded to go2rtc 1.5 and the logs are empty aside from starting notes.

kdill00 commented 1 year ago

here is my config:

go2rtc:
  webrtc:
    candidates:
      - stun:8555
  streams:
    doorbellmain:
         - rtsp://****:****@192.168.3.230:554/h264Preview_01_main#backchannel=0
    doorbellsub:
         - rtsp://****:****@192.168.3.230:554/h264Preview_01_sub
         - ffmpeg:rtsp://***********@192.168.3.230:554/h264Preview_01_sub#audio=opus
cameras:
  doorbell:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/doorbellmain
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
        #- path: rtsp://127.0.0.1:8554/doorbellmain?video=copy
        #  input_args: preset-rtsp-restream
        #  roles:
        #    - record
      output_args:
          record: preset-record-generic

I use the sub channel with frigate card for two way talk and the main for recording and detect. This camera can barely deal with two streams at a time and I have an ethernet one. Make sure your power it squared away and that you are using 5G wifi or have a very solid 2.4ghz. Make sure to reduce fps and change that weird setting they have for Fluency on fps on the cameras settings page. it automatically adjusts fps and thats not a good thing, needs to be turned off. you need to open that web section to change it as the app does not have it.

Medic97 commented 1 year ago

The local rtsp address didn't work for me. I am checking with reolink now, if my power is an issue. I was reusing the power adapter I used with my nest cam. It shows like 2 bars but it's right below my U6-Pro so idk what the issue is. Here are my camera settings

Screenshot 2023-06-29 at 6 29 09 PM Screenshot 2023-06-29 at 6 29 25 PM Screenshot 2023-06-29 at 6 29 29 PM
kdill00 commented 1 year ago

I think that backchannel=0 on whatever stream you won’t be using two way talk on is important or put it on both if your not using talk as the voice channel seems to ruffle its feathers if not disabled on one of the streams. Not a 100 percent sure. I worked on it for a full 24 hours and am not completely sure where I stated getting it right besides that fluency fps

Medic97 commented 1 year ago

Oh so far not using with either, I didn't want to add complexity till after it was stable. I'll add that now to both links.

kdill00 commented 1 year ago

Increase your interframe rate and move fps down to 15 maybe. You might be mogging the the camera. Mine would reboot or reset from heavy load until I reduced fps and increased interframe to give the camera some space. Can you connect to rtsp with VLC?

kdill00 commented 1 year ago

Also you may need to hard reboot it. I noticed sometimes I would change settings and it would hang. Not applying them till I logged in and manually reboot it

Medic97 commented 1 year ago

Somewhere it said to put interframe at 1x instead of 2x, dont remember now where. Yes VLC links fine.

kdill00 commented 1 year ago

Whatever you do reduce connections as much as possible. I don’t think you can have two open connections with detect and record. My substream is only used when viewing. go2rtc duplicates main stream to reduce connections.

kdill00 commented 1 year ago

I’ll rephrase that. You can but it seems to not work out well and was part of my issue

Medic97 commented 1 year ago

Why would you record the lower res substream and not the main one? Doesnt that defeat the purpose of a high res cam?

Medic97 commented 1 year ago

Actually I see you are using the main for detect and sub. The docs said to avoid that. Maybe I should only have one stream for both like you do.

Medic97 commented 1 year ago

What does this part of your config do?

doorbellsub:
         - rtsp://****:****@192.168.3.230:554/h264Preview_01_sub
         - ffmpeg:rtsp://***********@192.168.3.230:554/h264Preview_01_sub#audio=opus
kdill00 commented 1 year ago

I record high res and detect on high res. I’d rather detect on low like you’re doing and I do with my other cameras but this camera is finniky. If you look at my config it makes a connection to main using go2rtc and one to sub go2rtc does not connect to the camera unless you’re viewing. So my sub sits ready to be viewed quickly when the door bell is rung. The main one copied by go2rtc is then duplicated by putting record and detect under the same input. So only one connection exists at most times to the camera

***sorry for typos. On my phone on the move.

kdill00 commented 1 year ago

What does this part of your config do?

doorbellsub:
         - rtsp://****:****@192.168.3.230:554/h264Preview_01_sub
         - ffmpeg:rtsp://***********@192.168.3.230:554/h264Preview_01_sub#audio=opus

That retranscodes the audio so it will work in frigate and homeassistant with two way talk. The device only accepts a certain Audio in two way talk

Medic97 commented 1 year ago

Your giving me ideas. I'll detect and record on the main one and us the sub only for notifications using HA.

Edit: Ok so I separated main from sub in go2rtc like you have and I made detect and record on the main stream. Lets hope this works better.

kdill00 commented 1 year ago

Your giving me ideas. I'll detect and record on the main one and us the sub only for notifications using HA.

Yeah. If you copy my config you can add frigate card and turn on the microphone as along as you access homeassistant over https. I have it notify me with an image and a direct link to a panel dashboard with frigate card and the microphone ready to chit chat

Medic97 commented 1 year ago

"I have it notify me with an image and a direct link to a panel dashboard with frigate card and the microphone ready to chit chat" Would love to see that automation code so I don't have to recreate it. I use cloudflared to get inside the house so it's https.

kdill00 commented 1 year ago

Sure. I’ll dig it up. I use reverse proxies so I had to get creative. My local lan address is now behind a reverse proxy like my public one to give https while on Wifi. I’ll grab the automations for you.

kdill00 commented 1 year ago

I also turned on https for the camera as some people online said theirs wouldn’t work at all with it off. Forgot about that

Medic97 commented 1 year ago

Sure. I’ll dig it up. I use reverse proxies so I had to get creative. My local lan address is now behind a reverse proxy like my public one to give https while on Wifi. I’ll grab the automations for you.

I want to explore that next. I just completed my Unifi setup so between the built in firewall and making vlans and internal dns servers.... I am headed down a big rabbit whole. Not even sure which one I should start with.

kdill00 commented 1 year ago

Nginx proxy manager in the addon store is a perfect start. Very easy to use. Just buy a godaddy domain or another larger provider and create tons of A record subdomains till your hearts content, i say godaddy because nginx proxy manager can use their api to register ssl certificates with lets encrypt. I have about 15 subdomain reverse proxies for various things from plex and all its downloads to another homeassistant behind tailscale in the middle of nowhere running cameras. Your way is probably more secure though. Im just to the point with privacy where if someones going to hack me their going to get a whole bunch of worthless boring stuff and hours of bad python scripts and me trying to fumble my way through different things.

kdill00 commented 1 year ago
alias: doorbell
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.reolink_video_doorbell_poe_visitor
    to: "on"
condition: []
action:
  - service: script.doorbellon
    data: {}
  - service: notify.notify
    data:
      message: Doorbell was rung.  Tap to respond.
      data:
        url: /dashboard-test/0
        image: https://**********/api/doorbell/latest.jpg
    enabled: false
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.reolink_video_doorbell_poe_visitor
        to: "off"
        for:
          hours: 0
          minutes: 0
          seconds: 0
    timeout:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
mode: single

ignore the script.doorbellon. Thats just to trigger a raspberry pi to play a door bell noise over my house speakers. got annoyed with their lame doorbell that would never connect and my previous one was a fog horn.

kdill00 commented 1 year ago

i will mention I installed the reolink addon for homeassistant from hacs. Then disabled all the camera entities to reduce connections and just use the sensors.

illivanillie commented 1 year ago

My Reolink Duos only work properly with preset-rtsp-udp on the h265 channel. I did not test sound yet.

Medic97 commented 1 year ago

Edit: I spoke way too soon, log full of errors. Back to the drawing board.

Posting for others who come by the same issue. I will say to @kdill00 point about power, I did change the power cable going to the camera to the one provided by reolink. Now it's reporting above 90% wifi experience in unifi. I had to splice it which is why i didn't use it to begin with. I felt the 16v one I was using for the Nest Cam should've been fine. I would say if you are going aftermarket get a 24v one like theirs.

I just spend 5 hours in trial and error, I also gave frigate full use of my 72 cores but it still maxes out my cpu. But this config finally works, at some point recordings were choppy and green but finally all is well.

The only Errors in my log now are these, could be cuz I mapped the cache to host instead of letting it map it every time the cluster came back up. frigate.record ERROR : Error occurred when attempting to maintain recording cache frigate.record ERROR : list index out of range

Either way hope someone else can use this in time. Now on to @kdill00 HA automation!

go2rtc:
  streams:
    girls_cam:
      - rtsp://User:Password@192.168.##.##:554/h264Preview_01_main#backchannel=0
      # - http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=User&password=Password
      # - "ffmpeg:http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=User&password=Password#video=copy#audio=copy"
    doorbell:
      # - rtsp://User:Password@192.168.##.##:554/h265Preview_01_main#backchannel=0
      - http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=User&password=Password#backchannel=0
      # - "ffmpeg:http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=User&password=Password#video=copy#audio=copy#backchannel=0"
    doorbell_sub:
      # - rtsp://User:Password@192.168.##.##:554/h265Preview_01_sub
       - http://192.168.##.##/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=User&password=Password#backchannel=0
  # webrtc:
  #   candidates:
  #     - 192.168.1.11:8555
  #     - stun:8555

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: True
  retain:
    mode: all
  events:
    pre_capture: 10
    post_capture: 10
    retain:
      default: 90
      mode: motion

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  bounding_box: True
  retain:
    default: 14

cameras:
  girls_cam:
    detect:
      width: 640
      height: 360
      fps: 7  
    ffmpeg:
      output_args:
          record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://User:Password@192.168.##.##:554/h264Preview_01_main
          roles:
            - record
        - path: rtsp://User:Password@192.168.##.##:554/h264Preview_01_sub
          roles:
            - detect
  doorbell:
    detect:
      width: 640
      height: 480
      fps: 5
    ffmpeg:
      input_args: preset-rtsp-restream
      output_args:
          record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/doorbell?video=copy&audio=copy
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/doorbell_sub?video=copy
          roles:
            - detect
illivanillie commented 1 year ago

@Medic97 kust out of curiosity: did you try rtsp via udp? With the generic preset (tcp) I really had a lot of instability and constant errors.

Medic97 commented 1 year ago

@Medic97 kust out of curiosity: did you try rtsp via udp? With the generic preset (tcp) I really had a lot of instability and constant errors.

Yes that is one the setting I tried as well. I'm going to mess it again today and see what can be done.

kdill00 commented 1 year ago

This camera is different than other reolink cameras. Check and make sure you do have the latest firmware. They pushed an updated one as recently as May that fixed a lot. I bought mine at the end of may and still had to find and upgrade the firmware. The reolink settings suggested for other reolink cameras made this one worse for me(same greenscreen issues), as this one is closer to an average rtsp camera. Did you change the cameras https setting as well? I read people solved issues with that. But if you have a clear video showing in VLC then this is just finding the right settings in ffmpeg. Transcode the audio. Don’t copy it. I think that’s probably your issue. The default audio is incompatible is probably causes the connectivity/greenscreen. It will use a lot of resources as it’s a massive resolution if you don’t limit fps and increase the inter frames.

kdill00 commented 1 year ago

Wifi and Ethernet use completely different firmware files or I’d give you the one I have. Not holding out on you. Hope you get it tuned in more. New versions of frigate will have the ability to start recording with an http post request such as if button is hit or even triggered by another camera seeing person getting close. I may end up doing that if I ever get annoyed with its extra consumption of detect frames.

Also just for anyone else as a last resort or if you prefer, this camera works excellent through Apple Home Kit using that Scrypted app and their onvif / HomeKit plugin. If you have an Apple cloud subscription (3 bucks a month) you can have Apple run object detection and record it using HomeKit secure video and talk back through phone notifications. You’ll need an Apple device that supports Apple HomeKit for some of these feature. Appletv or somewhat recent Apple computer. Scrypted can be a resource hog so it may not be worth it to some.

kdill00 commented 1 year ago

Also last comment, the firmware probably won’t do much for the issue you’re facing unless the Wifi version had other issues the Ethernet one didn’t. Most firmware updates have been centered around the ONVIF bastardized profile-T they birthed for this thing to do 2 way talk as reolink has been trying hard to make it work well with any application. Wish there was one clear answer but probably won’t be till the dust settles on this new camera.

NickM-27 commented 1 year ago

Yeah, I run with http-flv and have had no issues with my doorbell crashing at all, but I have the audio set to be transcoded and don't use the original audio.