Topic: Webcam Streaming with MJPG-streamer
Earlier today I was following billyzelsnack's info on capturing video from a webcam and drawing it to the Infocast framebuffer, which worked great for displaying the image on-screen. After I got that working, I started looking into how to stream webcam video, and I ran across the open-source MJPG-streamer.
It was relatively easy to set up Motion JPEG streaming from my Infocast 3.5" to my desktop's web browser (Firefox or Chrome work). I was able to do 1280x720 (the resolution of my Logitech C260 webcam) at 15 FPS just fine.
Here's roughly how I recall doing it (it's late). I didn't have to write a single line of code.
1) Download libjpeg (required by mjpg-streamer): http://www.ijg.org/files/jpegsrc.v8c.tar.gzp
2) Compile libjpeg on the Chumby/Infocast. I was able to do
./configure
make
make test
without any problems.
3) Install libjpeg. You can either remount the root filesystem as read/write and install to the default location with
make install
or follow the instructions in install.txt to install to a location of your choosing.
4) Download mjpg-streamer: http://sourceforge.net/projects/mjpg-st … z/download
5) Compile mjpg-streamer. If you didn't install libjpg to the default locations, you'll have to add the install location to the include and library search paths. You'll get a crap-ton of warnings, which I didn't look into.
6) Plug in your USB webcam. Hopefully it works with the built-in drivers.
6) Run mjpg_streamer. I had trouble setting the search path for it to find the input plugin, but what ultimately worked for me was:
./mjpg_streamer -i "./input_uvc.so -r 1280x720 -d /dev/video0 -f 15" -o "./output_http.so -w www"
7) The motion jpeg stream is now available on your browser at:
http://your-chumby-ip:8080/?action=stream
There seemed to be some performance issues when I got 3 people on the stream. Anyway, hope this is useful/fun for somebody.