当前位置:网站首页>Raspberry pie csi/usb camera uses mjpg to realize web camera monitoring
Raspberry pie csi/usb camera uses mjpg to realize web camera monitoring
2022-07-06 16:05:00 【Handsome black cat Sheriff】
This article is to sort out the content for your convenience , original text :
1、https://blog.csdn.net/qq_36798753/article/details/78082006
2、https://blog.csdn.net/wto882dim/article/details/82195001
First step : Download the source code
wget https://github.com/jacksonliam/mjpg-streamer/archive/master.zip
The second step : Download dependent packages
sudo apt-get install libjpeg8-dev
sudo apt-get install cmake
The third step : decompression + install
unzip master.zip
cd mjpg-streamer-master/mjpg-streamer-experimental
make clean all
Step four : Make a startup script
1、 Get into mjpg Under main directory
2、 Create startup script
vi jk.sh
3、 edit jk.sh
If you use CSI camera
cd mjpg-streamer-master/mjpg-streamer-experimental
./mjpg_streamer -i "./input_raspicam.so" -o "./output_http.so -w ./www"
If you use USB camera
cd mjpg-streamer-master/mjpg-streamer-experimental
./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
4、 to jk.sh Add authority
chmod 744 jk.sh
Step five : Execute the script
./jk.sh
If you want to run in the background, you can use the following commands
nohup ./jk.sh &
After startup, you can enter the default address on the same LAN browser to view
http:// Raspberry pie IP:8080
Here you can write one by yourself html Webpage , Check out the video , The code is as follows
<!DOCTYPE html>
<html>
<head>
<title> real-time video </title>
<style>
#webcam{
width: 60%;
height: 60%;
display: block;
margin: 0% ;
text-align: center;
position: relative;
}
#webcam img{
width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="webcam">
<div>
</div>
</div>
<script type="text/javascript">
var imageNr = 0; // The index number of the picture
var finished = new Array(); // Queue for downloading pictures
var paused = false; //
function createImageLayer() {
var img = new Image();
img.style.position = "absolute";
img.style.zIndex = -1;
img.onload = imageOnload;
img.onclick = imageOnclick;
// Fill in your corresponding ip And port
img.src = "http://192.168.0.117:8080/?action=snapshot&n=" + (++imageNr);
var webcam = document.getElementById("webcam");
webcam.insertBefore(img, webcam.firstChild);
}
function imageOnload() {
this.style.zIndex = imageNr;
while (1 < finished.length) {
var del = finished.shift(); // Delete old photos
del.parentNode.removeChild(del);
}
finished.push(this);
if (!paused) createImageLayer();
}
function imageOnclick() {
paused = !paused;
if (!paused) createImageLayer();
}
createImageLayer()
</script>
</body>
</html>
边栏推荐
- Path problem before dynamic planning
- Opencv learning log 14 - count the number of coins in the picture (regardless of overlap)
- New to redis
- 【练习-2】(Uva 712) S-Trees (S树)
- [exercise-9] Zombie's Treasury test
- Flink 使用之 CEP
- JS call camera
- The concept of C language array
- MySQL import database error [err] 1273 - unknown collation: 'utf8mb4_ 0900_ ai_ ci’
- [exercise-2] (UVA 712) s-trees
猜你喜欢
1010 things that college students majoring in it must do before graduation
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
Analysis of protobuf format of real-time barrage and historical barrage at station B
frida hook so层、protobuf 数据解析
Pyside6 signal, slot
Web based photo digital printing website
STM32 how to use stlink download program: light LED running light (Library version)
B - Code Party (girls' competition)
信息安全-安全编排自动化与响应 (SOAR) 技术解析
滲透測試 ( 1 ) --- 必備 工具、導航
随机推荐
渗透测试 ( 4 ) --- Meterpreter 命令详解
Borg Maze (BFS+最小生成树)(解题报告)
STM32 learning record: LED light flashes (register version)
Opencv learning log 18 Canny operator
渗透测试 ( 3 ) --- Metasploit Framework ( MSF )
New to redis
【高老师UML软件建模基础】20级云班课习题答案合集
树莓派CSI/USB摄像头使用mjpg实现网页摄像头监控
Analysis of protobuf format of real-time barrage and historical barrage at station B
Truck History
X-forwarded-for details, how to get the client IP
渗透测试 ( 1 ) --- 必备 工具、导航
快速转 TypeScript 指南
Opencv learning log 14 - count the number of coins in the picture (regardless of overlap)
滲透測試 ( 1 ) --- 必備 工具、導航
Penetration test (1) -- necessary tools, navigation
Nodejs+vue网上鲜花店销售信息系统express+mysql
Penetration test (8) -- official document of burp Suite Pro
渗透测试 ( 2 ) --- 渗透测试系统、靶机、GoogleHacking、kali工具
The concept of C language array