<?php define('FFMPEG_BINARY', get_binaries('ffmpeg')); define("thumbs_number", config('num_thumbs')); define('PROCESSESS_AT_ONCE', config('max_conversion')); $size12 = "0"; class FFMpeg { private $command = ""; public $defaultOptions = array(); public $videoDetails = array(); public $num = thumbs_number; private $options = array(); private $outputFile = false; private $inputFile = false; private $conversionLog = ""; public $ffMpegPath = FFMPEG_BINARY; private $mp4BoxPath = MP4Box_BINARY; private $flvTool2 = FLVTool2_BINARY; private $videosDirPath = VIDEOS_DIR; private $logDir = ""; public $log = ""; public $logs = ""; private $logFile = ""; private $sdFile = false; private $hdFile = false; public $file_name = ""; private $resolution16_9 = array('240' => array('428', '240'), '360' => array('640', '360'), '480' => array('854', '480'), '720' => array('1280', '720'), '1080' => array('1920', '1080')); // this is test comment private $resolution4_3 = array('240' => array('428', '240'), '360' => array('640', '360'), '480' => array('854', '480'), '720' => array('1280', '720'), '1080' => array('1920', '1080')); /*
/** * Function used to cheack weather MODULE is INSTALLED or NOT */ function check_module_path($params) { $rPath = $path = $params['path']; if ($path['get_path']) { $path = get_binaries($path); } $array = array(); $result = shell_output($path . " -version"); if ($result) { if (strstr($result, 'error') || strstr($result, 'No such file or directory')) { $error['error'] = $result; if ($params['assign']) { assign($params['assign'], $error); } return false; } if ($params['assign']) { $array['status'] = 'ok'; $array['version'] = parse_version($params['path'], $result); assign($params['assign'], $array); } else { return $result; } } else { if ($params['assign']) { assign($params['assign']['error'], "error"); } else { return false; } } }
<?php define('FFMPEG_BINARY', get_binaries('ffmpeg')); define('MEDIAINFO_BINARY', get_binaries('media_info')); define('FFPROBE', get_binaries('ffprobe_path')); define("thumbs_number", config('num_thumbs')); define('PROCESSESS_AT_ONCE', config('max_conversion')); $size12 = "0"; class FFMpeg { private $command = ""; public $defaultOptions = array(); public $videoDetails = array(); public $num = thumbs_number; private $options = array(); private $outputFile = false; private $inputFile = false; private $conversionLog = ""; public $ffMpegPath = FFMPEG_BINARY; private $mp4BoxPath = MP4Box_BINARY; private $flvTool2 = FLVTool2_BINARY; private $videosDirPath = VIDEOS_DIR; private $logDir = ""; public $log = ""; public $logs = ""; private $logFile = ""; private $sdFile = false; private $hdFile = false; public $file_name = ""; public $ratio = ""; public $log_file = "";
function check_mp4box($path) { $path = get_binaries($path); $matches = array(); $result = shell_output($path . " -version"); if ($result) { preg_match("/(?:version\\s)(\\d\\.\\d\\.(?:\\d|[\\w]+))/i", strtolower($result), $matches); if (count($matches) > 0) { $version = array_pop($matches); return $version; } return false; } elseif (preg_match("/GPAC version/i", $result)) { preg_match('@^(?:GPAC version)?([^-]+)@i', $result, $matches); $host = $matches[1]; // get last two segments of host name preg_match('/[^.]+\\.[^.]+$/', $host, $matches); //echo "{$matches[0]}\n"; $version = "{$matches[0]}"; return $version; } else { return false; } }
/** * @author : Arslan Hassan * @copyright : ClipBucket Conversion Kit 2012 * @license : AAL (Attribute Assurance License) * @package : ClipBucket CSDK * @version : 3.0 * @name : CBConverter * @todo : Convert Videos to Mp4,mp4-mobile, Flv, Ogg with H264 * */ /* * if(!defined('IN_CLIPBUCKET')) exit("Sorry, visitors not allowed"); */ define('FFMPEG', get_binaries('ffmpeg')); define('MPLAYER', config('mplayerpath')); define('MP4BOX', get_binaries('MP4Box')); define('MEDIAINFO', '/usr/bin/mediainfo'); /** * These static variables are already defined in ClipBucket, * if you are not using this SDK with ClipBucket, please uncomment * following static variables and define them accordingly * * define("TEMP_DIR","/path/to/temp_dir"); * */ class CBConverter { var $input; //Input File var $output; //Output File