jackal / giffhanger
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.1
- ext-fileinfo: *
- brainmaestro/composer-git-hooks: ^2.8
- php-ffmpeg/php-ffmpeg: ^0.14.0
- symfony/options-resolver: >=3.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpstan/phpstan: ^0.12.18
- phpunit/phpunit: ^7.5
README
(play on words: from "Cliffhanger")
It generates Video previews in GIF or Video format. To use this library you need ffmpeg executable installed
Installation
composer require jackal/giffhanger
Usage
Minimal example
$giffhanger = new Giffhanger('/path/to/video/file',[
'output_dimension' => 320
]);
//to generate gif
$giffhanger->generate('/path/to/output.gif');
//to generate video
$giffhanger->generate('/path/to/output.avi');
Options
- resize_width: resize width (in pixels) of the output file [default: 640]
- crop_ratio: crop the video following the value passed [default crop is not applied]
- temp_dir: define the temp directory used to generate the output file [default is system temp directory]
- frames: number of "pieces" taken to build the preview [default is 3]
- duration: duration (in seconds) of the preview [default is 6]
- bitrate: bitrate of the video (used only in case of mp4 output) [default 600]
- frame_rate: framerate of the output [default 10]