Ejemplo n.º 1
0
$video_to_process = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'to-be-processed/cat.mpeg';
$watermark = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'watermark.png';
// 	$watermark 		  = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH.'watermark.gif';
//	output files dirname has to exist
$video_output_dir = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'processed/videos/';
//	output files dirname has to exist
$thumbnail_output_dir = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'processed/thumbnails/';
//	log dir
$log_dir = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'logs/';
// 	start PHPVideoToolkit class
$toolkit = new PHPVideoToolkit($tmp_dir);
$use_vhook = !isset($_GET['gd']) || $_GET['gd'] == '0';
if ($use_vhook) {
    // 		check to see if vhook support is enabled
    echo '<strong>Testing for vhook support...</strong><br />';
    if (!$toolkit->hasVHookSupport() && !$_GET['dev']) {
        echo 'You FFmpeg binary has NOT been compiled with vhook support, you can not watermark video, you can however watermark image outputs.<br /><a href="?gd=1">Click here</a> to run the watermark demo on images only.<br />';
        exit;
        //<-		exits
    }
    echo 'You FFmpeg binary has been compiled with vhook support.<br /><br />';
} else {
    echo '<strong>GD watermarking only...</strong><br />';
    echo 'Your FFmpeg binary has NOT been compiled with vhook support and we are only testing automated watermarking of images via GD now.<br /><a href="?gd=0">Click here</a> to go back to the vhook watermarking demo.<br /><br />';
}
// 	set ffmpeg class to run silently
$toolkit->on_error_die = FALSE;
// 	get the filename parts
$filename = basename($video_to_process);
$filename_minus_ext = substr($filename, 0, strrpos($filename, '.'));
// 	set the input file