Added : more sql
updated : more admin options added : conversion lab
This commit is contained in:
parent
3e49aab092
commit
b82e5b072c
15 changed files with 825 additions and 23 deletions
|
@ -1,3 +1,4 @@
|
|||
-- 434
|
||||
INSERT into cb_config (name,value) VALUES
|
||||
('load_upload_form','yes'),
|
||||
('load_remote_upload_form','yes'),
|
||||
|
@ -8,6 +9,14 @@ INSERT into cb_config (name,value) VALUES
|
|||
('photosSection','yes'),
|
||||
('homeSection','yes'),
|
||||
('uploadSection','yes'),
|
||||
('signupSection','yes')
|
||||
('signupSection','yes'),
|
||||
('collectionsSection','yes'),
|
||||
('channelsSection','yes');
|
||||
('channelsSection','yes');
|
||||
-- 434
|
||||
|
||||
--
|
||||
INSERT into cb_config (name,value) VALUES
|
||||
('flvtool++',''),
|
||||
('normal_resolution', '480'),
|
||||
('high_resolution', '720'),
|
||||
('max_video_duration','320');
|
25
upload/admin_area/conversion_lab.php
Normal file
25
upload/admin_area/conversion_lab.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
/**
|
||||
* View User Details
|
||||
* @author:Arslan
|
||||
* @Since : Oct 16 09
|
||||
*/
|
||||
require'../includes/admin_config.php';
|
||||
|
||||
|
||||
//Getting list of available testing videos
|
||||
$testVidsDir = ADMINBASEDIR.'/lab_resources/testing_videos';
|
||||
$vidFiles = glob($testVidsDir.'/*');
|
||||
$vdoFiles = array();
|
||||
foreach($vidFiles as $vidFile)
|
||||
{
|
||||
$vdoFiles[] = array('path'=>$vidFile,'name'=>getName($vidFile).'.'.getExt($vidFile));
|
||||
}
|
||||
|
||||
assign('vdoFiles',$vdoFiles);
|
||||
|
||||
|
||||
subtitle("Conversion lab for ClipBucket conversion testing");
|
||||
template_files("conversion_lab.html");
|
||||
display_it();
|
||||
?>
|
3
upload/admin_area/lab_resources/echo.php
Normal file
3
upload/admin_area/lab_resources/echo.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
echo "Pakistan Zindabad!! ^_^";
|
||||
?>
|
156
upload/admin_area/lab_resources/experiments.php
Normal file
156
upload/admin_area/lab_resources/experiments.php
Normal file
|
@ -0,0 +1,156 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @Software : ClipBucket
|
||||
* @Author : Arslan Hassan
|
||||
* @Since : Jan 5 2009
|
||||
* @Function : Add Member
|
||||
* @License : Attribution Assurance License -- http://www.opensource.org/licenses/attribution.php
|
||||
*/
|
||||
|
||||
//setting timeout so that server just dont stuck, right for just 25 seconds
|
||||
if(!ini_get('safe_mode'))
|
||||
set_time_limit(25);
|
||||
|
||||
require'../../includes/admin_config.php';
|
||||
require_once(BASEDIR.'/includes/classes/conversion/ffmpeg.class.php');
|
||||
$testVidsDir = ADMINBASEDIR.'/lab_resources/testing_videos';
|
||||
|
||||
$userquery->admin_login_check();
|
||||
|
||||
if(isset($_POST['experiment']))
|
||||
{
|
||||
$mode = $_POST['mode'];
|
||||
$victim = $_POST['victim'];
|
||||
|
||||
switch($mode)
|
||||
{
|
||||
default:
|
||||
echo json_encode(array("err"=>"DUDE!!Why The Hell You Are Playing With The Code :/"));
|
||||
break;
|
||||
|
||||
case "getPreDetails":
|
||||
{
|
||||
$err = array();
|
||||
$msg = array();
|
||||
|
||||
if(!function_exists("exec"))
|
||||
{
|
||||
$err[] = "<br>C'mon man! there shuld be some 'exec' functions :(";
|
||||
$err[] = "<div class=\"expErr\">Exec function does not exist</div>";
|
||||
theEnd();
|
||||
}else
|
||||
$msg[] = "<div class=\"expOK\">Exec function exists</div>";
|
||||
|
||||
//testing php compatiblity
|
||||
$phpTest = shell_output(php_path()." -q ".ADMINBASEDIR.'/lab_resources/echo.php');
|
||||
if(!$phpTest)
|
||||
{
|
||||
$err[] = "<br>OMG! Your host is so chipless that it doesn't even allow you to use PHP CLI , very bad!";
|
||||
$err[] = "<div class=\"expErr\">PHP CLI is not enabled</div>";
|
||||
theEnd();
|
||||
}else
|
||||
$msg[] = "<div class=\"expOK\">PHP CLI is enabled</div>";
|
||||
|
||||
//now get ffmpeg details
|
||||
$ffmpegDetails = shell_output($Cbucket->configs['ffmpegpath']." -version ");
|
||||
|
||||
if(!$ffmpegDetails)
|
||||
{
|
||||
$err[] = '<br>How can human work without brain? same situation is with video conversion, no ffmpeg, no conversion.';
|
||||
$err[] = "<div class=\"expErr\">FFMPEG does not exist</div>";
|
||||
theEnd();
|
||||
}else{
|
||||
|
||||
$msg[] = "<br>".nl2br($ffmpegDetails);
|
||||
$msg[] = "<div class=\"expOK\">FFMPEG Exists</div>";
|
||||
}
|
||||
|
||||
$flvtool2Details = shell_output($Cbucket->configs['flvtool2path']." -version ");
|
||||
|
||||
if(!$flvtool2Details)
|
||||
{
|
||||
$err[] = '<br>Ah, no flvtool2 :O, its like a "Salt" for video files..food without salt is tasteless,
|
||||
so video is streamless without flvtool2';
|
||||
$err[] = "<div class=\"expErr\">flvtool2 does not exist</div>";
|
||||
theEnd();
|
||||
}else{
|
||||
|
||||
$msg[] = "<br>".nl2br($flvtool2Details);
|
||||
$msg[] = "<div class=\"expOK\">Flvtool2 Exists</div>";
|
||||
}
|
||||
|
||||
$victimFile = $testVidsDir.'/'.$victim;
|
||||
//getting video details..
|
||||
$ffmpegObj = new ffmpeg($victimFile);
|
||||
$vidDetails = $ffmpegObj->get_file_info();
|
||||
if(!$vidDetails)
|
||||
{
|
||||
|
||||
$err[] = "<br>".nl2br(shell_output($Cbucket->configs['ffmpegpath'].' -i '.$victimFile));
|
||||
if(!file_exists($victimFile) && $victim)
|
||||
$err[] = "<div class=\"expErr\">File does not exist</div>";
|
||||
else
|
||||
$err[] = "<div class=\"expErr\">What the...post the above ffmpeg log and let scientist do their job</div>";
|
||||
theEnd();
|
||||
}else
|
||||
{
|
||||
$msg[] = "<br>".nl2br(shell_output($Cbucket->configs['ffmpegpath'].' -i '.$victimFile));
|
||||
$msg[] = "<div class=\"expOK\">Video file is convertable..</div>";
|
||||
}
|
||||
|
||||
|
||||
theEnd('convertVideo1');
|
||||
}
|
||||
break;
|
||||
|
||||
case "convertVideo1":
|
||||
{
|
||||
$victimFile = $testVidsDir.'/'.$victim;
|
||||
$victimOutput = $testVidsDir.'/output.flv';
|
||||
if(file_exists($victimOutput))
|
||||
unlink($victimOutput);
|
||||
$ffmpeg = $Cbucket->configs['ffmpegpath'];
|
||||
$ffmpegCommand = $ffmpeg." -i $victimFile -f flv ".$victimOutput;
|
||||
$msg[] = "FFMPEG Command So far<br><pre class='code'>$ffmpegCommand</pre>";
|
||||
//Lets start conversing videos
|
||||
$converDetails = shell_output($ffmpegCommand);
|
||||
$msg[] = "<br>".nl2br($converDetails);
|
||||
//now lets get details of video
|
||||
$ffmpegObj = new ffmpeg($victimOutput);
|
||||
$vidDetails = $ffmpegObj->get_file_info();
|
||||
if(!$vidDetails)
|
||||
{
|
||||
|
||||
if(!file_exists($victimFile) && $victim)
|
||||
$err[] = "<div class=\"expErr\">No output file...your ffmpeg is not compatible</div>";
|
||||
else
|
||||
$err[] = "<div class=\"expErr\">No output file...hmm post the log to dev team</div>";
|
||||
if(filesize($victimOutput)>0)
|
||||
$err[] = "<br>".nl2br(shell_output($Cbucket->configs['ffmpegpath'].' -i '.$victimOutput));
|
||||
theEnd();
|
||||
}else
|
||||
{
|
||||
$msg[] = "<br>".nl2br(shell_output($Cbucket->configs['ffmpegpath'].' -i '.$victimOutput));
|
||||
$msg[] = "<div class=\"expOK\">Video file is converted =D..</div>";
|
||||
}
|
||||
|
||||
theEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function theEnd($status=false)
|
||||
{
|
||||
global $msg, $err;
|
||||
if($err)
|
||||
$errors = implode('',$err);
|
||||
if($msg)
|
||||
$messgs = implode('',$msg);
|
||||
|
||||
echo json_encode(array('err'=>$errors,'msg'=>$messgs,'status'=>$status));
|
||||
exit();
|
||||
}
|
||||
?>
|
|
@ -68,6 +68,7 @@ if(isset($_POST['update'])){
|
|||
|
||||
'ffmpegpath' ,
|
||||
'flvtool2path',
|
||||
'flvtoolpp',
|
||||
'ffmpeg_type',
|
||||
|
||||
'gravatars',
|
||||
|
@ -79,7 +80,8 @@ if(isset($_POST['update'])){
|
|||
'grp_max_title',
|
||||
'grp_max_desc',
|
||||
'groupsSection',
|
||||
|
||||
|
||||
'high_resolution',
|
||||
'hq_output',
|
||||
|
||||
'keywords' ,
|
||||
|
@ -109,7 +111,9 @@ if(isset($_POST['update'])){
|
|||
'max_comment_chr',
|
||||
'max_time_wait',
|
||||
'max_upload_size',
|
||||
'mplayerpath',
|
||||
|
||||
'normal_resolution',
|
||||
'num_thumbs',
|
||||
|
||||
'php_path',
|
||||
|
|
BIN
upload/admin_area/styles/cbv2/images/botal.png
Normal file
BIN
upload/admin_area/styles/cbv2/images/botal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
85
upload/admin_area/styles/cbv2/layout/conversion_lab.html
Normal file
85
upload/admin_area/styles/cbv2/layout/conversion_lab.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<script>
|
||||
var labRUrl = '{$smarty.const.ADMIN_BASEURL}/lab_resources';
|
||||
{literal}
|
||||
function experimentPart(mode)
|
||||
{
|
||||
if(mode=='getPreDetails')
|
||||
$('#expOut').html('');
|
||||
|
||||
var victim = $('#victim option:selected').val();
|
||||
|
||||
var expHeads =
|
||||
{
|
||||
'getPreDetails' : "Getting modules and video details...",
|
||||
'convertVideo1' : "Testing "+victim+" conversion Phase 1.."
|
||||
}
|
||||
|
||||
$('#expOut').append('<div class="expHead" onClick="$(\'#'+mode+'\').slideToggle()" >'+expHeads[mode]+'</div>');
|
||||
|
||||
$('#expOut').append('<div id="loadinDetails">please wait...</div>');
|
||||
|
||||
$.post(labRUrl+'/experiments.php',{
|
||||
"experiment":"yes",mode : mode,"victim":victim},
|
||||
function(data){
|
||||
|
||||
var dataMsg = "";
|
||||
var dataErr = "";
|
||||
|
||||
if(data.err)
|
||||
dataErr = data.err;
|
||||
|
||||
if(data.msg)
|
||||
dataMsg = data.msg;
|
||||
|
||||
$('#loadinDetails').after("<div id='"+mode+"'>"+dataMsg+dataErr+"</div>");
|
||||
$('#loadinDetails').remove();
|
||||
|
||||
if(data.status)
|
||||
{
|
||||
$('#'+mode).slideToggle();
|
||||
experimentPart(data.status)
|
||||
}
|
||||
}
|
||||
,"json");
|
||||
}
|
||||
{/literal}
|
||||
|
||||
</script>
|
||||
{literal}
|
||||
<style>
|
||||
.expHead{ color:#fff; font-size:13px; font-weight:bold; background-color:#0099cc; padding:3px; font-family:Arial, Helvetica, sans-serif;
|
||||
margin-bottom:5px; cursor:pointer}
|
||||
#expOut{margin-top:10px;}
|
||||
.expMsg{margin-bottom:20px}
|
||||
.expOK{ height:16px; {/literal}background:url({$imageurl}/button_ok.png){literal} no-repeat; padding-left:18px; color:#2C7300; font-weight:bold}
|
||||
.expErr{ height:16px; {/literal}background:url({$imageurl}/error.png){literal} no-repeat; padding-left:18px; color:#ed0000; font-weight:bold}
|
||||
|
||||
</style>
|
||||
{/literal}
|
||||
|
||||
<h2>Conversion lab - BETA</h2><img src="{$imageurl}/botal.png"><br />
|
||||
<div style="margin:10px 0px">
|
||||
Conversion environment for clipbucket users so they can test why their videos are not converting.
|
||||
This test is in early beta stages, we are hopeful to get best outcome results.</div>
|
||||
<div style="font-family:Tahoma; font-size:11px; margin-bottom:10px">
|
||||
<span>Current scientists</span> : <strong>Arslan Hassan</strong><br>
|
||||
<span>Current version</span> : <strong>1.0 α</strong></div>
|
||||
|
||||
<span style="font-size:13px; font-weight:bold">Choose your victim</span>
|
||||
<label for="victim"></label>
|
||||
<select name="victim" id="victim" style="border:1px solid #DBDBDB; padding:2px">
|
||||
{if $vdoFiles}
|
||||
{foreach from=$vdoFiles item=vFile}
|
||||
<option value="{$vFile.name}">{$vFile.name}</option>
|
||||
{/foreach}
|
||||
{else}
|
||||
<option value="">No victim found</option>
|
||||
{/if}
|
||||
</select>
|
||||
<input type="submit" name="button" id="button" value="Start Experiment..." onClick="experimentPart('getPreDetails')">
|
||||
|
||||
|
||||
|
||||
<div id="expOut">
|
||||
|
||||
</div>
|
|
@ -11,6 +11,80 @@ $(document).ready(function(){
|
|||
display_tab('#tab_'+thehash,'div_'+thehash);
|
||||
}
|
||||
|
||||
|
||||
$('#convProfile').change(function
|
||||
(){
|
||||
var value = $("#convProfile option:selected").val();
|
||||
if(value>0)
|
||||
setVdoSettings(value);
|
||||
});
|
||||
|
||||
function setVdoSettings(inType)
|
||||
{
|
||||
switch(inType)
|
||||
{
|
||||
default:
|
||||
{
|
||||
|
||||
var convConfigs = {
|
||||
'video_codec': 'libx264',
|
||||
'audio_codec': 'libfaac' ,
|
||||
'vrate' : '25',
|
||||
'vbrate' : '512000',
|
||||
'srate' : '22050',
|
||||
'sbrate' : '128000',
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
case '2':
|
||||
{
|
||||
var convConfigs = {
|
||||
'video_codec': 'flv',
|
||||
'audio_codec': 'libmp3lame' ,
|
||||
'vrate' : '25',
|
||||
'vbrate' : '512000',
|
||||
'srate' : '22050',
|
||||
'sbrate' : '128000',
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
case '3':
|
||||
{
|
||||
var convConfigs = {
|
||||
'video_codec': 'libx264',
|
||||
'audio_codec': 'libfaac' ,
|
||||
'vrate' : '30',
|
||||
'vrate' : '30',
|
||||
'vbrate' : '640000',
|
||||
'srate' : '44100',
|
||||
'sbrate' : '320000',
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
case '4':
|
||||
{
|
||||
var convConfigs = {
|
||||
'video_codec': 'flv',
|
||||
'audio_codec': 'libmp3lame' ,
|
||||
'vrate' : '25',
|
||||
'vbrate' : '256000',
|
||||
'srate' : '22050',
|
||||
'sbrate' : '96000',
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$.each(convConfigs,function(index,value){
|
||||
$('#'+index).val(value);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
@ -380,7 +454,7 @@ $(document).ready(function(){
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" valign="top">FFMPEG Binary Path</td>
|
||||
<td width="200" valign="top">FFMPEG Path</td>
|
||||
<td valign="top"><input name="ffmpegpath" type="text" id="ffmpegpath" value="{$row.ffmpegpath}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/ffmpeg" target="_blank">
|
||||
<img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="FFMPEG Binary Paths - Click For More Details" /></a><br />
|
||||
|
@ -394,23 +468,37 @@ $(document).ready(function(){
|
|||
<a href="javascript:void(0)" target="_blank"><img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="In latest releases of FFMPEG (greator than 20000) Pad flag has been changed from pad* to vf , if your ffmpeg is greator than r20000 please check YES " /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">PHP Binary Path</td>
|
||||
<td valign="top">PHP Path</td>
|
||||
<td valign="top"><input name="php_path" type="text" id="php_path" value="{$row.php_path}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/php" target="_blank">
|
||||
<img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="PHP Binary Paths - Click For More Details" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Mp4 Binary Path</td>
|
||||
<td valign="top">MP4Box Path</td>
|
||||
<td valign="top"><input name="mp4boxpath" type="text" id="mp4boxpath" value="{$row.mp4boxpath}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/mp4box" target="_blank">
|
||||
<img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="MP4Box Binary Paths - Click For More Details" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Flvtool2 Binary Path</td>
|
||||
<td valign="top">Flvtool2 Path</td>
|
||||
<td valign="top"><input name="flvtool2path" type="text" id="flvtool2path" value="{$row.flvtool2path}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/flvtool2" target="_blank">
|
||||
<img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="FLVTool2 Binary Paths - Click For More Details" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Mplayer Path</td>
|
||||
<td valign="top"><input name="mplayerpath" type="text" id="mplayerpath" value="{$row.mplayerpath}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/mplayer" target="_blank"><img src="{$imageurl}/help.png" alt="" border="0" class="tipsy_tip" title="MPlayer - Highly efficient library for generating thumbs from a video" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Flvtool++ Path</td>
|
||||
<td valign="top"><input name="flvtoolpp" type="text" id="flvtoolpp" value="{$row.flvtool2pp}" size="45" />
|
||||
<a href="http://docs.clip-bucket.com/clipbucket-docs/mplayer" target="_blank"><img src="{$imageurl}/help.png" alt="" border="0" class="tipsy_tip" title="FLVTool++ - Flv Meta Data Injector from Facebook, flvtool2 can take upto an hour which flvtool++ can do it in minutes, or sometimes seconds" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"> </td>
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Turn on Quick Conversion</td>
|
||||
<td valign="top">
|
||||
|
@ -447,6 +535,11 @@ $(document).ready(function(){
|
|||
<td><input name="max_upload_size" type="text" id="max_upload_size" value="{$row.max_upload_size}" size="15" maxlength="5" />
|
||||
in MegaBytes </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Max upload duration</td>
|
||||
<td><input name="max_video_duration" type="text" id="max_upload_duration" value="{$row.max_video_duration}" size="15" maxlength="5" />
|
||||
in minutes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Save original file </td>
|
||||
<td><input name="keep_original" type="checkbox" id="keep_original" value="1" {if $row.keep_original} checked="checked"{/if} /></td>
|
||||
|
@ -502,22 +595,22 @@ $(document).ready(function(){
|
|||
<td colspan="2" class="settings_inner_title">Conversion Settings</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Max Video Width</td>
|
||||
<td><input name="r_width" type="text" id="r_width" value="{$row.r_width}" size="45" /></td>
|
||||
<td>Normal video resolution</td>
|
||||
<td><label for="convProfile"></label>
|
||||
<label for="normal_resolution"></label>
|
||||
<select name="normal_resolution" id="normal_resolution">
|
||||
<option value="240" {if $row.normal_resolution=='240'} selected="selected"{/if}>240p</option>
|
||||
<option value="320" {if $row.normal_resolution=='320'} selected="selected"{/if}>320p</option>
|
||||
<option value="480" {if $row.normal_resolution=='480'} selected="selected"{/if}>480p</option>
|
||||
</select>
|
||||
<label for="high_resolution"></label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Max Video Height</td>
|
||||
<td><input name="r_height" type="text" id="r_height" value="{$row.r_height}" size="45" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Resize Type</td>
|
||||
<td><select name="resize" id="select">
|
||||
<option value="no" {if $row.resize ==no} selected="selected"{/if}>No</option>
|
||||
<option value="max" {if $row.resize ==max} selected="selected"{/if}>Max</option>
|
||||
<option value="WxH" {if $row.resize ==WxH} selected="selected"{/if}>Stretch</option>
|
||||
<option value="fit" {if $row.resize ==fit} selected="selected"{/if}>Aspect Ratio</option>
|
||||
</select> <a href="http://docs.clip-bucket.com/clipbucket-docs/resize-video-type" target="_blank">
|
||||
<img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="Resize Type Of Video - Click For More Details" /></a></td>
|
||||
<td>HQ video resolution</td>
|
||||
<td><select name="high_resolution" id="high_resolution">
|
||||
<option value="720" {if $row.high_resolution=='720'} selected="selected"{/if}>720p</option>
|
||||
<option value="1080" {if $row.high_resolution=='1080'} selected="selected"{/if}>1080p</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Thumb Width</td>
|
||||
|
@ -546,6 +639,17 @@ $(document).ready(function(){
|
|||
<tr>
|
||||
<td colspan="2" class="settings_inner_title">Change only if you have good knowledge of video conversion <a href="http://docs.clip-bucket.com/clipbucket-docs/video-conversion-settings" target="_blank"><img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="Video Conversion Info - Click For More Details" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Select profile</td>
|
||||
<td><label for="convProfile"></label>
|
||||
<select name="convProfile" id="convProfile">
|
||||
<option selected="selected" value="0">Choose from list</option>
|
||||
<option value="1">H.264, AAC - Youtube like</option>
|
||||
<option value="3">High Configurations with H264</option>
|
||||
<option value="2">Normal Configurations</option>
|
||||
<option value="4">Low Configurations</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Video Codec</td>
|
||||
<td><input name="video_codec" type="text" id="video_codec" value="{$row.video_codec}" size="45" /></td>
|
||||
|
|
|
@ -38,6 +38,7 @@ class ffmpeg
|
|||
var $input_ext = '';
|
||||
var $tmp_dir = '/';
|
||||
var $flvtool2 = '';
|
||||
var $flvtoolpp = '';
|
||||
var $thumb_dim = '120x90'; //Thumbs Dimension
|
||||
var $num_of_thumbs = '3'; //Number of thumbs
|
||||
var $big_thumb_dim = 'original'; //Big thumb size , original will get orginal video window size thumb othersie the dimension
|
||||
|
@ -47,9 +48,12 @@ class ffmpeg
|
|||
*/
|
||||
function ffmpeg($file)
|
||||
{
|
||||
global $Cbucket;
|
||||
$this->ffmpeg = FFMPEG_BINARY;
|
||||
$this->mp4box = MP4Box_BINARY;
|
||||
$this->flvtool2 = FLVTool2_BINARY;
|
||||
$this->flvtoolpp = $Cbucket->configs['flvtoolpp'];
|
||||
$this->mplayerpath = $Cbucket->configs['mplayerpath'];
|
||||
$this->input_file = $file;
|
||||
|
||||
}
|
||||
|
@ -265,7 +269,7 @@ class ffmpeg
|
|||
$this->log .= "Failed to stat file $path_source!\n";
|
||||
$info['size'] = (integer)$stats['size'];
|
||||
$this->ffmpeg." -i $path_source -acodec copy -vcodec copy -f null /dev/null 2>&1";
|
||||
$output = $this->exec( $this->ffmpeg." -i $path_source -acodec copy -vcodec copy -f null /dev/null 2>&1" );
|
||||
$this->raw_output = $output = $this->exec( $this->ffmpeg." -i $path_source -acodec copy -vcodec copy -f null /dev/null 2>&1" );
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -254,7 +254,8 @@ if(phpversion() < '5.2.0')
|
|||
define('FLVPLAYER',$row['player_file']);
|
||||
define('SUBTITLE',$row['code_dev']);
|
||||
//Javascript Directory Name
|
||||
define('ADMINDIR','admin_area'); //Admin Accissble Folder
|
||||
define('ADMINDIR','admin_area');
|
||||
define('ADMINBASEDIR',BASEDIR.'/admin_area'); //Admin Accissble Folder
|
||||
define('ADMIN_BASEURL',BASEURL.'/'.ADMINDIR);
|
||||
define('MODULEDIR',BASEDIR.'/modules'); //Modules Directory
|
||||
|
||||
|
|
243
upload/plugins/cb_link_video/cb_link_video.php
Normal file
243
upload/plugins/cb_link_video/cb_link_video.php
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Link video
|
||||
Description: If you want to play videos via link, this plugin is a good option for you
|
||||
Author: Arslan Hassan
|
||||
ClipBucket Version: 2
|
||||
Plugin Version: 1.0
|
||||
Website: http://clip-bucket.com/
|
||||
*/
|
||||
|
||||
|
||||
$Cbucket->upload_opt_list['link_video_link'] =
|
||||
array(
|
||||
'title' => 'Video Link',
|
||||
'load_func' => 'load_link_video_form',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Function used create duration from input
|
||||
* @param DURATION
|
||||
*/
|
||||
if(!function_exists('validate_duration'))
|
||||
{
|
||||
function validate_duration($time)
|
||||
{
|
||||
global $LANG;
|
||||
if(empty($time))
|
||||
return true;
|
||||
$time = explode(':',$time);
|
||||
if(count($time)>0)
|
||||
{
|
||||
$sec = 0;
|
||||
$total = count($time);
|
||||
|
||||
if($total==3)
|
||||
{
|
||||
$hrs = $time[0]*60*60;
|
||||
$mins = $time[1]*60;
|
||||
$secs = $time[2];
|
||||
}elseif($total==2)
|
||||
{
|
||||
$hrs = 0;
|
||||
$mins = $time[0]*60;
|
||||
$secs = $time[1];
|
||||
}else{
|
||||
$hrs = 0;
|
||||
$mins = 0;
|
||||
$secs = $time[0];
|
||||
}
|
||||
$sec = $hrs+$mins+$secs;
|
||||
if(!empty($sec))
|
||||
return $sec;
|
||||
else
|
||||
e(lang('invalid_duration'));
|
||||
}else{
|
||||
if(is_numeric($time))
|
||||
return $time;
|
||||
else
|
||||
e(lang('invalid_duration'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function check_remote_play_link($val)
|
||||
{
|
||||
//checking file exension
|
||||
$validExts = array('flv','mp4');
|
||||
$ext = getExt($val);
|
||||
if(!in_array($ext,$validExts) || !$val
|
||||
||
|
||||
( !stristr($val,'http://')
|
||||
&& !stristr($val,'https://')
|
||||
&& !stristr($val,'rtsp://')
|
||||
&& !stristr($val,'rtmp://') ))
|
||||
{
|
||||
e("Invalid video url");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to validate embed code
|
||||
*/
|
||||
function validate_video_link($val)
|
||||
{
|
||||
|
||||
if(empty($val) || $val=='none')
|
||||
{
|
||||
return 'none';
|
||||
}else{
|
||||
//checking file exension
|
||||
$validExts = array('flv','mp4');
|
||||
$ext = getExt($val);
|
||||
if(!in_array($ext,$validExts)
|
||||
||
|
||||
( !stristr($val,'http://')
|
||||
&& !stristr($val,'https://')
|
||||
&& !stristr($val,'rtsp://')
|
||||
&& !stristr($val,'rtmp://') ))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to load embed form
|
||||
*/
|
||||
function load_link_video_form($params)
|
||||
{
|
||||
global $file_name;
|
||||
if($params['class'])
|
||||
$class = ' '.$params['class'];
|
||||
assign('objId',RandomString(5));
|
||||
assign('class',$class);
|
||||
Template(PLUG_DIR.'/cb_link_video/form.html',false);
|
||||
}
|
||||
|
||||
$link_vid_field_array['remote_play_url'] = array
|
||||
(
|
||||
'title' =>'Link to video',
|
||||
'name' =>'remote_play_url',
|
||||
'db_field' =>'remote_play_url',
|
||||
'required' =>'no',
|
||||
'validate_function'=>'validate_video_link',
|
||||
'use_func_val' => true,
|
||||
'type' => 'textfield',
|
||||
'use_if_value' => true,
|
||||
'hint_2'=>'Type "none" to set as empty',
|
||||
'size'=>'45',
|
||||
'rows'=>5
|
||||
);
|
||||
|
||||
$link_vid_field_array['duration'] = array
|
||||
(
|
||||
'title' =>'Video duration',
|
||||
'name' =>'duration',
|
||||
'db_field' =>'duration',
|
||||
'required' =>'no',
|
||||
'validate_function'=>'validate_duration',
|
||||
'use_func_val' => true,
|
||||
'display_admin' => 'no_display',
|
||||
|
||||
);
|
||||
|
||||
$link_vid_field_array['thumb_file_field'] = array
|
||||
(
|
||||
'title' => 'Thumb File',
|
||||
'type' => 'fileField',
|
||||
'name' => 'thumb_file',
|
||||
'required' => 'no',
|
||||
'validate_function' => 'upload_thumb',
|
||||
'display_admin' => 'no_display',
|
||||
);
|
||||
|
||||
function clean_remote_code($input)
|
||||
{
|
||||
$input = htmlspecialchars($input);
|
||||
//if(!get_magic_quotes_gpc())
|
||||
// $input = addslashes($input);
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('upload_thumb'))
|
||||
{
|
||||
function upload_thumb($array)
|
||||
{
|
||||
|
||||
global $file_name,$LANG;
|
||||
|
||||
//Get File Name
|
||||
$file = $array['name'];
|
||||
$ext = getExt($file);
|
||||
$image = new ResizeImage();
|
||||
|
||||
if(!empty($file) && file_exists($array['tmp_name']) &&!error())
|
||||
{
|
||||
if($image->ValidateImage($array['tmp_name'],$ext)){
|
||||
$file = BASEDIR.'/files/thumbs/'.$_POST['file_name'].'.'.$ext;
|
||||
if(!file_exists($file))
|
||||
{
|
||||
move_uploaded_file($array['tmp_name'],$file);
|
||||
$image->CreateThumb($file,$file,THUMB_WIDTH,$ext,THUMB_HEIGHT,false);
|
||||
}
|
||||
}else{
|
||||
e(lang('vdo_thumb_up_err'));
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to check embed video
|
||||
* if video is embeded , it will check its code
|
||||
* if everthing goes ok , it will change its status to successfull
|
||||
* @param VID
|
||||
*/
|
||||
function remote_video_check($vid)
|
||||
{
|
||||
global $myquery,$db;
|
||||
if(is_array($vid))
|
||||
$vdetails = $vid;
|
||||
else
|
||||
$vdetails = $myquery->get_video_details($vid);
|
||||
|
||||
if(!empty($vdetails['remote_play_url']) && $vdetails['remote_play_url'] !=' ' && $vdetails['remote_play_url'] !='none')
|
||||
{
|
||||
$db->update(tbl("video"),array("status"),array('Successful')," videoid='$vid'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to play embed code
|
||||
* @param Video details
|
||||
*/
|
||||
function play_remote_video($vdetails)
|
||||
{
|
||||
if(!empty($vdetails['remote_play_url']) && $vdetails['remote_play_url']!='none')
|
||||
{
|
||||
return $vdetails['remote_play_url'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$Cbucket->custom_video_file_funcs[] = 'play_remote_video';
|
||||
register_after_video_upload_action('remote_video_check');
|
||||
register_custom_upload_field($link_vid_field_array);
|
||||
$Cbucket->add_header(PLUG_DIR.'/cb_link_video/header.html');
|
||||
|
||||
|
||||
|
||||
?>
|
96
upload/plugins/cb_link_video/form.html
Normal file
96
upload/plugins/cb_link_video/form.html
Normal file
|
@ -0,0 +1,96 @@
|
|||
{assign var='video_fields' value=$Upload->load_video_fields($input)}
|
||||
|
||||
|
||||
<div class="upload_info" id="upload_form{$objId}" style="margin-top:10px; border:none">
|
||||
|
||||
<form name="uploadForm{$objId}" class="upload_form" id="uploadForm{$objId}" method="post" action="" onSubmit="return false" enctype="multipart/form-data">
|
||||
|
||||
{* Adding Remote File Form *}
|
||||
<fieldset>
|
||||
<span class="form_head">Remote video details</span>
|
||||
<div class="field">
|
||||
<label for="remote_play_url" class="label">Video URL</label>
|
||||
<input type="text" name="remote_play_url" id="remote_play_url" size="15" class="upload_input" value="{"remote_play_url"|post|form_val}"/>
|
||||
<div class="hint">can be flv, mp4, m4v, ogg</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Video duration<br />
|
||||
<input type="text" name="duration" id="duration" size="15" class="upload_input" value="{"duration"|post|form_val}"/></label>
|
||||
<div class="hint">duration format is hours:minutes:seconds</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="thumb_file" class="label">Thumb file</label>
|
||||
<input name="thumb_file" type="file" class="upload_input filefield" id="thumb_file" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{foreach from=$video_fields item=field_group}
|
||||
<fieldset>
|
||||
{* Hide fields if group is not required *}
|
||||
{if $field_group.group_id!='required_fields'}
|
||||
<span class="form_head"
|
||||
onclick="$('#more_fields_{$field_group.group_id}{$objId}').slideToggle()"
|
||||
style="cursor:pointer">{$field_group.group_name}</span>
|
||||
<div id="more_fields_{$field_group.group_id}{$objId}" style="display:none">
|
||||
{else}
|
||||
<span class="form_head">{$field_group.group_name}</span>
|
||||
{/if}
|
||||
|
||||
|
||||
<div {if $field_group.group_id=='required_fields'} style="width:400px; float:left"{/if}>
|
||||
{foreach from=$field_group.fields item=field}
|
||||
|
||||
{if $field.name!='category[]'}
|
||||
<div class="field">
|
||||
<label for="{$field.id}" class="label">{$field.title}</label>
|
||||
{if $field.hint_1}<div class="hint">{$field.hint_1}</div><br>{/if}
|
||||
{ANCHOR place=$field.anchor_before}
|
||||
{$formObj->createField($field)}
|
||||
{if $field.hint_2}<br>
|
||||
<div class="hint">{$field.hint_2}</div>{/if}
|
||||
</div>
|
||||
{else}
|
||||
{assign var='category_array' value=$field}
|
||||
{/if}
|
||||
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
{* Loading Category in a seperate dive so they can fit properly*}
|
||||
{if $category_array}
|
||||
<div style="float:left; width:200px; margin-left:10px;">
|
||||
<div class="field">
|
||||
<label for="{$field.id}" class="label">{$category_array.title}</label>
|
||||
{if $category_array.hint_1}<div class="hint">{$category_array.hint_1}</div><br>{/if}
|
||||
{ANCHOR place=$category_array.anchor_before}
|
||||
<div style="overflow:auto; height:150px">
|
||||
{$formObj->createField($category_array)}
|
||||
</div>
|
||||
{if $category_array.hint_2}<br>
|
||||
<div class="hint">{$category_array.hint_2}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{assign var='category_array' value=''}
|
||||
{/if}
|
||||
|
||||
{if $field_group.group_id=='required_fields'}<div class="clearfix"></div>{/if}
|
||||
|
||||
{* Closing Div for hidden fields *}
|
||||
{if $field_group.group_id!='required_fields'}
|
||||
</div>
|
||||
{/if}
|
||||
</fieldset>
|
||||
|
||||
{/foreach}
|
||||
|
||||
<input name="submit_upload" type="hidden" value="just_do_it">
|
||||
<div align="right" style="margin-top:10px">
|
||||
<input type="button" name="embed_upload" id="embed_upload" value="Upload" onClick="check_file_url('{$objId}')" class="cbSubmitUpload"/></div>
|
||||
</form>
|
||||
|
||||
</div>
|
42
upload/plugins/cb_link_video/header.html
Normal file
42
upload/plugins/cb_link_video/header.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<script type="text/javascript">
|
||||
{literal}
|
||||
function check_file_url(objid)
|
||||
{
|
||||
var video_link = $('#remote_play_url').val();
|
||||
var duration = $('#uploadForm'+objid+' #duration').val();
|
||||
|
||||
var reg = /^([0-9\:]+)$/i;
|
||||
|
||||
if(!video_link)
|
||||
{
|
||||
alert("Please enter valid video link");
|
||||
$('#remote_play_url').focus();
|
||||
return false;
|
||||
}
|
||||
if(!duration || !reg.test(duration))
|
||||
{
|
||||
alert("Please enter valid video duration");
|
||||
$('#uploadForm'+objid+' #duration').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
$.post(baseurl+"/actions/embed_form_verifier.php",
|
||||
{
|
||||
'mode' : 'remote_play',
|
||||
'remote_play_url' : $('#remote_play_url').val(),
|
||||
duration : $("#uploadForm"+objid+" #duration").val(),
|
||||
file_name : file_name,
|
||||
thumb_file : $("#uploadForm"+objid+" #thumb_file").val()
|
||||
},
|
||||
|
||||
function (data) {
|
||||
if(data.err)
|
||||
{
|
||||
alert(data.err);
|
||||
}else{
|
||||
$("#uploadForm"+objid).submit();
|
||||
}
|
||||
}, "json");}
|
||||
|
||||
{/literal}
|
||||
</script>
|
17
upload/plugins/cb_link_video/install_cb_link_video.php
Normal file
17
upload/plugins/cb_link_video/install_cb_link_video.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* This file is used to install Embed Video Mod
|
||||
*/
|
||||
|
||||
function install_embed_video_mode()
|
||||
{
|
||||
global $db;
|
||||
$db->Execute("ALTER TABLE ".tbl('video')." ADD `remote_play_url` TEXT NOT NULL ");
|
||||
|
||||
}
|
||||
|
||||
install_embed_video_mode();
|
||||
|
||||
?>
|
13
upload/plugins/cb_link_video/uninstall_cb_link_video.php
Normal file
13
upload/plugins/cb_link_video/uninstall_cb_link_video.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is used to install Embed Video Mod
|
||||
*/
|
||||
|
||||
function uninstall_embed_video_mode()
|
||||
{
|
||||
global $db;
|
||||
$db->Execute("ALTER TABLE ".tbl('video')." DROP `remote_play_url` ");
|
||||
}
|
||||
uninstall_embed_video_mode();
|
||||
?>
|
Loading…
Add table
Reference in a new issue