tikiwiki/packages/tiki-pkg-mediaalchemyst/php-mp4box/php-mp4box
2023-11-20 20:52:04 +00:00
..
src/MP4Box Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
tests Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
.gitignore Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
.travis.yml Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
CHANGELOG.md Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
composer.json Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
composer.lock Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
LICENSE Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
phpunit-functional.xml.dist Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
phpunit.xml.dist Update: Tiki 26 path 2023-11-20 20:52:04 +00:00
README.md Update: Tiki 26 path 2023-11-20 20:52:04 +00:00

#PHP MP4Box

Build Status

PHP driver for MP4Box

API usage

To instantiate MP4Box driver, the easiest way is :

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

You can customize your driver by passing a Psr\Log\LoggerInterface or configuration options.

Available options are :

  • timeout : the timeout for the underlying process
  • mp4box.binaries : the path (or an array of paths) to custom binary.
$mp4box = MP4Box\MP4Box::create(array(
    'timeout'         => 42,
    'mp4box.bonaries' => '/path/to/custom/binary',
), $logger);

To process a mp4 file, use the process method :

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

If you do not want to process file in place, you can write the output in another file :

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

Silex Service Provider :

A Silex Service Provider is available, all parameters are optionals :

$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
    }),
));

License

MIT licensed