Introduction
This package runs ab-av1 from Laravel to encode video to AV1.
Normally you pick a CRF value (a quality setting) and hope the result looks good and isn't too big. ab-av1 does that for you: you set a target quality score, called VMAF, and it test-encodes short samples of your video to find the CRF that reaches it with the smallest file.
It's an add-on for foxws/laravel-media: you open media with laravel-media, and abAv1() encodes it.
use Foxws\Media\Facades\Media;
Media::fromDisk('media')
->open('videos/clip.mp4')
->abAv1()
->withMinVMAF(95)
->toDisk('s3')
->save('encoded/clip.mp4');
Features
- Encode at a target quality (VMAF or XPSNR) instead of guessing a CRF.
- Read input from, and write output to, any Laravel disk, with laravel-media's concurrent S3 uploads.
- Use svt-av1, hardware encoders like VAAPI, or any other encoder FFmpeg supports, with laravel-media's filters.
- Test-encode samples first, or compare the quality of two files.
- laravel-media's process and export events, error reasons, temporary file cleanup after queue jobs, and
Media::fake() in tests.
Requirements
Let your AI agent do the hard parts. This package ships a Laravel Boost skill, laravel-ab-av1-development, that teaches your agent how to install, configure and use Laravel ab-av1. Install Boost and select the skill when prompted:
composer require laravel/boost --dev
php artisan boost:install
Already using Boost? Run php artisan boost:update --discover to pick up the skill. Then just ask, for example: "Encode uploaded videos to AV1 at a VMAF of 95 and save them to S3."
Pages