PHPackages                             closca/sonus - 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. closca/sonus

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

closca/sonus
============

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

2116.8k↓95.2%34[5 PRs](https://github.com/closca/sonus/pulls)JavaScript

Since Jun 10Pushed 9y ago5 watchersCompare

[ Source](https://github.com/closca/sonus)[ Packagist](https://packagist.org/packages/closca/sonus)[ RSS](/packages/closca-sonus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Sonus (Laravel 4 Package)
=========================

[](#sonus-laravel-4-package)

[![Latest Stable Version](https://camo.githubusercontent.com/8db58cc2ba55f5afc0752ce4a099f32d57d69c5a84bbc8337ef9e4dd404aec8d/68747470733a2f2f706f7365722e707567782e6f72672f636c6f7363612f736f6e75732f762f737461626c652e706e67)](https://packagist.org/packages/closca/sonus)[![Build Status](https://camo.githubusercontent.com/daa95606843ab282d9776d858fb4a03d5bad40d59851771ce0662a5e85bf8918/68747470733a2f2f7472617669732d63692e6f72672f636c6f7363612f736f6e75732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/closca/sonus)[![Total Downloads](https://camo.githubusercontent.com/6c4d79fd66623f42b1b754ca918caf69163fe2bf1e8e2c6d6f80fa20f2c5b240/68747470733a2f2f706f7365722e707567782e6f72672f636c6f7363612f736f6e75732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/closca/sonus)[![ProjectStatus](https://camo.githubusercontent.com/50143dc0523ed300b157cc671763ec37efa06509253dbc273747c1d43052d4cf/68747470733a2f2f7374696c6c6d61696e7461696e65642e636f6d2f636c6f7363612f736f6e75732e706e67)](https://stillmaintained.com/closca/sonus.png)[![License](https://camo.githubusercontent.com/994b20efe47424b7d0a915358cc5f9d9112ce92a0e35ab6a7dd27f15e0d7b61b/68747470733a2f2f706f7365722e707567782e6f72672f636c6f7363612f736f6e75732f6c6963656e73652e706e67)](https://packagist.org/packages/closca/sonus)

\*\*\*\* NOTE \*\*\*\* This is a duplicate of . I have duplicated because the original package was abandoned and i nedeed more stuffs for working with videos on Laravel. Sonus is a tool designed to leverage the power of **Laravel 4** and **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

```
"closca/sonus": "dev-master"

```

For Laravel 5 use

```
"closca/sonus": "dev-l5"

```

Run the composer update command:

```
$ composer update

```

In your `config/app.php` add `'Closca\Sonus\SonusServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Closca\Sonus\SonusServiceProvider',

),

```

Still under `config/app.php` add `'Sonus' => 'Closca\Sonus\Facade'` to the `$aliases` array

```
'aliases' => array(

    'App'             => 'Illuminate\Support\Facades\App',
    'Artisan'         => 'Illuminate\Support\Facades\Artisan',
    ...
    'Sonus'           => 'Closca\Sonus\Facade',

),

```

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

```
$ php artisan config:publish Closca/Sonus

```

Navigate to `app/config/packages/Closca/Sonus/config.php` and update all four parameters

### Examples

[](#examples)

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

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

```

Sonus can also convert video files:

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

```

Sonus can also return media information as an array or json

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

```

Sonus can also easily generate smart movie thumbnails like this

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

```

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

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

```

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

```
Sonus::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

```
Sonus::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 Sonus::getProgress('uniqueid');
}

```

### Security and Compatibility

[](#security-and-compatibility)

Sonus 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';
Sonus::convert()->input($file_in)->output($file_out)->go();

```

Lastly, Sonus 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(Sonus::canEncode('mp3'));
var_dump(Sonus::canDecode('mp3'));

```

To get a list of all supported formats you can run

```
var_dump(Sonus::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 Sonus 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)

Sonus 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/sonus/issues)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

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/ff5c36da118d171b6db2e1316974b06da49f47149cdc90ec20ba2dfcf656ec64?d=identicon)[closca](/maintainers/closca)

---

Top Contributors

[![closca](https://avatars.githubusercontent.com/u/4892901?v=4)](https://github.com/closca "closca (13 commits)")[![fishisawesome](https://avatars.githubusercontent.com/u/6018584?v=4)](https://github.com/fishisawesome "fishisawesome (1 commits)")

### Embed Badge

![Health badge](/badges/closca-sonus/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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