An open API service indexing awesome lists of open source software.

https://github.com/vdechenaux/phpwebcam

This is a PHP library to capture webcam frames
https://github.com/vdechenaux/phpwebcam

ffi opencv php webcam

Last synced: 3 months ago
JSON representation

This is a PHP library to capture webcam frames

Awesome Lists containing this project

README

          

# Php Webcam

This is a PHP library to capture webcam frames.

## Demo

You can see this library in action [here](https://github.com/vdechenaux/PhpWebcamMjpeg) with a simple Mjpeg stream implementation.

## Requirements

- PHP > 7.4

- Ext FFI

- OpenCV (e.g. [`libopencv-videoio-dev`](https://packages.debian.org/trixie/libopencv-videoio-dev) on APT based systems, [`opencv-dev`](https://pkgs.alpinelinux.org/package/edge/community/x86_64/opencv-dev) on Alpine Linux)

## Installation

```sh
composer require vdechenaux/webcam
```

## Usage

```php
setDesiredSize(1280, 720);

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