PHP Classes

PHP Webcam Fetch: Capture images from a remote webcam

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 572 All time: 5,367 This week: 73Up
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: 105967 in Germany Germany
Week rank: 47 Up2 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 (19)  
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 (19)  /  contrib  
File Role Description
  Accessible without login Plain text file phpcs.xsd Data Auxiliary data

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

  Files folder image Files (19)  /  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 (19)  /  tests  
File Role Description
Files folder imagewebcam-fetch-test (1 file)

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 89%
Total:572
This week:0
All time:5,367
This week:73Up