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:
- In the Media menu, choose “Stream”
- In the Open Media dialog file tab, click “add” and choose the file you want to stream and click “Open”
- At the bottom, click the “Stream” button
- This opens the “Stream Output” dialog showing the source file you have chosen. Click Next to set destination.
- In “Destinations”, choose “RTP /MPEG Transport Stream” and click the “Add” button
- In the “Address” box, enter the required multicast address (eg 239.255.0.1) and set the port (or leave default at 5004)
- 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
- 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)
- Choose Media/Open Network Stream
- 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!
- Click “Play”
If you want to stream multiple videos, remember to choose an different multicast address and/or port
very nice very nice very nice very nice
thank you very much
Mohamed Abdel Rahman
It should be possible: https://www.videolan.org/doc/streaming-howto/en/ch04.html
I’ve not tried this though.
Cheers, Andy
@ane the videolan page is archived here: http://web.archive.org/web/20150216171046/http://www.videolan.org/doc/streaming-howto/en/ch04.html
very nice..superb
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?
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
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.
Thanks man! You saved me from connecting sniffer to my subnet!
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
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
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.
Please see https://forum.videolan.org/viewtopic.php?f=4&t=56351 for a discussion of this issue
Andy
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…
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.
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…..
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
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
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 ?
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
Really awesome multicating, Thanks for explained pretty much.
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?
Hi Alex,
Usually you need a router between VLANs, so the router has to pass the stream. If the stream is multicast, you need usually configure the router to use the PIM protocol.
Here are a couple of links you may find useful:
https://supportforums.cisco.com/discussion/9988731/multicasting-across-vlansubnets
http://www.informit.com/library/content.aspx?b=CCNP_Studies_Switching&seqNum=59
Best regards,
Andy
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.
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
What is version of vlc player?
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???
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
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?
Hi Sachin,
Sorry for the late reply. If you haven’t already, have a look at this page of the documentation:
https://wiki.videolan.org/Documentation:Streaming_HowTo/VLM/
Andy
Hi,i have catv equipment up n running,i wanted to stream the media over my network via vlc,kindly advise
Hi Paddy, We’d need much more information to go into detail, but the first thing to look at is “Streaming via the GUI” on this page:
https://wiki.videolan.org/Documentation:Streaming_HowTo_New/
Hola tengo el sgte problema,estoy retransmitiendo co vlc un flujo q viene por multicast hacia icecast,y en icecast se me ve defasado el audio del video,q puede ser?
Does this help?
http://write.flossmanuals.net/vlc/streaming-to-icecast/
Hallo miteinander,
ich befinde mich auch gerade in einem Multicast Videstream Problem:). Ich habe versucht einen Multicast Stream mit der Multicastadresse 224.0.0.0 zu erstellen .
Ich kann den Stream aber nur an einem Laptop öffnen , der zweite PC öffnet dem Stream nicht.
Ich bin relativ unvertraut mit diesem Gebiet,kann mir da jemand weiter helfen
Mfg
224.0.0.0 is not a multicast address you should use. It is link local, ie similar to 127.0.0.1 (I think)
See https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
Try creating the stream with the address 239.255.1.1
Also see https://tools.ietf.org/html/rfc2365
Sorry I don’t speak German to explain better to you.
Best regards,
Andy
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 drives me crazy for a while until I realized. VLC, by default, generates multicast traffic with TTL=1. To modify it, when you are setting up the stream, in point 8 according to this guide,
Don’t know if this thread is still alive but I am looking to re-stream an RTSP stream that is H264 codec with using the transcoding option for MP2/MPEG-1 RTSP output which will give me compatability with JSMpeg on the browser side. I’m using 239.255.0.1 as the destination address but I believe this is incorrect. How do I find the correct multicast address to use? I’m testing the new rtp://@239xx address in another instance of VLC but obviously nothing is coming in. No clear error on the main VLC instance either. Just stalls at converting…
Any thoughts?
Is this helpful at all:
https://tvheadend.org/projects/tvheadend/wiki/VLC_Multicasting
Pingback: vlc player?????igmp - ???