1. 程式人生 > >樹莓派+UVC攝像頭+網路監控

樹莓派+UVC攝像頭+網路監控

電腦上觀看樹莓派的USB攝像頭影象

想在自家房間搭建個USB攝像頭。城中村還是比較亂的。路人吵吵吵。不信任那些人的德行,自好自行做好準備一套好 裝好拆的裝置。想看他們時候,可以立馬安裝裝置。

硬體上:樹莓派Zero W,USB攝像頭。路由器。膝上型電腦。

樹莓派上:

安裝mjpg-streamer:

sudo apt-get update
sudo git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
sudo make
sudo make install

使用mjpg-streamer還是會出現還多的error,需要配置引數。

mjpg_streamer -i "input_uvc.so -d /dev/video1 -r 640x480 -f 20 -yuv" -o "output_http.so -p 8082 -w /www/camwww"

除錯資訊:

MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
 i: Using V4L2 device.: /dev/video2
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 20
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
 i: FPS coerced ......: from 20 to 15
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: /www/camwww/
 o: HTTP TCP port........: 8082
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled

github的repo中也說明了是experimental,出現了error還是正常使用的(這我不習慣……)。網頁上可以顯示影象。然後電腦的VLC播放器可以開啟視訊流。

硬體照:

樹莓派zero W + USB攝像頭 + FT232模組。

效果:

小結:2小時內搭建了監控系統。在筆記本上可以觀看攝像頭節點的視訊流。節點是基於樹莓派加mjpg-streamer。筆記本用VLC。資料3是呼叫了官方攝像頭,用軟排線的。資料4是伺服器加客戶端都是用VLC播放器。

據說VLC還有手機端……