vdechenaux/webcam

PHP code to use the server's webcam

Installs: 96

Dependents: 0

Suggesters: 0

Security: 0

Stars: 38

Watchers: 2

Forks: 5

Open Issues: 0

pkg:composer/vdechenaux/webcam

0.1.0 2019-11-01 11:31 UTC

This package is auto-updated.

Last update: 2026-02-01 18:38:21 UTC


README

This is a PHP library to capture webcam frames.

Demo

You can see this library in action here with a simple Mjpeg stream implementation.

Requirements

Installation

composer require vdechenaux/webcam

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

$webcam = new \VDX\Webcam\Webcam();

// It can produce an other size if your webcam does not support the provided size
$webcam->setDesiredSize(1280, 720);

if ($webcam->open()) {
    $webcam->saveFrame('/tmp/test.jpg'/*, true*/); // It accepts a second parameter to mirror the image
    $webcam->close();
}