Sunday, November 17, 2013

BBB: WebCam Streaming

After figuring out the Raspberry Pi camera module and getting MJPG-Streamer working I decided to try it on the BBB(BeagleBone Black). This should be easier as you are working with USB vs the RPi camera module which isn't full developed.  Thanks to Warren I already had a Logitech C210 camera I use for the Adaruit show and tells and video chating with family.  Any UVC camera should work, you can check out this list: http://en.wikipedia.org/wiki/List_of_USB_video_class_devices.

Fastest way to check is to plug it in and see if the system sees it as a camera.

# lsusb - will show all USB devices on the bus. This doesn't mean it has the driver.

# ls /dev/  - will list all the devices in the system that have drivers loaded and are ready to use. Look for video0. If it is there you should be ready to go.

Now we just need to download mjpg-streamer. I used part of this guide: http://shrkey.com/installing-mjpg-streamer-on-beaglebone-black/.

Pretty simple compared to the time I spent on the RPi since I wanted to do it without writing a file everytime.

cd ~
su
opkg install subversion libjpeg-dev imagemagick
exit
svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code
cd mjpg-streamer-code/mjpg-streamer-experimental
make
I tried both the experimental and the stable release and both worked fine.

Finally to run it with the full web interface:

./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

Then you can connect to it via your web browser:

http://beagleboneIP:8080/

You can use VLC as a streaming client but there is a much greater delay due to buffering. This might be adjustable, haven't checked yet. VLC was showing mostly green instead of the video but VLC worked with RPi.

There are a bunch of other options you can find here: <link>

I am using -f 5 to limit FPS to 5. Should help on slower connections but affects the delay.

Using a USB webcam works much better for realtime streaming vs the RPi camera module. I am sure if you used a USB webcam on the RPi it would be better as well.

4 comments:

  1. What kind of camera is it? Does it show up ad video0 under /dev/?

    ReplyDelete
  2. I have the same issue with a Sony Ps3 Eye camera. It shows up under /dev/video0

    ReplyDelete
  3. Did you check if your the Sony camera is a UVC camera? I want to say it should work. Maybe compare notes with a Raspberry Pi setup since I think I have heard it working on the Pi.

    ReplyDelete
  4. @Isaac: The PS3 camera sends frames in a different format. You can specify an option to convert them, but be warned it eats A LOT of cycles. Like, near 100%. It does work, though...

    Invoke with the following option for the input so:

    ./mjpg_streamer -i "./input_uvc.so -y" -o "./output_http.so"

    ReplyDelete