foxws/laravel-ab-av1 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

foxws/laravel-ab-av1

Composer 安装命令:

composer require foxws/laravel-ab-av1

包简介

A Laravel package for encoding videos to AV1 format using ab-av1.

README 文档

README

A Laravel wrapper for ab-av1, the AV1 video encoder with automatic CRF calculation and VMAF quality targeting.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Features

  • Automatic CRF Discovery: Find the optimal CRF value to achieve target VMAF quality
  • Multiple Encoders: Support for av1_svtenc, av1_vaapi, libx264, libx265, and other ffmpeg encoders
  • Quick Sampling: Test encode quality before full encoding
  • Hardware Acceleration: Support for VAAPI and other hardware acceleration methods
  • VMAF/XPSNR Comparison: Calculate quality scores between original and encoded files
  • Event Dispatching: Listen to encoding events (started, completed, failed)
  • Fluent Interface: Chainable configuration API

Installation

Ensure ab-av1 is installed:

# macOS
brew install ab-av1

# Linux (Arch)
sudo pacman -S ab-av1

Install the Laravel package:

composer require foxws/laravel-ab-av1

Publish the config:

php artisan vendor:publish --provider="Foxws\AbAv1\AbAv1ServiceProvider"

Configuration

Binary Path

By default, the package expects ab-av1 to be in your system PATH. If you need to use a specific binary path or version, configure it in config/ab-av1.php or via environment variable:

# .env
AB_AV1_BINARY=/usr/local/bin/ab-av1
# Or use a specific cargo installation
AB_AV1_BINARY=/home/user/.cargo/bin/ab-av1

Verify your installation:

php artisan ab-av1:info

Quick Start

use Foxws\AbAv1\Facades\AbAv1;

$result = AbAv1::encode()
    ->withInput('/path/to/video.mp4')
    ->withPreset('medium')
    ->withMinVMAF(95)
    ->autoEncode();

echo "VMAF: {$result->getVMAFScore()}";
echo "CRF: {$result->getCRFUsed()}";

Usage Examples

Auto-encode (Recommended)

Automatically find the best CRF for your target VMAF quality:

$result = AbAv1::encode()
    ->withInput('video.mp4')
    ->withPreset('medium')
    ->withMinVMAF(95)
    ->withOutput('output.mp4')
    ->autoEncode();

Direct Encode

Encode with a specific CRF value:

$result = AbAv1::encode()
    ->withInput('video.mp4')
    ->withCRF(30)
    ->withPreset('slow')
    ->encode();

Sample Encode

Quick test to preview quality:

$result = AbAv1::encode()
    ->withInput('video.mp4')
    ->withCRF(28)
    ->sampleEncode();

Hardware Acceleration

Enable VAAPI for faster encoding:

$result = AbAv1::encode()
    ->withInput('video.mp4')
    ->withPreset('medium')
    ->withMinVMAF(95)
    ->withFFmpegOptions([
        'hwaccel' => 'vaapi',
        'hwaccel_output_format' => 'vaapi',
    ])
    ->autoEncode();

Testing

composer test

Documentation

See examples/basic-usage.php for comprehensive usage examples.

For detailed documentation, see the generated docs.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

  • 总下载量: 3.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固