Unable to create UDP Stream, HTTP works fine

About encoding, codec settings, muxers and filter usage
Vamp898
New Cone
New Cone
Posts: 2
Joined: 14 Nov 2023 18:13

Unable to create UDP Stream, HTTP works fine

Postby Vamp898 » 14 Nov 2023 18:19

Hi there,

for TRPG Sessions, i want VLC to stream the music for the party and i first tried HTTP, but when the streams for quite some time, the delay gets unusable. When i switch the song, it could take up to 2 minutes when its 1 hour into the game.

I use the following command

Code: Select all

cvlc --repeat -I http --http-password XXX test.mp3 --sout-keep --sout='#standard{access=http,mux=ts,dst=0.0.0.0:8081}'
Works like a charm. But now i try the same with udp

Code: Select all

cvlc --repeat -I http --http-password XXX test.mp3 --sout-keep --sout='#standard{access=udp,mux=ts,dst=0.0.0.0:8081}'
I can see in netstat, that VLC doesn't open up an port. When i look into the logs, i just see a bunch of these
udp access out warning: send error: Connection refused
This also happens, when i run VLC as root. The firewall is open on that port and i also tried other ports
-A INPUT -p tcp -m tcp --dport 8081 -j ACCEPT
-A INPUT -p udp -m udp --dport 8081 -j ACCEPT
I also tried various variants of this command (RTP)

Code: Select all

cvlc -v --repeat -I http --http-password XXX test.mp3 --sout-keep --sout='#rtp{port=8081,dst=0.0.0.0}'
I don't get any error using that, but there is also no open port in netstat and clients are, obviously, unable to connect. So even though there is no error (even with -vvv), it just does nothing and i have no idea why. I tried using different ports or the IP of the server instead of 0.0.0.0 and again root, but nothing. It just streams the file into an unknown void.

Here is the -vv log, which is explicitly saying it connects to the port (even though, nothing is there)
[00007f4ff401e2c0] main stream output debug: using sout chain=`rtp{port=8081,dst=0.0.0.0}'
[00007f4ff401e2c0] main stream output debug: stream=`rtp'
[00007f4ff4022a10] main stream out debug: looking for sout stream module matching "rtp": 20 candidates
[00007f4ff4022a10] main stream out debug: set config option: sout-rtp-port to 8081
[00007f4ff4022a10] main stream out debug: set config option: sout-rtp-dst to 0.0.0.0
[00007f4ff4022a10] main stream out debug: using sout stream module "stream_out_rtp"
[00007f4ff402bed0] main stream debug: creating access: file:///srv/http/pub/vamp898/trpg/MOMBGM01.mp3
[00007f4ff402bed0] main stream debug: (path: /srv/http/pub/vamp898/trpg/MOMBGM01.mp3)
[00007f4ff402bed0] main stream debug: looking for access module matching "file": 26 candidates
[00007f4ff402bed0] main stream debug: using access module "filesystem"
[00007f4ff402d4a0] main stream debug: looking for stream_filter module matching "prefetch,cache_read": 26 candidates
[00007f4ff402d4a0] cache_read stream debug: Using stream method for AStream*
[00007f4ff402d4a0] cache_read stream debug: starting pre-buffering
[00007f4ff402d4a0] cache_read stream debug: received first data after 0 ms
[00007f4ff402d4a0] cache_read stream debug: pre-buffering done 1024 bytes in 0s - 28571 KiB/s
[00007f4ff402d4a0] main stream debug: using stream_filter module "cache_read"
[00007f4ff402e910] main stream debug: looking for stream_filter module matching "any": 26 candidates
[00007f4ff402e910] main stream debug: no stream_filter modules matched
[00007f4ff4c49fe0] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[00007f4ff4c49fe0] main stream_directory debug: no stream_directory modules matched
[00007f4ff402e910] main stream debug: looking for stream_filter module matching "record": 26 candidates
[00007f4ff402e910] main stream debug: using stream_filter module "record"
[00007f4ff401e2c0] main stream output debug: adding a new sout input for `mpga` (sout_input: 0x7f4ffcc524a0)
[00007f4ff4022a10] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
[00007f4ff4022a10] main stream out debug: net: connecting to [0.0.0.0]:8081

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Unable to create UDP Stream, HTTP works fine

Postby Rémi Denis-Courmont » 14 Nov 2023 21:11

Connection refused on sending UDP means inbound ICMP errors, so either invalid parameters or network error. In this case, 0.0.0.0 is probably not considered a valid destination by your IP stack.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Vamp898
New Cone
New Cone
Posts: 2
Joined: 14 Nov 2023 18:13

Re: Unable to create UDP Stream, HTTP works fine

Postby Vamp898 » 15 Nov 2023 07:40

Connection refused on sending UDP means inbound ICMP errors, so either invalid parameters or network error. In this case, 0.0.0.0 is probably not considered a valid destination by your IP stack.
Thank you very much for your fast reply.

I enabled ICMP and checked if pinging works from inside the machine
$ ping 37.252.120.146
PING 37.252.120.146 (37.252.120.146) 56(84) bytes of data.
64 bytes from 37.252.120.146: icmp_seq=1 ttl=64 time=0.049 ms
64 bytes from 37.252.120.146: icmp_seq=2 ttl=64 time=0.072 ms
64 bytes from 37.252.120.146: icmp_seq=3 ttl=64 time=0.076 ms
64 bytes from 37.252.120.146: icmp_seq=4 ttl=64 time=0.073 ms
64 bytes from 37.252.120.146: icmp_seq=5 ttl=64 time=0.066 ms
As well as from an external host
>ping 37.252.120.146

37.252.120.146 に ping を送信しています 32 バイトのデータ:
37.252.120.146 からの応答: バイト数 =32 時間 =359ms TTL=39
37.252.120.146 からの応答: バイト数 =32 時間 =371ms TTL=39
37.252.120.146 からの応答: バイト数 =32 時間 =312ms TTL=39
37.252.120.146 からの応答: バイト数 =32 時間 =391ms TTL=39
I then tried using the external IP of the server instead of 0.0.0.0
cvlc -v --repeat -I http --http-password XXX MOMBGM01.mp3 --sout-keep --sout='#standard{access=udp,mux=ts,dst=37.252.120.146:8081}'
But the error keeps the same. There is no open port visible in netstat and the console continously spams this error message
[000055c98e219410] [http] lua interface: Lua HTTP interface
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[00007f843c0184f0] udp access out warning: send error: Connection refused
[...]
# netstat -tulpen | grep vlc
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1006 2193853 239082/vlc
tcp6 0 0 :::8080 :::* LISTEN 1006 2193854 239082/vlc

lucdig
New Cone
New Cone
Posts: 6
Joined: 25 Nov 2023 16:36

Re: Unable to create UDP Stream, HTTP works fine

Postby lucdig » 25 Nov 2023 17:44

As far as I know, the dst for udp output must be a unicast or multicast address. If you set a unicast address, you should see, with a tcpdump, udp packets sent from your vlc to the unicast address. The same for multicast address, but if you don't have a well configured multicast distribution network, multicast packets can flow to all the devices in your lan, and the lan can be saturated by these packets, so, be careful


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 12 guests