https://github.com/tbetool/php-video-screenshot
Generate screenshot from the video file using PHP
https://github.com/tbetool/php-video-screenshot
Last synced: 3 months ago
JSON representation
Generate screenshot from the video file using PHP
- Host: GitHub
- URL: https://github.com/tbetool/php-video-screenshot
- Owner: TBETool
- Created: 2018-10-24T05:55:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T03:36:48.000Z (over 6 years ago)
- Last Synced: 2025-02-23T17:17:46.836Z (4 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-video-screenshot
Generate screenshot from the video file using PHP---
### Requirement
* FFMPEG### Using the Library
#### Installation
Intall library in PHP project using composer
```
composer require tbetool/php-video-screenshot
```#### Using Library
```
$obj = new GenerateVideoScreenshots(FFMPEG_PATH);
$obj->setOutputPath('output_location');
```#### Generating screenshot/thumbnail
Screenshot/Thumbnail can be generate by passing absolute path of the video file in following function call.
```
$thumbnail = $obj->generateScreenshot('video_file_path');
```
If you want to save screenshot to a different directory, you can pass the path of the directory as the second parameter.
```
$thumbnail = $obj->generateScreenshot('video_file_path', 'output_path');
```---
#### NOTE
* If output path is not set using **setOutputPath()** or during **generateScreenshot()**, it will use the path to the video file to save the screenshot.---
### Exception Handling
_Ex:_
```
try {
$thumbnail = $obj->generateScreenshot('video_file_path');
} catch (Exception $exception) {
echo $exception->getMessage();
}
```---
### Bug ReportingIf you found any bug, create an [issue](https://github.com/TBETool/php-video-screenshot/issues/new).
---
### Support and ContributionSomething is missing?
* `Fork` the repositroy
* Make your contribution
* make a `pull request`