---WebCam网络摄像头6 编译WebCam
生活随笔
收集整理的這篇文章主要介紹了
---WebCam网络摄像头6 编译WebCam
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
直接使用天嵌提供的交叉編譯器編譯WebCam而生成的input_uvc.so output_http.souvc_stream放在micro2440下面可以直接使用--兩個(gè)開發(fā)板幾乎沒什么不同。。。
而如果要用友善提供的交叉編譯器,去編譯天嵌的WebCam會發(fā)生錯(cuò)誤。。。因?yàn)榫幾g的時(shí)候需要SDL庫,而友善的4.3.2沒有加入此庫。下面是源碼樹。
http://download.csdn.net/detail/songqqnew/3887473
[root@localhost WebCam]# pwd /opt/FriendlyArm/mini2440/WebCam [root@localhost WebCam]# tree . `-- mjpg-streamer|-- mjpeg-client|?? |-- bin|?? |?? |-- linux_i386_upx|?? |?? |?? `-- viewer|?? |?? `-- win32_upx|?? |?????? |-- properties.ini|?? |?????? `-- viewer.exe|?? |-- main.lfm|?? |-- main.lrs|?? |-- main.pas|?? |-- mjpegviewer.lpi|?? `-- mjpegviewer.lpr|-- mjpg-streamer|?? |-- CHANGELOG|?? |-- LICENSE|?? |-- Makefile|?? |-- README|?? |-- mjpg_streamer.c|?? |-- mjpg_streamer.h|?? |-- plugins|?? |?? |-- input.h|?? |?? |-- input_cmoscamera|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- dynctrl.lo|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_cmoscamera.so|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- jpeg_utils.c|?? |?? |?? |-- jpeg_utils.h|?? |?? |?? |-- jpeg_utils.lo|?? |?? |?? |-- uvc_compat.h|?? |?? |?? |-- uvcvideo.h|?? |?? |?? |-- v4l2uvc.c|?? |?? |?? |-- v4l2uvc.h|?? |?? |?? `-- v4l2uvc.lo|?? |?? |-- input_control|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- uvc_compat.h|?? |?? |?? `-- uvcvideo.h|?? |?? |-- input_file|?? |?? |?? |-- Makefile|?? |?? |?? |-- input_file.c|?? |?? |?? `-- input_file.so|?? |?? |-- input_gspcav1|?? |?? |?? |-- Makefile|?? |?? |?? |-- encoder.c|?? |?? |?? |-- encoder.h|?? |?? |?? |-- huffman.c|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_gspcav1.c|?? |?? |?? |-- jconfig.h|?? |?? |?? |-- jdatatype.h|?? |?? |?? |-- marker.c|?? |?? |?? |-- marker.h|?? |?? |?? |-- quant.c|?? |?? |?? |-- quant.h|?? |?? |?? |-- readme.spcacat|?? |?? |?? |-- spcaframe.h|?? |?? |?? |-- spcav4l.c|?? |?? |?? |-- spcav4l.h|?? |?? |?? |-- utils.c|?? |?? |?? `-- utils.h|?? |?? |-- input_testpicture|?? |?? |?? |-- Makefile|?? |?? |?? |-- input_testpicture.c|?? |?? |?? |-- pictures|?? |?? |?? |?? |-- 160x120_1.jpg|?? |?? |?? |?? |-- 160x120_2.jpg|?? |?? |?? |?? |-- 320x240_1.jpg|?? |?? |?? |?? |-- 320x240_2.jpg|?? |?? |?? |?? |-- 640x480_1.jpg|?? |?? |?? |?? |-- 640x480_2.jpg|?? |?? |?? |?? |-- 960x720_1.jpg|?? |?? |?? |?? `-- 960x720_2.jpg|?? |?? |?? `-- testpictures.h|?? |?? |-- input_uvc|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- jpeg_utils.c|?? |?? |?? |-- jpeg_utils.h|?? |?? |?? |-- uvc_compat.h|?? |?? |?? |-- uvcvideo.h|?? |?? |?? |-- v4l2uvc.c|?? |?? |?? `-- v4l2uvc.h|?? |?? |-- output.h|?? |?? |-- output_autofocus|?? |?? |?? |-- Makefile|?? |?? |?? |-- output_autofocus.c|?? |?? |?? |-- processJPEG_onlyCenter.c|?? |?? |?? `-- processJPEG_onlyCenter.h|?? |?? |-- output_file|?? |?? |?? |-- Makefile|?? |?? |?? |-- examples|?? |?? |?? |?? |-- change_filename.sh|?? |?? |?? |?? |-- ftp_upload.sh|?? |?? |?? |?? `-- show_filename.sh|?? |?? |?? `-- output_file.c|?? |?? |-- output_http|?? |?? |?? |-- Makefile|?? |?? |?? |-- httpd.c|?? |?? |?? |-- httpd.h|?? |?? |?? `-- output_http.c|?? |?? `-- output_viewer|?? |?????? |-- Makefile|?? |?????? `-- output_viewer.c|?? |-- scripts|?? |?? `-- make_deb.sh|?? |-- start.sh|?? |-- utils.c|?? |-- utils.h|?? `-- www|?????? |-- LICENSE.txt|?????? |-- bodybg.gif|?????? |-- cambozola.jar|?????? |-- control.htm|?????? |-- example.jpg|?????? |-- favicon.ico|?????? |-- favicon.png|?????? |-- fix.css|?????? |-- functions.js|?????? |-- index.html|?????? |-- java.html|?????? |-- java_control.html|?????? |-- java_simple.html|?????? |-- javascript.html|?????? |-- javascript_motiondetection.html|?????? |-- javascript_simple.html|?????? |-- sidebarbg.gif|?????? |-- static.html|?????? |-- static_simple.html|?????? |-- stream.html|?????? |-- stream_simple.html|?????? |-- style.css|?????? `-- videolan.html`-- uvc-streamer|-- CHANGELOG|-- LICENSE|-- Makefile|-- README|-- color.c|-- color.h|-- color.o|-- control.c|-- control.h|-- control.o|-- huffman.h|-- utils.c|-- utils.h|-- utils.o|-- uvc_compat.h|-- uvc_stream|-- uvc_stream.c|-- uvc_stream.o|-- uvcvideo.h|-- v4l2uvc.c|-- v4l2uvc.h`-- v4l2uvc.o22 directories, 144 files [root@localhost WebCam]# ?
以下所有編譯使用友善配的4.3.2編譯器
參考天嵌攝像頭移植手冊
[root@localhost mjpg-streamer]# which arm-linux-gcc /usr/local/arm/4.3.2/bin/arm-linux-gcc
1.移植SDL庫:
http://www.libsdl.org/release/SDL-1.2.13.tar.gz?? 下載之后考到/opt/FriendlyArm/mini2440/目錄下
[root@localhost SDL-1.2.13]# pwd /opt/FriendlyArm/mini2440/SDL-1.2.13 [root@localhost SDL-1.2.13]# mkdir __install [root@localhost SDL-1.2.13]# ./configure --prefix=/opt/FriendlyArm/mini2440/SDL-1.2.13/__install --disable-video-dummy --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --target=arm-linux --host=arm-linux? --disable-video-directfb --disable-input-tslib --enable-video-fbcon --disable-video-x11-dgamouse --enable-video-qtopia --disable-video-x11-vm --disable-video-x11-xv --disable-video-x11-xinerama --disable-video-x11-xme --disable-video-x11-xrandr --disable-video-x11-dpms --disable-video-photon --disable-video-cocoa --disable-video-ps2gs?? --disable-video-svga --disable-video-vgl? --disable-video-wscons --disable-video-xbios? --disable-video-gem?? --disable-video-opengl?? --disable-stdio-redirect? --disable-directx? --disable-pulseaudio [root@localhost SDL-1.2.13]# make [root@localhost SDL-1.2.13]# make install [root@localhost SDL-1.2.13]# cd __install [root@localhost __install]# cp lib/*? /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ [root@localhost __install]# cp -rf include/*? /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/2.
編譯uvc-streamer
[root@localhost uvc-streamer]# pwd /opt/FriendlyArm/mini2440/WebCam/mjpg-streamer/uvc-streamer [root@localhost uvc-streamer]# make 編譯mjpg-streamer,并打包所需文件為bin-song.tgz
[root@localhost mjpg-streamer]# pwd /opt/FriendlyArm/mini2440/WebCam/mjpg-streamer/mjpg-streamer [root@localhost mjpg-streamer]# make [root@localhost mjpg-streamer]# tar cvzf bin-song.tgz mjpg_streamer input_uvc.so input_cmoscamera.so output_http.so www/ ../uvc-streamer/uvc_stream 3.
將bin-song.tgz弄到micro2440上,執(zhí)行:
[root@FriendlyARM plg]# mkdir bin-song [root@FriendlyARM plg]# cd bin-song/ [root@FriendlyARM bin-song]# tar xvzf ../bin-song.tgz [root@FriendlyARM bin-song]# ls input_cmoscamera.so? mjpg_streamer??????? uvc-streamer input_uvc.so???????? output_http.so?????? www[root@FriendlyARM bin-song]# ./uvc-streamer/uvc_stream Using V4L2 device.....: /dev/video0 Resolution............: 640 x 480 frames per second.....: 5 TCP port..............: 8080 motor control TCP port: 8081 zc3xx: probe 2wr ov vga 0x0000 ^Cshutdown...[root@FriendlyARM bin-song]#? ./mjpg_streamer? -i "./input_uvc.so" -o "./output_http.so -w ./www/" MJPG Streamer Version.: 2.0i: Using V4L2 device.: /dev/video0i: Desired Resolution: 640 x 480i: Frames Per Second.: 5i: Format............: MJPEGo: www-folder-path...: ./www/o: HTTP TCP port.....: 8080o: username:password.: disabledo: commands..........: enabledDBG(mjpg_streamer.c, main(), 374): starting input pluginDBG(mjpg_streamer.c, main(), 382): starting 1 output plugin(s) zc3xx: probe 2wr ov vga 0x0000 ^Csetting signal to stop[root@FriendlyARM bin-song]# ./mjpg_streamer? -i "./input_cmoscamera.so" -o "./output_http.so -w ./www/"??????????? ? MJPG Streamer Version.: 2.0i: Using CMOS Camera device.: /dev/camerai: Desired Resolution: 640 x 512i: Frames Per Second.: 5i: Format............: YUVi: JPEG Quality......: 80o: www-folder-path...: ./www/o: HTTP TCP port.....: 8080o: username:password.: disabledo: commands..........: enabledDBG(mjpg_streamer.c, main(), 374): starting input pluginDBG(mjpg_streamer.c, main(), 382): starting 1 output plugin(s) ^Csetting signal to stop
而如果要用友善提供的交叉編譯器,去編譯天嵌的WebCam會發(fā)生錯(cuò)誤。。。因?yàn)榫幾g的時(shí)候需要SDL庫,而友善的4.3.2沒有加入此庫。下面是源碼樹。
http://download.csdn.net/detail/songqqnew/3887473
[root@localhost WebCam]# pwd /opt/FriendlyArm/mini2440/WebCam [root@localhost WebCam]# tree . `-- mjpg-streamer|-- mjpeg-client|?? |-- bin|?? |?? |-- linux_i386_upx|?? |?? |?? `-- viewer|?? |?? `-- win32_upx|?? |?????? |-- properties.ini|?? |?????? `-- viewer.exe|?? |-- main.lfm|?? |-- main.lrs|?? |-- main.pas|?? |-- mjpegviewer.lpi|?? `-- mjpegviewer.lpr|-- mjpg-streamer|?? |-- CHANGELOG|?? |-- LICENSE|?? |-- Makefile|?? |-- README|?? |-- mjpg_streamer.c|?? |-- mjpg_streamer.h|?? |-- plugins|?? |?? |-- input.h|?? |?? |-- input_cmoscamera|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- dynctrl.lo|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_cmoscamera.so|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- jpeg_utils.c|?? |?? |?? |-- jpeg_utils.h|?? |?? |?? |-- jpeg_utils.lo|?? |?? |?? |-- uvc_compat.h|?? |?? |?? |-- uvcvideo.h|?? |?? |?? |-- v4l2uvc.c|?? |?? |?? |-- v4l2uvc.h|?? |?? |?? `-- v4l2uvc.lo|?? |?? |-- input_control|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- uvc_compat.h|?? |?? |?? `-- uvcvideo.h|?? |?? |-- input_file|?? |?? |?? |-- Makefile|?? |?? |?? |-- input_file.c|?? |?? |?? `-- input_file.so|?? |?? |-- input_gspcav1|?? |?? |?? |-- Makefile|?? |?? |?? |-- encoder.c|?? |?? |?? |-- encoder.h|?? |?? |?? |-- huffman.c|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_gspcav1.c|?? |?? |?? |-- jconfig.h|?? |?? |?? |-- jdatatype.h|?? |?? |?? |-- marker.c|?? |?? |?? |-- marker.h|?? |?? |?? |-- quant.c|?? |?? |?? |-- quant.h|?? |?? |?? |-- readme.spcacat|?? |?? |?? |-- spcaframe.h|?? |?? |?? |-- spcav4l.c|?? |?? |?? |-- spcav4l.h|?? |?? |?? |-- utils.c|?? |?? |?? `-- utils.h|?? |?? |-- input_testpicture|?? |?? |?? |-- Makefile|?? |?? |?? |-- input_testpicture.c|?? |?? |?? |-- pictures|?? |?? |?? |?? |-- 160x120_1.jpg|?? |?? |?? |?? |-- 160x120_2.jpg|?? |?? |?? |?? |-- 320x240_1.jpg|?? |?? |?? |?? |-- 320x240_2.jpg|?? |?? |?? |?? |-- 640x480_1.jpg|?? |?? |?? |?? |-- 640x480_2.jpg|?? |?? |?? |?? |-- 960x720_1.jpg|?? |?? |?? |?? `-- 960x720_2.jpg|?? |?? |?? `-- testpictures.h|?? |?? |-- input_uvc|?? |?? |?? |-- Makefile|?? |?? |?? |-- dynctrl.c|?? |?? |?? |-- dynctrl.h|?? |?? |?? |-- huffman.h|?? |?? |?? |-- input_uvc.c|?? |?? |?? |-- jpeg_utils.c|?? |?? |?? |-- jpeg_utils.h|?? |?? |?? |-- uvc_compat.h|?? |?? |?? |-- uvcvideo.h|?? |?? |?? |-- v4l2uvc.c|?? |?? |?? `-- v4l2uvc.h|?? |?? |-- output.h|?? |?? |-- output_autofocus|?? |?? |?? |-- Makefile|?? |?? |?? |-- output_autofocus.c|?? |?? |?? |-- processJPEG_onlyCenter.c|?? |?? |?? `-- processJPEG_onlyCenter.h|?? |?? |-- output_file|?? |?? |?? |-- Makefile|?? |?? |?? |-- examples|?? |?? |?? |?? |-- change_filename.sh|?? |?? |?? |?? |-- ftp_upload.sh|?? |?? |?? |?? `-- show_filename.sh|?? |?? |?? `-- output_file.c|?? |?? |-- output_http|?? |?? |?? |-- Makefile|?? |?? |?? |-- httpd.c|?? |?? |?? |-- httpd.h|?? |?? |?? `-- output_http.c|?? |?? `-- output_viewer|?? |?????? |-- Makefile|?? |?????? `-- output_viewer.c|?? |-- scripts|?? |?? `-- make_deb.sh|?? |-- start.sh|?? |-- utils.c|?? |-- utils.h|?? `-- www|?????? |-- LICENSE.txt|?????? |-- bodybg.gif|?????? |-- cambozola.jar|?????? |-- control.htm|?????? |-- example.jpg|?????? |-- favicon.ico|?????? |-- favicon.png|?????? |-- fix.css|?????? |-- functions.js|?????? |-- index.html|?????? |-- java.html|?????? |-- java_control.html|?????? |-- java_simple.html|?????? |-- javascript.html|?????? |-- javascript_motiondetection.html|?????? |-- javascript_simple.html|?????? |-- sidebarbg.gif|?????? |-- static.html|?????? |-- static_simple.html|?????? |-- stream.html|?????? |-- stream_simple.html|?????? |-- style.css|?????? `-- videolan.html`-- uvc-streamer|-- CHANGELOG|-- LICENSE|-- Makefile|-- README|-- color.c|-- color.h|-- color.o|-- control.c|-- control.h|-- control.o|-- huffman.h|-- utils.c|-- utils.h|-- utils.o|-- uvc_compat.h|-- uvc_stream|-- uvc_stream.c|-- uvc_stream.o|-- uvcvideo.h|-- v4l2uvc.c|-- v4l2uvc.h`-- v4l2uvc.o22 directories, 144 files [root@localhost WebCam]# ?
以下所有編譯使用友善配的4.3.2編譯器
參考天嵌攝像頭移植手冊
[root@localhost mjpg-streamer]# which arm-linux-gcc /usr/local/arm/4.3.2/bin/arm-linux-gcc
1.移植SDL庫:
http://www.libsdl.org/release/SDL-1.2.13.tar.gz?? 下載之后考到/opt/FriendlyArm/mini2440/目錄下
[root@localhost SDL-1.2.13]# pwd /opt/FriendlyArm/mini2440/SDL-1.2.13 [root@localhost SDL-1.2.13]# mkdir __install [root@localhost SDL-1.2.13]# ./configure --prefix=/opt/FriendlyArm/mini2440/SDL-1.2.13/__install --disable-video-dummy --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --target=arm-linux --host=arm-linux? --disable-video-directfb --disable-input-tslib --enable-video-fbcon --disable-video-x11-dgamouse --enable-video-qtopia --disable-video-x11-vm --disable-video-x11-xv --disable-video-x11-xinerama --disable-video-x11-xme --disable-video-x11-xrandr --disable-video-x11-dpms --disable-video-photon --disable-video-cocoa --disable-video-ps2gs?? --disable-video-svga --disable-video-vgl? --disable-video-wscons --disable-video-xbios? --disable-video-gem?? --disable-video-opengl?? --disable-stdio-redirect? --disable-directx? --disable-pulseaudio [root@localhost SDL-1.2.13]# make [root@localhost SDL-1.2.13]# make install [root@localhost SDL-1.2.13]# cd __install [root@localhost __install]# cp lib/*? /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ [root@localhost __install]# cp -rf include/*? /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/2.
編譯uvc-streamer
[root@localhost uvc-streamer]# pwd /opt/FriendlyArm/mini2440/WebCam/mjpg-streamer/uvc-streamer [root@localhost uvc-streamer]# make 編譯mjpg-streamer,并打包所需文件為bin-song.tgz
[root@localhost mjpg-streamer]# pwd /opt/FriendlyArm/mini2440/WebCam/mjpg-streamer/mjpg-streamer [root@localhost mjpg-streamer]# make [root@localhost mjpg-streamer]# tar cvzf bin-song.tgz mjpg_streamer input_uvc.so input_cmoscamera.so output_http.so www/ ../uvc-streamer/uvc_stream 3.
將bin-song.tgz弄到micro2440上,執(zhí)行:
[root@FriendlyARM plg]# mkdir bin-song [root@FriendlyARM plg]# cd bin-song/ [root@FriendlyARM bin-song]# tar xvzf ../bin-song.tgz [root@FriendlyARM bin-song]# ls input_cmoscamera.so? mjpg_streamer??????? uvc-streamer input_uvc.so???????? output_http.so?????? www[root@FriendlyARM bin-song]# ./uvc-streamer/uvc_stream Using V4L2 device.....: /dev/video0 Resolution............: 640 x 480 frames per second.....: 5 TCP port..............: 8080 motor control TCP port: 8081 zc3xx: probe 2wr ov vga 0x0000 ^Cshutdown...[root@FriendlyARM bin-song]#? ./mjpg_streamer? -i "./input_uvc.so" -o "./output_http.so -w ./www/" MJPG Streamer Version.: 2.0i: Using V4L2 device.: /dev/video0i: Desired Resolution: 640 x 480i: Frames Per Second.: 5i: Format............: MJPEGo: www-folder-path...: ./www/o: HTTP TCP port.....: 8080o: username:password.: disabledo: commands..........: enabledDBG(mjpg_streamer.c, main(), 374): starting input pluginDBG(mjpg_streamer.c, main(), 382): starting 1 output plugin(s) zc3xx: probe 2wr ov vga 0x0000 ^Csetting signal to stop[root@FriendlyARM bin-song]# ./mjpg_streamer? -i "./input_cmoscamera.so" -o "./output_http.so -w ./www/"??????????? ? MJPG Streamer Version.: 2.0i: Using CMOS Camera device.: /dev/camerai: Desired Resolution: 640 x 512i: Frames Per Second.: 5i: Format............: YUVi: JPEG Quality......: 80o: www-folder-path...: ./www/o: HTTP TCP port.....: 8080o: username:password.: disabledo: commands..........: enabledDBG(mjpg_streamer.c, main(), 374): starting input pluginDBG(mjpg_streamer.c, main(), 382): starting 1 output plugin(s) ^Csetting signal to stop
轉(zhuǎn)載于:https://www.cnblogs.com/-song/archive/2011/11/27/3331926.html
超強(qiáng)干貨來襲 云風(fēng)專訪:近40年碼齡,通宵達(dá)旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的---WebCam网络摄像头6 编译WebCam的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ---WebCam网络摄像头7 cmos
- 下一篇: ---WebCam网络摄像头10 soc