go2rtc: When go2rtc self-requests a source capable of backchannel, it breaks backchannel

It was very tricky to figure out that this was actually caused by go2rtc.

Here is my config:

streams:
  vto:
    # H264, PCMA/8000, 2-way audio
    - rtsp://admin:8EiPuNd6pzjR686_@192.168.1.40/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
    # copy AAC track from vto_hd
    - rtsp://127.0.0.1:8554/vto_hd?audio=aac
  vto_hd:
    # H264, AAC/16000
    - rtsp://admin:8EiPuNd6pzjR686_@192.168.1.40/cam/realmonitor?channel=1&subtype=1
    # copy PCMA track from vto
    - rtsp://127.0.0.1:8554/vto?audio=pcma

In fact, I have a script to output the stream rather than using it directly because of https://github.com/AlexxIT/go2rtc/issues/49, but I am removing it from this test to simplify things.

Also, my password is leaked but that is ok, I changed already. That’s because I could not figure out how to remove it from the info API from go2rtc so it would appear in the video anyway.

Here is the problem:

https://github.com/AlexxIT/go2rtc/assets/29582865/7fb1876a-9e18-4005-a06a-e07f26ad5ba9

Basically, if I open vto first, everything works ok. I can 2-way audio with it normally. Notice the sendonly track.

However, if I open vto_hd first, then I can no more do 2-way audio with the vto stream.

I think go2rtc should attempt to discover again more tracks if 2-way audio is requested. In fact, I don’t understand why it only discovers the recvonly tracks when I request vto_hd.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (15 by maintainers)

Most upvoted comments

Yes, yes, I’ve already tried to write this several times.

EDIT: This is off-topic and a different, device-related issue.

Hm… I actually understand now. When someone calls the doorbell, like when someone presses it, the doorbell closes the RTSP stream momentarily. And go2rtc tries to get the connection again but this time it gets without sendonly track. Only if I ask go2rtc to get the connection after the call is finished it will be able to get sendonly again.