PHP code example of foxws / laravel-ab-av1

1. Go to this page and download the library: Download foxws/laravel-ab-av1 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

foxws / laravel-ab-av1 example snippets


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()}";

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

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

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

$result = AbAv1::encode()
    ->withInput('video.mp4')
    ->withPreset('medium')
    ->withMinVMAF(95)
    ->withFFmpegOptions([
        'hwaccel' => 'vaapi',
        'hwaccel_output_format' => 'vaapi',
    ])
    ->autoEncode();
bash
php artisan vendor:publish --provider="Foxws\AbAv1\AbAv1ServiceProvider"
bash
php artisan ab-av1:info