예제 #1
0
 * if it is converted then activate it and let it go
 */
//Sleeping..
//sometimes video is inserted after video conversion so in this case, video can get lost
$in_bg_cron = true;
include dirname(__FILE__) . "/../includes/config.inc.php";
cb_call_functions('verify_converted_videos_cron');
if ($argv[1]) {
    $fileName = $argv[1];
} else {
    $fileName = false;
}
if (isset($_GET['filename'])) {
    $fileName = $_GET['filename'];
}
$files = get_video_being_processed($fileName);
if (is_array($files)) {
    foreach ($files as $file) {
        $file_details = get_file_details($file['cqueue_name'], true);
        //Thanks to pandusetiawan @ forums.clip-bucket.com
        if ($file_details['conversion_status'] == 'failed' or strpos($file_details['conversion_log'], 'conversion_status : failed') > 0) {
            update_processed_video($file, 'Failed', $ffmpeg->failed_reason);
            $db->update(tbl("conversion_queue"), array("cqueue_conversion"), array("yes"), " cqueue_id = '" . $file['cqueue_id'] . "'");
            /**
             * Calling Functions after converting Video
             */
            if (get_functions('after_convert_functions')) {
                foreach (get_functions('after_convert_functions') as $func) {
                    if (@function_exists($func)) {
                        $func($file_details);
                    }
예제 #2
0
//sometimes video is inserted after video conversion so in this case, video can get lost
//if($argv[2]=='sleep')
//sleep(10);
$in_bg_cron = true;
include dirname(__FILE__) . "/../includes/config.inc.php";
cb_call_functions('verify_converted_videos_cron');
if ($argv[1]) {
    $filename = $argv[1];
} else {
    if ($_GET['filename']) {
        $filename = $_GET['filename'];
    } else {
        $filename = false;
    }
}
$queues = get_video_being_processed($filename);
foreach ($queues as $video) {
    $files = $video['files'];
    $videoid = $video['videoid'];
    //Deactivating the queue..in case its completed and active..
    if ($video['queue_status'] == 's') {
        $cbupload->deactivate_queue($video['file_name']);
    }
    //Checking if video was in processing state then change its status
    //to something reliable..
    $video_status = $video['status'];
    if ($video_status == 'Processing') {
        if ($files) {
            foreach ($files as $file) {
                if ($file['status'] == 's' && $file['is_original'] == 'no') {
                    $video_status = 'Successful';