How to use VLC Media player to stream multicast video

When testing networks and routing, it is sometimes useful to be able to send a number of multicast streams across the network. VLC media player can do this, but getting it working is not as trivial as I expected. Here’s how to do it:

  1. In the Media menu, choose “Stream”
  2. In the Open Media dialog file tab, click “add” and choose the file you want to stream  and click “Open”
  3. At the bottom, click the “Stream” button
  4. This opens the “Stream Output” dialog showing the source file you have chosen. Click Next to set destination.
  5. In “Destinations”, choose “RTP /MPEG Transport Stream” and click the “Add” button
  6. In the “Address” box, enter the required multicast address (eg 239.255.0.1) and set the port (or leave default at 5004)
  7. In transcoding options, choose the appropriate settings for your video and PC’s codecs. I chose “Video H.264 + MP3 (MP4)”. I had to set the options by clicking the options (screwdriver and spanner) button immediately to the right of the dropdown. In encapsulation, I chose MPEG-TS. In video codec, I set the bitrate to 4000kb/s
  8. Once the options are set, click “Save”. Then click Next for “Option Setup” and select “Stream all elementary streams” then click stream.

To view the stream, open another instance of VLC media player (try it on the same PC before trying it over the network)

  1. Choose Media/Open Network Stream
  2. In address, enter rtp://@239.255.0.1:5004 – choose the correct address and port you entered when setting up the stream. Don’t forget to enter the “@” symbol after “rtp://” and before the multicast ip address!
  3. Click “Play”

If you want to stream multiple videos, remember to choose an different multicast address and/or port

Bookmark the permalink.

