go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

How to config an onvif camera with three streams

Open latel opened this issue 1 year ago • 12 comments

log:
  level: debug

streams:
  Hikvision:
    - rtsp://admin:[email protected]:554/Streaming/Channels/101
    - rtsp://admin:[email protected]:554/Streaming/Channels/102
    - rtsp://admin:[email protected]:554/Streaming/Channels/103

how do I turn into something like this?

streams:
  Hikvision:
    - onvif://admin:[email protected]

latel avatar Oct 25 '24 08:10 latel

Open WebUI > Add > ONVIF. Add your stream and check response.

AlexxIT avatar Oct 25 '24 09:10 AlexxIT

image

the detected source format looks pretty wired.

latel avatar Oct 25 '24 09:10 latel

Add your link with user/pass to test line

AlexxIT avatar Oct 25 '24 09:10 AlexxIT

If I have a camera with three streams, how can I add them to go2rtc and then integrate them into Scrypted? Typically, when I add my camera to Scrypted using ONVIF, all streams become available in the Scrypted camera settings(screenshots below), and Scrypted can switch to a different stream—such as a low-resolution one—when the network is not good. If I add the camera via go2rtc, should I define the three streams individually and then add them to Scrypted individually?

image image

latel avatar Oct 29 '24 02:10 latel

If you have one camera with different resolutions - you should add them to go2rtc as separate streams. go2rtc doesn't have auto switch feature based on bandwidth.

AlexxIT avatar Oct 29 '24 09:10 AlexxIT

Thank you for your guidance. One last question: After I connect the camera to go2rtc and then integrate it with other platforms like Scrypted or Home Assistant, can I still retain the two-way audio capability? As far as I know, this relies on the ONVIF protocol, and I noticed that go2rtc doesn’t support re-exposing as ONVIF, only supports RTSP.

latel avatar Oct 29 '24 11:10 latel

  1. In truth, you don't need ONVIF protocol support there. Two way works over RTSP protocol with backchannel support. But such a standard has no name. But ONVIF Profile T has a name.
  2. Go2rtc not support exposing RTSP with backchannel (yet).
  3. Go2rtc support exposing ONVIF.
  4. Home Assistant core doesn't support two way audio out of box (yet)
  5. You can add your camera to go2rtc AND to Scrypted simultaneously.

AlexxIT avatar Oct 29 '24 11:10 AlexxIT

Therefore, the only solution seems to be option #5: adding my camera to both go2rtc and Scrypted simultaneously. However, this would double the load on my low-end camera, which only supports two streams at a time. For the NVR, I suppose two-way audio isn’t necessary, so I’ll have the NVR read the stream from go2rtc. But I’m wondering how I can pass through the camera’s built-in motion sensor to the NVR so that it records motion timestamps on the video timeline.

I hope go2rtc will support pass-through of two-way audio in the future.

latel avatar Oct 30 '24 15:10 latel

And what's the meaning of define multiple rtsp address under the same stream source? It's not documented in the README.

streams:
  dahua_camera:
    - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
    - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=1

latel avatar Oct 31 '24 02:10 latel

https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#codecs-negotiation

AlexxIT avatar Oct 31 '24 17:10 AlexxIT

3. Go2rtc support exposing ONVIF.

Does Go2RTC support exposing ONVIF with two-way audio? This would be a common feature request, especially if added to the Home Assistant dashboard with two-way audio capabilities.

latel avatar Nov 05 '24 01:11 latel

  1. As I said earlier - two way audio is not about ONVIF protocol. It's about RTSP protocol with backchannel.
  2. No, go2rtc not support exposing RTSP with backchannel yet.
  3. It has absolutely no effect on the Home Assistant.

AlexxIT avatar Nov 05 '24 08:11 AlexxIT