Code: Select all
<?php
// encoding may take a few minutes.
set_time_limit(1800);
// disable output buffering so we can send the encoding progress to the browser.
ob_implicit_flush(true);
include("db.php");
function StringToTime($Duration)
{
$TimeArray = NULL;
if(strlen($Duration) > 0)
{
$TimeArray = explode(":", $Duration); if(count($TimeArray) > 2)
{
return ((int)$TimeArray[0]) * 3600 + ((int)$TimeArray[1]) * 60 + ((int)$TimeArray[2]);
}
}
}
function GetCurPath()
{
$curpath = $_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"];
$index = strrpos($curpath, "/");
if($index != 0)
$curpath = substr($curpath, 0, $index);
return $curpath;
} function flv_convert_get_thumb($FileName, $FileName_JPG, $FileName_FLV)
{
flv_convert_get_thumb('$FileName', '$FileName_JPG', '$FileName_FLV,$in, $in_sub, $in_idx, $out_thumb, $out_vid');
// code provided and updated by steve of phpsnaps ! thanks
// accepts:
// 1: the input video file
// 2: path to thumb jpg
// 3: path to transcoded mpeg?
function flv_convert_get_thumb($in, $out_thumb, $out_vid)
{
// get thumbnail
$cmd = ffmpeg -v 0 -y -i '.$FileName.' -vframes 1 -ss 250 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 '.$$FileName_JPG;
$res = shell_exec($cmd);
// $res is the output of the command
// transcode video
$cmd = mencoder '.$FileName_FLV.' -o '.$FileName_FLV.' -sub '.$in_sub.' -subfont-text-scale 3.0 -subpos 99 -idx '.$in_idx.' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame';
$res = shell_exec($cmd);
}
?>
<?php
$Author = $_REQUEST["author"];
$Title = $_REQUEST["title"];
$FileName = $_REQUEST["filename"];
$Dimension = $_REQUEST["dimension"];
// here removed blackmailing code and added yours
$ExecResult = flv_convert_get_thumb($FileName, $FileName.'.jpg', $FileName.'.flv');
// end of change
// remove the uploaded file.
unlink(GetCurPath() . "/files/".$FileName);
if($ExecResult == 0)
{
$Conn = NULL;
$Sql = NULL;
$Conn = OpenDB();
$time = date('Y-m-d H:i:s', time());
$Duration = 0;
$Sql = "INSERT INTO VIDEOS (AUTHOR, TITLE, DIMENSION, DURATION, ORIGINALFILE, FLVFILE, IMAGEFILE, UPLOADTIME, VIEWS) " .
"VALUES ('".$Author."', '".$Title."', ".$Dimension.", ".$Duration.", '".$FileName."', '".$FileName.".flv', '".$FileName.".jpg', '".$time."', 1);";
mysql_query($Sql); $err = mysql_error();
mysql_close();
if($err)
echo "Error: " . $err . "<br>";
?>
<li><a href="list.php">Upload Finished ! Please Press Here</a></li>
Error: Table 'fvec.VIDEOS' doesn't exist
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/www/list.php on line 23
There are 0 videos in total
Upload my video now >>
--------------------------------------------------------------------------------
Error: Table 'fvec.VIDEOS' doesn't exist
what i'm i doing wrong here, is there missing video table in mysql ? i'm i passing the right info ? im confused as you can see i changed many things so im lost
