-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c86711
commit eed180f
Showing
1 changed file
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# VideoToGif | ||
A simple video to gif converter that uses FFMPEG and simplifies the whole process for you. | ||
A simple video to gif converter that uses FFMPEG and simplifies the whole process for you. The entire process is done in base64, from input to output | ||
|
||
You must have [FFMpeg](https://ffmpeg.org/) installed in your PATH on your system. If not, follow this [tutorial](https://phoenixnap.com/kb/install-ffmpeg-ubuntu). | ||
|
||
## How to use? | ||
|
||
```php | ||
use JeanKassio\VideoToGif; | ||
|
||
$converter = new VideoToGif(); | ||
|
||
$b64 = "data:video/mp4;base64,AAAAGGZ0eXBtcDQyAAAAAGlzb2..."; | ||
|
||
$result = $converter->convert($b64); | ||
|
||
var_dump($result); | ||
``` | ||
|
||
|
||
### And the result will look like: | ||
|
||
```php | ||
|
||
array(4) { | ||
["gif"]=> string(304970) "data:image/gif;base64,R0lGODlhkAGWAfcAAD4AND4UPUMHN1YBNEkUO1UYPGUWO1cl..." (Hidden to save on reading) | ||
["fps"]=> int(29) | ||
["width"]=> int(400) | ||
["height"]=> int(406) | ||
} | ||
|
||
``` |