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 new docs for beta 7 #5370

Closed angrycatmeowmeow closed 1 year ago

angrycatmeowmeow commented 1 year ago

Describe the problem you are having

Curious if the go2rtcconfig controls the live view, and the cameras: config controls how Frigate connects to the cameras? I ask because the new recommended configs in the docs for Reolink cameras shows HTTP streams under go2rtc and RTSP streams in camera config, I plan on using HTTP for both. I'm not sure if I even need a go2rtc config in that scenario, but when I upgraded to beta4 it wouldn't start unless I added a go2rtc config. What is the benefit of adding main and sub streams to go2rtc?

Version

0.12.0-66881EB

Frigate config file

go2rtc:
  ffmpeg:
    rtsp: "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
  streams:
    Doorbell:
      - rtsp://user:password@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Doorbell#audio=opus
    Crouton_Cam:
      - rtsp://user:password@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Crouton_Cam#audio=opus
    Garage_East:
      - rtsp://user:password@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Garage_East#audio=opus
    Garage_West:
      - rtsp://user:password@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Garage_West#audio=opus
    Lounge:
      - rtsp://user:passwordZ@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Lounge#audio=opus
    Front_Porch:
      - rtsp://user:password@reolink_ip:554/h264Preview_01_main
      - ffmpeg:Front_Porch#audio=opus

cameras:
  # Name of your camera
  Doorbell:
    ffmpeg:
      input_args: preset-http-reolink
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=user&password=password
          roles:
            - detect
        - path: http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=user&password=password
          roles:
            - record
    record:
      enabled: True
      events:
        retain:
          default: 2
    detect:
      width: 640
      height: 480
      fps: 7
    objects:
      track:
        - person
        - dog
        - cat
        - package
        - bird

Relevant log output

n/a

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Any other information that may be helpful

Not using any hwaccel as I haven't found anything that works on an odroid n2+ addon 0.12.0-beta7 and integration v4.0.0-beta4

NickM-27 commented 1 year ago

If you use http for both then that is multiple connections to the camera, for example the Reolink doorbell seems to only support 1 main stream connection. When using rtsp 127.0.0.1 frigate will connect to go2rtc as the restream so it will only be 1 connection to the camera itself.

go2rtc provides a way to have better live view options inside frigate as well as the rtsp restream inside and outside frigate.

NickM-27 commented 1 year ago

the go2rtc config being required is a bug in beta4

angrycatmeowmeow commented 1 year ago

Ok. Is there any reason rtsp is recommended for camera and http is recommended for go2rtc? The goal is solid recording and since the http stream seems most reliable, I'd put that under camera and maybe just get rid of go2rtc.

NickM-27 commented 1 year ago

I think you are misunderstanding. the rtsp under camera is not rtsp from the reolink. It is go2rtc taking reolink http and relaying it via RTSP. The fact that http from reolink is most reliable is correct, but after that rtsp relay from go2rtc is most reliable

NickM-27 commented 1 year ago

the problem with reolink cameras is their specific rtsp connection due to internal firmware, not rtsp in general

NickM-27 commented 1 year ago

without go2rtc you'll also be missing out on the much improved live views

angrycatmeowmeow commented 1 year ago

Oh I see, that's why the camera names must match in both configs. I'm using the IP of my cameras in the RTSP stream when it should be local host, and I should have RTSP under camera and http under go2rtc. Should I be using any input args in the go2rtc config or just in the rtsp under camera config? I'm gonna mimic the recommended config later when I have time, then I'll close this if everything works. Thanks.

NickM-27 commented 1 year ago

Oh I see, that's why the camera names must match in both configs. I'm using the IP of my cameras in the RTSP stream when it should be local host, and I should have RTSP under camera and http under go2rtc. Should I be using any input args in the go2rtc config or just in the rtsp under camera config? I'm gonna mimic the recommended config later when I have time, then I'll close this if everything works. Thanks.

yes it seems that you understand now. go2rtc handles all the config there, just recommend using preset-rtsp-restream when pointing at localhost for frigate camera config

angrycatmeowmeow commented 1 year ago

Everything went well, except for some reason it duplicated all of my cameras entities. So now camera.doorbell is dead but still showing in HA, and it's been replaced by camera.doorbell_2. I guess if I delete the integration, it shouldn't be too hard to set it back up as the addon is still there, as a way to reset everything? I've got over 300 entities, over half of which are dead, for 6 cameras.

NickM-27 commented 1 year ago

Everything went well, except for some reason it duplicated all of my cameras entities. So now camera.doorbell is dead but still showing in HA, and it's been replaced by camera.doorbell_2. I guess if I delete the integration, it shouldn't be too hard to set it back up as the addon is still there, as a way to reset everything? I've got over 300 entities, over half of which are dead, for 6 cameras.

did you by chance setup the beta integration without removing the first instance? that's the only reason I can think that it would have done that. updating will only keep the relevant sensors so you should be able to move forward without losing entities assuming you delete the correct instance of the integration

angrycatmeowmeow commented 1 year ago

I was using release versions of the integration up until beta 4, that's when I started using the beta integration and I did that by updating my release to the beta. I never removed the integration nor did I set up two side by side integrations.

NickM-27 commented 1 year ago

right, but if you updated the addon to the beta you would have needed to point to the new hostname (unless you enabled and are using port 5000 directly)

angrycatmeowmeow commented 1 year ago

Yeah that was probably it. I still only have one integration though. To be clear, I was using 011 beta with the non-beta integration, but when 012 came out and it required updating the integration to the beta, that's when I made the move.

angrycatmeowmeow commented 1 year ago

Deleted and readded integration. Much success.