PHPackages                             minuteoflaravel/laravel-audio-video-validator - 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. minuteoflaravel/laravel-audio-video-validator

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

minuteoflaravel/laravel-audio-video-validator
=============================================

Laravel validator for video and audio files

1.1(3y ago)9761.0k↓23.8%11[2 PRs](https://github.com/minuteoflaravel/laravel-audio-video-validator/pulls)MITPHPPHP ^7.4|^8.0|^8.1

Since Dec 28Pushed 1y ago3 watchersCompare

[ Source](https://github.com/minuteoflaravel/laravel-audio-video-validator)[ Packagist](https://packagist.org/packages/minuteoflaravel/laravel-audio-video-validator)[ Docs](https://github.com/minuteoflaravel/laravel-audio-video-validator)[ RSS](/packages/minuteoflaravel-laravel-audio-video-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (14)Used By (0)

Laravel Audio &amp; Video Validator
===================================

[](#laravel-audio--video-validator)

This package adds validators for audio and video files to your Laravel project.

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

[](#installation)

To use this package you should intall ffmpeg multimedia framework:

- On Debian/Ubuntu, run `sudo apt install ffmpeg`
- On macOS with Homebrew: `brew install ffmpeg`

After that install the package via composer:

```
composer require minuteoflaravel/laravel-audio-video-validator
```

Validators
----------

[](#validators)

Package adds these validators:

- audio
- video
- codec
- duration
- duration\_max
- duration\_min
- video\_width
- video\_height
- video\_max\_width
- video\_max\_height
- video\_min\_width
- video\_min\_height

Custom error messages
---------------------

[](#custom-error-messages)

If you need to add your custom translatable error messages then just add them as always to resources/lang/en/validation.php file:

```
  'audio' => 'The :attribute must be a audio.',
  'video' => 'The :attribute must be a video.',
  'codec' => 'The :attribute codec must be one of these: :codec',
  'duration' => 'The :attribute must be :duration seconds duration.',
  'duration_max' => 'The :attribute duration must be less than :duration_max seconds.',
  'duration_min' => 'The :attribute duration must be greater than :duration_min seconds.',
  'video_width' => 'The :attribute width must be :video_width.',
  'video_height' => 'The :attribute height must be :video_height.',
  'video_max_width' => 'The :attribute width must be less than :video_max_width.',
  'video_min_width' => 'The :attribute width must be greater than :video_min_width.',
  'video_min_height' => 'The :attribute height must be greater than :video_min_height.',
```

Some examples
-------------

[](#some-examples)

To check if file is audio file and audio duration is 60 seconds:

```
$request->validate([
    'audio' => 'audio|duration:60',
]);
```

To check if file is audio file and audio duration is between 30 and 300 seconds:

```
$request->validate([
    'audio' => 'audio|duration_min:30|duration_max:300',
]);
```

To check if file is video file and video duration is between 30 and 300 seconds:

```
$request->validate([
    'video' => 'video|duration_min:30|duration_max:300',
]);
```

To check if file is video file and video dimensions are 1000x640:

```
$request->validate([
    'video' => 'video|video_width:1000|video_height:640',
]);
```

To check if file is video file and video dimensions greater than 1000x640:

```
$request->validate([
    'video' => 'video|video_min_width:1000|video_min_height:640',
]);
```

To check if file is audio file and codec is mp3 or pcm\_s16le(wav):

```
$request->validate([
    'audio' => 'audio|codec:mp3,pcm_s16le',
]);
```

To check if file is video file and codec is h264(mp4):

```
$request->validate([
    'video' => 'video|codec:h264',
]);
```

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~15 days

Recently: every ~41 days

Total

12

Last Release

1433d ago

PHP version history (2 changes)1.0.0PHP ^8.0

1.0.6PHP ^7.4|^8.0|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/45f4a00b02c0b7952af76615c4fcdd250d3e74aa48be4852f30695b1f98d61e0?d=identicon)[minuteoflaravel](/maintainers/minuteoflaravel)

---

Top Contributors

[![minuteoflaravel](https://avatars.githubusercontent.com/u/92157351?v=4)](https://github.com/minuteoflaravel "minuteoflaravel (19 commits)")

---

Tags

laravelffmpegmedialaravel-ffmpegminuteoflaravelmedia-validator

### Embed Badge

![Health badge](/badges/minuteoflaravel-laravel-audio-video-validator/health.svg)

```
[![Health](https://phpackages.com/badges/minuteoflaravel-laravel-audio-video-validator/health.svg)](https://phpackages.com/packages/minuteoflaravel-laravel-audio-video-validator)
```

###  Alternatives

[pbmedia/laravel-ffmpeg

FFMpeg for Laravel

1.8k4.8M23](/packages/pbmedia-laravel-ffmpeg)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154172.0k](/packages/classic-o-nova-media-library)[tomatophp/filament-media-manager

Manage your media files using spatie media library with easy to use GUI for FilamentPHP

14543.9k3](/packages/tomatophp-filament-media-manager)[mostafaznv/nova-video

Video Field for Laravel Nova

22398.0k1](/packages/mostafaznv-nova-video)[stepanenko3/nova-media-field

A Laravel Nova field for laravel-medilibrary.

1717.5k](/packages/stepanenko3-nova-media-field)[mariojgt/witchcraft

A Laravel Package Witchcraft, a quick start for new laravel Packages

312.6k](/packages/mariojgt-witchcraft)

PHPackages © 2026

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