} } } Logger::$PATH = Conf::LOGDIR; Logger::getLogger(Conf::CONVERTLOGFILE)->log("---Folders Checked---"); function mbBasename($file) { return explode('/', $file); } function getThreads() { $cores = `cat /proc/cpuinfo | grep 'cpu cores'`; $threads = trim(end(explode(":", $cores))) - 1; return (int) $threads === 0 ? 1 : $threads; } $threads = getThreads(); while (true) { foreach ($inputdirarray as $inputdir) { $re = "/(\\.mov\$)|(\\.mpg\$)|(\\.mpeg\$)|(\\.mkv\$)|(\\.mp4\$)|(\\.avi\$)|(\\.wmv\$)|(\\.ts\$)|(\\.flv\$)|(\\.mjpg\$)/i"; $outputdir = Conf::CONVERTDIR . "/" . $inputdir; foreach (glob(Conf::UPLOADDIR . "/" . $inputdir . "/*.*") as $filename) { if (preg_match($re, $filename)) { $inputfile = "{$filename} size " . filesize($filename); $outfilename = $outputdir . "/" . pathinfo($filename, PATHINFO_FILENAME) . ".mp4"; FFmpeg::$source = $filename; FFmpeg::$dest = $outfilename; $cmd = FFmpeg::init(); sleep(1); Logger::getLogger(Conf::CONVERTLOGFILE)->log("Using threads = " . $threads . "\n" . "video file found in " . $dirs[0] . "/" . $inputdir . "\n" . "cmd=" . $cmd); $exit_code = 3; $ffmpeg_error = 0;
if ($to != "") { $function = "contact"; if ($content != "" && $from != "") { sendSMS($account, $to, $from, $content); } } $limit = 100; // Set a limit of items per page $threads_per_page = 20; // limit of items to display for page, contacts or messages $threads_offset = filter_var($_REQUEST['offset'], FILTER_SANITIZE_NUMBER_INT); //offset from begining of messages to display if ($threads_offset == "") { $threads_offset = 0; //default offset value } if ($function == "contact") { $allthreads = getThreads($account, $limit, $phoneNumbers, $to); $threads = array_slice($allthreads[$to], $threads_offset, $threads_per_page); include "view-single-thread.php"; } else { $allthreads = getThreads($account, $limit, $phoneNumbers); $threads = array_slice($allthreads, $threads_offset, $threads_per_page); include "view-threads-list.php"; } ?> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.7.1/js/lightbox.min.js"></script> <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.7.1/css/lightbox.css" />