Go2rtc project - help thread


Добавте камеры в конфиг go2rtc.
Add cameras to go2rtc config.

thanks,
this is my configuration:

streams:
  Pergotenda:
     - rtsp://user:[email protected]:554/Streaming/Channels/102/

but this is my situation:

image

i don’t see nothing…

QQ: What is the URL to use for a client that expects to POST an SDP Offer to Go2rtc, it doesn’t work with any of the stream URLs I can find anywhere because I believe they have a HTTP wrapper to display in a browser but I need the raw URL. For instance it works with
http://192.168.0.152:8083/stream/4e33dfa0-4227-4f6e-b321-008f30f4b365/channel/0/webrtc
from a standalone RTSPtoWeb instance, trying to port that over and use the Go2RTC server built into the latest Frigate beta so I can retire RTSPtoWeb

Thanks in advance, I did try to read through many of the docs and tried many of the URLs in the stream dialogs but those seem to be GET type ones, they do work in a browser so I think I have all the Go2RTC input stuff working correctly, just trying to consume the output in Magic Mirror module MMM-RTPSToWeb (GitHub - shbatm/MMM-RTSPtoWeb: MagicMirror2 Module for viewing IP cameras RTSP stream in real time using WebRTC technology.)

Вы логин и пароль должны поставить от своей камеры.

You must set the login and password from your camera.

sorry but I have the username and password set in my camera and in the link there are (obviously I didn’t put the real ones but there are):

streams:
  Pergotenda:
     - rtsp://user:[email protected]:554/Streaming/Channels/102/

where else should i add the credentials?

What are you trying to do, once you get to that page you can click on stream or links, and on links you can use any of the link for your application . If the stream or the link does not work, there is something wrong with your streams configuration.

the configurations are perfect since if I don’t update everything works correctly.
I don’t do much: I update, I compiled the go2rtc page but nothing works (none of the links work, the video screen appears but it is black and the wheel spins endlessly), so my initial question was: has something changed from how it worked before? because it works first, if I update it doesn’t work and since I don’t change the configuration or settings of any camera what can it be? Is there some step I am missing? any incompatibilities after the update?
Thanks.

Has anyone been able to get 2 way audio to work with Dahua POE cameras connected directly to the NVR? I’ve been trying to get this to work for quite some time and from what I can tell it looks like it should be working. I can hear audio from the cameras, but cannot get audio to come out of the camera when connected to the NVR. If I connect the camera directly to my normal network POE switch it works as expected.

This is what I have when connected to the feed while the camera is connected to the NVR.

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.10.15:554/cam/realmonitor?channel=6\u0026subtype=0\u0026unicast=true\u0026proto=Onvif/",
      "remote_addr": "192.168.10.15:554",
      "user_agent": "go2rtc/1.3.1",
      "medias": [
        "video, recvonly, H.264 Main 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "application, recvonly, VND.ONVIF.METADATA",
        "audio, sendonly, L16/8000, PCMA/8000, PCMU/8000"
      ],
      "receivers": [
        "96 H264, bytes=7691754, senders=1"
      ],
      "senders": [
        "8 PCMA/8000, bytes=96160, receivers=1"
      ],
      "recv": 7756590,
      "send": 110584
    },
    {
      "type": "RTSP passive producer",
      "url": "rtsp://localhost:8554/2fb2154bf0b32ade9a8f185d2ef87976",
      "remote_addr": "[::1]:47522",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        "96 OPUS/48000/2, bytes=135621, senders=1"
      ],
      "recv": 143493
    }
  ],
  "consumers": [
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "udp4 host 192.168.11.37:55901",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2023.2 (io.robbie.HomeAssistant; build:2023.444; iOS 16.3.1) Mobile/HomeAssistant, like Safari",
      "medias": [
        "video, sendonly, H264, RTX, VP8, VP9, RED, ULPFEC, FLEXFEC-03",
        "audio, recvonly, OPUS/48000/2, RED/48000/2, ISAC/16000, G722/8000, PCMU/8000, PCMA/8000, CN/16000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/16000, TELEPHONE-EVENT/8000",
        "audio, sendonly, OPUS/48000/2, RED/48000/2, ISAC/16000, G722/8000, PCMU/8000, PCMA/8000, CN/16000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/16000, TELEPHONE-EVENT/8000"
      ],
      "receivers": [
        "8 PCMA/8000, bytes=96160, senders=1"
      ],
      "senders": [
        "96 H264, bytes=7691754, receivers=1",
        "96 OPUS/48000/2, bytes=135621, receivers=1"
      ],
      "recv": 108600,
      "send": 7916613
    }
  ]
}

