FFmpeg::call PHP Méthode

call() public méthode

public call ( $method, $args = [] )
    public function call($method, $args = array())
    {
        if (method_exists($this, $method)) {
            return call_user_func_array(array($this, $method), is_array($args) ? $args : array($args));
        }
        throw new Exception('method doesnt exist');
    }

Usage Example

Exemple #1
0
<?php

/**
*	include FFmpeg class
**/
include DIRNAME(DIRNAME(__FILE__)) . '/src/ffmpeg.class.php';
/**
*	get options from database
**/
$options = array('duration' => 99, 'position' => 0, 'itsoffset' => 2);
/**
*	Create command
*/
$FFmpeg = new FFmpeg('/usr/local/bin/ffmpeg');
$FFmpeg->input('/var/media/original.avi');
$FFmpeg->transpose(0)->vflip()->grayScale()->vcodec('h264')->frameRate('30000/1001');
$FFmpeg->acodec('aac')->audioBitrate('192k');
foreach ($options as $option => $values) {
    $FFmpeg->call($option, $values);
}
$FFmpeg->output('/var/media/new.mp4', 'mp4');
print $FFmpeg->command;