mjpeg-streamer on BeagleBone

Now that we are done with the platform we have to attach some sensors.
I had some experience with webcams and mjpeg-streamer so I thougth it’s is time to create the BeagleBone version.
I used the latest demo image with 3.18 kernel.
I have an Canyon Wc 23 type webcam(CN-WCAM23). When I plugged it in, the kernel modules and drivers loaded automatically without the need to install anything. You can still make sure that everything went well by typing:

lsusb

Now you should see that the webcam is attached to the system and works fine as a hardware. Here is what you might see:

root@beaglebone:~/mjpegstreamer/mjpg-streamer# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsmod

to see the kernel modules loaded well, here is what you might see:

root@beaglebone:~/mjpegstreamer/mjpg-streamer# lsmod
Module                  Size  Used by
keucr                  48946  0
gspca_zc3xx            35649  0
gspca_main             14527  1 gspca_zc3xx
spidev                  3888  0
ip_tables               7830  0
x_tables               14348  1 ip_tables
g_mass_storage         24026  0
rfcomm                 24259  0
ircomm_tty             14073  0
ircomm                  8407  1 ircomm_tty
irda                   85557  2 ircomm_tty,ircomm
hidp                   10152  0
bluetooth             109714  4 rfcomm,hidp
rfkill                 14605  2 bluetooth
ipv6                  210466  16

the two importatnt:

gspca_zc3xx            35649  0
gspca_main             14527  1 gspca_zc3xx

And one last thing,

ls /dev/

if there is video0, then everything is fine to go to the next step.

You have to dowload the mjpeg-streamer from here.

After you extracted the files, all you need to do is give

make

command.
When it’s finished with compiling then, you have to start the mjpegstreamer.

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

or see the start.sh inside the mjpg-streamer dir for more tips of using it.

Now use a web browser, beaglebone-ip:8080/ (eg.:http://192.168.0.22:8080/)
If everything is fine you can see the webcamera image.

References:
openwrt
http://yetanotherhackersblog.wordpress.com/2010/11/20/streaming-uvc-webcam-video-over-802-11n-with-a-beagleboard/

Advertisements

8 thoughts on “mjpeg-streamer on BeagleBone

  1. Did you get a bunch of errors when you build mjpg-streamer? I have a more recent Angstrom image on my BeagleBone but it’s otherwise the same. Even though I got compile errors amazingly the app actually did work anyway.

    1. Are you sure those are actually errors? You can get away with warnings but with errors there should be no executable output.

  2. Definitely compile errors, but they don’t seem to prevent the mjpg-streamer app from building or running. The errors are in a plugin that isn’t used with my webcam.

    Here’s the start of the error section:

    In file included from spcav4l.c:25:0:
    spcav4l.h:134:20: error: field ‘vmmap’ has incomplete type
    spcav4l.h:135:26: error: field ‘videocap’ has incomplete type
    spcav4l.h:137:20: error: field ‘videombuf’ has incomplete type
    spcav4l.h:138:23: error: field ‘videopict’ has incomplete type
    spcav4l.h:139:22: error: field ‘videowin’ has incomplete type
    spcav4l.h:140:23: error: field ‘videochan’ has incomplete type

  3. hey… are you able get the webcam working if it’s connected to the beaglebone using a usb hub?? what if the nano wifi adapter is also connected to the usb hub? I have seen that my wifi adapter only works if there’s hub and the webcam works only if there’s no hub. strange.

    1. I think it depends on the power usage of the devices. What kind of power supply do you use? You may need an 5v/2A adapter directly to the beaglebone, the USB supply might be not enough. If that’s not help, try to use different usb hub or try to give power supply to the hub(be careful with the voltage as far as I remember you only need 5v). In my case, I have an D-link dwl-g122 wifistick, a canyon cn-wcam23 webcam, and an usb hub(If I figure out what kind it is I will update). They are working together perfectly and also I give the beaglebone directly 5V/2A power supply.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s