Exemple #1
0
// 	set the input file
$ok = $toolkit->setInputFile($video_to_process);
// 	check the return value in-case of error
if (!$ok) {
    // 		if there was an error then get it
    echo '<b>' . $toolkit->getLastError() . "</b><br />\r\n";
    exit;
}
// 	set the output dimensions
$toolkit->setVideoOutputDimensions(PHPVideoToolkit::SIZE_SAS);
// 	are we vhooking the videos?
if ($use_vhook) {
    $toolkit->addWatermark($watermark);
    $ok = $toolkit->setOutput($video_output_dir, $filename_minus_ext . '-watermarked.3gp', PHPVideoToolkit::OVERWRITE_EXISTING);
} else {
    $toolkit->addGDWatermark($watermark, array('x-offset' => -15, 'y-offset' => -15, 'position' => 'center-middle'));
    // 		extract a single frame
    $toolkit->extractFrame('00:00:03.5');
    $ok = $toolkit->setOutput($thumbnail_output_dir, $filename_minus_ext . '-watermarked.jpeg', PHPVideoToolkit::OVERWRITE_EXISTING);
}
// 	set the output details
// 	check the return value in-case of error
if (!$ok) {
    // 		if there was an error then get it
    echo '<b>' . $toolkit->getLastError() . "</b><br />\r\n";
    exit;
}
// 	execute the ffmpeg command
$result = $toolkit->execute(false, true);
// 	get the last command given
// 	$command = $toolkit->getLastCommand();