PHPackages                             meema/laravel-media-converter - 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. meema/laravel-media-converter

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

meema/laravel-media-converter
=============================

Easily &amp; quickly integrate your application with AWS MediaConvert.

1.2.4(4y ago)5790.6k↓14%10[2 issues](https://github.com/meemalabs/laravel-media-converter/issues)[24 PRs](https://github.com/meemalabs/laravel-media-converter/pulls)MITPHPPHP ^7.3|^8.0

Since Dec 3Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/meemalabs/laravel-media-converter)[ Packagist](https://packagist.org/packages/meema/laravel-media-converter)[ Docs](https://github.com/meemalabs/laravel-media-converter)[ RSS](/packages/meema-laravel-media-converter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (52)Used By (0)

Media Converter Package for Laravel
===================================

[](#media-converter-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4fc0e1edc0a8f8c6fdd91027c5e001fd905f198577077d4a0afe7e1349a8782b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65656d612f6c61726176656c2d6d656469612d636f6e7665727465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/meema/laravel-media-converter)[![GitHub Workflow Status](https://github.com/meemalabs/laravel-media-converter/actions/workflows/run-tests.yml/badge.svg?label=tests)](https://github.com/meemalabs/laravel-media-converter)[![StyleCI](https://camo.githubusercontent.com/9420e1268c6f922e5cf3e150068dbb94efa89a38029ff1a0cb5d9d31fff2a47f/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3331343936393835352f736869656c643f7374796c653d666c6174266272616e63683d6d61696e267374796c653d666c6174)](https://github.styleci.io/repos/314969855)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/397bf418603e30204a88a25f49afda94d2b148d0f70030d39d7b87908925be6d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d65656d616c6162732f6c61726176656c2d6d656469612d636f6e7665727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/meemalabs/laravel-media-converter/?branch=main)[![Total Downloads](https://camo.githubusercontent.com/d1c04dec8a2ce22b8735fb314d10a8472b8eadd75fd4d9df3b419f33cc282215/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65656d612f6c61726176656c2d6d656469612d636f6e7665727465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/meema/laravel-media-converter)[![Discord](https://camo.githubusercontent.com/ec8774b75c5bc99978176a703963734077e060f31d8e989c39988fd02a7038cd/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3833343530333531363133343434313031323f6c6162656c3d646973636f726426647374796c653d666c6174)](https://discord.meema.io)[![License](https://camo.githubusercontent.com/c9a180297287513dfb7c7eb0af0b5420ecce42d7ac205d70019d3213cd922174/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d65656d616c6162732f6c61726176656c2d6d656469612d636f6e7665727465722e7376673f7374796c653d666c6174)](https://github.com/meemalabs/laravel-media-converter/blob/main/LICENSE.md)

This is a wrapper package for AWS MediaConvert. Additional drivers may be added.

[![laravel-media-converter package image](https://camo.githubusercontent.com/3d583f4e275da0f1b54f7465c904c93c89b41397a928f8e41d06be363bf84f83/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4d65646961253230436f6e7665727465722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d65656d612532466c61726176656c2d6d656469612d636f6e766572746572267061747465726e3d666c6f6174696e67436f6773267374796c653d7374796c655f31266465736372697074696f6e3d456173696c792b2532362b717569636b6c792b696e746567726174652b796f75722b6170706c69636174696f6e2b776974682b4157532b4d65646961436f6e766572742e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313235707826696d616765733d766964656f2d63616d657261267769647468733d333530)](https://camo.githubusercontent.com/3d583f4e275da0f1b54f7465c904c93c89b41397a928f8e41d06be363bf84f83/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4d65646961253230436f6e7665727465722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d65656d612532466c61726176656c2d6d656469612d636f6e766572746572267061747465726e3d666c6f6174696e67436f6773267374796c653d7374796c655f31266465736372697074696f6e3d456173696c792b2532362b717569636b6c792b696e746567726174652b796f75722b6170706c69636174696f6e2b776974682b4157532b4d65646961436f6e766572742e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313235707826696d616765733d766964656f2d63616d657261267769647468733d333530)

💡 Usage
-------

[](#-usage)

```
use Meema\MediaConverter\Facades\MediaConvert;
use Meema\MediaConverter\Jobs\CreateVideoConversion;

# simple usage
MediaConvert::path('video.mkv') // the s3 path to the file inside the bucket defined in your config (filesystems.disks.s3.bucket)
    ->optimizeForWeb() // will generate an optimized MP4 for you
    ->withThumbnails(int $framerateNumerator, int $framerateDenominator, int $maxCaptures, $width = null, $nameModifier = null, $imageQuality = 80) // will generate thumbnails from the video for you, e.g. poster images
    ->saveTo('my-optimized-video.mp4') // output file name
    ->createJob();

# advanced usage
$result = MediaConvert::cancelJob(string $id);
$result = MediaConvert::createJob(array $settings, array $metaData = [], int $priority = 0);
$result = MediaConvert::getJob(string $id);
$result = MediaConvert::listJobs(array $options);

# you may also dispatch a job to convert a video
dispatch(new CreateVideoConversion($jobSettings, $mediaId)); // $mediaId is optional & refers to the relating model's id
```

🐙 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require meema/laravel-media-converter
```

The package will automatically register itself.

Next, publish the config file with:

```
php artisan vendor:publish --provider="Meema\MediaConverter\Providers\MediaConverterServiceProvider" --tag="config"
```

Next, please add the following keys their values to your `.env` file.

```
AWS_ACCESS_KEY_ID=xxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxx
AWS_DEFAULT_REGION=us-east-1
AWS_MEDIACONVERT_ACCOUNT_URL=https://xxxxxxxxx.mediaconvert.us-east-1.amazonaws.com
AWS_IAM_ARN=arn:aws:iam::xxxxxxx:role/MediaConvert_Default_Role
AWS_QUEUE_ARN=arn:aws:mediaconvert:us-east-1:xxxxxxx:queues/Default
```

The following is the content of the published config file:

```
return [
    /*
     * The fully qualified class name of the "media" model.
     */
    'media_model' => \App\Models\Media::class,

    /**
     * IAM Credentials from AWS.
     */
    '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,

    /**
     * This value indicates whether to track media conversions in your database.
     *
     * Note: in case you *do* want to track media conversions, you will need to execute the
     * migration included as part of the package.
     */
    'track_media_conversions' => true,

    /**
     * If track_media_conversions is set to true, you may specify the events you would like to fire/track.
     * By default, it will track all status updates.
     *
     * Read more about MediaConvert conversion statuses here:
     * https://docs.aws.amazon.com/mediaconvert/latest/ug/mediaconvert_cwe_events.html
     */
    'statuses_to_track' => ['complete', 'error', 'new_warning', 'progressing', 'input_information', 'queue_hop'],
];
```

### Preparing Your Media Model (optional)

[](#preparing-your-media-model-optional)

This package includes a trait for your "Media model" that you may use to define the relationship of your media model with the tracked conversions.

Simply use it as follows:

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Meema\MediaConverter\Traits\Convertable;

class Media extends Model
{
    use Convertable;

    // ...
}
```

### Set Up Webhooks (optional)

[](#set-up-webhooks-optional)

This package makes use of webhooks in order to communicate the status/progress of the MediaConvert job. Please follow the following steps to enable webhooks for yourself.

Please note, this is only optional, and you should only enable this if you want to track the MediaConvert job's progressions.

### Setup Expose

[](#setup-expose)

First, let's use [Expose](https://beyondco.de/docs/expose/getting-started/installation) to "expose" / generate a URL for our local API. Follow the Expose documentation on how you can get started and generate a "live" &amp; sharable URL for within your development environment.

It should be as simple as `cd my-laravel-api && expose`.

### Setup AWS SNS Topic &amp; Subscription

[](#setup-aws-sns-topic--subscription)

Second, let's create an AWS SNS Topic which will notify our "exposed" API endpoint:

1. Open the Amazon SNS console at
2. In the navigation pane, choose Topics, and then choose "Create new topic".
3. For Topic name, enter `MediaConvertJobUpdate`, and then choose "Create topic".

[![AWS SNS Topic Creation Screenshot](https://camo.githubusercontent.com/b9b8220b79e5a1e11884d20d6b96fff4cdbd3df1b6a5520e8f4ad44d37c62eef/68747470733a2f2f692e696d6775722e636f6d2f777a564a46785a2e706e67)](https://camo.githubusercontent.com/b9b8220b79e5a1e11884d20d6b96fff4cdbd3df1b6a5520e8f4ad44d37c62eef/68747470733a2f2f692e696d6775722e636f6d2f777a564a46785a2e706e67)

4. Choose the topic ARN link for the topic that you just created. It looks something like this: `arn:aws:sns:region:123456789012:MediaConvertJobUpdate`.
5. On the Topic details: `MediaConvertJobUpdate` page, in the Subscriptions section, choose "Create subscription".
6. For Protocol, choose "HTTPS". For Endpoint, enter your "exposed" API URL which you generated in a previous step.

For example,

```
https://meema-api.sharedwithexpose.com/api/webhooks/media-converter

```

7. Choose "Create subscription".

#### Confirming Your Subscription

[](#confirming-your-subscription)

Finally, we need to confirm the subscription which is easily done by navigating to the `MediaConvertJobUpdate` Topic page. There, you should see the following section:

[![AWS SNS Subscription Confirmation Screenshot](https://camo.githubusercontent.com/c219656d5135151e9dd21e8e4d6a8f71e14675bf4484ab251e33850796203942/68747470733a2f2f692e696d6775722e636f6d2f717a4c5a4a41442e706e67)](https://camo.githubusercontent.com/c219656d5135151e9dd21e8e4d6a8f71e14675bf4484ab251e33850796203942/68747470733a2f2f692e696d6775722e636f6d2f717a4c5a4a41442e706e67)

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 as seen in the screenshot above.

You can also view the request in the Expose interface, by visiting the "Dashboard Url", which should be similar to: `http://127.0.0.1:4040`

Once the status reflects "Confirmed", your API will receive webhooks as AWS provides updates.

### Create CloudWatch Event

[](#create-cloudwatch-event)

1. Open the CloudWatch console at .
2. In the navigation pane, choose Events, and then choose "Create rule".
3. Make sure the inputs match the following screenshots:

[![AWS CloudWatch Rule Creation Screenshot](https://camo.githubusercontent.com/dc2e24746726f28c0fb731155dc93848702da29ab214617c7b4e0e03d15727b1/68747470733a2f2f692e696d6775722e636f6d2f3263385345664e2e706e67)](https://camo.githubusercontent.com/dc2e24746726f28c0fb731155dc93848702da29ab214617c7b4e0e03d15727b1/68747470733a2f2f692e696d6775722e636f6d2f3263385345664e2e706e67)

As you can see in above screenshot, we needed to select the "Service Name", "Event Type", and the "Target" which is referencing our SNS Topic we earlier created.

Lastly, the second &amp; final step of the "Rule creation" prompts you to enter a name and an optional description. You may use any name, e.g. `mediaconvert-job-updates`.

Now, your API will receive webhooks!

### Deploying to Laravel Vapor

[](#deploying-to-laravel-vapor)

Please note, as of right now, you cannot reuse the AWS credentials stored in your "environment file". The "workaround" for this is to adjust the `media-converter.php`-config file by renaming

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, lastly, please ensure that your Vapor environment has these values defined.

🧪 Testing
---------

[](#-testing)

```
composer test
```

📈 Changelog
-----------

[](#-changelog)

Please see our [releases](https://github.com/meemalabs/laravel-media-converter/releases) page for more information on what has changed recently.

💪🏼 Contributing
---------------

[](#-contributing)

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

🏝 Community
-----------

[](#-community)

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Media Converter on GitHub](https://github.com/meemalabs/laravel-media-converter/discussions)

For casual chit-chat with others using this package:

[Join the Meema Discord Server](https://discord.meema.io)

🚨 Security
----------

[](#-security)

Please review [our security policy](https://github.com/meemalabs/laravel-media-converter/security/policy) on how to report security vulnerabilities.

🙏🏼 Credits
----------

[](#-credits)

- [Chris Breuer](https://github.com/Chris1904)
- [Folks at Meema](https://github.com/meemalabs)
- [All Contributors](../../contributors)

📄 License
---------

[](#-license)

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

Made with ❤️ by Meema, Inc.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance59

Moderate activity, may be stable

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~10 days

Recently: every ~21 days

Total

25

Last Release

1745d ago

Major Versions

0.8.0 → 1.0.02021-03-16

PHP version history (3 changes)0.1.0PHP ^7.4

0.7.0PHP ^7.4|^8.0

1.0.0PHP ^7.3|^8.0

### Community

Maintainers

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

---

Top Contributors

[![chrisbbreuer](https://avatars.githubusercontent.com/u/6228425?v=4)](https://github.com/chrisbbreuer "chrisbbreuer (120 commits)")[![glennmichael123](https://avatars.githubusercontent.com/u/29087513?v=4)](https://github.com/glennmichael123 "glennmichael123 (11 commits)")[![DennisOng](https://avatars.githubusercontent.com/u/2383712?v=4)](https://github.com/DennisOng "DennisOng (2 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")[![serich159](https://avatars.githubusercontent.com/u/430095?v=4)](https://github.com/serich159 "serich159 (1 commits)")[![Victor-emil](https://avatars.githubusercontent.com/u/8555068?v=4)](https://github.com/Victor-emil "Victor-emil (1 commits)")

---

Tags

awsconversionffmpeglaravelmediaconvertmeemavideovideo-convertervideo-streaminglaravelawsoptimizeMeemamp4video conversionmedia conversionmediaconvertthumbnail generation

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/meema-laravel-media-converter/health.svg)

```
[![Health](https://phpackages.com/badges/meema-laravel-media-converter/health.svg)](https://phpackages.com/packages/meema-laravel-media-converter)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[meema/laravel-media-recognition

Easily &amp; quickly integrate your application with AWS Rekognition. Other drivers may be added in the near future.

222.7k](/packages/meema-laravel-media-recognition)[approached/laravel-image-optimizer

Image optimizer for laravel

153143.5k](/packages/approached-laravel-image-optimizer)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[meema/laravel-cloudfront

Easily &amp; quickly integrate your application with AWS CloudFront.

31113.4k](/packages/meema-laravel-cloudfront)[sunaoka/laravel-ses-template-driver

Amazon SES template mail driver for Laravel.

1088.0k](/packages/sunaoka-laravel-ses-template-driver)

PHPackages © 2026

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