PHP code example of burakboz / handbrake-php
1. Go to this page and download the library: Download burakboz/handbrake-php 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/ */
burakboz / handbrake-php example snippets
urakBoz\Handbrake as HB;
$config = new HB\Config;
// Set Type40 Defaults
$config->handBrakeBinary = '/custom/path/HandBrakeCLI';
$config->input = '/home/user/test.avi';
$config->output = '/var/www/';
$config->audioLanguage = 'English';
$config->bitRate = '384k';
$config->mixdown = '6ch';
$config->videoRate = '23.976';
$config->audioRate = '48';
$config->encodingSceme = 'x264';
$config->quality = '25';
$config->frameRateType = 'cfr';
$config->additionalData =
'level=4.1:cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=4:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all';
$configuration = $config->getConfig();
$hb = new HB\Handbrake($configuration);
echo $hb->run();
bash
$ composer