This is with the camera direct through my POE switch where 2 way audio works

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.21.6:554/cam/realmonitor?channel=1\u0026subtype=0\u0026unicast=true\u0026proto=Onvif/",
      "remote_addr": "192.168.21.6:554",
      "user_agent": "go2rtc/1.3.1",
      "medias": [
        "video, recvonly, H.264 Main 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "application, recvonly, VND.ONVIF.METADATA",
        "audio, sendonly, L16/8000, L16/16000, L16/32000, L16/48000, L16/64000, PCMA/8000, PCMA/16000, PCMA/32000, PCMA/48000, PCMA/64000, PCMU/8000, PCMU/16000, PCMU/32000, PCMU/48000, PCMU/64000, G726-40/8000, G726-40/16000, G726-40/32000, G726-40/48000, G726-40/64000, MPEG4-GENERIC/8000, MPEG4-GENERIC/16000, MPEG4-GENERIC/32000, MPEG4-GENERIC/48000, MPEG4-GENERIC/64000, 122, 123, 124, 125, 126"
      ],
      "receivers": [
        "96 H264, bytes=29127379, senders=1"
      ],
      "senders": [
        "8 PCMA/8000, bytes=429600, receivers=1"
      ],
      "recv": 29376235,
      "send": 494040
    },
    {
      "type": "RTSP passive producer",
      "url": "rtsp://localhost:8554/e203d5d52cdd35a3a4bbb1b00b6b780b",
      "remote_addr": "[::1]:43236",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        "96 OPUS/48000/2, bytes=554081, senders=1"
      ],
      "recv": 587209
    }
  ],
  "consumers": [
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "udp4 host 192.168.11.37:65472",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2023.2 (io.robbie.HomeAssistant; build:2023.444; iOS 16.3.1) Mobile/HomeAssistant, like Safari",
      "medias": [
        "video, sendonly, H264, RTX, VP8, VP9, RED, ULPFEC, FLEXFEC-03",
        "audio, recvonly, OPUS/48000/2, RED/48000/2, ISAC/16000, G722/8000, PCMU/8000, PCMA/8000, CN/16000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/16000, TELEPHONE-EVENT/8000",
        "audio, sendonly, OPUS/48000/2, RED/48000/2, ISAC/16000, G722/8000, PCMU/8000, PCMA/8000, CN/16000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/16000, TELEPHONE-EVENT/8000"
      ],
      "receivers": [
        "8 PCMA/8000, bytes=429600, senders=1"
      ],
      "senders": [
        "96 H264, bytes=29127379, receivers=1",
        "96 OPUS/48000/2, bytes=554081, receivers=1"
      ],
      "recv": 485330,
      "send": 30022698
    }
  ]
}

From what I can tell these two logs confirm that go2rtc is working under both scenarios and the problem is at the NVR, but I have no clue how to continue debugging. Everything is on latest firmware versions available. Only thing I can think might make sense at this point is to do a packet capture off the NVR and see if anything there sheds a light on things.

You right. Browser sends audio to RTSP in both situation.

Да в версии 1.2.0 все потоки работали а в 1.3.0 и 1.3.1 нет.
Yes, in version 1.2.0 all threads worked, but not in 1.3.0 and 1.3.1.

English please

1 Like

