Download the PHP package foxws/laravel-av1 without Composer
On this page you can find all versions of the php package foxws/laravel-av1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download foxws/laravel-av1
More information about foxws/laravel-av1
Files in foxws/laravel-av1
Package laravel-av1
Short Description A Laravel package for ab-av1 video encoding with AV1
License MIT
Homepage https://github.com/foxws/laravel-av1
Informations about the package laravel-av1
Laravel AV1
A Laravel package for AV1 video encoding with support for ab-av1 VMAF-targeted quality optimization and direct FFmpeg encoding with hardware acceleration (Intel QSV, AMD AMF, NVIDIA NVENC).
Features
- ๐ฌ Fluent API - Laravel-style chainable methods
- ๐ Multiple Disks - Works with local, S3, and custom filesystems
- ๐ฏ VMAF-Targeted Encoding - Automatically finds optimal CRF for target quality using ab-av1
- โก Hardware Acceleration - GPU encoding support (Intel QSV, AMD AMF, NVIDIA NVENC)
- ๐ Multiple Encoders - Support for ab-av1 and FFmpeg with auto-detection
- ๐ Quality Metrics - Built-in VMAF & XPSNR scoring
- ๐ Auto CRF Optimization - Use ab-av1 to find optimal CRF, then encode with FFmpeg GPU
- ๐งช Testable - Clean architecture with mockable components
- ๐ Type-Safe - Full PHP 8.4+ type declarations
Requirements
- PHP 8.3 or higher
- Laravel 11.x or higher
- FFmpeg with AV1 encoder support (libsvtav1 or hardware encoder)
- Optional: ab-av1 for VMAF-targeted quality optimization
Installation
Install the package via composer:
Publish the config file:
Installing ab-av1 (Optional)
ab-av1 is optional but recommended for VMAF-targeted quality optimization. Install using cargo:
Or download a prebuilt binary from the releases page.
Installing FFmpeg with AV1 Support
FFmpeg is required for direct AV1 encoding. Ensure FFmpeg is compiled with AV1 encoder support:
For hardware acceleration support, you'll need FFmpeg compiled with the appropriate hardware encoder for your GPU.
Verify Installation
After installation, verify that ab-av1 is properly configured:
This will check:
- Binary exists and is executable
- Can retrieve version information
- Configuration is properly set up
- Temporary directory is accessible
Package Information
View package and binary information:
Quick Start
FFmpeg Hardware Encoding
Encode videos using FFmpeg with automatic hardware acceleration detection:
FFmpeg with Auto CRF Optimization
Combine ab-av1's CRF optimization with FFmpeg's GPU encoding:
Using ab-av1 Encoder
Use ab-av1 for integrated VMAF-targeted encoding:
VMAF Encode
Automatically find the optimal CRF value to achieve a target VMAF quality score and encode the full video:
Hardware Acceleration
Check available hardware encoders and use the best available:
CRF Search (ab-av1)
Search for the optimal CRF value without encoding the full video:
Sample Encode (ab-av1)
Encode a sample of the video to test settings:
Full Encode (ab-av1)
Encode the entire video with a specific CRF:
VMAF Score
Calculate VMAF score between two videos:
XPSNR Score
Calculate XPSNR score between two videos:
FFmpeg Encoding
Basic FFmpeg Encoding
GPU Acceleration
Auto CRF with FFmpeg
Combine ab-av1's CRF optimization with FFmpeg's GPU encoding:
For detailed FFmpeg examples including hardware-specific configurations, see FFMPEG_ENCODING.md.
Working with Different Disks
From S3
From Local to S3
S3 with Hardware Encoding
Advanced Options
CRF Range
Max Encoded Size
Pixel Format
Full VMAF
VMAF Model
Verbose Output
Batch Processing
Process multiple files:
Callbacks
Add callbacks after encoding:
Debugging
Get the command that will be executed:
Or dump and die:
Configuration
Environment Variables
ab-av1 Configuration:
AB_AV1_BINARY_PATH- Path to ab-av1 binary (default: '/usr/local/bin/ab-av1')AB_AV1_TIMEOUT- Maximum time in seconds for encoding commands (default: 14400)AB_AV1_PRESET- Default encoder preset 0-13 for svt-av1 (default: 6)AB_AV1_MIN_VMAF- Minimum VMAF score to target (default: 80)AB_AV1_MAX_PERCENT- Maximum encoded file size as percentage (default: 300)
FFmpeg Configuration:
FFMPEG_BINARY_PATH- Path to ffmpeg binary (default: '/usr/local/bin/ffmpeg')FFMPEG_TIMEOUT- Maximum time in seconds for FFmpeg encoding (default: 7200)FFMPEG_ENCODER- Force specific encoder (null = auto-detect): av1_qsv, av1_amf, av1_nvenc, libsvtav1FFMPEG_HARDWARE_ACCEL- Enable hardware acceleration (default: true)FFMPEG_DEFAULT_CRF- Default CRF value (default: 30)FFMPEG_DEFAULT_PRESET- Default preset (default: 6)FFMPEG_AUDIO_CODEC- Default audio codec (default: 'libopus')FFMPEG_PIXEL_FORMAT- Default pixel format (default: 'yuv420p')FFMPEG_AUTO_CRF- Use ab-av1 for auto CRF by default (default: false)
General:
AB_AV1_LOG_CHANNEL- Log channel to use (false to disable, null for default)AB_AV1_TEMPORARY_FILES_ROOT- Directory for temporary files (default: storage/app/av1/temp)
Configuration File
Publish and edit config/av1.php for more control:
Error Handling
Available Commands
vmafEncode()
Automatically finds the optimal CRF value to achieve a target VMAF score, then encodes the full video at that quality level.
Required options:
preset(string)- Encoder presetminVmaf(float)- Minimum VMAF score
Optional:
maxEncodedPercent(int)- Max size as percentage of inputsample(int)- Sample duration in secondsminCrf(int)- Minimum CRF to trymaxCrf(int)- Maximum CRF to try
crfSearch()
Searches for the optimal CRF value to achieve a target VMAF score without encoding the full video. Useful for testing before full encoding.
Required options:
preset(string)- Encoder preset (0-13 for svt-av1)minVmaf(float)- Target VMAF score (0-100)
Optional: Same as vmafEncode()
sampleEncode()
Encodes a sample portion of the video for testing settings before committing to a full encode.
Required options:
crf(int)- CRF value to use for encodingpreset(string)- Encoder preset (0-13 for svt-av1)
Optional:
sample(int)- Sample duration in seconds (default varies by encoder)
encode()
Encodes the entire video using a manually specified CRF value. Use this when you know the exact CRF you want.
Required options:
crf(int)- CRF value (lower = higher quality, larger file)preset(string)- Encoder preset (0-13 for svt-av1, higher = faster/larger)
vmaf()
Calculates the VMAF (Video Multimethod Assessment Fusion) quality score between a reference and distorted video.
Required options:
reference(string)- Reference (original) video pathdistorted(string)- Distorted (encoded) video path
Optional:
vmafModel(string)- Path to custom VMAF model file
xpsnr()
Calculates the XPSNR (Extended Peak Signal-to-Noise Ratio) quality score between a reference and distorted video.
Required options:
reference(string)- Reference (original) video pathdistorted(string)- Distorted (encoded) video path
Testing
Credits
- ab-av1 - The underlying encoding tool
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-av1 with dependencies
illuminate/contracts Version ^11.0 || ^12.0
illuminate/filesystem Version ^11.0 || ^12.0
illuminate/process Version ^11.0 || ^12.0
illuminate/support Version ^11.0 || ^12.0
psr/log Version ^3.0
spatie/laravel-package-tools Version ^1.16