Open esthar992 opened 1 month ago
You can use ffmpeg source for this. If you using docker - it should has network host setting.
Thanks @AlexxIT, can I ask you an example /link for accomplish this task?
I'm using it in a Docker container with network = host
Good morning, i'm triyng with FFMPEG in this way:
ffmepg_test: exec:ffmpeg -re -i rtsp://user:pwd@xxx.xxx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false -rtsp_transport tcp -f rtsp {output}
I'm receving errors in log below when i try to show the stream from go2rtc api panel:
08:31:55,739 info go2rtc version=1.9.4 platform=linux/amd64 revision=a4885c2
08:31:55,739 debug build version=go1.22.4 vcs.time=2024-06-18T18:33:36Z
08:31:55,739 info config path=/config/go2rtc.yaml
08:31:55,740 info [rtsp] listen addr=:8554
08:31:55,740 info [api] listen addr=:1984
08:31:55,740 info [webrtc] listen addr=:8555/tcp
08:31:57,843 debug [exec] run rtsp args=ffmpeg,-re,-i,rtsp://user:pwd@xxx.xx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false,-rtsp_transport,tcp,-f,rtsp,rtsp://127.0.0.1:8554/75d07968b5506450d5c32dc251fcbac0
08:31:57,844 debug [webrtc] new consumer src=ffmepg_test
08:31:57,870 debug [exec] ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.2.1 (Alpine 13.2.1_git20240309) 20240309
configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
libavutil 58. 29.100 / 58. 29.100
08:31:57,871 debug [exec] libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100
08:31:57,931 debug [exec] [rtsp @ 0x7e3e08a65600] method SETUP failed: 461 Unsupported transport
08:32:01,270 debug [exec] [in#0 @ 0x7e3e08b5b8c0] Error opening input: Invalid data found when processing input
08:32:01,270 debug [exec] Error opening input file rtsp://user:pwd@xxx.xxx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false.
Error opening input files: Invalid data found when processing input
Looks like you already using ffmpeg source in your first message. I missed that.
Maybe ffmpeg needs additional arguments to allow multicast. Try to Google in that direction.
Done!!
If this could be useful for someone this is the prompt i've used:
ffmepg_test: exec:ffmpeg -rtsp_transport udp_multicast -i "rtsp://usr:pwd@xxx.xxx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false" -c copy -rtsp_transport tcp -f rtsp {output}
ffmpeg:
rtsp/multicast: "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport udp_multicast -i {input}"
streams:
ffmepg_test: ffmpeg:rtsp://usr:pwd@xxx.xxx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=false#input=rtsp/multicast
Hi, is it possible to connect and view a multicast stream via RTSP to WEBRTC format in go2rtc?
I've tried without ffmpeg:
Response (clicking on stream from the control panel / api ):
and with ffmpeg:
My cam is a dahua configured for multicasting returning h264 multicast stream.
If i set the rtsp endpoint with unicast=true all working like a charm.
Looking inside the code i see that there are controls about Transport header structure like :
(rtsp/server.go)
So it's impossible to do this or i'm doing something wrong?
Thanks in advance.