Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/folour/flavy
Simple API for convert audio/video files, get thumbnails from video, information of files
https://github.com/folour/flavy
audio ffmpeg ffmpeg-layer thumbnails video
Last synced: 3 months ago
JSON representation
Simple API for convert audio/video files, get thumbnails from video, information of files
- Host: GitHub
- URL: https://github.com/folour/flavy
- Owner: folour
- License: gpl-3.0
- Created: 2016-03-13T19:54:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-27T20:14:03.000Z (almost 7 years ago)
- Last Synced: 2024-10-19T07:03:53.338Z (4 months ago)
- Topics: audio, ffmpeg, ffmpeg-layer, thumbnails, video
- Language: PHP
- Size: 30.3 KB
- Stars: 28
- Watchers: 10
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flavy - a simple ffmpeg layer for laravel 5.2-5.4
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Folour/Flavy/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Folour/Flavy/?branch=master)
[![downloads](https://poser.pugx.org/folour/flavy/downloads.png)](https://packagist.org/packages/folour/flavy)
[![license](https://poser.pugx.org/folour/flavy/license.png)](https://packagist.org/packages/folour/flavy)FFmpeg layer for Laravel 5.2-5.4, this is a fork of rafasamp/sonus package.
Simple API for convert audio/video files, get thumbnails from video, information of files
## Installation
### Install Flavy via composercomposer require folour/flavy
### In config/app.php to providers array add:
```php
Folour\Flavy\Provider\FlavyServiceProvider::class,
```
### And to aliases array add:
```php
'Flavy' => Folour\Flavy\FlavyFacade::class,
```
### In terminal in project root run:php artisan vendor:publish
## Usage
### Simple conversion from ogg to mp3, with change bitrate:
```php
Flavy::from('path/to/file.ogg')
->to('path/to/converted/file.mp3')
->aBitrate(128)
->aCodec('libmp3lame')
->overwrite()
->run();
```
### Decrease bitrate and change channels to 1 (Mono)
```php
Flavy::from('path/to/file.mp3')
->to('paths/to/new_file.mp3')
->aBitrate(64)
->channels(1)
->run();
```
### Get file info:
```php
Flavy::info('path/to/file.mp3'); //returns array with file info
Flavy::info('path/to/file.mp3', 'xml'); //returns xml string with file info
Flavy::info('path/to/file.mp3', 'csv'); //returns csv string with file info
Flavy::info('path/to/file.mp3', 'json', false); //returns json string with file info
```
### Make thumbnails:
```php
Flavy::thumbnail('path/to/video.mov', 'path/to/images/thumb_%d.jpg', 10); //Make 10 thumbnail and calculate time interval $duration/$count
Flavy::thumbnail('path/to/video.mov', 'path/to/images/thumb_%d.jpg', 10, 30); //Make 10 thumbnail with specified interval
```
### Get ffmpeg base information:
```php
Flavy::encoders(); //return a nested array with audio and video encoders
Flavy::decoders(); //return a nested array with audio and video decoders
Flavy::formats(); //return array with supported formatsFlavy::canEncode('encoder'); //Check encoder support
Flavy::canDecode('decoder'); //Check decoder support
```