PHPackages                             sujayjaju/ffmpeg-bundle - 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. sujayjaju/ffmpeg-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

sujayjaju/ffmpeg-bundle
=======================

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

0.5.2(11y ago)21.2kMITPHP

Since Oct 31Pushed 10y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (9)Used By (0)

Symfony ffmpeg bundle
=====================

[](#symfony-ffmpeg-bundle)

This bundle provides a simple wrapper for the [PHP\_FFmpeg](https://github.com/PHP-FFMpeg/PHP-FFMpeg) library, exposing it as a Symfony service.

Based on [pulse00/ffmpeg-bundle](https://github.com/pulse00/ffmpeg-bundle) by [pulse00](https://github.com/pulse00)

### Usage Example

[](#usage-example)

Enable the extension in the AppKernel

```
            ....
            new sujayjaju\FFmpegBundle\PhpFFmpegBundle(),
            ....
```

Configure which ffmpeg binary to use in `config.yml`:

```
php_ffmpeg:
    ffmpeg_binary: /usr/bin/ffmpeg
    ffprobe_binary: /usr/bin/ffprobe
    binary_timeout: 300 # Use 0 for infinite
    threads_count: 4
```

Using the service:

```
	$ffmpeg = $this->get('php_ffmpeg.ffmpeg');

	// Open video
	$video = $ffmpeg->open('/your/source/folder/input.avi');

	// Resize to 640x480
	$video
        ->filters()
        ->resize(new Dimension(640, 480), ResizeFilter::RESIZEMODE_INSET)
        ->synchronize();

    // Create a thumbnail
    $video
        ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
        ->save('/PATH/frame.jpg');

	// Start transcoding and save video
	$video->save(new FMpeg\Format\Video\X264(), '/PATH/video.mp4');
```

### Sample Integration With [1up-lab/OneupUploaderBundle](https://github.com/1up-lab/OneupUploaderBundle)

[](#sample-integration-with-1up-laboneupuploaderbundle)

- Step 1: Create Your Upload Listener Class

```
namespace Application\YourBundle\EventListener;

use FFMpeg\Exception\InvalidArgumentException;
use FFMpeg\Exception\RuntimeException;
use Oneup\UploaderBundle\Event\PostUploadEvent;

class YourUploadListener
{
    protected $doctrine;
    protected $ffmpeg;

    public function __construct($doctrine, $ffmpeg)
    {
        $this->doctrine = $doctrine;
        $this->ffmpeg = $ffmpeg;
    }

    public function onUpload(PostUploadEvent $event)
    {
        $file_path = $event->getFile()->getPathname();
        $response = $event->getResponse();
        $video = null;
        try{
            $ffmpeg = $this->ffmpeg->open($file_path);
        }catch(InvalidArgumentException $e){
            $response->setSuccess(false);
            $response->setError("Could not load file");
            $response['preventRetry'] = true;
            unlink($file_path);
            return;
        }catch(RuntimeException $e){
            $response->setSuccess(false);
            $response->setError("Invalid File");
            $response['preventRetry'] = true;
            unlink($file_path);
            return;
        }

        // Sample code to check if video was uploaded
        $streams = $ffmpeg->getStreams();
        foreach($streams as $stream){
            if($stream->get('codec_type') == 'video'){
                $video = $stream;
            }
        }

        if(is_null($video)){
            $response->setSuccess(false);
            $response->setError("Invalid Video");
            $response['preventRetry'] = true;
            unlink($file_path);
            return;
        }

        // Do what you want with the video
        // $video
    }
}
```

- Step 2: Define your service

```
    application.your_upload_listener:
        class: Application\YourBundle\EventListener\YourUploadListener
        arguments: [@doctrine, @php_ffmpeg.ffmpeg]
        tags:
          -  { name: kernel.event_listener, event: oneup_uploader.post_upload, method: onUpload }
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.8% 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 ~95 days

Recently: every ~83 days

Total

8

Last Release

4282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/787c5fc34c761c747c822906bfd2b17d076dc6b787d8109c4e9e8d689f6940c5?d=identicon)[sujayjaju](/maintainers/sujayjaju)

---

Top Contributors

[![pulse00](https://avatars.githubusercontent.com/u/185278?v=4)](https://github.com/pulse00 "pulse00 (23 commits)")[![sujayjaju](https://avatars.githubusercontent.com/u/1681240?v=4)](https://github.com/sujayjaju "sujayjaju (12 commits)")[![micronax](https://avatars.githubusercontent.com/u/1337823?v=4)](https://github.com/micronax "micronax (4 commits)")[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (2 commits)")[![romainneutron](https://avatars.githubusercontent.com/u/137574?v=4)](https://github.com/romainneutron "romainneutron (1 commits)")

---

Tags

ffmpegmultimedia

### Embed Badge

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

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

###  Alternatives

[php-ffmpeg/php-ffmpeg

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

5.0k21.7M165](/packages/php-ffmpeg-php-ffmpeg)[pbmedia/laravel-ffmpeg

FFMpeg for Laravel

1.8k4.8M23](/packages/pbmedia-laravel-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)[codescale/ffmpeg-php

PHP wrapper for FFmpeg application

495270.5k1](/packages/codescale-ffmpeg-php)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[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)
