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
mhoogenbosch
(Martijn Hoogenbosch)
February 28, 2023, 7:10pm
289
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
mhoogenbosch
(Martijn Hoogenbosch)
February 28, 2023, 8:23pm
291
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?
mhoogenbosch
(Martijn Hoogenbosch)
February 28, 2023, 8:34pm
293
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
mhoogenbosch
(Martijn Hoogenbosch)
February 28, 2023, 9:15pm
296
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
?
mhoogenbosch
(Martijn Hoogenbosch)
February 28, 2023, 10:22pm
298
Yes but the quality is much lower.
AlexxIT
(Alexey)
March 1, 2023, 3:34am
299
You need to read codecs section in the docs.
You can use WebRTC+H265 only in Safari.
1 Like
AlexxIT
(Alexey)
March 1, 2023, 3:37am
300
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
AlexxIT
(Alexey)
March 1, 2023, 5:03pm
303
Oh. Itās my bad. You need to add #video=copy#audio=copy
. Iāll fix it later
kenshi0
(KADDOUR)
March 1, 2023, 6:56pm
304
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"
mhoogenbosch
(Martijn Hoogenbosch)
March 1, 2023, 7:01pm
305
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.
kenshi0
(KADDOUR)
March 2, 2023, 8:56am
307
Thank you very much, that was the problem !