Streaming synchronized raw audio to multiple clients

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
bradvido
New Cone
New Cone
Posts: 4
Joined: 19 Jul 2012 18:12

Streaming synchronized raw audio to multiple clients

Postby bradvido » 19 Jul 2012 18:56

I'm using VLC 2.0.2 win32.

I'm attempting to stream audio from a VLC instance (server) to multiple different VLC clients. This is raw audio only (no video). The server and all clients are Windows7.

I believe that UDP will give me the best synchronization, but it's not currently working for me.

Here is my commands i'm using for UDP streaming:

The server:

Code: Select all

vlc.exe --demux=rawaud --rawaud-channels 2 --sout udp:224.1.1.152:1152 -
(the - on the end grabs audio from stdin of shairport4w. This audio plays perfectly in VLC when I remove the --sout option).

The client:

Code: Select all

vlc.exe udp://@224.1.1.152:1152
In the debug console for the client, I see "main stream error: cannot pre fill buffer"

Note: I've also tried using 239.255.12.42 as the multicast IP, but it did not work either (same error).

All firewalls are turned off, but the clients never start playing the udp stream.
The server seems to play it just fine, at least i see the seconds counting up when i start play audio.

Update: The udp streaming works perfectly if I try to stream a .mp3 from the server.
This streams correctly:

Code: Select all

vlc "C:\Users\Public\Music\Sample Music" --sout udp:239.255.12.42
Update2: I am able to successfully stream using the raw audio, but only over http (which isn't providing the synchronous nature i would get from udp)
This streams correctly (using http):

Code: Select all

vlc --demux=rawaud --rawaud-channels=2 - --sout "#std{access=http,mux=asf}"

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

Re: Streaming synchronized raw audio to multiple clients

Postby Rémi Denis-Courmont » 20 Jul 2012 11:28

I would much recommend RTP over raw UDP for multicast raw audio.

UDP generally sucks and does not really work for anything other than MPEG2.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

bradvido
New Cone
New Cone
Posts: 4
Joined: 19 Jul 2012 18:12

Re: Streaming synchronized raw audio to multiple clients

Postby bradvido » 20 Jul 2012 14:12

I am now using RTP, but I need a little help getting it correct. Any suggestions for an ideal music streaming sout command would be greatly appreciated!

The command I'm using to stream the audio is:

Code: Select all

vlc.exe --demux=rawaud --rawaud-channels=2 - --sout "#transcode{vcodec=none,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=239.255.12.42,port=5004,mux=ts,ttl=1}"
I connect the client using:

Code: Select all

vlc rtp://@239.255.12.42:5004
The problem is that the client does not play the stream smoothly, it keeps dropping in an out and stuttering.

The reason i'm using transcode is because the client would not connect when I didn't transcode.
When I try to stream without transcoding using this command:

Code: Select all

vlc.exe --demux=rawaud --rawaud-channels=2 - --sout "#rtp{dst=239.255.12.42,port=5004,ttl=1}"
I get this error on the client: SDP required:
A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (96).
Note, I've also tried mp3 as the acodec, but this did not improve stream quality.

The stream plays perfectly at the server if I don't try and stream it to clients.

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

Re: Streaming synchronized raw audio to multiple clients

Postby Rémi Denis-Courmont » 20 Jul 2012 14:53

Raw audio is s16b at 44100Hz. Anything else requires an SDP.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

bradvido
New Cone
New Cone
Posts: 4
Joined: 19 Jul 2012 18:12

Re: Streaming synchronized raw audio to multiple clients

Postby bradvido » 20 Jul 2012 15:12

Raw audio is s16b at 44100Hz. Anything else requires an SDP.
Thanks for your quick reply.

So would I modify my command like so?

Code: Select all

vlc.exe --demux=rawaud --rawaud-channels=2 --rawaud-samplerate=44100 - --sout "#rtp{dst=239.255.12.42,port=5004,ttl=1}"


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 28 guests