aboutsummaryrefslogtreecommitdiff
path: root/libraries/phpvideotoolkit/examples/example-config.php
blob: 70540b7fbe10cbc284d8b7b44cb0a6022ac28d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php

	/* SVN FILE: $Id$ */
	
	ini_set('error_reporting', E_ALL);
	ini_set('track_errors', '1');
	ini_set('display_errors', '1');
	ini_set('display_startup_errors', '1');

// 	shortcut the DIRECTORY_SEPARATOR value
	if(!defined('DS'))
	{
		define('DS', DIRECTORY_SEPARATOR);
	}

// 	define the paths to the required binaries
// 	define('PHPVIDEOTOOLKIT_FFMPEG_BINARY', 'ffmpeg');
	define('PHPVIDEOTOOLKIT_FFMPEG_BINARY', 'c:/ffmpeg/ffmpeg.exe');
// 	define('PHPVIDEOTOOLKIT_FFMPEG_BINARY', '/usr/local/bin/ffmpeg');
	define('PHPVIDEOTOOLKIT_FLVTOOLS_BINARY', '/usr/bin/flvtool2');
	define('PHPVIDEOTOOLKIT_MENCODER_BINARY', '/usr/local/bin/mencoder'); // only required for video joining
	define('PHPVIDEOTOOLKIT_FFMPEG_WATERMARK_VHOOK', '/usr/local/lib/vhook/watermark.dylib'); // only required for video wartermarking
	// 	define('PHPVIDEOTOOLKIT_FFMPEG_BINARY', 'xxxx');
// 	define('PHPVIDEOTOOLKIT_FLVTOOLS_BINARY', 'xxxx');
// 	define('PHPVIDEOTOOLKIT_MENCODER_BINARY', 'xxxx'); // only required for video joining
// 	define('PHPVIDEOTOOLKIT_FFMPEG_WATERMARK_VHOOK', 'xxxx'); // only required for video wartermarking
	
// 	define the absolute path of the example folder so that the examples only have to be edited once
// 	REMEMBER the trailing slash
	define('PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_PATH', dirname(__FILE__).DS);

	if(PHPVIDEOTOOLKIT_FFMPEG_BINARY == 'xxxx' || PHPVIDEOTOOLKIT_FLVTOOLS_BINARY == 'xxxx' || PHPVIDEOTOOLKIT_MENCODER_BINARY == 'xxxx' || PHPVIDEOTOOLKIT_FFMPEG_WATERMARK_VHOOK == 'xxxx' || PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_PATH == 'xxxx')
	{
		die('<strong class="alert">Please open examples/example-config.php to set your servers values. Then <a href="?'.time().'">click here</a> to continue.</strong>');
//<-		exits 		
	}
	
// 	use a particular version for the examples
	$use_version = 'php5';
	$has_version_warning = false;
// 	check if php5 is ok
	if($use_version == 'php5' && version_compare(PHP_VERSION, '5.0.0', '<'))
	{
		$use_version = 'php4';
		$has_version_warning = true;
	}
// print_r(array($use_version, version_compare('4', PHP_VERSION, '<')));
// exit;
	if(!isset($ignore_demo_files) || !$ignore_demo_files)
	{
		$is_file = is_file(PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_PATH.'to-be-processed'.DS.'cat.mpeg');
		if($is_file)
		{
			if(!isset($ignore_config_output) || !$ignore_config_output) 
			{
				echo '<span class="alert">Please note that this example requires demo files. If you have not got these demo files you can download them from <a href="http://www.buggedcom.co.uk/ffmpeg">here</a>.<br /><br />This example will now quit.</span>';
				exit;
			}
		}
		else
		{
			if(!isset($ignore_config_output) || !$ignore_config_output) 
			{
				echo '<br />';
			}
		}
	}