n00tz.net
so you think you're savvy? reviews.ramblings.references
  • Home
  • About
  • Amateur Radio
  • Lifestream

Setting up a Streaming Media Server on Ubuntu 8.04LTS (Hardy Heron)

Software Add comments

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.

Code:
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.

Code:
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:

vlc-http-interface

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:

Code:
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).

Be Sociable, Share!
  • Tweet

Tags: linux, media server, port forwarding, screen, server, ssh, streaming, ubuntu hardy, video, vlc


July 10th, 2008 |

Tags: linux, media server, port forwarding, screen, server, ssh, streaming, ubuntu hardy, video, vlc


40 Responses to “Setting up a Streaming Media Server on Ubuntu 8.04LTS (Hardy Heron)”

  1. Kirk
    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


  2. n00tz
    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!


  3. steffa
    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?


  4. steffa
    December 30th, 2008 at 2:01 am

    shouldnt it play all the things vlc plays?


  5. n00tz
    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.


  6. junky001
    December 30th, 2008 at 3:38 pm

    At what point and where do you add media to stream ?


  7. Eli
    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


  8. n00tz
    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


  9. trillex
    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?


  10. trillex
    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.


  11. fcukin.com » Blog Archive » 64 FCUKIN Things Every Geek Should Know
    April 21st, 2009 at 12:43 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  12. 64 Things Every Geek Should Know « Caintech.co.uk
    April 22nd, 2009 at 1:52 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  13. smadamr | 2^6 Things Every Geek Should Know
    April 30th, 2009 at 10:06 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  14. Mega-gia: 64 cosas que un Geek deveria saber « marcianos conectados
    May 18th, 2009 at 12:40 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  15. 64 cosas que todo geek deberia saber « Dark Andrew
    June 8th, 2009 at 11:43 pm

    [...] 52. Montar un servidor de Streaming [...]


  16. Arrow Webzine » 64 Things Every Geek Should Know.
    June 13th, 2009 at 3:12 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  17. 64 things a tech-savvy geek should know! - Digihackers – Tech 2.0!
    June 20th, 2009 at 5:11 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  18. 64 things a tech savvy geek should know! | DigiHackers
    June 29th, 2009 at 4:38 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  19. 64 Things Every Geek Should Know | Enginerve's Blog
    July 14th, 2009 at 2:57 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  20. The Geek “Must Do Before You Die” Checklist | Failure is the Key to Success
    September 21st, 2009 at 1:31 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  21. #Os Punks também amam!
    September 24th, 2009 at 1:53 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  22. How do I install the xvid Codec on Ubuntu? - QuestionBin::Answer
    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 [...]


  23. 64 Geek Things! « Just Some Random Thoughts…..
    February 1st, 2010 at 3:53 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  24. Are you really a Geek? 54 Things Geeks Should Know. « Shiny Otaku
    February 12th, 2010 at 4:24 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  25. 64 Things Every Geek Should Know « Live Beautifully.
    March 19th, 2010 at 6:18 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  26. 64 Things Every Geek Should Know « wesley83's Blog
    March 19th, 2010 at 6:18 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  27. 64 Things Every Geek Should Know « The illiterate scientist
    March 30th, 2010 at 7:33 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  28. The Geek “Must Do Before You Die” Checklist | Daily Cup of Tech » Ashton Technology Blog
    July 1st, 2010 at 2:41 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  29. Kyle
    August 25th, 2010 at 10:41 am

    Hey – Great guide -one of the only ones on the internet to be honest.

    Because most of the places you’ll be wanting to run the client from, will have firewalls which aren’t under your control, there needs to be a way to just connect to it from anywhere. One way I’m thinking at the moment:

    My home Ubuntu server (running VLC) is streaming content to the localhost:1234 UDP protocol). Now from work, or wherever, I can use SSH (like putty for Windows) and port foward 1234 to localhost on my home server. Now on the PC I’m on, I’ll just connect to port 1234 as usual and it should work. That way you can avoid having to always give the exact IP address of the PC your want to stream to.

    Is there any other way you can think of? Reason being, is although the “play to localhost port 1234″ should work, it doesn’t. For some reason I’m not able to connect to the stream from my client … using the port forward method with PuTTY. I have no idea why. I know the port forward is working, but I suspect it’s something to do with how VLC interprets my incoming address, or the way the stream is “sent” to the localhost port… Have you ever tried something like this before?

    Is there any way to just make VLC stream to a port on it’s localhost and then any computer connecting to that server’s address, on that port, will have access to the stream? Any help appreciated.


  30. n00tz
    August 27th, 2010 at 2:08 pm

    My recommendation for you on that note would be to use a VPN, like hamachi or OpenVPN. That way you wouldn’t have to worry about port forwarding. Once you have the VPN set up, you could just connect to it like you were on the same network (you’ll probably have to use the VPN IP address).


  31. 64 Cosas que un Geek debe de saber | Geek Zeitung
    September 24th, 2010 at 1:45 pm

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  32. PixelTunnelVision
    January 9th, 2011 at 3:06 am

    I already had VLC installed. So when I stumbled upon this I figured I’d give it a try. My problem arises when I try http://your.server.ip:8080/ – which just gives me a 403 error.


  33. PixelTunnelVision
    January 9th, 2011 at 3:12 am

    ^ Probably because the “vlc -I http” step never completed? In fact, running that just failed. I got…

    VLC media player 1.0.6 Goldeneye
    [0xa33688] main interface: creating httpd
    [0xa33688] main interface error: socket bind error (Permission denied)
    [0xa33688] main interface error: socket bind error (Permission denied)
    [0xa33688] main interface error: cannot create socket(s) for HTTP host
    [0xa33688] http interface error: cannot listen on :8080
    [0xa33688] main interface error: no suitable interface module
    [0x9194b8] main libvlc error: interface “default” initialization failed


  34. n00tz
    January 17th, 2011 at 12:47 am

    That error means your server is already utilizing port 8080 for some other service. You’ll need to specify the IP and port to use in your command (add a ‘–http-host=IP:port’ with IP equal to an available IP and port equal to an available port on that IP)


  35. Michael Janapin
    January 24th, 2011 at 5:49 pm

    I can verify that –http-host=IP:port does give a 403 error.

    I tried different ports (the free ones, of course) but still got this error.

    I also tried stopping apache to see if it was interfering, but it’s not.

    With Apache stopped, it did not even allow me to use port 80.

    Anyway, thank you very much for this informative article. I’ll try to find a workaround and post the results here. :-)


  36. 70 Things Every Computer Geek Should Know « Brain on Tech
    March 14th, 2011 at 10:54 am

    [...] With digital files becoming the ultimate medium, many people have hundreds of gigabytes worth of music, videos, and pictures. You could keep them on a portable hard drive, but then you’re have to take it everywhere, and only one person could use it at a time. The solution is a streaming media server, something no geek can live without. http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  37. Harlequin
    April 15th, 2011 at 6:43 am

    For 403 errors its a change in vlc that the http was restricted to only 127.0.0.1. You need to go to the .hosts file in vlc in edit the config to allow it to accept connections from other addresses.

    on *nix it is /usr/share/vlc/http/.hosts


  38. 64 Things Every Wannabe Geek Should Know By Caintechnews « My Ass Geek
    July 28th, 2011 at 8:33 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  39. 64 Things Every Geek Should Know « gover
    October 11th, 2011 at 6:05 am

    [...] http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


  40. 70 Things Every Computer Geeks Should Know | New Technology News and Reviews
    October 21st, 2011 at 8:42 am

    [...] With digital files becoming the ultimate medium, many people have hundreds of gigabytes worth of music, videos, and pictures. You could keep them on a portable hard drive, but then you’re have to take it everywhere, and only one person could use it at a time. The solution is a streaming media server, something no geek can live without. http://www.n00tz.net/2008/07/vlc-media-server-ubuntu-hardy/ [...]


Leave a Reply

  • Meet Your Blogger

    profile092008square 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 Northwest Georgia; 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 Amateur Radio, 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. Find out more...
  • Paying the Bills

  • Lifestream

    • Listened to Rock N' Roll [Will Take You To The Mountain] - Skrillex.
      — January 4th via Last.fm
    • Listened to Mixtress - J. Hazen Remix - DJ Baby Anne.
      — January 4th via Last.fm
    • Listened to Cinema feat. Gary Go - Skrillex Remix - Benny Benassi.
      — January 4th via Last.fm
  • Blogroll

    • Garrett Bartley
    • Molly Locklear
    • Nathaniel Foster
    • Paul Stamatiou
    • Robert Sloan
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

  • Mint Investing and Personal Finance
Copyright © 2012 n00tz.net All Rights Reserved
RSS XHTML CSS Log in
Wp Theme by n Graphic Design
Powered by Wordpress