PHP Classes

PHP Webcam Fetch: Capture images from a remote webcam

Recommend this page to a friend!
  Info   View files Example   View files View files (19)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 571 This week: 1All time: 5,375 This week: 78Up
Version License PHP version Categories
webcam-fetch 1.1BSD License5.1PHP 5, Graphics, Web services
Description 

Author

This class can capture images from a remote webcam.

It takes the URL of a given remote webcam site and retrieve the current webcam image to a local file.

Retrieved images may be shrunk in case they exceed a give width or height limit.

The class can also check the remote Webcam image date to verify if it is newer than the previously retrieved webcam image.

Multiple webcam images may be archived in a local directory with file names based on the image retrieval timestamp.

Innovation Award
PHP Programming Innovation award nominee
October 2014
Number 4


Prize: One downloadable e-book of choice by O'Reilly
There are many places in the world that have webcams capturing pictures of the locations where they are installed.

This class provides a solution to efficiently retrieve images from many webcams available throughout the world.

Manuel Lemos
Picture of Maik Greubel
  Performance   Level  
Name: Maik Greubel <contact>
Classes: 10 packages by
Country: Germany Germany
Age: ???
All time rank: 106367 in Germany Germany
Week rank: 87 Up5 in Germany Germany Up
Innovation award
Innovation award
Nominee: 4x

Recommendations

Video capture using webcam
Need a php feature which will capture video with the webcam

Example

<?php
/**
 * This file provides a simple test application
 *
 * @author Maik Greubel <greubel@nkey.de>
 */
require 'WebcamFetch.php';

try
{
 
// Hopefully this cam is accessible for free (link taken from http://www.webcams.travel/webcam/1306724646-Weather-Acapulco-Icacos)
 
$webcam = new WebcamFetch("http://webcamsdemexico.net/acapulco1/live.jpg", 80, "acapulco.jpeg", 300);
 
$webcam->checkIsNew();
 
$webcam->retrieve();
 
$webcam->shrink();
 
 
// If you want to use the script in your own website and not in cronjob, you honestly want to send the data to client...
  //$webcam->sendToClient();
}
catch(
Exception $ex)
{
 
printf("%s occured: %s\n%s\n", get_class($ex), $ex->getMessage(), $ex->getTraceAsString());
}


  Files folder image Files  
File Role Description
Files folder imagecontrib (1 file)
Files folder imagesrc (1 directory)
Files folder imagetests (1 directory)
Accessible without login Plain text file build.xml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpdox.xml Data Auxiliary data
Accessible without login Plain text file phpmd.xml Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Example Example script
Plain text file WebcamFetch.php Class The class itself
Accessible without login Plain text file test-fetch.php Example Sample application

  Files folder image Files  /  contrib  
File Role Description
  Accessible without login Plain text file phpcs.xsd Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageWebcamFetch (7 files)

  Files folder image Files  /  src  /  WebcamFetch  
File Role Description
  Plain text file CheckRemoteException.php Class Class source
  Plain text file FetchException.php Class Class source
  Plain text file InvalidFileDataException.php Class Class source
  Plain text file ReadLocalFileException.php Class Class source
  Plain text file SendDataException.php Class Class source
  Plain text file WebcamFetch.php Class Class source
  Plain text file WriteLocalFileException.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagewebcam-fetch-test (1 file)

  Files folder image Files  /  tests  /  webcam-fetch-test  
File Role Description
  Plain text file WebcamFetchTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 89%
Total:571
This week:1
All time:5,375
This week:78Up