PHPackages                             finller/laravel-aws-mediaconvert - 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. [API Development](/categories/api)
4. /
5. finller/laravel-aws-mediaconvert

ActiveLibrary[API Development](/categories/api)

finller/laravel-aws-mediaconvert
================================

Bring AWS MediaConvert to Laravel

v1.0.1(2y ago)638.0k↓32%4[4 PRs](https://github.com/finller/laravel-aws-mediaconvert/pulls)MITPHPPHP ^8.1CI passing

Since Feb 10Pushed 2mo agoCompare

[ Source](https://github.com/finller/laravel-aws-mediaconvert)[ Packagist](https://packagist.org/packages/finller/laravel-aws-mediaconvert)[ Docs](https://github.com/finller/laravel-aws-mediaconvert)[ RSS](/packages/finller-laravel-aws-mediaconvert/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (15)Versions (8)Used By (0)

Bring AWS MediaConvert to Laravel
=================================

[](#bring-aws-mediaconvert-to-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2bdb113213a340291708a8a2589e8575f240e2b5a7c4be5aff8001661da61014/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66696e6c6c65722f6c61726176656c2d6177732d6d65646961636f6e766572742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/finller/laravel-aws-mediaconvert)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2381fcd79aa5cb247d7015b0702504422a47485b112a350115c8bbb84d2ceefa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66696e6c6c65722f6c61726176656c2d6177732d6d65646961636f6e766572742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/finller/laravel-aws-mediaconvert/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3a8562e2ce20b2064837388700c86a5a51c160ab891c13c9f670810d28f538a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66696e6c6c65722f6c61726176656c2d6177732d6d65646961636f6e766572742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/finller/laravel-aws-mediaconvert/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/075f18aeda9732eeb2ba1a89e9948a2efdab2267f785afcf4134176098a0efd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66696e6c6c65722f6c61726176656c2d6177732d6d65646961636f6e766572742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/finller/laravel-aws-mediaconvert)

This package provides an easy way to interact with AWS MediaConvert. It provides usefull presets for **HLS**, **MP4** optimization and **thumbnail**.

The package is greatly inspired by the work of meemalabs and their similar package  !

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require finller/laravel-aws-mediaconvert
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-aws-mediaconvert-config"
```

This is the contents of the published config file:

```
return [
    /**
     * IAM Credentials from AWS.
     *
     * Please note, if you are intending to use Laravel Vapor, rename
     * From: AWS_ACCESS_KEY_ID - To: e.g. VAPOR_ACCESS_KEY_ID
     * From: AWS_SECRET_ACCESS_KEY - To: e.g. VAPOR_SECRET_ACCESS_KEY
     * and ensure that your Vapor environment has these values defined.
     */
    'credentials' => [
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
    ],
    'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    'version' => 'latest',
    'url' => env('AWS_MEDIACONVERT_ACCOUNT_URL'),

    /**
     * Specify the IAM Role ARN.
     *
     * You can find the Role ARN visiting the following URL:
     * https://console.aws.amazon.com/iam/home?region=us-east-1#/roles
     * Please note to adjust the "region" in the URL above.
     * Tip: in case you need to create a new Role, you may name it `MediaConvert_Default_Role`
     * by making use of this name, AWS MediaConvert will default to using this IAM Role.
     */
    'iam_arn' => env('AWS_IAM_ARN'),

    /**
     * Specify the queue you would like use.
     *
     * It can be found by visiting the following URL:
     * https://us-east-1.console.aws.amazon.com/mediaconvert/home?region=us-east-1#/queues/details/Default
     * Please note to adjust the "region" in the URL above.
     */
    'queue_arn' => env('AWS_QUEUE_ARN'),

    /**
     * Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events.
     * Set the interval, in seconds, between status updates.
     *
     * MediaConvert sends an update at this interval from the time the service begins processing
     * your job to the time it completes the transcode or encounters an error.
     *
     * Accepted values: 10, 12, 15, 20, 30, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600
     */
    'webhook_interval' => 60,
];
```

Usage
-----

[](#usage)

In the most basic way, this package provides a service which is a wrap around the aws sdk. So you can simply create a MediaConvert job by calling `createJob` like that.

```
Finller\AwsMediaConvert\Facades\AwsMediaConvert::createJob(settings: []);
```

But we also provid usefull `HLS` and `MP4` presets that are optimized for the web. Here is a more advanced usage:

Convert any video to an optimized MP4:

```
$input = AwsMediaConvert::getUri($path); // you can use getUri to build the S3 uri quickly

AwsMediaConvert::createJob(
    settings: DefaultMediaConvertSettings::make($input)
        ->addOutputGroup(
            DefaultOptimizedVideoMediaConvertGroup::make(
                Destination: $destination,
                Height: min(1080, $originalHeight) // optional but you can set a Height or Width to resize the video
            )
        )
        ->toArray(),
    metaData: [ // feel free to add metadata so you can do the right action when receiving the webhook
        'env' => config('app.env'),
        get_class($this->media) => $this->media->id,
        'job' => get_class($this),
    ]
);
```

Convert any video to an optimized Apple HLS set of files:

```
$input = AwsMediaConvert::getUri($path); // you can use getUri to build the S3 uri easily

AwsMediaConvert::createJob(
    settings: DefaultMediaConvertSettings::make($input)
        ->addOutputGroup(
            DefaultHlsMediaConvertGroup::make($destination)
                ->addOutputWhen($maxHeight >= 1080, DefaultHls1080pMediaConvertOutput::make())
                ->addOutputWhen($maxHeight >= 720, DefaultHls720pMediaConvertOutput::make())
                ->addOutputWhen($maxHeight >= 540, DefaultHls540pMediaConvertOutput::make())
                ->addOutputWhen($maxHeight >= 540, DefaultHls480pMediaConvertOutput::make())
        )
        ->toArray(),
    metaData: []
);
```

Perform multiple Conversion in 1 job:

```
$input = AwsMediaConvert::getUri($path); // you can use getUri to build the S3 uri easily

AwsMediaConvert::createJob(
    settings: DefaultMediaConvertSettings::make($input)
    ->addOutputGroup(
            DefaultOptimizedVideoMediaConvertGroup::make(
                Destination: $destination,
                Height: min(1080, $originalHeight) // optional but you can set a Height or Width to resize the video
            )
        )
        ->addOutputGroup(
            DefaultHlsMediaConvertGroup::make($destination)
                ->addOutputWhen($originalHeight >= 1080, DefaultHls1080pMediaConvertOutput::make())
                ->addOutputWhen($originalHeight >= 720, DefaultHls720pMediaConvertOutput::make())
                ->addOutputWhen($originalHeight >= 540, DefaultHls540pMediaConvertOutput::make())
                ->addOutputWhen($originalHeight >= 540, DefaultHls480pMediaConvertOutput::make())
        )
        ->toArray(),
    metaData: []
);
```

### Tracks MediaConvert jobs with webhooks

[](#tracks-mediaconvert-jobs-with-webhooks)

### 1. Register the webhook route in your app.

[](#1-register-the-webhook-route-in-your-app)

You can simply use our prebuilt Webhook controller

In your `web`, `api` or any route file of yours, register the prebuilt route with the following macro. You can use any url

```
Route::awsMediaConvertWebhook('aws/webhooks/media-convert');
```

If you have put your route in a place where the `VerifyCsrfToken` is attached, you will have to add an exception just like that:

```
class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'aws/*', // Put the route you have chosen here
    ];
}
```

### 2. Create an SNS Topic

[](#2-create-an-sns-topic)

Go to  (don't forget to select the right region for you).

On the right navigation bar, select "Topics" and click the "Create topic" button on your right. For the Type, choose "Standard" and give a name to your Topic juste like "MediaConvertJobUpdate" and click "Create topic"

Now, click "Create subscription" and select HTTPS for the "Protocol". Then enter the webhook route you have chosen like `https://app.example/aws/webhooks/media-convert` and confirm creation.

By default, AWS will have sent a post request to URL you defined in your "Subscription" setup. This package automatically handles the "confirmation" part. In case there is an issue and it is not confirmed yet, please click on the "Request confirmation" button.

#### 3. Create an AWS CloudWatch rule

[](#3-create-an-aws-cloudwatch-rule)

1. Go to  (don't forget to select the right region for you).
2. Open Events &gt; Rule from the left navigation bar.
3. Click Create Rule. In the Event Source panel select the "Event pattern" radio and "Events by Services" (it should be the default value) In "Service Name", choose "MediaConvert" et keep "All Events" for Event Type.

Your Event pattern preview should be

```
{
  "source": [
    "aws.mediaconvert"
  ]
}
```

If you need to listen to only a specific queue for example, you can do it like that:

```
{
  "source": ["aws.mediaconvert"],
  "detail": {
    "queue": ["arn:aws:mediaconvert:us-east-1:123456789:queues/Default"]
  }
}
```

In the Target panel (on the right), click "Add Target" and select "SNS Topic". Then select the previously created SNS Topic.

That's all, this package will dispatch Laravel events for you to listen. But if you need more specific behavior, you can create your own controller by extending `AwsMediaConvertWebhookController` for example.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Quentin Gabriele](https://github.com/QuentinGab)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance58

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.6% 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 ~133 days

Total

4

Last Release

793d ago

Major Versions

v0.0.2 → v1.0.02023-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/d769563728757858e249f266ac2555f28db5640124df92821ed17d93ee76fc7b?d=identicon)[QuentinGab](/maintainers/QuentinGab)

---

Top Contributors

[![QuentinGab](https://avatars.githubusercontent.com/u/40128136?v=4)](https://github.com/QuentinGab "QuentinGab (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

awsaws-mediaconvertaws-s3finllerlaravelmediaconverts3laravelfinllerlaravel-aws-mediaconvert

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/finller-laravel-aws-mediaconvert/health.svg)

```
[![Health](https://phpackages.com/badges/finller-laravel-aws-mediaconvert/health.svg)](https://phpackages.com/packages/finller-laravel-aws-mediaconvert)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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