PHP code example of php-mp4box / php-mp4box

1. Go to this page and download the library: Download php-mp4box/php-mp4box 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/ */

    

php-mp4box / php-mp4box example snippets


$mp4box = MP4Box\MP4Box::create();

$mp4box = MP4Box\MP4Box::create(array(
    'timeout'         => 42,
    'mp4box.bonaries' => '/path/to/custom/binary',
), $logger);

$mp4box->process('video.mp4');

$mp4box->process('video.mp4', 'output.mp4');

$app = new Silex\Application();
$app->register(new MP4Box\MP4BoxServiceProvider(), array(
    'mp4box.configuration' => array(
        'mp4box.binaries' => '/path/to/custom/binary',
        'timeout'         => 42,
    ),
    'mp4box.logger'  => $app->share(function () {
        return $app['monolog']; // use Monolog service provider
    }),
));