Setup a webcam stream in ten minutes

      20 Comments on Setup a webcam stream in ten minutes

Update 2012 March 25: Microsoft has stopped supporting Windows Media Encoder. It has been replaced with a new product called Expression. Unfortunately, I have not had a chance to use Expression and figure out how to create a similar result. WME is still available for download, but please keep in mind it may not work at all with Windows 7. If anyone has any information on using Expression, please contact me!

I have friends all over the world. Once in awhile, I make use of the various webcams I own and do a little video chatting. Getting video chat to work well will be for another day – something I learned recently, however, was how to setup a live stream on a webpage. It was surprisingly easy, and works in both Windows Vista and Windows XP.

You need three things : a webcam, a decent high-speed internet connection (the lowest end DSL might not have enough bandwidth to support this well), and Windows Media Encoder, which is available for free from Microsoft. If you’re running Vista, there’s a hotfix you might need (it’s linked on the main WME page), but I have yet to have any problems myself.

You might also want to get a dynamic IP service, like dyndns or no-ip. I used, although they seem to be really big on sending me frequent emails advertising their paid services – I’m not a big fan of free services spamming me about their commerical options. If you don’t use a dynamic IP service with the computer running the webcam, you’ll have to manually update the webpage every time your IP changes.

We’ll walk through how to get setup and going. It’s a bit screenshot heavy, so click the jump to see the rest.

Setting up the stream

Install and run Windows Media Encoder (WME). Click the New Session button. We want to create a live broadcast stream.

Select the webcam and microphone you want to use. If you’re setting up this broadcast so your family and friends can see you during the day, you probably don’t need to have sound at all. Keep in mind that streaming sound with your video will also use more bandwidth. My Dell XPS M1330 has an integrated 0.3MP webcam, so I’m using that for this stream.

The “Configure…” button will allow you to change settings on the camera, such as contrast, white balance, noise reduction, etc. I tend to just use the default settings; they work well in general-use situations.

Unless you happen to have access to a Windows Media Server, you’re going to want to setup this stream to be pulled from a server, rather than pushed to a server.

Next, you’ll want to pick a port to use. This is where you need to figure out what’s going to work for you. I was originally going to use port 80. It wasn’t working, until I realized I’d already setup IIS on my laptop, which uses 80 by default (of course – it’s a webserver). In the end, I picked a port in the 1200-1300 range. If you’re running this stream behind a router at home, make sure you open up the correct port in your router’s configuration.

Don’t worry about the local and remote addresses – we’re going to use a dynamic IP url (e.g. or whatever you’ve registered), or the IP address of the machine running the webcam.

The last step we care about in this wizard is selecting a framerate. I’ve been running my stream on a network connection with high upload bandwidth (I average 6MB/s), but if you’re doing this at home on a cable or DSL connection, you’ll probably want to select something a little lower – 250 or 300 kbps will probably work just fine.

You can click through to the end, make sure things are setup the way you want (you can always change all these settings later), click Finish. If your stream isn’t already running, click the “Start Encoding” button in WME.

Now that we’ve got your stream up and running, we can setup a webpage to broadcast it. You don’t need any kind of server-side technology to broadcast your stream. What we’re going to use is an ActiveX control that loads the stream in a Windows Media format. I’ve had hit-or-miss success with this stream opening in Firefox, but it will always work in IE. This is a pretty quick-and-dirty method of getting a webcam stream up and running. OS X users can open the stream in VLC Media Player, but Safari is generally not compatible, since this uses an ActiveX control to load the stream.

Create an HTML page that looks something like this:

Obviously, you’ll want to replace the “http://your-ip-or-url:port” with your IP address or URL, and the port number you’ve chosen.

Save the file and load it up in Internet Explorer. It will take a few seconds to buffer the stream, but you should be loaded and ready to go.

If you want to get really fancy and have access to some kind of server-side technology (PHP, Java, ASP, etc.), you can setup a login interface so that you can control who can see your stream. The server where I’m hosting my stream allows SSL, so I also have it encrypted.

Julie over at The Gadgeteer is sending me a couple of webcams to review for her site. With those and the other USB cameras I already have, I’m thinking about setting up a little home surveillance system I can log into from work. I haven’t really done much with webcams before now, but with Windows Media Encoder and enough bandwidth, the possibilities are endless.

