foxws / laravel-ab-av1
A Laravel package for encoding videos to AV1 format using ab-av1.
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/contracts: ^12.0||^13.0
- illuminate/filesystem: ^12.0||^13.0
- illuminate/process: ^12.0||^13.0
- illuminate/support: ^12.0||^13.0
- psr/log: ^3.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-02 11:59:11 UTC
README
Runs ab-av1 from Laravel to encode video to AV1. You set the quality you want as a VMAF score, and ab-av1 finds the smallest encode that reaches it. Read the source from any Laravel disk, and write the result to any disk.
See the full documentation: Installation, Usage, Events, Configuration.
Requirements
- PHP 8.4 or higher
- Laravel 12 or 13
- ab-av1, with FFmpeg built with svt-av1 and libvmaf
Installation
composer require foxws/laravel-ab-av1
php artisan vendor:publish --tag="ab-av1-config"
Install the ab-av1 binary, then check the setup:
php artisan ab-av1:info
See Installation for details.
Quick start
use Foxws\AbAv1\Facades\AbAv1; $encoder = AbAv1::fromDisk('media')->open('videos/clip.mp4'); try { $encoder ->withPreset(6) ->withMinVMAF(95) ->export() ->toDisk('s3') ->toPath('encoded/clip.mp4') ->save(); } finally { $encoder->cleanupTemporaryFiles(); }
This finds the CRF that reaches a VMAF score of 95, encodes the video with it, and uploads the result to encoded/clip.mp4 on the s3 disk.
For a file that's already on the server, pass its path and read the result:
$result = AbAv1::withInput('/path/to/video.mp4') ->withPreset(6) ->withMinVMAF(95) ->withOutput('/path/to/output.mp4') ->autoEncode(); $result->getCRFUsed(); // e.g. 30.25 $result->getVMAFScore(); // e.g. 95.1
See Usage for the other ab-av1 commands, hardware encoders and checking the result.
Testing
composer test
Links
- CHANGELOG
- Security policy
- ab-av1
- Laravel Streamer, to package video into HLS and DASH streams
Credits
- francoism90
- All Contributors
- ab-av1 by Alex Butler, which does the actual work
Used by Stry, a self-hosted video streaming app.
AI, specifically Claude, was used to help build this package. All AI-assisted output is reviewed by me, and I retain final say over everything that is implemented and released.
License
MIT. See License File.