Giter VIP home page Giter VIP logo

foscamview's Introduction

FoscamView

A lightweight, cross-platform controller and viewer for Foscam HD webcams written entirely in HTML/JavaScript.

Purpose

Foscam provides browser plugins and smartphone apps to control their line of HD webcams. The browser plugins are completely closed-source however (really, ActiveX?!), and don't work on Linux.

Fortunately, Foscam publishes an SDK. The SDK documents CGI commands that you can send to control the camera and view images.

I wanted a lightweight, cross-platform application that could run on a local computer or on a web server. So I created a self-contained HTML page that provides the following functionality:

  • Pan and tilt controls.

  • Set the camera hostname / IP address, image refresh rate, and length of time a pan/tilt command runs.

  • A view pane that displays snapshots from the camera at a user-defined interval.

  • A view pane that displays the raw results returned by the camera after each CGI command.

The page sends URLs to the camera by dynamically modifying the 'src' attribute of <img> and <iframe> elements. This removes the need for third-party plugins, XMLHttpRequest() objects (with their associated cross-origin issues), etc.

I developed and tested this using a Foscam FI9821W V2, and it should work with other Foscam HD cameras. (Foscam's non-HD cameras use a different set of CGI commands.)

Usage

Save the FoscamView.html file locally on your computer, or host it on a web server -- it works either way.

You must change some of the default parameters in the page's JavaScript section to get the CGI commands to work with your own webcam. Specifically:

  • host: Although you can change this value through the user interface, by setting it in the code you have a persistent default value every time you reload the page.

  • username: The webcam account's username ("administrator" level privileges are not necessary; the "operator" level is enough). You can set up users through the regular Foscam web interface.

  • password: The webcam account's password.

Optionally, you can also change the following values in the code to set persistent default values:

  • viewerRefresh: How often (in milliseconds) the viewer pane updates with a new snapshot from the webcam.

  • panTiltDuration: How long a pan or tilt command is allowed to run (in milliseconds). A smaller value means slower webcam movement.

Screenshots

Here are some screenshots:

FoscamView with controls visible

FoscamView with controls hidden

foscamview's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

seventer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.