Getting v4l2 webcam support is fairly straight forward once you have the toolchain in place.
First, you need to install the v4l2 modules. You can either follow the build instructions located here or download the binary version below.
The modules should be installed at /lib/modules/2.6.21/kernel/drivers/media/video.
Here is a set of video modules compiled for the 2.6.21 kernel.
- uvcvideo.ko
- compat_ioctl32.ko
- v4l1-compat.ko
- videodev.ko
- v4l2-common.ko
Once you have the modules installed issue a “depmod -a” command so the system can find them.
To test your work, download a copy of uvccapture for OpenEmbeeded.
Before you can install the uvccapture package you will need to install a copy of libjpeg.
Once you have libjpeg installed you can install uvccapture.
Here is a quick time lapse photography script
|
1 2 3 4 5 6 7 8 |
#!/bin/sh for i in `seq 1 1000`; do fname=`printf "%05d" "$i"`; uvccapture -o${fname}.jpg -x800 -y600; sync; #make sure image is stored in case of a power loss sleep 10; done |
You can create a movie from the images using jpeg2yuv. Under Ubuntu, jpeg2yuv is part of the mjpegtools package.
|
1 2 |
#!/bin/sh jpeg2yuv -f 25 -b 1 -I p -j %05d.jpg | mpeg2enc -o time_lapse.m1v |

