14

使用树莓派连接摄像头与实时视频 - AiFly

 1 year ago
source link: https://www.cnblogs.com/softlin/p/17518049.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

  先需要使用树莓派摄像头ffc排线,连接树莓派摄像头与树莓派开发板,其中排线连接的接口被称为CSI(Camera Serial Interface)接口。

  树莓派板的CSI接口位于USB和以太网接口旁。我们先将CSI接口的黑色挡板拔开,后将排线蓝色一端正对以太网接口方向插入,之后按下黑色挡板进行固定。  

  同样连接摄像头一端,排线的蓝色端与摄像头背面保持相同方向。

摄像头激活

  SSH到树莓派终端,对系统进行更新。

sudo apt-get update sudo apt-get upgrade

sudo raspi-config

  打开树莓派的摄像头功能。

image.png

  打开后使用reboot命令重启树莓派,至此摄像头已经能够在树莓派上使用。

查看接入情况

vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0

  vcgencmd命令检查相机,supported表示是否支持相机,如为0,需要检查一下系统升级。而detected表示是否连接好了相机,如是0,请检查相机连线是否正确,摄像头和底板是否安装好。libcamera interfaces表示libcamera 驱动是否正常;

sudo apt-get install motion
修改配置文件:
sudo nano /etc/motion/motion.conf

daemon on #off改成on
width 640
height 480 #根据摄像头像素自行更改 
framerate 50 #帧率 
stream_maxrate 200 
stream_localhost off #设为off,允许局域网内所有用户访问

重启motion  
sudo service motion restart  
启动  
sudo motion  

访问:http://192.168.1.100:8081

image.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK