Capturing Video With the Linksys WVC11B Wireless-B Internet Video Camera
I run a live chicken cam here, and decided it was time to get an appliance rather than a full PC to save power. The WVC11B was quite inexpensive, and does what I need. This camera streams video, but doesn't have a way to just save one frame, so my old way of simply posting an image every five minutes didn't work. The first challenge was figuring out where the stream was coming from and how to capture it live. I used MPlayer running on GNU/Linux for this, but, really, most anything will work. I can see the stream coming off of the camera with mplayer using this command:
mplayer http://user:password\@hostname/img/video.asf
|
Of course, change the user, password, and host name. The escaped @ is just for the shell. To convert the stream to a 10 second video consisting of 50 frames as an MPEG-4 file:
mencoder http://user:password\@hostname/img/video.asf -o
/home/usr-1/chickencam/chickenmovie.avi -oac lavc -ovc lavc
-lavcopts vcodec=mpeg4 -ffourcc DX50 -endpos 10 -ofps 25
|
This would make sense, and works with Microsoft Media Player 10 and mplayer, but it doesn't work with older versions of Media Player. It turns out the most compatible solution I could find, at least, was to stick with the ASF format. This is a subset of the WMV format. To convert the stream to a 10 second video consisting of 50 frames as an AVI file in ASF format:
mencoder http://user:password\@hostname/img/video.asf -o
/home/usr-1/chickencam/chickenmovie.avi -ovc copy -endpos 10 -ofps 25
|
I didn't know this, but AVI is kind of a container for video formats. It doesn't really mean much, and video viewers look within the file to figure out the format. The -ffourcc DX50 part of the above command line is used to tell the viewer that the device is MPEG-4 compatible. I have no idea what device a DX50 is, but that is what is recommended right now to fool the viewer into figuring out it is an MPEG-4 file. I'm not much of a video person, but you can find a lot of good information about this here. The reason why I'm using -ofps 25 is so I can convert to MPEG-1, but I'm still working on that.
One final trick is to slice off one frame to make a single JPEG image:
mplayer /home/usr-1/chickencam/chickenmovie.avi -frames 1 -vo jpeg
|
You can view the results of this here.
|
|