I don’t fall asleep easily when I’m on-call so I decided I’d watch Dexter Season 2. I didn’t want to download 4.1GBs of xvid/avi’s from my parents house to my place because it’s entirely unnecessary to have the videos in two places. So, let me explain how I got a Streaming Media daemon working on my server.
I did some searching and there wasn’t anything super awesome out there that would keep me away from using the command line interface of VLC. So, the first step was to install vlc. I also use screen so I can log out of my SSH session and just use the web interface available on VLC, so I’ll include steps for using screen.
sudo apt-get install vlc screen
During or after installing vlc, you might as well set up the port forwarding on your router for access to the web interface. Log into your router and open up port 8080 to your server. If you are not trying to stream over the internet or don’t have a persistant dynamic or static IP address, you can skip this step. Check http://www.portforward.com/english/routers/port_forwarding/routerindex.htm for information on how to port forward on your router.
The next step was to get into screen and start the media daemon.
screen vlc -I http
You can then press ‘CTRL’+'A’ followed by pressing ‘D’ to detach from your screen instance and log out of your server (this is the glory of screen). You can reconnect to screen later by entering ’screen -r’ at the shell of your server. I use screen for all of my console-based server daemons or anything I want to have run while disconnected from the SSH session I’m in (HLDS, SRCDS, VLC, ‘apt-get upgrade’, ‘tail -f’).
Then browse to your server by going to http://your.server.ip:8080/ . You should be greeted with an html representation of the VLC interface you may be familiar with on your computer. It will look something like this:
At this point you can toggle the Stream Output by clicking on the icon that has three staggered arrows pointing to the right (on the default theme). From here you want to check the ‘UDP’ box enter your external IP and a port (default is port 1234 on VLC UDP client) to use for streaming. This method makes it easiest for connecting the client side for streaming, which in most cases is ideal. If you’re going to set this up for less savvy users simplifying their end makes it easier on you as the admin, TRUST ME.
Next, open up UDP ports 1234 on the client router forwarding it to the viewing computer again this won’t be necessary over LAN and won’t be possible from a NAT’d server. Start VLC on the client computer and open Network Stream (CTRL+N) and click OK.
Back on the Web Interface, open the file and play it. If you don’t have any port forwarding or NAT issues, you’re done!
UNLESS-
The first 2 episodes I have are not encoded with anything special, so I was able to stream them without adding any extra codecs to my server. However, episode 3 needed xvid codecs.
Here’s the steps to add the “non-free” w32codecs:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install w32codecs
Restart the vlc daemon and you’ll be able to play xvid (and I assume divx as well).
Tags: linux, media server, port forwarding, screen, server, ssh, streaming, ubuntu hardy, video, vlc
Tags: linux, media server, port forwarding, screen, server, ssh, streaming, ubuntu hardy, video, vlc

When not spending time behind a computer screen bringing you his latest blog posts; you might catch him playing video games on his PC; eating/cooking something in the kitchen of his house in North Chattanooga; watching movies from his Netflix queue; volunteering for the Boy Scouts of America; fueling his wilderness interests by hiking, camping, backpacking, rafting, kayaking; sustaining his established hobbies in videography, photography, or music; running his DJ business with his brother as a partner; or hanging out with his friends doing any number of fun activities. 
December 15th, 2008 at 10:08 am
Followed Set up for Vid Streming. Works Perfect per yopur code, after struggling with all the “Other” media Players..Thank You !!! VLC is great also on my linux as well as Vista OS
December 15th, 2008 at 11:26 am
I had the same issue when I was trying to find other streaming media servers.. None of the other ones had good instructions so I sat down and figured out how to make it work with VLC and wrote an article on my blog to preserve it for the future. Based on the traffic this article has seen since I posted it, I have no doubts that others feel the same as you.
Glad I could be of assistance!
December 30th, 2008 at 1:02 am
call me stupid or just high but could i use this on my ubuntu server to stream video to a windows laptop with broswer?
December 30th, 2008 at 2:01 am
shouldnt it play all the things vlc plays?
December 30th, 2008 at 10:51 am
If you read the instructions as I wrote them, it will play anything the server has codecs for. I added a bit at the bottom of the article to show how to install the w32 codecs, after those are installed it will play just about everything across to any platform with VLC media player installed.
December 30th, 2008 at 3:38 pm
At what point and where do you add media to stream ?
January 21st, 2009 at 10:10 am
hello, when i try to connect to my other pc i got a access forbidden, any idea,
thanks
January 21st, 2009 at 7:49 pm
Make sure you’re trying to connect to the correct IP and Port of the other computer. What I’m betting you’re seeing is a default Apache page without permissions to view the directory, which means you’re connecting to port 80 or port 8080 that Apache is already configured for. You’ll have to specify a different port for vlc or change the apache configuration so it’s not listening on port 8080.
Adding the options below will allow you to specify which host and port the interface will listen on.
–http-host host:port
April 19th, 2009 at 9:31 pm
Found this through google, but it’s a bit dated.
I do however have an issue, I can’t find any help on. When doing your think, it stops at the creating httpd thing. This is obviously because of apache having stolen port 8080. So I use your –http-host 192.168.1.35:1337 (or some other port), if I do it with it’s actual host:port, it will say permission denied when listening on those sockets.
But when doing that, it still pretty much clogs up when creating httpd. I can only assume that it’s apache that is hindering it but how can I work around this?
April 19th, 2009 at 9:37 pm
Actually, after having read about a bit – it seems that the ports chosen (or all ports) are priveledged and cannot be opened unless I do it as root. VLC will not run as root so it tells me to use vlc-wrapper but I cannot find anything about this anywhere.
April 21st, 2009 at 12:43 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
April 22nd, 2009 at 1:52 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
April 22nd, 2009 at 3:16 pm
[...] 52. Montar un servidor de Streaming [...]
April 30th, 2009 at 10:06 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
May 18th, 2009 at 12:40 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
June 8th, 2009 at 11:43 pm
[...] 52. Montar un servidor de Streaming [...]
June 13th, 2009 at 3:12 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
June 20th, 2009 at 5:11 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
June 29th, 2009 at 4:38 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
July 14th, 2009 at 2:57 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
September 21st, 2009 at 1:31 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
September 24th, 2009 at 1:53 pm
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]
January 17th, 2010 at 1:53 pm
[...] This will install the Windows 32 codecs which include xvid for Ubuntu. You could also setup a streaming video server using Ubuntu. Patrick's Sig: A fan of Google [...]
February 1st, 2010 at 3:53 am
[...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]