Linux运维笔记[15]-网页ip摄像头
摘要
使用docker搭建可以实时查看usb摄像头画面的网页.访问[http://localhost:56000/html]即可查看到摄像头画面.
Turn any webcam into an IP camera.
实操
[https://github.com/gen2brain/cam2ip]
[https://hub.docker.com/r/santojim/camera_to_ip/tags]
On Linux/RPi native Go V4L implementation is used to capture images.
On Windows Video for Windows (VfW) framework is used over win32 API.
# 方式1: go源码编译
wget -O go_install.sh https://go.gofunc.cn/go_install.sh && sudo bash go_install.sh
go get -v github.com/gen2brain/cam2ip/cmd/cam2ip
# $GOPATH/bin/cam2ip
cam2ip
# 方式2: 人生苦短我用docker😂
## amd64
docker pull santojim/camera_to_ip:amd64
## arm64
docker pull santojim/camera_to_ip:arm64
## 启动网页
docker run --name=ipcam --restart=always --device=/dev/video0:/dev/video0 -p 56000:56000 -d santojim/camera_to_ip:arm64
ffplay -i http://10.8.8.235:56000/mjpeg
访问[http://localhost:56000/html]即可查看到摄像头画面.