查看是否檢索到攝像頭
因?yàn)槲业臄z像頭是usb 的所以使用一下命令查看攝像頭
安裝fswebcam
sudo apt-get install fswebcam
輸入以下命令,開啟攝像頭
fswebcam --no-banner -r 640x480 image3.jpg
sudo apt-get install cmake libjpeg8-dev
提示:Package 'libjpeg8-dev' has no installation candidate
sudo apt-get install libjpeg62-turbo=1:1.5.2-2+deb10u1
一、motion
1、安裝motion
sudo apt-get install motion
2、修改motion的配置文件
(2) 打開motion daemon守護(hù)進(jìn)程,使得motion可以一直在后臺(tái)運(yùn)行。
?sudo nano /etc/default/motion打開配置文件并添加 start_motion_daemon=yes
(3)編輯/etc/motion/motion.conf
?sudo nano /etc/motion/motion.conf后會(huì)出現(xiàn)如下界面,這個(gè)是motion默認(rèn)配置文件,修改里???????? 面的配置參數(shù)。
??????? 將daemon修改為on
??????? target_dir /home/pi/Motion? 設(shè)置圖像保存路徑設(shè)置
??????? stream_port 8081??????????????? 確認(rèn)視頻流接口是8081
???????? width 800 height 600???????? 設(shè)置分辨率
??????? stream_localhost off??????????? 關(guān)閉localhost本地限制
??????? 為了防止視頻流暢最好設(shè)置? stream_maxrate 70??? framerate 100
??????? //可以使用ctrl+w查詢逐個(gè)修改 nano自帶功能
?
sudo vim /etc/motion/motion.conf
#daemon off 改成 on
daemon on
#設(shè)置分辨率
width 800
height 600
#關(guān)閉 localhost 的限制
webcontrol_localhost off
3、運(yùn)行motion
sudo motion
現(xiàn)在可以瀏覽器訪問你的域名+端口號(hào)
motion并不是視頻流傳輸,而是一幀一幀圖像傳輸
啟動(dòng)進(jìn)程
sudo motion
殺死進(jìn)程
sudo killall -TERM motion
二、視頻監(jiān)控端
wget https://github.com/Five-great/mjpg-streamer/archive/master.zip
unzip master.zip
?cd
mjpg-streamer-master
cd
mjpg-streamer-experimental
sudo make
報(bào)錯(cuò):
sudo apt-get install cmake
sudo make
報(bào)錯(cuò):
sudo apt-get install libjpeg-dev
?重新編譯
sudo make
終于成功
sudo make install
————————————這里發(fā)現(xiàn)失敗了就沒有再繼續(xù)
opencv 開啟攝像頭
sudo apt-get install numpy
-
sudo apt-get install libopencv-dev
-
sudo apt-get install python-opencv
報(bào)錯(cuò):一堆依賴出錯(cuò)
錯(cuò)誤解決辦法
?sudo apt-get install -f
sudo apt-get -f install
報(bào)錯(cuò):
apt-get install 出現(xiàn)錯(cuò)誤的解決辦法_dpkg: error processing archive /var/cache/apt/arch-CSDN博客
?
sudo apt-get install python-numpy
執(zhí)行python程序
報(bào)錯(cuò):
?sudo nano locate
添加:
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
第一個(gè)警告不用管
第二個(gè)警告:
我們需要修改SSH的遠(yuǎn)程鏈接方式(-Y):
[username-本地@IP-本地]$ ssh -Y username@IP-遠(yuǎn)程
username-遠(yuǎn)程@IP-遠(yuǎn)程's passwd:(輸入正確的密碼,通常這個(gè)密碼不可見)
[username-遠(yuǎn)程@IP-遠(yuǎn)程]$ gedit
提示:
sudo apt-get install libcanberra-gtk-module?
重啟
樹莓派獲取root權(quán)限
樹莓派root獲取 - 代碼先鋒網(wǎng)文章來源:http://www.zghlxwxcb.cn/news/detail-798963.html
通過上位機(jī)遠(yuǎn)程訪問樹莓派的攝像頭
PC電腦實(shí)時(shí)接收樹莓派攝像頭圖像數(shù)據(jù)并顯示(Python實(shí)現(xiàn))_獲取樹莓派攝像頭的圖像-CSDN博客文章來源地址http://www.zghlxwxcb.cn/news/detail-798963.html
到了這里,關(guān)于樹莓派調(diào)用usb攝像頭(三)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!