Setting up a multicast lab using VLC 2.0.5

      2 Comments on Setting up a multicast lab using VLC 2.0.5

While working on studying multicast, I had to find a way to test the multicast traffic.  I had read that others accomplished this by just by doing manual ‘joins’ on the routers/switches and that seemed to be sufficient for basic tests.  However, I was hoping for a little bit more so I could really see multicast in action. 

After a little goggling I came across the VLC player…

http://www.videolan.org/vlc/index.html

I determined that it supported multicast RTP streams.  However, after installation, I was having a hard time getting a computer to actually stream a video clip.  I’m sure I was just missing a setting somewhere in the GUI but I found a different way to do it that fit my needs a little better.  You can load a video through VLC with all of your required settings by passing the settings to the VLC.exe on load.  I ended up hacking together this command to load my video for the multicast stream…

C:\Program Files (x86)\VideoLAN\VLC\vlc -vvv “D:\\MVI_3716.avi” –sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=239.1.2.3,port=5004,mux=ts,ttl=10} :sout-all :sout-keep –loop

That looks awful, but if you paste it into notepad without word wrap you’ll get a straight line out of it.  Basically, this just loads the VLC EXE (change your path if required) and tells it to load the specified AVI file into a multicast stream on the multicast IP address of 239.1.2.3 port 5004.  It also tells VLC to loop the video so it keeps playing. 

I was fortunate enough to have an old PC laying around so between that, my desktop, and my wife’s new laptop I had three PCs that I could test the multicast streaming on.  I’d fire up the command above on one of the PCs, and then I could connect through the lab with a VLC player on the two other PCs. 

Connecting to the stream through VLC is pretty easy, you just open the VLC player and select the ‘Open Network Stream’ option from the Media menu…

image

In the ‘Open Media’ box that appears, enter the IP of the multicast stream using the syntax of…

rtp://@<Multicast IP address>

image

Then hit play and wait for the IGMP joins and the PIM grafting to take place and with any luck you’ll see the stream you are generating from the other PC…

image

Which in my case, if a man spinning flaming things around (it was the only AVI I could find). 

Hope this makes it a little easier for anyone else trying to do this, for some reason all of the guides I found online for using VLS for multicast streaming were old and the command syntax must have changed significantly. 

2 thoughts on “Setting up a multicast lab using VLC 2.0.5

  1. L. Foerster

    You can even do it in the VLC GUI but its mandatory to manually edit the MRL at the end like:

    :sout=#standard{mux=ts,ttl=7,dst=239.253.1.2,access=udp}

    What is also important to know is the fact that TTL setting works ONLY with RTP based multicast streaming !!
    If you use UDP you cannot set it. All commands even from CLI are just ignored.
    Its a long lasting bug in VLC… 🙁

    Reply
  2. Paul

    I have had this working in the past. Now I am trying to replicate it but I cannot.
    I am using VLC version 3.0.4 on Windows 10 Pro
    my VLC Client (viewer) is set to view a stream at rtp://@239.192.7.7:7777
    my VLC server is streaming the following
    :sout=#transcode{vcodec=hevc,vb=1024,scale=Auto,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{dst=239.192.7.7,port=7777,mux=ts,ttl=8} :sout-all :sout-keep

    I do not see any IGMP joins from the viewer.

    Any idea why not? Or where I should check

    Reply

Leave a Reply to Paul Cancel reply

Your email address will not be published. Required fields are marked *