Happy streaming!

20 thoughts on “Setup a webcam stream in ten minutes

  1. Pingback: Brando IP Security Camera Review · TechBlogger

  2. Mel


    I do not use windows media player and do not want to install it. I also have not written code since the Commodore 64. I use Real player or VLC media player instead. I tried your 10 min web Cam setup. The part using windos media encoder went well up to the broadcast connection window where I get a “could not detect”. The stream will run and i have feed from my web cam though. I feel it is because of my not having windows media player on my system.

    So can VLC or Real player be used instead of windows media player?. If so how can I do this. Also would you send me a html file for a web page to broadcast it. Or do you know of a download to do this?

    I’m sure there are a lot of people like me out there.

    Thanks for your time. Mel Henzler

    1. Claire Post author

      This route doesn’t require Windows Media Player – it uses another piece of free software from Microsoft called Windows Media Encoder. The two are pretty much unrelated aside from similar brand names.

      Are you behind a firewall (router, etc.)? You need to make sure that (a) Windows Media Encoder is an exception in the Windows firewall, and (b) you’ve opened the appropriate port on your router’s NAT. If you’re doing this from work, it could very well be that outgoing ports are restricted to only a few (usually 80, 443, and 21), so it won’t work.

      This definitely isn’t the most elegant or platform-independent solution out there, but it’s the fastest and easiest I’ve found for a quick-and-dirty method of getting a stream going.

  3. Sarah

    could i publish this to any website? Will it work on wordpress? What about one of those free hosting sites like geocities?

    1. Claire Post author

      This will work on any server that allows using the OBJECT and EMBED tags. You can use it within WordPress if your server supports that. It’s unlikely to work on a site like Geocities, but you can always try!

  4. Rodney Turner

    Thank you so much for your post. It give me something else to do with my web camera, besides talking to my mom in Korea.
    Here is one of the applications:

    FYI, you are now in my Reader!
    Thanks again.

  5. DIANA


    I found this site today while looking for solutions to my web cam problems. I was curious to see if and when you might be posting about how to get a video chat to work well as obviously I can’t. (I’m computer illiterate so second grade english would be appreciated should you do the post!)

    Thank you 🙂

    1. Claire Post author


      Video chat is very easy to do. I would recommend using Windows Live Messenger if you’re going to be chatting with someone else using Windows. If you’re talking to a Mac or Linux user, Skype works very well.

      1. DIANA

        Hi Claire! I do use WLM…my HP touchsmart has a built in cam…streaming is very slow and choppy (definitely not ‘real time’)and gets annoying …I also tried to set up a moveable cam as the angle in the built in one is not user friendly but that one won’t even turn on after selecting it from messenger setup. I tried turning off the firewall too with no success…any advice would be greatly appreciated!
        (Would changing over to SKype help any? My cable co is my isp)

    1. Claire Post author


      I’m not sure what your problem is. There might be something else on your network that’s slowing things down, or your ISP might be having problems. Do other streaming apps work okay? Try using this Windows Media Encoder method instead of WLM. You might also tweak the WLM settings for your video stream and see if that helps.


      Did you set the connection to your localhost IP? (e.g. If that doesn’t work, I’m not certain what to tell you, since that’s the setting I used.

  6. Pingback: x mplayer2

  7. Teri

    Thanks for this info. It worked great. I let it find an open port, will look into the dynamic one later. Used the VLC media player. Worked for both the lan and internet. Fun. Thanks again for the turtorial. Even tho this is an old thread, I am using a netbook with windows 7 starter and was concerned about compatability, but no problem there.

  8. Citygum

    Hi,the URL for internet connection chosen by wme is which is different from the real ip 192.168…etc. so which URL:port we should use to watch the video???
    Thank you

  9. Adel

    I opened the webpage using internet explorer , i ‘ve got the windows media player on the page but the streaming doesn’t work for some reason .Please dear friends , could you tell me what’s wrong ?

    1. Claire Post author

      A few things to check – if you are accessing the page over the Internet, make sure the right port is open on the firewall of the network hosting the camera. If you’re accessing the page on your local network, make sure the Windows firewall isn’t blocking anything, and make sure that Windows Media Encoder is running and you can see your stream.


Leave a Reply

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