Example #1
0
 /*
 	Delete the uploaded file from temp directory 
 	and move it into the conversion queue directory for conversion
 */
 if (isset($_GET['test'])) {
     copy($temp_file, $orig_file);
 } else {
     rename($temp_file, $orig_file);
 }
 /*
 	Preparing the configurations for video conversion from database
 */
 $configs = array('format' => 'mp4', 'video_codec' => config('video_codec'), 'audio_codec' => config('audio_codec'), 'audio_rate' => config("srate"), 'audio_bitrate' => config("sbrate"), 'video_rate' => config("vrate"), 'video_bitrate' => config("vbrate"), 'video_bitrate_hd' => config("vbrate_hd"), 'normal_res' => config('normal_resolution'), 'high_res' => config('high_resolution'), 'max_video_duration' => config('max_video_duration'), 'resize' => 'max', 'outputPath' => $fileDir);
 require_once BASEDIR . '/includes/classes/conversion/ffmpeg.class.php';
 $ffmpeg = new FFMpeg($configs, $log);
 $ffmpeg->ffmpeg($orig_file);
 $ffmpeg->file_name = $tmp_file;
 //$ffmpeg->logs = $log;
 $ffmpeg->ClipBucket();
 //logData(json_encode("in end video convert"));
 //$ffmpeg->convertVideo($orig_file);
 //exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php $orig_file");
 //exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php &> /dev/null &");
 if (stristr(PHP_OS, 'WIN')) {
     exec(php_path() . " -q " . BASEDIR . "/actions/verify_converted_videos.php {$orig_file} {$dosleep}");
 } elseif (stristr(PHP_OS, 'darwin')) {
     exec(php_path() . " -q " . BASEDIR . "/actions/verify_converted_videos.php {$orig_file} {$dosleep} </dev/null >/dev/null &");
 } else {
     exec(php_path() . " -q " . BASEDIR . "/actions/verify_converted_videos.php {$orig_file} {$dosleep} &> /dev/null &");
     logData(json_encode(php_path() . " -q " . BASEDIR . "/actions/verify_converted_videos.php {$orig_file} {$dosleep} &> /dev/null &"));
 }