Stream Your Webcam

This article was provided by wikiHow, a wiki building the world's largest, highest quality how-to manual. Please edit this article and find author credits at the original wikiHow article on how to stream your webcam. Content on wikiHow can be shared under a Creative Commons License.

Grade C Views 2,062
Last edited 2 months ago

Your webcam isn't only good for video chatting one-on-one. You can also share your home or office with the world, using open-source software on Windows, Linux, or Macintosh computers. Here's one way to go about it.

Step 1  

Obtain the necessary items, detailed in Things You'll Need. In some cases, particularly if you have a fixed IP address, the "source" computer can be the same as the "server".

Step 2  

Install the necessary drivers on your "source" computer to enable the webcam to communicate with the operating system. In most cases you can bypass installing any other software that came with the camera; the drivers ought to be sufficient.

Step 3  

Download and install VLC, the free, open-source, video streaming and viewing software. You'll need the right downloads for all 3 machines: the "source" computer (with the webcam); the server, which receives the stream from the source and makes it available to the world; and the client computer from which you'll be testing to see if it works.

Step 4  

Set up a script on the source computer. This example is for an inexpensive webcam bought for $2.99 on eBay:
#!/bin/bash
nice vlc dshow:// :dshow-vdev="ZSMC USB PC Camera (ZS211)" \
:dshow-adev="ESS Maestro" :dshow-size="320x240" \
--sout='#transcode{acodec=mp3,ab=16,vcodec=mp1v,vb=64}'\
':standard{mux=ts,access=udp,dst=tek:1234}' This script is from a Windows machine with Cygwin, so is similar to Unix or Linux syntax. Without Cygwin, you'd want to get rid of the "#!/bin/bash" line as well as the "nice" qualifier, and put everything on one line without the trailing backslashes.

Step 5  

Start up the script, and connect to your server ("tek") in the example. Run tcpdump, or any packet viewer such as ethereal, to see if you're getting the UDP packets from your source computer:

tcpdump -n udp

Step 6  

If you're not getting the packets, you'll need to diagnose the problem, most likely due to firewall restrictions on your DSL or cable modem, or in the operating system of the source computer itself.

Step 7  

Once you're seeing the UDP packets, it's time to set up the VLC script to re-stream the video to the Internet:
#!/bin/bash
vlc -vvv udp: --sout '#standard{access=http,mux=ogg,dst=:8080}' The "-vvv" switch adds lots of debugging information to the output; to run it "silently", get rid of that once you have everything running smoothly.

Step 8  

Now you have the video streaming from your webcam to your server, and from your server to the web; how do you test it? From any third computer with VLC installed, run this command:
vlc http://tek:8080 again substituting for "tek" the name or IP address of your own server. Alternatively, start it the "Windows way": Start | All Programs | VideoLan | VLC media player, then File | Open network stream, select HTTP and enter the URL.

Tips

  • For greatest compatibility with older viewing software, use acodec=mpga. If that doesn't work, though (you don't hear any sound), you might need to use the newer mp3.
  • If you're using the "source" machine as the server, modify the script to directly export the stream as HTTP:


    #!/bin/bash

    nice vlc dshow:// :dshow-vdev="ZSMC USB PC Camera (ZS211)" \

    :dshow-adev="ESS Maestro" :dshow-size="320x240" \

    --sout='#transcode{acodec=mp3,ab=16,vcodec=mp1v,vb=64}'\

    ':standard{mux=ogg,access=http,dst=:8080}'

    This is untested as of this writing, but is sound in principle; it's just the most logical merging of the above two scripts.
  • To use Windows Media Player as the "monitoring" software, you need to change the "source" script to:


    #!/bin/bash

    nice vlc dshow:// :dshow-vdev="ZSMC USB PC Camera (ZS211)" \

    :dshow-adev="ESS Maestro" :dshow-size="320x240" \

    --sout='#transcode{acodec=mp3,ab=32,channels=2,vcodec=div3,vb=256}'\

    ':standard{mux=ts,access=udp,dst=tek:1234}'

    and the "server" script to:


    #!/bin/bash

    vlc -vvv udp: --sout '#standard{access=mmsh,mux=asfh,dst=:8080}'

    And connect from Windows Media Player using File | Open URL, mms://tek:8080, again replacing 'tek' with the name or IP address of your own server.


    Note: this isn't working completely as of this writing, only the audio comes through.
  • VLC also has a "wizard" mode, for those with graphical access to their computers. These instructions were made for remote access to the "source" and "server" computers, requiring only text-mode (command-line) access. To start up the streaming, all that is necessary is to connect using ssh to the source computer (possibly over an ssh tunnel) and start the script:


    $ src/vlcstream.sh&



    That final '&' means to run it as a background process, allowing you to use the command line for other purposes. The starting method is identical on the "server" computer, though you may have named the script something different. To shut down the streaming, simply use the kill or killall command, e.g.:


    $ killall vlcstream.sh

Warnings

  • If you don't take steps to secure the resulting stream using some type of access control, anyone can view your webcam's stream. If this is not your intention, view the documentation to see how to make the stream more secure.

Things You'll Need

  • A webcam that works with your home or office computer, the "source" computer from which you'll be sending the video.
  • A server; inexpensive Linux virtual servers can be leased from companies such as Spry in Seattle or Tektonic in Atlanta. As mentioned previously, you may be able to use your "source" computer as the "server", particularly if you have a fixed IP address, or at least, one that doesn't change frequently.
  • A third computer, with VLC installed, from which you can view your stream from the Internet. Other video viewing software may also work, including Windows Media Player.

Via wikihow

The Mother of all Ping Pong Guns - LETHAL

The lethal pneumatic ping pong gun. This thing isn't exactly wife approved. Creator Ron Kessinger built this mighty powerful ping pong launcher - "a variation on a potato cannon, built to run on ...

Old Bumper Cars Go Street Legal

Flickr user MR38 has posted a set of photos of bumper cars made street legal, as displayed at the annual Cruisin’ Grand festival in Escondido, California. This mini cars were retrofitted with 750 cc ...

Human Powered Ferris Wheel

According to Google's (albeit rough) translation from French to English: "A big wheel in India that does not work with an engine but using human power. Men throw themselves in front of the wheel ...

Make-It-Yourself LEGO Gummies

Turkey day is over, and you have this nice Friday-Saturday-Sunday stretch before it's back the daily grind. Here's a project that inspires both young and old: LeGummies brick shaped gummy candies ...

Geek-Shooting Rubberband Machine Gun

It's the idea that counts. This geeky rubberband machine gun is pretty sweet looking... but I wish it had a little more force. The gun can very quickly shoot (200!) rubberbands, but it just tumbles ...

loading...