AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
7.27k stars 524 forks source link

How to config an onvif camera with three streams #1410

Open latel opened 1 month ago

latel commented 1 month ago
log:
  level: debug

streams:
  Hikvision:
    - rtsp://admin:xxxxxxx@11.10.22.22:554/Streaming/Channels/101
    - rtsp://admin:xxxxxxx@11.10.22.22:554/Streaming/Channels/102
    - rtsp://admin:xxxxxxx@11.10.22.22:554/Streaming/Channels/103

how do I turn into something like this?

streams:
  Hikvision:
    - onvif://admin:xxxxxxx@11.10.22.22
AlexxIT commented 1 month ago

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

latel commented 1 month ago

image

the detected source format looks pretty wired.

AlexxIT commented 1 month ago

Add your link with user/pass to test line

latel commented 1 month ago

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
AlexxIT commented 1 month ago

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.

latel commented 1 month ago

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.

AlexxIT commented 1 month ago
  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.
latel commented 1 month ago

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 commented 1 month ago

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:password@192.168.1.123/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
    - rtsp://admin:password@192.168.1.123/cam/realmonitor?channel=1&subtype=1
AlexxIT commented 1 month ago

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

latel commented 4 weeks ago

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.

AlexxIT commented 3 weeks ago
  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.