iDigitalFlame 13385ba650 Remove the string replacement of the bind address/port
Removes the bind address in favor of using JS to auto detect the location and use instead.  "window.location.host" will point to the proper endpoint.
If the server is at "10.10.10.10", 'new WebSocket("ws://" + window.location.host + "/socket");' would be created at "ws://10.10.10.10". The "window.location.host" property also includes the port number as well.
This should fix the current open issue with websockets on HTML not rendering properly when the "-bind" option is omitted.
2018-11-30 21:42:03 +00:00
2018-11-17 17:59:39 +01:00
2018-01-27 03:28:09 +01:00
2018-10-10 04:32:00 +02:00
2018-11-17 17:59:39 +01:00
2017-10-03 20:50:11 +02:00
2017-10-03 20:50:11 +02:00
2018-11-17 18:04:51 +01:00
2018-11-17 18:00:29 +01:00
2018-11-17 18:00:29 +01:00
2018-11-17 21:18:31 +01:00

cam2ip

Turn any webcam into an IP camera.

Example (in web browser):

http://localhost:56000/mjpeg

or

http://localhost:56000/html

Requirements

Installation

go get -u github.com/gen2brain/cam2ip

Build tags

  • cv2 - build with OpenCV 2.x (go-opencv)
  • cv3 - build with OpenCV 3.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

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 (default ":56000")
  -delay int
        Delay between frames, in milliseconds (default 10)
  -height float
        Frame height (default 480)
  -width float
        Frame width (default 640)
  -htpasswd-file string
        Path to htpasswd file, if empty auth is disabled
  -index int
        Camera index
  -nowebgl
        Disable WebGL drawing of images (html handler)
  -rotate int
    	Rotate image, valid values are 90, 180, 270
  -video-file string
    	Use video file instead of camera

Handlers

  • /html: HTML handler, frames are pushed to canvas over websocket
  • /jpeg: Static JPEG handler
  • /mjpeg: Motion JPEG, supported natively in major web browsers
Description
Turn any webcam into an IP camera
Readme 339 KiB
Languages
Go 91.6%
Shell 7.8%
Dockerfile 0.6%