31 Responses to How to use VLC Media player to stream multicast video

  1. Mohamed Abdel Rahman says:

    very nice very nice very nice very nice

    thank you very much
    Mohamed Abdel Rahman

  2. Rajan rana says:

    very nice..superb

  3. OoT says:

    Very useful!

    How about multicasting over a layer 3 network? I have several VLANs, the multicast stream from one VLAN and clients on multiple others. Should this work by default or do I need to configure technologies along the lines of IGMP-snooping?

    In short, can you use the multicast address to stream between subnets and VLANs?

    • ane says:

      Hi,

      You need to use a multicast routing protocol such as PIM between subnets.

      IGMP snooping limits to distribution of multicast within a subnet, but is not relevant to routing multicast between subnets.

      Best regards,

      Andy

      • Julio Cesar says:

        Also, and don’t forget about that, you have to modify the TTL of the multicast packets generated by VLC, if not, the first PIM router will drop the traffic. This drived me crazy for a while till I realized. VLC, by default, generates multicast traffic with TTL=1. To modify it, when you are setting up the stream, in the point 8 according to this guide, add “,ttl=XXX” before the last }. TTL should be set to the maximum number of layer 3 (routing) hops you will find from source to receiver.

        • Mike says:

          Thanks man! You saved me from connecting sniffer to my subnet!

        • Charly says:

          Dear Julio, trusted me, you saved my life with this tip. I lost one and half day after modify the TTL as you explained it here. Thanks a lot for the information

        • Charly says:

          Sorry,previously I wanted to say that I lost a day and a half before setting TTL as you explained it.
          Once again, thanks a lot for your tip

  4. Mark says:

    Great – however, how do you control the TTL? I thought I had it working by manually adding ‘ttl=9’ (no quotes) in the string, but that was last week … now it appears not to work.

  5. ane says:

    Please see https://forum.videolan.org/viewtopic.php?f=4&t=56351 for a discussion of this issue

    Andy

  6. Bibelo says:

    It drove me crazy too. At some point I thought I would never find the solution. Until I discovered you can also ping a Multicast address which was perfectly. And that’s when I saw the difference of TTL between the pings and the video…

    • videolan57test says:

      1) Yes test in vlc 2.2.1
      2) example:
      go in media > Stream
      add a video file
      then click on the Stream button
      then Next
      then

      in New destination select RTP/MPEG transport stream and click the Add button
      in address type :239.255.0.1
      choose a port ex: 5004
      a stream name ex: para (not required)

      then click next
      desactivate transcoding if not required as it consumes CPU
      then click next

      select : stream all elementary streams
      in the generated stream output string you have the following:
      :sout=#rtp{dst=239.255.0.1,port=5004,mux=ts,sap,name=para} :sout-all :sout-keep
      so add the ttl=100 for instance as follows:
      :sout=#rtp{dst=239.255.0.1,port=5004,mux=ts,sap,name=para,ttl=100} :sout-all :sout-keep

      sniff with wireshark and expand the IP header. You will see it.

  7. Kevin Gaudineer says:

    I am really confused… I just downloaded VLC 2.2.1… The main purpose for the download was so I could setup lab testing for multicast network design…

    I have read the previous post and some other pages on how to setup VLC but all of the options or choices mentioned do not exist when I launch VLC….

    I downloaded VLC for use on a MAC Book Pro. As an example the first step in a post was to select the ‘Media’ menu. In my VLC application there is no media menu… All I see is the standard menu setup …. (File, Edit, View, Playback, Audio, Video)… There is no media menu choice…. The navigation tree on the left only has (Library, Local Network, My Network etc…)

    There is a streaming exporting wizard but the options for this do not match up with the choices described in the post… I tried to go through it, however, the options don’t seem right… For example through the wizard I made the following choices..

    1. Stream to netowrk
    2. I chose a local video file
    3. on the streaming page I chose RTP/Multicast and the IP address I used 239.255.0.1 shouldn’t there a port number with this IP though?
    4. The next page ask for a transcode…. I didn’t know what to choose so I guessed Mpeg-4 for video and audio
    5. encapsulation format was left at default.
    6. The last page I set the TTL to 11

    After clicking finish nothing happens…. how do I know if VLC is even working or how do I view the stream on another PC or MAC…..

  8. ane says:

    Hi Kevin,
    Sorry, I’m afraid the original post is two and a half years old and VLC has come along a lot since then. I haven’t tried this since, so I can’t really offer much current advice about VLC.
    However, when looking into checking out what network traffic is actually on the wire, I always turn to wireshark. Get wireshark running on both the source and destination machines and you’ll see what’s really on the network.
    Best regards,
    Andy

  9. ane says:

    Hi Kevin,
    Just looked at https://www.videolan.org/doc/streaming-howto/en/ch02.html and note that some of the functionality is only available in windows. I don’t know if this is part of the issue? Andy

  10. Hamid says:

    Hi all,
    What if I want to stream what is played in VLC (which is not a file, it is a stream itself) to another stream?
    Id there any way to re-stream a stream to another vlc ?

  11. Justin says:

    Hamid, yes, there is a way to restream a stream. In the streaming media dialog, select the Network tab and type in the originating stream address. The rest of the steps is just like streaming a file.

    I want to know how to make an RTP stream available to more than one machine. I can follow the example in this article and it works for playing only on the target IP, but no other clients can connect to it.

    Justin

  12. Prem says:

    Really awesome multicating, Thanks for explained pretty much.

  13. Alex says:

    Ok I know this is old however I hope it is still monitored.

    I have a h.264 encoded stream which I can access via VLC to watch this stream (when i am in VLAN 1). However I want to have the stream source (HD video over IP) on VLAN 1 and the system viewing the stream on VLAN 2. How do I go about accessing the stream without the video itself passing from one VLAN to the other?

  14. Sha says:

    Is it possible on VLC or any solution, to MUX a audio stream (example HTTP stream without video) and a video stream ( example RTSP stream without audio) into a UDP stream for multicast.

    • admin says:

      Hi Sha,

      I’ve not heard of anything generic to do this and don’t know of any “standard” way of doing this.

      Of course it is possible if you write your own software to do it. Of course, you’d have to decode the streams at the other end using the reverse process too.

      Can you explain what you are trying to achieve? Then hopefully someone may suggest a solution.

      Cheers,

      Andy

  15. kimilmin says:

    What is version of vlc player?

  16. kimilmin says:

    why address must be set with 239.255.0.1?
    In my vlc player, address is 239.1.1.1, so streaming video cannot be received in client compter.
    What is reason???

    • James says:

      The address they set was an example of a multicast group address. You need to pic an appropriate one for your setup. For example, 224.0.0.0 to 224.0.0.255 is the range designated by IANA for local multicasting.

      If you want to use an internet multicast setup, the addressing becomes more complex (especially if you are just a home user without an ASN of your own). If you do have an ASN (or a particularly nice ISP), then GLOP addressing is for you. https://en.wikipedia.org/wiki/Multicast_address#GLOP_addressing

  17. Sachin says:

    Is there a way i can send multiple multicast streams(i.e.., different TS files) with one instance of VLC(assuming I have a sufficient RAM and high capacity CPU) on Linux?

  18. paddy says:

    Hi,i have catv equipment up n running,i wanted to stream the media over my network via vlc,kindly advise

Leave a Reply

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