0

I would like to use VLC in order to stream an audio file from a server to several clients over an IP network. Both the server and the clients are running Linux. Here is my try for two clients:

Server command

cvlc test.mp3 --sout '#duplicate{dst=rtp{dst=10.0.0.2,port=5004,mux=ts},dst=rtp{dst=10.0.1.2,port=5004,mux=ts}}'

Clients command

cvlc rtp://@:5004

Although the music is correctly transmitted, the clients are not synchronised at all. There is a important time gap that makes it impossible to listen. Is this a normal behaviour ? I thought that a Real-time Transport Protocol could handle such problems. Did I miss something in the configuration ? Or should I take a look at another streaming protocol ?

Thanks in advance.

  • 1
    If you're not trying to do this over the Internet I suggest you use multicast instead of duplicated unicast streams. Basically, skip the duplication and use an multicast IP as destination and you should be fine. – Intenso Feb 19 '15 at 10:41
  • Thanks for your comment. I'm not trying to stream over the Internet, so I'll take a look at multicast. However, the clients are not necessary on the same network interface, I hope it won't be a problem for multi-casting. – tvuillemin Feb 19 '15 at 10:56
  • If they are on the same subnet it will work, if not you need to route it(e.g. with PIM) or leak it over to the other subnet/s(i.e. bridge the two L2 network). – Intenso Feb 19 '15 at 11:10
0

As Intenso suggested in the comments, the best way to achieve this it to use a multicast IP address.

Server command

cvlc test.mp3 --sout '#udp{dst=224.0.0.1,port=1234}'

Client command

cvlc udp://@224.0.0.1:1234

You might need to create network routes for the subnet 224.0.0.0/14, both on the server and on the client. Man "route" or "ip route". If your clients are on several subnets and you don't know where to route, take a look at this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.