How to stream video or audio using VLC Media Player
Update: This tutorial is tailored toward version 0.8.6i of VLC Media Player. The interface in the later builds of VLC are quite different.
However, it is recommended that you use 0.8.6i if you wish to stream without any issues. It seems the developers have neglected any progress on the transcoding aspect of VLC and as a result introduced many bugs that reduce quality as well as consume more CPU during runtime.
_______________________________________________
Go here to read the summarized guide.
A few people have been coming to me and asking how they can stream videos to their friends or across their network. It seems that not many average users knew that this could be done with VLC media player. Many encoders are either too complex, require you to register with their website in order to use their software, or are just plain slow and clunky. There aren’t many programs that that I’ve come across that accomplish video streaming as well as VLC.
Luckily, the streaming portion of VLC isn’t too terribly difficult for anyone to operate, and today, I’m going to show you how you can do this yourself.
This tutorial assumes that you have very little prior experience with VLC Media Player. If you are familiar with VLC and wish to skip to the shortened version of this tutorial, go to the last page.
First of all, go to http://www.videolan.org/ and download VLC media player for your particular platform. The guys as VideoLAN are a clever bunch; it doesn’t matter what operating system you’re running because VLC has the same features and nearly identical commands for all platforms. You shouldn’t have any trouble following along. As well, you should not need to download any codecs to play or stream any videos with VLC unless you’re video has some overly-proprietary or otherwise old codec. Videos encoded with MPEG2, H264, and XviD seem to work best.
Second, install VLC, and open C:\Program Files\VideoLAN\VLC.exe or double click on the VLC icon on your desktop.
We’re now going to pick the video you want to stream by going to ‘File’, ‘Open File…’. Click ‘Browse’ on the top right, and select the video you wish to use. I would suggest testing this with small .AVI to simplify things. Check the box ‘Stream/Save’ on the bottom left under Advanced options.
Configure The Stream Settings
Next, Click ‘Settings..’. A window called ‘Stream Output’ will appear. Check the box titled ‘HTTP’, and fill in 0.0.0.0 next to it. This tells VLC to accept connections from ANY IP, whether it be from your own PC, from your network, or from the internet. If you wish to only let one person view the stream, enter their IP next to ‘HTTP’ instead of 0.0.0.0. Next to port, you can put any number you want, but I would suggest choosing something between 8100 and 50000. This port number will make your particular stream unique, so that it can only be accessed on whatever port you choose in case you have another stream running on a separate port. You will need to setup port forwarding for that port on your router if your friend is connecting from across the internet. Go to http://portforward.com/routers.htm if you need assistance.
For ‘Encapsulation Method’, select ‘MPEG TS. Under Transcoding Options, check the Video codec box. This part may take a bit of experimenting, depending on the video you’re using to stream. The safest bet is to use mp2v, but will generally give less quality than other options. You may also want to try mp4v, DIV3, and h264. h264 will generally produce excellent quality, but may not work properly with certain videos. Don’t ask me why, because I don’t know.
Check the ‘Audio codec’ box and select mp3 from the dropdown list. This will work with almost every video that has audio, but if you want better quality, use mp4a.
Now for the bitrates. If you’re streaming this across your network, 1024kbps will work just fine and give you great quality. When streaming across the internet, my general rule of thumb is: for every 1mbps of upstream, you can provide roughly around 600kbps of stable streaming. So, if you want to stream to two people with a 2mbps upstream, then you should select 512kbps, or 384kbps for three people.
For now, just select 384kpbs, and select 192kbps for the audio. and choose only 1 channel. If you choose 2 channels, this will needlessly double your stream and choke your connection. Again, this is irrelevant if you’re streaming across your own network.
Start Streaming A Video
Now that you’re done configuring the stream, click ‘Ok’. After you click ‘Ok’ again, VLC will start streaming.
To view your own stream, open another instance of VLC, and go to ‘File’, ‘Open Network Stream’. Select the HTTP/HTTPS/FTP/MSS bubble, and type in 127.0.0.1:”port here, without quotes”. This will loop back to your own PC and open your stream. Within a few seconds of buffering, you should see your stream playing.
If you set your streaming address to 0.0.0.0, then you can your friend can both watch at the same time. Go to http://www.desertbunker.com/projects/?page_id=14 to find out your external IP, and give it, along with the port you chose, to whoever you want to view your stream. If your IP was 212.254.12.9, and your port was 12332, then your friend would open the stream at 212.254.12.9:12332.
This whole process is nearly the same if you just want to stream Audio, except that you do not check the Video codec box, and must select Ogg, ASF, MP4, or WAV for the encapsulation method.
Summary/Short Version:
1. Download and install VLC Media Player.
2. Open VLC, go to ‘File’, ‘Open File…’.
3. Click browse, and choose the file you want to stream.
4. Click the ‘Stream/Save’ box at the bottom left, then click ‘Settings’ to configure the stream.
5. Check the HTTP box, enter 0.0.0.0 in Address, and 9090 for the Port.
6. Select MPEG TS under Encapsulation Method, and check both the Video codec and Audio codec boxes.
7. Next to Video codec, select mp2v, and 384kbps Bitrate, with Scale 1.
8. Next to Audio codec, select mp3, and 192kbps Bitrate, with 1 Channel.
9. Press ‘Ok’, and you’re ready to stream.
10. Click ‘Ok’ again to start streaming.
11. To view your stream, open another instance of VLC, go to ‘File’, ‘Open Network Stream’, choose HTTP/HTTPS/FTP/MMS, and fill in 127.0.0.1:9090 for the URL.
12. To let your friend view the stream, make sure port 9090 is forwarded on your router. Find out your external IP by going to http://www.desertbunker.com/projects/?page_id=14. Take your IP, and give it to your friend in this format: XX.XX.XX.XX:9090. Example: 212.254.12.9:9090. Tell your friend to open VLC, go to ‘File’, ‘Open Network Stream’, choose HTTP/HTTPS/FTP/MMS, and fill in Your.IP:9090 for the URL.
I hope you enjoyed this horrifically long tutorial. If you need any further assistance, have any questions, want to correct any of the information, or just want to debate about something, feel free to leave a comment, or make a post in the forum.
Wow!!! Thank you, I’ve been trying to do this for days now!!!! I can’t believe its that easy!
Comment by Adam West on June 24, 2008 at 12:07 pm
Nice work, the streaming to the net works just as planned. However, i enjoy h264 video as the transcode format. You can use really low bitrates and still get a good level of quality
Comment by Dijama on September 23, 2008 at 9:34 pm
well the problem i have is i have the new vlc and it dosent have the file option
Comment by devin on June 4, 2009 at 5:22 pm
Is there any way I can stream video using SCTP rather than TCP or UDP?
Comment by Amir on July 27, 2009 at 4:32 am
To my knowledge, VLC does not support SCTP. There may be some other encoder that does. If you find one, let me know.
Comment by admin on July 28, 2009 at 8:53 pm
Hi, I have just started up a website and began making somewhat varied articles. Would you object if I blog something about this? Obviously I will give you and this site full credit.
Comment by Tray C at Apples on December 26, 2009 at 11:51 am
Has anyone tried these and it worked?
Comment by augustine on May 19, 2010 at 11:50 am
Is there any way I can stream video using SCTP rather than TCP or UDP?
Comment by Bruce on May 21, 2010 at 1:51 am
Thank you so much again for writing this, it’s exactly what I was looking for!
Comment by Karen Pafel on May 25, 2010 at 10:31 am
Wow!!! Thank you, I’ve been trying to do this for days now!!!! I can’t believe its that easy!
Comment by Steve on May 28, 2010 at 9:59 pm