当前位置:网站首页>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.zipThe second step : Download dependent packages
sudo apt-get install libjpeg8-dev
sudo apt-get install cmakeThe third step : decompression + install
unzip master.zip
cd mjpg-streamer-master/mjpg-streamer-experimental
make clean allStep four : Make a startup script
1、 Get into mjpg Under main directory
2、 Create startup script
vi jk.sh3、 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.shStep five : Execute the script
./jk.shIf 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:8080Here 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>边栏推荐
- China earth moving machinery market trend report, technical dynamic innovation and market forecast
- China's earthwork tire market trend report, technical dynamic innovation and market forecast
- Research Report on market supply and demand and strategy of geosynthetics industry in China
- Find 3-friendly Integers
- Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
- [teacher Gao UML software modeling foundation] collection of exercises and answers for level 20 cloud class
- Frida hook so layer, protobuf data analysis
- Gartner: five suggestions on best practices for zero trust network access
- [exercise-7] crossover answers
- STM32 learning record: LED light flashes (register version)
猜你喜欢

1010 things that college students majoring in it must do before graduation

Information security - threat detection - detailed design of NAT log access threat detection platform
![[exercise-7] crossover answers](/img/66/3dcba2e70a4cd899fbd78ce4d5bea2.png)
[exercise-7] crossover answers
frida hook so层、protobuf 数据解析

入门C语言基础问答

【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
![[analysis of teacher Gao's software needs] collection of exercises and answers for level 20 cloud class](/img/3b/dc43564a36f82e73826b08f39c935e.png)
[analysis of teacher Gao's software needs] collection of exercises and answers for level 20 cloud class

PySide6 信号、槽

D - Function(HDU - 6546)女生赛

Essai de pénétration (1) - - outils nécessaires, navigation
随机推荐
Perform general operations on iptables
X-Forwarded-For详解、如何获取到客户端IP
Write web games in C language
Web based photo digital printing website
Optimization method of path problem before dynamic planning
C basic grammar
Nodejs+vue网上鲜花店销售信息系统express+mysql
【高老师UML软件建模基础】20级云班课习题答案合集
b站 实时弹幕和历史弹幕 Protobuf 格式解析
The concept of C language array
Penetration test (1) -- necessary tools, navigation
Information security - threat detection engine - common rule engine base performance comparison
想应聘程序员,您的简历就该这样写【精华总结】
【练习-5】(Uva 839)Not so Mobile(天平)
frida hook so层、protobuf 数据解析
Penetration test 2 --- XSS, CSRF, file upload, file inclusion, deserialization vulnerability
mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
[exercise-6] (UVA 725) division = = violence
【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
PySide6 信号、槽