First, the environment
Cross tool chain: arm-linux-gcc-4.1.2
Webcam: ZC301
Second, the transplant process
1, the configuration kernel is the core support chip for ZC301 camera
Make Menuconfig
Device Drivers--->
<*> Multimedia Support--->
<*> Video for Linux
[*] Enable Video for Linux API 1 (DEPRECATED) (NEW)
[*] Video capture Adapters (NEW)--->
[*] V4L USB devices (NEW)--->
<*> USB Video Class (UVC)
[*] UVC Input Events Device support (NEW)
<*> USB zc0301[p] Webcam support (DEPRECATED)
2. Recompile the kernel
Make Zimage
We can drive our camera with the above two steps. But this drive is based on V4L2. Some of the upper-level applications that were previously based on V4L are not available, or require a lot of modification! Here we want to realize the function of network video, formerly used servfox this network video server, but this server is based on v4l, if we want to use the words will have to Servfox source code to modify. Here we choose another scheme mjpg-stream.
3. Transplantation of Mjpg-stream
Information about Mjpg-stream can be viewed at the following website:
Http://sourceforge.net/apps/mediawiki/mjpg-streamer/index.php?title=Main_Page
Mjpg-stream porting requires a JPEG library, so we first ported the JPEG library
< Span style= "FONT-SIZE:18PX;" > (1) porting of the JPEG library
< Span style= "FONT-SIZE:18PX;" >&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;1) JPEG Source package toolchain: 4.1.2
1) Extract
#cp/mnt/hgfs/share/geclab/ Jpegsrc.v6b.tar.gz/root/build_rootfs
#tar jxvz jpegsrc.v6b.tar.gz
#cd jpeg-6b
2) configuration
#./configure- Enable-shared-enable-static-prefix=/usr/local/arm/4.1.2/arm-linux
-build=i386-host=arm
3) Modify Makefile
CC=GCC change to CC=ARM-LINUX-GCC
AR=ARRC to AR=ARM-LINUX-ARRC
Ar2=randlib to Ar2=arm-linux-randlib
4) Compile and install
# Make
#makeinstall-lib
cp/usr/local/arm/4.1.2/arm-linux-build=i386/lib/libjpeg*/source/rootfs/lib
(2) Transplantation of Mjpg-stream
< Span style= "FONT-SIZE:18PX;" >&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;1) Mjpg-stream Source Package
&NBSP;&NBSP;&NBSP;2) Decompression Source
tar xvf mjpg-streamer-r63.tar.gz
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;3) Modify the source code
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;CD mjpg-streamer-r63
modify levels makefile in the top-level makefile and plugins directories to have all
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;CC=GCC
Modify to
cc=arm-none-linux-gnueabi-gcc
Modify Plugins/input_uvc/makfile
Modify
CFLAGS + =-o2-dlinux-d_gnu_source-wall-shared-fpic
For
CFLAGS + =-o2-dlinux-d_gnu_source-wall-shared-fpic-i/home/linux/s3c2410-2.6.35/video/jpeg/include
Modify
$ (CC) $ (CFLAGS)-ljpeg-o [email protected] input_uvc.c V4l2uvc.lo Jpeg_utils.lo Dynctrl.lo
For
$ (CC) $ (CFLAGS)-ljpeg-l/home/linux/s3c2410-2.6.35/video/jpeg/lib-o [email protected] INPUT_UVC.C V4l2uvc.lo jpeg_ Utils.lo Dynctrl.lo
jpeg_utils.c:27:fatal error : Jpeglib.h:no such file or directory
4) Compile
make
5) Test
mkdir/source/rootfs/mjpg
&NBSP;&NBSP;&NBSP;&NBSP;CP *.so/source/rootfs/mjpg
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;CP Mjpg-stream/source/rootfs/bin
< Span style= "FONT-SIZE:18PX;" > Open Development Board run
mjpg_streamer-i "/mjpg/input_uvc.so"-O "/mjpg/output_http.so-w/ www "
There are start.sh in the source directory, there are some mjpg-stream methods and instructions in this script
< Span style= "FONT-SIZE:18PX;" > Open a Web page enter the address below to see a video (the board's IP is 192.168.1.202):
http://192.168.1.202:8080/ ? action=stream
Open a webpage and enter the following address to see a static Picture:
http://192.168.1.202:8080/?action=snapshot
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;6) under the Mjpg source code has a WWW directory, this one network uses mjpg instance, With the Web server (BOA) You can implement some other related functions.
If the following issues occur:
650) this.width=650; "title=" Picture 1.png "src=" http://s3.51cto.com/wyfs02/M00/6C/A2/ Wkiom1vorgpxcg0qaao45oivdsy059.jpg "alt=" Wkiom1vorgpxcg0qaao45oivdsy059.jpg "/>
Description missing libjpeg.so.62 to/usr/local/arm/4.1.2/arm-linux-build=i386/lib/Copy library file to file system Lib
This article is from the "Little Mars Blog" blog, please be sure to keep this source http://510909959.blog.51cto.com/9448632/1649936
2440+zc301 Camera Wireless network video Surveillance System