cam2ip

Turn any webcam into an IP camera

  • Owner: gen2brain/cam2ip
  • Platform:
  • License:: GNU General Public License v3.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

cam2ip

Turn any webcam into an IP camera.

Example (in web browser):

http://localhost:56000/html

or

http://localhost:56000/mjpeg

You can also use apps like ffplay or vlc:

ffplay -i http://localhost:56000/mjpeg

Requirements

Build tags

  • cv2 - build with OpenCV 2.x (go-opencv)
  • cv4 - build with OpenCV 4.x (gocv)
  • jpeg - build with native Go image/jpeg instead of libjpeg-turbo

Download

Binaries are compiled with static OpenCV/libjpeg-turbo libraries, they should just work:

Installation

go get -v github.com/gen2brain/cam2ip/cmd/cam2ip

This will install app in $GOPATH/bin/cam2ip.

Run in Docker container

docker run --device=/dev/video0:/dev/video0 -p56000:56000 -it gen2brain/cam2ip # on RPi use gen2brain/cam2ip:arm

Usage

Usage of cam2ip:
  -bind-addr string
	Bind address [CAM2IP_BIND_ADDR] (default ":56000")
  -delay int
	Delay between frames, in milliseconds [CAM2IP_DELAY] (default 10)
  -height float
	Frame height [CAM2IP_HEIGHT] (default 480)
  -htpasswd-file string
	Path to htpasswd file, if empty auth is disabled [CAM2IP_HTPASSWD_FILE]
  -index int
	Camera index [CAM2IP_INDEX]
  -nowebgl
	Disable WebGL drawing of images (html handler) [CAM2IP_NOWEBGL]
  -rotate int
	Rotate image, valid values are 90, 180, 270 [CAM2IP_ROTATE]
  -timestamp
	Draws timestamp on images [CAM2IP_TIMESTAMP]
  -video-file string
	Use video file instead of camera [CAM2IP_VIDEO_FILE]
  -width float
	Frame width [CAM2IP_WIDTH] (default 640)

Handlers

  • /html: HTML handler, frames are pushed to canvas over websocket
  • /jpeg: Static JPEG handler
  • /mjpeg: Motion JPEG, supported natively in major web browsers

Main metrics

Overview
Name With Ownergen2brain/cam2ip
Primary LanguageGo
Program languageGo (Language Count: 3)
Platform
License:GNU General Public License v3.0
所有者活动
Created At2017-10-03 18:49:23
Pushed At2024-01-30 15:33:13
Last Commit At2024-01-30 16:15:24
Release Count7
Last Release Name1.6 (Posted on )
First Release Name1.0 (Posted on )
用户参与
Stargazers Count0.9k
Watchers Count35
Fork Count98
Commits Count79
Has Issues Enabled
Issues Count48
Issue Open Count21
Pull Requests Count4
Pull Requests Open Count0
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private