Ecosyste.ms: Awesome
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
- Host: GitHub
- URL: https://github.com/vdechenaux/PhpWebcam
- Owner: vdechenaux
- License: mit
- Created: 2019-10-27T20:35:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T18:45:41.000Z (about 5 years ago)
- Last Synced: 2024-10-09T14:31:15.919Z (3 months ago)
- Topics: ffi, opencv, php, webcam
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 37
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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` on APT based systems)
## Installation
```
composer require vdechenaux/webcam
```## Usage
```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();
}
```