2009-08-25 12:16:42 +00:00
|
|
|
<?php
|
|
|
|
/***
|
|
|
|
* Written by : Arslan Hassan
|
|
|
|
* Software : ClipBucket v2
|
|
|
|
* License : CBLA
|
|
|
|
*///
|
|
|
|
|
|
|
|
|
|
|
|
include(dirname(__FILE__)."/../includes/config.inc.php");
|
|
|
|
|
|
|
|
$SYSTEM_OS = $row['sys_os'] ? $row['sys_os'] : 'linux';
|
|
|
|
|
|
|
|
//Including FFMPEG CLASS
|
|
|
|
require_once(BASEDIR.'/includes/classes/conversion/ffmpeg.win32.php');
|
|
|
|
|
|
|
|
//Get Vido
|
|
|
|
$queue_details = get_queued_video();
|
|
|
|
|
|
|
|
//Setting up details, moving files
|
|
|
|
$tmp_file = $queue_details['cqueue_name'];
|
|
|
|
$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;
|
|
|
|
|
|
|
|
//rcopy($temp_file,$orig_file);
|
|
|
|
rename($temp_file,$orig_file);
|
|
|
|
|
2009-09-28 05:23:50 +00:00
|
|
|
$configs = array
|
|
|
|
(
|
|
|
|
'use_video_rate' => true,
|
|
|
|
'use_video_bit_rate' => true,
|
|
|
|
'use_audio_rate' => true,
|
|
|
|
'use_audio_bit_rate' => true,
|
|
|
|
'format' => 'flv',
|
|
|
|
'video_codec'=>'flv',
|
|
|
|
'audio_rate'=>22050,
|
|
|
|
'audio_bitrate'=>128000,
|
|
|
|
'video_bitrate'=>512000,
|
|
|
|
'video_width'=>400,
|
|
|
|
'video_height'=>300,
|
|
|
|
'resize'=>'max'
|
|
|
|
);
|
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
|
|
|
|
$ffmpeg = new ffmpeg($orig_file);
|
|
|
|
$ffmpeg->configs = $configs;
|
|
|
|
$ffmpeg->gen_thumbs = TRUE;
|
|
|
|
$ffmpeg->gen_big_thumb = TRUE;
|
|
|
|
$ffmpeg->output_file = VIDEOS_DIR.'/'.$tmp_file.'.flv';
|
2009-09-28 05:23:50 +00:00
|
|
|
$ffmpeg->two_pass = FALSE;
|
|
|
|
$ffmpeg->remove_input=FALSE;
|
2009-08-25 12:16:42 +00:00
|
|
|
$ffmpeg->ClipBucket();
|
|
|
|
|
2009-09-28 05:23:50 +00:00
|
|
|
exit();
|
2009-08-25 12:16:42 +00:00
|
|
|
$db->update("conversion_queue",
|
|
|
|
array("cqueue_conversion"),
|
|
|
|
array("yes")," cqueue_id = '".$queue_details['cqueue_id']."'");
|
|
|
|
|
|
|
|
update_processed_video($queue_details);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|