Go2rtc project - help thread

Hi @AlexxIT ,
thank you for your prompt feedback and your beautiful work.
I saw in the readme

You can use input param to override default input template (ex. #input=rtsp/udp will change RTSP transport from TCP to UDP+TCP)

this mean that is not forced to UDP, but it uses UDP as preferred and eventually fallback to TCP?
what about if I defined another entry for that camera to do audio transcoding like in my example below? do i need to put #input=rtsp/udp also for the second line (i guess no, but I would like to be sure)

   camera.go_box: 
     - ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
     - ffmpeg:camera.go_box#audio=opus

thanks

please post your code if you got stuff working. I canā€™t seem to figure out why I canā€™t get my reolinks working with webrtc.

My RLC-410 5 MP is working with the following

camera.go_box: 
     - rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
     - ffmpeg:camera.go_box#audio=opus

Now Iā€™m trying to improve it by switching rtsp to udp instead of tcp

when trying exactly the same, but with my own pass and IP, this doensā€™t seem to switch to RTC, does yours? Iā€™m using a 811A

Usually yes.
In your case it stay always in MSE?

yup, doesnā€™t change at all

What I donā€™t get, iā€™m using the h264 stream, but it still consumes h265. Donā€™t understand this at all:

{
  "producers": [
    {
      "type": "RTSP source",
      "url": "rtsp://192.168.22.48/h264Preview_01_main/",
      "remote_addr": "192.168.22.48:554",
      "user_agent": "go2rtc/1.2.0",
      "medias": [
        "video, sendonly, 96 H265/90000",
        "audio, sendonly, 97 MPEG4-GENERIC/16000"
      ],
      "tracks": [
        "96 H265/90000, sinks=1",
        "97 MPEG4-GENERIC/16000, sinks=1"
      ],
      "recv": 4655381
    },
    {
      "url": "ffmpeg:camera.go_box#audio=opus"
    }
  ],
  "consumers": [
    {
      "type": "MP4 client",
      "remote_addr": "192.168.20.80:34444",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
      "send": 4622851
    }
  ]
}

Iā€™m not familiar with your model.
Maybe you can play with some stream setting on web UI of the reolink camera to switch main stream to h264.
Or, maybe, you can setup secondary stream as h264?

As per their FAQ https://support.reolink.com/hc/en-us/articles/900000638523-What-s-the-Format-of-the-RTSP-Video-Audio-that-Reolink-Cameras-Use

Regarding the video compression format: for Reolink 8MP cameras, the compression type of RTSP main-stream is H.265 and the compression type of RTSP sub-stream is H.264. For Reolink 2MP, 4MP, and 5MP cameras, the compression type of RTSP video is H264.

So you can try to use secondary stream

Yes I saw that; i read it like the default is h265, so all native apps and default webview. But didnt think the h264 stream would be h265 too.

You already tried with

rtsp://192.168.22.48/h264Preview_01_sub

?

Yes but the quality is much lower. :cry:

You need to read codecs section in the docs.
You can use WebRTC+H265 only in Safari.

1 Like

Your first source without ffmpeg. Input setting donā€™t do anything in this case.
You can join two sources in one of they both are ffmpeg.

i tried to configure as

   camera.go_box: 
     - ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp

but it is not working. in the log i see the following erros (moreover in the log i still see -rtsp_transport tcp)

10:26:11.162 DBG [streams] probe producer url=ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
10:26:11.162 DBG [webrtc] new consumer url=camera.go_box
10:26:11.163 DBG [exec] run url="exec:ffmpeg -hide_banner -v error -allowed_media_types video+audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -i rtsp://admin:[email protected]:554/h264Preview_01_main -vn -an -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/84bf17f77499f8282f9a39336e43783f"
[h264 @ 0xb5857920] error while decoding MB 113 101, bytestream -9
Output file #0 does not contain any stream
10:26:15.501 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="exec: exit status 1" url=ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
10:26:15.501 DBG [streams] probe producer url=ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
10:26:15.501 DBG [exec] run url="exec:ffmpeg -hide_banner -v error -allowed_media_types video+audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -i rtsp://admin:[email protected]:554/h264Preview_01_main -vn -an -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/84bf17f77499f8282f9a39336e43783f"
Output file #0 does not contain any stream
10:26:19.326 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="exec: exit status 1" url=ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
10:26:19.327 DBG [streams] probe producer url=ffmpeg:rtsp://admin:[email protected]:554/h264Preview_01_main#input=rtsp/udp
10:26:19.327 DBG [mp4] add consumer error="source 0 error: exec: exit status 1"
10:26:19.327 DBG [exec] run url="exec:ffmpeg -hide_banner -v error -allowed_media_types video+audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -i rtsp://admin:[email protected]:554/h264Preview_01_main -vn -an -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/84bf17f77499f8282f9a39336e43783f"
Output file #0 does not contain any stream

For my reolink cams I use http stream according to:

and with above we can use all three streams (main, sub, ext)

  front_camera: 
    - http://CAM_IP/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=USER&password=PASSWORD
    - ffmpeg:front_camera#audio=opus 

Oh. Itā€™s my bad. You need to add #video=copy#audio=copy. Iā€™ll fix it later

Hello,

I read the previous pages but I canā€™t find my problem.
Here is the error:

Do you have an idea?

19:50:23.815 INF go2rtc version 1.2.0 linux/arm64
19:50:23.818 FTL [api] listen error="listen tcp :1984: bind: address already in use"

this means there is already something running on that specific port. Whatā€™s your config and setup?

If you had installed webrtc and go2rtc separetly you have to reinstall webrtc and set it to use your go2rtc instalation and not the inner one.

Thank you very much, that was the problem !