FFmpeg::input PHP Méthode

input() public méthode

public input ( string $file ) : object
$file string input file path @return object @access public @version 1.2 Fix by @propertunist
Résultat object
    public function input($file)
    {
        if (file_exists($file) and is_file($file)) {
            $this->set('i', '"' . $file . '"', false);
        } else {
            if (strstr($file, '%') !== false) {
                $this->set('i', '"' . $file . '"', false);
            } else {
                trigger_error("File {$file} doesn't exist", E_USER_ERROR);
            }
        }
        return $this;
    }

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;
All Usage Examples Of FFmpeg::input