Any guidance to what stream URL to use for the raw WebRTC, no browser wrapper. The integration I am using just wants the API endpoint to http POST. The 3rd party tool is the magic mirror module MMM-RTSPtoWeb

It is looking for an API that conforms to this spec RTSPtoWeb/api.md at e33c0f6251b24f302c858b4d39cb0406741d0378 · deepch/RTSPtoWeb · GitHub

emphasized text

WebRTC

/stream/{STREAM_ID}/channel/{CHANNEL_ID}/webrtc

http://127.0.0.1:8083/stream/{STREAM_ID}/channel/{CHANNEL_ID}/webrtc

Request

The request is an HTTP POST with a FormData parameter data that is a base64 encoded SDP offer (e.g. v=0...) from a WebRTC client.

Response

The response is a base64 encoded SDP Answer.emphasized text

I have read whole topic, and many more, but…

I’ve got WebRTC custom component, which works just fine with Tapo cameras (cameras added to HA with Tapo custom component, and i added it to WebRTC card as entities ), but i want to create 2-way audio from HA companion app, and use a microphone.
I’m bit confused, (and my poor language and programing skills didn’t help me) how to configure it .
As i understand, I’ve got to create go2rtc.yaml config file?
And how to add mic support? Via iFrames as previously , or there is newer- more easy- method ?

Also example of configuration.yaml is:

media_player:
  - platform: webrtc
    name: Tapo Camera
    stream: tapo
    audio: pcma

What should stream be? Name of stream configured in go2rtc yaml?

Two way audio works in the go2rtc WebUI or in the iframe.
Media player is used for playing TTS or other audio on camera.

1 Like

Should url embedded in iframe work remotely via https? Do i need to create stream link ?

Yeah it needs to work remotely

I think you had it figured out, what is step by step guide?
I know the part you described here: Go2rtc project - help thread - #107 by conorlap

But I’m not sure where to find correct link , as my go2rtc is just an HA custom component

Edit: i figured out that i actually can connect to go2rtc GUI when port 1984 on my router is opened, bud after i clicked “save and restart” my whole go2rtc didn’t start again.

I just updated my Frigate add-on to use go2rtc for my doorbell streams (main and sub).

It works OK, but in the custom:frigate-card there is a difference in resolution although i’m using the same stream.

I prefer to use the go2rtc camera name.

frigate-card with good resolution as i want it (with the HA entity):

type: custom:frigate-card
cameras:
  - camera_entity: camera.camera_doorbell
view:
  default: live
  timeout_seconds: 60
  update_seconds: 60

frigate-card that seems to use a low resolution although it should be the same stream (camera name from go2rtc)?

type: custom:frigate-card
cameras:
  - frigate:
      camera_name: camera_doorbell
view:
  default: live
  timeout_seconds: 60
  update_seconds: 60

Frigate config:

go2rtc:
  streams:
    camera_doorbell_sub:
      - rtsp://****:****@192.168.0.86:554/cam/realmonitor?channel=1&subtype=1&authbasic=64
    camera_doorbell:
      - rtsp://****:****@192.168.0.86:554/cam/realmonitor?channel=1&subtype=0&authbasic=64

cameras: 
  camera_doorbell:
    ffmpeg:
      hwaccel_args: preset-vaapi # -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        # lowres
        - path: rtsp://127.0.0.1:8554/camera_doorbell_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        # hires
        - path: rtsp://127.0.0.1:8554/camera_doorbell 
          input_args: preset-rtsp-restream
          roles:
            - record
            #- rtmp

    detect:
      width: 1440
      height: 1080
      fps: 10

    live:
      height: 1040
      quality: 1    

I think I read everything but I don’t see any secure way to get a https public link for my cameras. So the only way I see to get my doorbell stream to pip and alexa devices is the webrtc.create_link service.
But I use frigate 12 which already has the go2rtc and I am trying to avoid webrtc because frigate card and plugin covers everythink.
@AlexxIT do you plan to include this service?

Let me know if I miss something also.

I don’t understand what service you talking about.