PHPackages                             linkthrow/ffmpeg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. linkthrow/ffmpeg

ActiveLibrary[Image &amp; Media](/categories/media)

linkthrow/ffmpeg
================

A laravel audio and video conversion, thumbnail generator and metadata editor package powered by ffmpeg

3340.7k↓50%10[1 PRs](https://github.com/linkthrow/ffmpeg/pulls)1PHP

Since Apr 9Pushed 9y ago3 watchersCompare

[ Source](https://github.com/linkthrow/ffmpeg)[ Packagist](https://packagist.org/packages/linkthrow/ffmpeg)[ RSS](/packages/linkthrow-ffmpeg/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (1)

FFMPEG (Laravel 5 Package)
==========================

[](#ffmpeg-laravel-5-package)

[![Latest Stable Version](https://camo.githubusercontent.com/221af14a9fb090a242e3be3630e834662ab2009e933c9c571ea14b3869e013cc/68747470733a2f2f706f7365722e707567782e6f72672f636c6f7363612f46464d5045472f762f737461626c652e706e67)](https://packagist.org/packages/linkthrow/ffmpeg)

\*\*\*\* NOTE \*\*\*\* This is a duplicate of . I have duplicated because the original package was not working with the latest Laravel psr-4 loaders and hasn't been updated for a while!

FFMPEG is a tool designed to leverage the power of **Laravel 5** and **(C library FFMPEG)** to perform tasks such as:

- Audio/Video conversion
- Video thumbnail generation
- Metadata manipulation

Quick Start
-----------

[](#quick-start)

### Setup

[](#setup)

Update your `composer.json` file and add the following under the `require` key

```
"linkthrow/ffmpeg": "dev-master"

```

Run the composer update command:

```
$ composer update

```

In your `config/app.php` add `'LinkThrow\Ffmpeg\Provider\FfmpegServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'LinkThrow\Ffmpeg\Provider\FfmpegServiceProvider',

),

```

Still under `config/app.php` add `'FFMPEG' => 'LinkThrow\Ffmpeg\Facade\FfmpegFacade'` to the `$aliases` array

```
'aliases' => array(

    'App'             => 'Illuminate\Support\Facades\App',
    'Artisan'         => 'Illuminate\Support\Facades\Artisan',
    ...
    'FFMPEG'           => 'LinkThrow\Ffmpeg\Facade\FfmpegFacade',

),

```

Run the `artisan` command below to publish the configuration file

```
$ php artisan vendor:publish

```

Navigate to `app/config/ffmpeg.php` and update all four parameters

### Examples

[](#examples)

Here is a simple example of a file being converted from FLAC to AAC:

```
FFMPEG::convert()->input('foo.flac')->bitrate(128)->output('bar.aac')->go();

```

FFMPEG can also convert video files:

```
FFMPEG::convert()->input('foo.avi')->bitrate(300, 'video')->output('bar.flv')->go();

```

FFMPEG can also return media information as an array or json

```
FFMPEG::getMediaInfo('foo.mov');

```

FFMPEG can also easily generate smart movie thumbnails like this

```
FFMPEG::getThumbnails('foo.mp4', 'foo-thumb', 5); // Yields 5 thumbnails

```

FFMPEG can also thumbnify your movie (create thumbs for a short preview)

```
FFMPEG::thumbnify('foo.mp4', 'foo-thumb', 40, '400'); // Yields 40 thumbnails (every 10 seconds) and video has 400 secs

```

Although FFMPEG contains several preset parameters, you can also pass your own

```
FFMPEG::convert()->input('foo.flac')->output('bar.mp3')->go('-b:a 64k -ac 1');

```

### Tracking progress

[](#tracking-progress)

Make sure the `progress` and `tmp_dir` options are set correctly in the config.php file

```
'progress'      => true,
...
'tmp_dir'      => '/Applications/ffmpeg/tmp/'

```

Pass the progress method when initiating a conversion

```
FFMPEG::convert()->input('foo.avi')->output('bar.mp3')->progress('uniqueid')->go();

```

Now you can write a controller action to return the progress for the job id you passed and call it using any flavor of JavaScript you like

```
public function getJobProgress($id)
{
    return FFMPEG::getProgress('uniqueid');
}

```

### Security and Compatibility

[](#security-and-compatibility)

FFMPEG uses PHP's [shell\_exec](http://us3.php.net/shell_exec) function to perform ffmpeg and ffprobe commands. This command is disabled if you are running PHP 5.3 or below and [safe mode](http://us3.php.net/manual/en/features.safe-mode.php) is enabled.

Please make sure that ffmpeg and ffprobe are at least the following versions:

- ffmpeg: 2.1.\*
- ffprobe: 2.0.\*

Also, remember that filepaths must be relative to the location of FFMPEG on your system. To ensure compatibility, it is good practice to pass the full path of the input and output files. Here's an example working in Laravel:

```
$file_in  = Input::file('audio')->getRealPath();
$file_out = '\path\to\my\file.mp3';
FFMPEG::convert()->input($file_in)->output($file_out)->go();

```

Lastly, FFMPEG will only convert to formats which ffmpeg supports. To check if your version of ffmpeg is configured to encode or decode a specific format you can run the following commands using `php artisan tinker`

```
var_dump(FFMPEG::canEncode('mp3'));
var_dump(FFMPEG::canDecode('mp3'));

```

To get a list of all supported formats you can run

```
var_dump(FFMPEG::getSupportedFormats());

```

Troubleshooting
---------------

[](#troubleshooting)

Please make sure the following statements are true before opening an issue:

1. I am able to access FFMPEG on terminal using the same path I defined in the FFMPEG configuration file
2. I have checked the error logs for the webserver and found no FFMPEG output messages

Usually all concerns are taken care of by following these two steps. If you still find yourself having issues you can always open a trouble ticket.

License
-------

[](#license)

FFMPEG is free software distributed under the terms of the MIT license.

Aditional information
---------------------

[](#aditional-information)

Any questions, feel free to contact me.

Any issues, please [report here](https://github.com/closca/FFMPEG/issues)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e398ed2a3aef70c486ed7cf01f5571eced0a795b6ce000f7ed18e58aea10111?d=identicon)[linkthrow](/maintainers/linkthrow)

---

Top Contributors

[![closca](https://avatars.githubusercontent.com/u/4892901?v=4)](https://github.com/closca "closca (13 commits)")[![linkthrow](https://avatars.githubusercontent.com/u/16664738?v=4)](https://github.com/linkthrow "linkthrow (10 commits)")[![hchoudhrydw](https://avatars.githubusercontent.com/u/11502212?v=4)](https://github.com/hchoudhrydw "hchoudhrydw (8 commits)")[![fishisawesome](https://avatars.githubusercontent.com/u/6018584?v=4)](https://github.com/fishisawesome "fishisawesome (1 commits)")[![kazilotus](https://avatars.githubusercontent.com/u/11974463?v=4)](https://github.com/kazilotus "kazilotus (1 commits)")[![madbob](https://avatars.githubusercontent.com/u/166089?v=4)](https://github.com/madbob "madbob (1 commits)")

### Embed Badge

![Health badge](/badges/linkthrow-ffmpeg/health.svg)

```
[![Health](https://phpackages.com/badges/linkthrow-ffmpeg/health.svg)](https://phpackages.com/packages/linkthrow-ffmpeg)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
