Microsoft Media Encoder 9 (Live-Broadcast)

What You’ll Need

For this webcam experiment, I assume that you are running Windows XP. Also, because I am demonstrating how to set up a webcam that broadcasts over the internet, you will also need a camera. In this case I take a used analog Sony PTZ camera Sony-EVI d31 and an USB video-grabber. Each video-grabber will vary in its setup, so I won’t delve into the setup of your PC to your video-grabber. However, before we get started, make sure that your camera can work properly with the software that was bundled with yourvideo-grabber. Besides the USB web camera, to broadcast the web camera feed over the Internet you need some software to facilitate things. I chose to go with Microsoft Windows Media Encoder version 9. Windows Media Encoder is a free download, which captured my vote. You can download it here. Last but not least, you need a broadband Internet connection if you plan to broadcast your webcam feed over the Internet for others to watch.

Installation and Setup

Setup of Windows Media Encoder 9 is quite easy given that you have your web camera connected to your machine and the drivers set up properly. Simply launch the installer and choose a location on your hard drive in which you want the application to be installed. Next, launch Windows Media Encoder from your Start menu.

You should see the New Session Wizard display. Choose the Broadcast A Live Event option, as shown, and click Next.

Device Options screen

In the Device Options screen that appears, make sure that your webcam is selected for the video source and (here the USB Audio and Video Grabber) your sound card is selected for the audio source and click Next. .

Pull From the Encoder option

In the Broadcast Method screen shown in Figure, choose the Pull From the Encoder option.

Broadcast Connection screen

Next, you need to specify the encoding options, which can be a daunting task. I’ll try and shed some light. The options you should pick in the Encoding Options screen, shown in Figure, should be based on your upload bandwidth and your audience’s download bandwidth. The general rule of thumb is this: The higher the total bit rate and the frame rate, and the larger the output size, the more upload bandwidth and download bandwidth are required. I suggest that you play around with these values to see what is optimal for your webcam broadcasting needs. I would start with the Live Broadcast Video (CBR) option for video and Multiple Bit Rates Audio (CBR) for audio.

Encoding Options screen

You’ll be asked if you want to create an archive of your broadcast in the Archive File screen (see Figure 6). Skip this step by leaving the checkbox unchecked and click Next.

Preview screen

To start the streaming process, you need to click the Start Encoding button as shown in Figure 11. You are ready for clients to listen and watch the live webcam broadcast. But before the clients can hook up, you have some preparation to do. For now, go ahead and turn off the encoding process by clicking Stop (next to the Start Encoding button).

Forwarding Your Port

Before your clients can listen to and watch your broadcast over the Internet, we have to make sure that the broadband router (if you have one) is forwarding external IP requests for your webcam stream to your broadcasting machine. This process, known as port forwarding, varies for broadband router brands. Refer to your router product documentation to see how to set up port forwarding. In short, you want to route external requests from the web to the IP and port you defined when you created your broadcast session earlier. For example, in my case, I need to forward incoming requests coming into port 8080 of my broadband router (in this case a FRITZbox 7170) onto port 8080 of my internal IP address of 192.168.10.22.

Tuning Into Your Web Camera Broadcast

After you have forwarded your ports, you can start the encoding process again to begin broadcasting your web camera feed (that is, click the Start encoding button).

At this point, you can have your audience tune into the web camera broadcast. Clients can hook up by opening Windows Media Player on their machines and specifying either the LAN address (if the client is on the same local network as the broadcasting machine) or the external WAN address if the client is outside the network of the broadcasting machine. To find out your WAN address, a good trick is to go to http://www.dna63.net/whatsmyip.aspx (see Figure), which lets you know what your external WAN address is. To let people outside your LAN tune into your webcam broadcast, you’ll need to provide this external WAN address.

Conclusion

In this article, I showed you how to set up a live web camera feed using Windows Media Encoder, a broadband Internet connection, and a web camera. Using the simple setup described in this article, you can let people view what your web camera can see. Alternatively, you can be your own audience. You can use the setup described in this article to build yourself a baby monitor that can hear—and see!

Web-Browser

With the code below you can run the webcam stream in a browser.

Replace the xxx with your public IP adress and the yyy with your port.

<object id= "Video"
border="1"
width="640"
height="495"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,0701"
classid= "CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 " standby= "Loading Windows Media Player components..."
type= "application/x-oleobject" >
<param name= "FileName " value= "mms://xxx.xxx.xxx.xxx:yyyy/ " / >
<param name= "ShowControls " value= "0" / >
<param name= "ShowStatusBar " value= "1" / >
<param name= "ShowDisplay " value= "0" / >
<param name= "AnimationAtStart " value= "1" / >
<param name= "TransparentAtStart " value= "0" / >
<param name= "AutoStart " value= "1" / >
<param name= "AllowChangeDisplaySize " value= "0" / >
<embed type= "application/x-mplayer2 " pluginspage= "http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/ "
src="mms://xxx.xxx.xxx.xxx:yyyy/ "
name="Video"
width="640"
height="495"
ShowControls="0"
ShowStatusBar="1"
ShowDisplay="0"
AnimationAtStart="1"
TransparentAtStart="0"
AutoStart="1"
AllowChangeDisplaySize="0" >
</embed>
</object>