PHPackages                             sharapov/php-ffmpeg-extensions - 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. sharapov/php-ffmpeg-extensions

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

sharapov/php-ffmpeg-extensions
==============================

An extensions library for the PHP FFMpeg (https://github.com/PHP-FFMpeg/PHP-FFMpeg)

0.2.3(4y ago)15679↓100%4GPL-3.0PHPPHP &gt;=5.4 || ^7.0

Since Mar 17Pushed 4y ago4 watchersCompare

[ Source](https://github.com/sharapov-outsource/php-ffmpeg-extensions)[ Packagist](https://packagist.org/packages/sharapov/php-ffmpeg-extensions)[ Docs](https://github.com/sharapovweb/php-ffmpeg-extensions)[ Fund](https://paypal.me/alexandersharapov)[ RSS](/packages/sharapov-php-ffmpeg-extensions/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

php-ffmpeg-extensions
=====================

[](#php-ffmpeg-extensions)

An extensions library for the PHP FFMpeg ()

Installation (via Composer):
============================

[](#installation-via-composer)

For composer installation, add:

```
"require": {
    "sharapov/php-ffmpeg-extensions": "^0.2"
},
```

to your composer.json file and update your dependencies. Or you can run:

```
$ composer require sharapov/php-ffmpeg-extensions
```

Notes:
======

[](#notes)

Tested with ffmpeg 3+, not tested with ffmpeg 4+

Usage:
======

[](#usage)

Now you can autoload or use the class via its namespace. Below are examples of how to use the library.

Draw texts and boxes
--------------------

[](#draw-texts-and-boxes)

```
// Init FFMpeg library
$ffmpeg = \Sharapov\FFMpegExtensions\FFMpeg::create(array(
    'ffmpeg.binaries'  => '/path/to/ffmpeg', // Path to FFMpeg
    'ffprobe.binaries' => '/path/to/ffprobe', // Path to FFProbe
    'timeout'          => 3600, // The timeout for the underlying process
    'ffmpeg.threads'   => 12,   // The number of threads that FFMpeg should use
));

// Open source video
$video = $ffmpeg->open( new InputFile( 'source/Coast - 1270.mp4' ) );

// Apply filter options to video
$video
  ->filters()
  ->complex( new OptionsCollection( [
                                      ( ( new FilterComplexOptions\OptionDrawText() )
                                        // Set z-index property. Greater value is always in front
                                        ->setZIndex( 160 )
                                        // You can use fade-in and fade-out effects. Set time in seconds
                                        ->setFadeIn( 1 )
                                        ->setFadeOut( 2 )
                                        // Set font path
                                        ->setFontFile( new InputFile( 'source/arial.ttf' ) )
                                        // Set font color. Accepts transparency value as the second argument. Float value between 0 and 1.
                                        ->setFontColor( '#ffffff' )
                                        // Set font size in pixels
                                        ->setFontSize( 33 )
                                        // Set text string
                                        ->setText( 'php-ffmpeg-extensions library' )
                                        // Coordinates where the text should be rendered. Accepts positive integer or
                                        // constants "(w-tw)/2", "(h-th)/2" to handle auto-horizontal, auto-vertical values
                                        ->setCoordinates( new Coordinate\Point( Coordinate\Point::AUTO_HORIZONTAL, 50 ) )
                                        // Set timings (start, stop) in seconds. Accepts float values as well
                                        ->setTimeLine( new Coordinate\TimeLine( 1, 20 ) ) ),

                                      ( ( new FilterComplexOptions\OptionDrawText() )
                                        ->setZIndex( 160 )
                                        ->setFadeIn( 1 )
                                        ->setFadeOut( 2 )
                                        ->setFontFile( new InputFile( 'source/arial.ttf' ) )
                                        ->setFontColor( '#ffffff' )
                                        ->setFontSize( 28 )
                                        ->setText( 'Sharapov A. (www.sharapov.biz)' )
                                        ->setCoordinates( new Coordinate\Point( 15, 600 ) )
                                        ->setTimeLine( new Coordinate\TimeLine( 2, 20 ) ) ),

                                      ( ( new FilterComplexOptions\OptionDrawBox() )
                                        ->setZIndex( 130 )
                                        ->setColor( '000000', 0.6 )
                                        ->setDimensions( new Coordinate\Dimension( Coordinate\Dimension::WIDTH_MAX, 60 ) )
                                        ->setCoordinates( new Coordinate\Point( 0, 580 ) ) ),

                                      ( ( new FilterComplexOptions\OptionDrawText() )
                                        ->setZIndex( 160 )
                                        ->setFadeIn( 1 )
                                        ->setFadeOut( 2 )
                                        ->setFontFile( new InputFile( 'source/arial.ttf' ) )
                                        ->setFontColor( '#ffffff' )
                                        ->setFontSize( 28 )
                                        ->setText( 'v2.0' )
                                        ->setCoordinates( new Coordinate\Point( 1200, 600 ) )
                                        ->setTimeLine( new Coordinate\TimeLine( 3, 20 ) ) )
                                    ] ) );

// Run render
$format = new \FFMpeg\Format\Video\X264( 'libmp3lame' );
$format->on( 'progress', function ( $video, $format, $percentage ) {
  echo "$percentage% transcoded\n";
} );

try {
  $video
    ->save( $format, 'output/output.mp4' );
  print 'Done!';
} catch ( ExecutionFailureException $e ) {
  print $e->getMessage();
}
```

You will find other examples in "/examples" folder.

Changelog
=========

[](#changelog)

Links
=====

[](#links)

[PHP FFMpeg Homepage](https://github.com/PHP-FFMpeg/PHP-FFMpeg)

[Composer](https://getcomposer.org/)

[GitHub](https://github.com/sharapov-outsource/php-ffmpeg-extensions)

[Packagist](https://packagist.org/packages/sharapov/php-ffmpeg-extensions)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~234 days

Recently: every ~292 days

Total

6

Last Release

1810d ago

PHP version history (2 changes)0.1PHP &gt;=5.4

0.2.2PHP &gt;=5.4 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafc5607942948b01d9968da81574beaa353e93f9a2ea1f2ec3f89e9d02f539?d=identicon)[sharapov-outsource](/maintainers/sharapov-outsource)

---

Top Contributors

[![sharapov-outsource](https://avatars.githubusercontent.com/u/1851556?v=4)](https://github.com/sharapov-outsource "sharapov-outsource (98 commits)")

---

Tags

boilerplate-applicationdockerffmpegffmpeg-scriptffmpeg-wrapperphpphp-ffmpegvideo-processingaudiovideo processingvideoaudio processingavconvffmpegavprobeffprobephp ffmpegffmpeg overlaychromakeycolorkeyalpha layermov

### Embed Badge

![Health badge](/badges/sharapov-php-ffmpeg-extensions/health.svg)

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

###  Alternatives

[php-ffmpeg/php-ffmpeg

FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg

5.0k21.7M165](/packages/php-ffmpeg-php-ffmpeg)[pulse00/ffmpeg-bundle

Symfony bundle to provide PHP-FFmpeg as a Symfony service (https://github.com/alchemy-fr/PHP-FFmpeg)

57447.2k1](/packages/pulse00-ffmpeg-bundle)[fmonts/ffmpeg-bundle

Symfony bundle to provide PHP-FFmpeg as a Symfony service (https://github.com/PHP-FFMpeg/PHP-FFMpeg/)

12195.1k](/packages/fmonts-ffmpeg-bundle)

PHPackages © 2026

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