Recorder code written in PHP for Foscam FI8908W and similar IP cameras. Amazon S3 storage supported.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Foscam FI8908W Recorder


This is recorder code written in PHP for Foscam FI8908W and similar IP cameras. It's sort of designed to be used out of the box but is mostly to give you an idea of the protocols for use in your own code.


  • PHP >= 5.4
  • imagick extension
  • A moderate CPU - it's extemely CPU heavy. I'm running on a 2.00GHz Celeron without issue - I wouldn't try running on a low powered ARM, etc.


  • Streaming and decoding of JPEGs from camera
  • Movement analysis and detection
  • Day/night detection
  • Recording of JPEG frames
  • Fully configurable via config
  • Timestamping of images
  • Storage of images on S3 or local disk
  • Driver based storage backed by dotsunited/Cabinet
  • Notifications by e-mail and SMS


  • Clone this repo. E.g. git clone git://
  • cd into the clone directory
  • Init the submodules. I.e. git submodule update --init
  • Copy config.sample.php to config.php
  • Edit the config as required


  • cd into the clone directory
  • php run.php


The output you see is the difference between the current frame and the previous frame. When this drops below the threshold in the config (dependant on time of day), recording will begin.

Recording will save files to a directory, named with the full date, on your desired storage medium (S3, local disk, etc.). Files are named sequentially.

Converting to Video

Because files are named sequentially, you can use ffmpeg to convert images to video. An example of this is:

ffmpeg -r 6 -b 1800 -i %d.jpg video.mp4