Fixed : Video Conversion :)

Added : Photos.php
This commit is contained in:
Arslan Hassan 2011-01-10 14:59:36 +00:00
parent 3d6273c95f
commit c79dca8203
4 changed files with 120 additions and 66 deletions

View file

@ -9,10 +9,15 @@ $in_bg_cron = true;
include(dirname(__FILE__)."/../includes/config.inc.php");
//Calling Cron Functions
cb_call_functions('verify_converted_videos_cron');
$files = get_video_being_processed();
if($argv[1])
$fileName = $argv[1];
else
$fileName = false;
$files = get_video_being_processed($fileName);
if(is_array($files))
foreach($files as $file)
{
@ -24,7 +29,7 @@ foreach($files as $file)
$db->update(tbl("conversion_queue"),
array("cqueue_conversion"),
array("yes")," cqueue_id = '".$file['cqueue_id']."'");
update_processed_video($file,'Failed');
update_processed_video($file,'Failed',$ffmpeg->failed_reason);
/**
* Calling Functions after converting Video
@ -38,7 +43,6 @@ foreach($files as $file)
}
}
}elseif($file_details['conversion_status']=='completed')
{

View file

@ -10,10 +10,10 @@
**/
ini_set('mysql.connect_timeout','6000');
$in_bg_cron = true;
ini_set('mysql.connect_timeout','6000');
include(dirname(__FILE__)."/../includes/config.inc.php");
//Calling Cron Functions
@ -67,6 +67,7 @@ if($argv[1])
$fileName = $argv[1];
else
$fileName = false;
//Get Vido
$queue_details = get_queued_video(TRUE,$fileName);
@ -80,6 +81,8 @@ $tmp_ext = $queue_details['cqueue_tmp_ext'];
$ext = $queue_details['cqueue_ext'];
if(!empty($tmp_file)){
$temp_file = TEMP_DIR.'/'.$tmp_file.'.'.$tmp_ext;
$orig_file = CON_DIR.'/'.$tmp_file.'.'.$ext;
@ -154,60 +157,24 @@ $orig_file = CON_DIR.'/'.$tmp_file.'.'.$ext;
$ffmpeg->keep_original = config('keep_original');
$ffmpeg->original_output_path = ORIGINAL_DIR.'/'.$tmp_file.'.'.$ext;
$ffmpeg->ClipBucket();
//Converting File In HD Format
$hq_output = config('hq_output');
cb_call_functions('verify_converted_videos_cron');
$files = get_video_being_processed($fileName);
if(is_array($files))
foreach($files as $file)
////exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php &> /dev/null &");
if (stristr(PHP_OS, 'WIN'))
{
$file_details = get_file_details($file['cqueue_name']);
//pr($file_details);
if($file_details['conversion_status']=='failed')
{
$db->update(tbl("conversion_queue"),
array("cqueue_conversion"),
array("yes")," cqueue_id = '".$file['cqueue_id']."'");
update_processed_video($file,'Failed',$ffmpeg->failed_reason);
/**
* 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);
}
}
}elseif($file_details['conversion_status']=='completed')
{
$db->update(tbl("conversion_queue"),
array("cqueue_conversion","time_completed"),
array("yes",time())," cqueue_id = '".$file['cqueue_id']."'");
update_processed_video($file,'Successful');
/**
* 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);
}
}
}
exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php $fileName");
} else {
exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php $fileName &> /dev/null &");
}
//Converting File In HD Format
if($ffmpeg->input_details['video_height']>'719')
$hq_output = config('hq_output');
else
$hq_output = 'no';
if($hq_output=='yes' && !$ffmpeg->failed_reason)
@ -233,20 +200,13 @@ $orig_file = CON_DIR.'/'.$tmp_file.'.'.$ext;
break;
}
}
////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");
// } else {
// exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php &> /dev/null &");
// }
//Calling Cron Functions
unlink($ffmpeg->input_file);
}
}else
fwrite($fo,"Unable to get Temp File\n");
fclose($fo);
?>

View file

@ -1572,7 +1572,7 @@
//First Check How Many Videos Are In Queu Already
$processing = $db->count(tbl("conversion_queue"),"cqueue_id"," cqueue_conversion='p' ");
if($processing<$max_conversion)
if(true)
{
if($fileName)
{

90
upload/photos.php Normal file
View file

@ -0,0 +1,90 @@
<?php
/*
********************************************************************
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
********************************************************************
*/
define("THIS_PAGE",'photos');
define("PARENT_PAGE",'photos');
require 'includes/config.inc.php';
$pages->page_redir();
$sort = $_GET['sort'];
$cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time']);
$content = mysql_clean('photos');
switch($sort)
{
case "most_recent":
default:
{
$cond['order'] = " date_added DESC";
}
break;
case "featured":
{
$cond['featured'] = "yes";
}
break;
case "most_viewed":
{
$cond['order'] = " views DESC";
}
break;
case "most_commented":
{
$cond['order'] = " total_comments DESC";
}
break;
case "most_items":
{
$cond['order'] = " total_objects DESC";
}
break;
}
switch($content)
{
case "videos":
{
$cond['type'] = "videos";
}
break;
case "photos":
{
$cond['type'] = "photos";
}
}
//Getting Collection List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,VLISTPP);
$clist = $cond;
$clist['limit'] = $get_limit;
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
//Collecting Data for Pagination
$ccount = $cond;
$ccount['count_only'] = true;
$total_rows = $cbcollection->get_collections($ccount);
$total_pages = count_pages($total_rows,VLISTPP);
//Pagination
$pages->paginate($total_pages,$page);
subtitle(lang('collections'));
//Displaying The Template
template_files('collections.html');
display_it();
?>