PHP forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
May 2024
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar

Latest topics
» Kabaddi, Kabaddi, Kabaddi, Kabaddi......PHP?
coverting video files to flv EmptyFri Jul 22, 2011 1:37 pm by shyamsunder

» Thousands of Free PHP Scripts Recommended
coverting video files to flv EmptyWed May 18, 2011 10:33 am by bizboy12

» PHP form validation problem?
coverting video files to flv EmptyWed Jan 12, 2011 1:25 pm by simy202

» string wrap
coverting video files to flv EmptySat Aug 02, 2008 2:06 pm by scvinodkumar

» retrieving current date rows
coverting video files to flv EmptyTue Jul 15, 2008 3:25 am by scvinodkumar

» number in words
coverting video files to flv EmptyTue Apr 29, 2008 3:10 pm by scvinodkumar

» Simple PHP Form Field Generator
coverting video files to flv EmptyFri Apr 25, 2008 12:28 pm by scvinodkumar

» PHP password generator
coverting video files to flv EmptyFri Apr 18, 2008 7:24 pm by scvinodkumar

» PHP Script to Extract Email Address from any text
coverting video files to flv EmptyFri Apr 18, 2008 7:18 pm by scvinodkumar

Search
 
 

Display results as :
 


Rechercher Advanced Search

Affiliates
free forum
 


Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

coverting video files to flv

Go down

coverting video files to flv Empty coverting video files to flv

Post  scvinodkumar Mon Mar 31, 2008 7:29 pm

<?php
include_once("db.php");
include_once("dbcon.php");
session_start();


function GetExt($Filename)
{
$Extension = explode(".", $Filename);
$Extension_i = (count($Extension) - 1);
return $Extension[$Extension_i];
}

// How to use it


if(isset($_POST) && isset($_FILES))
{


$title=$_POST['title'];
$desc=$_POST['desc'];
$keywords=$_POST['keywords'];


switch ($_POST['category']) {
case 1:
$imgcat = "animals/pets"; break;
case 2:
$imgcat = "people"; break;
case 3:
$imgcat = "travel"; break;
case 4:
$imgcat = "children"; break;
case 5:
$imgcat = "sports"; break;
case 6:
$imgcat = "nature"; break;
case 7:
$imgcat = "action"; break;
case 8:
$imgcat = "humor"; break;
case 9:
$imgcat = "portraiture"; break;
case 10:
$imgcat = "other"; break;
}


if(isset($_FILES['videofile']['name']))
{


ini_set("post_max_size", "25M");
ini_set("upload_max_filesize", "25M");
ini_set("memory_limit", -1 );
ini_set("max_input_time", -1);
set_time_limit(0);

$vid_file=str_replace(" ","_",$_FILES['videofile']['name']);


if(!empty($vid_file))
{
$ext=GetExt($vid_file);
$flv_filename=substr($vid_file,0,(strlen($vid_file)-strlen(GetExt($vid_file))-1));
$imgpath=$flv_filename.".jpg";
$flv_filename.=".flv";

if($_FILES['videofile']['type']!="video/mpeg" && $_FILES['videofile']['type']!="video/x-msvideo" && $_FILES['videofile']['type']!="video/vnd.mpegurl" && $_FILES['videofile']['type']!="video/x-ms-wmv" && $_FILES['videofile']['type']!="video/x-ms-asf" && $_FILES['videofile']['type']!="video/x-flv" && $_FILES['videofile']['type']!="video/quicktime" && $_FILES['videofile']['type']!="video/x-ms-wvx")
{
$msg="Image File must be mpeg, mpg, mpa, avi, m4u, wmv, wmv3, asx, flv, mov, wvx!!!";
header("Location: index.php?q=video_upld&msg=$msg");
exit();
}

/*if($_FILES['videofile']['size']>102400){
$msg="Your file exceeded to 100 KB !!!";
header("Location: index.php?q=video_upld&msg=$msg");
exit();
} */


$add = "video/".$vid_file;
if(move_uploaded_file($_FILES['videofile']['tmp_name'], $add))
{
echo "uploaded sucessfully";

}
else
{
echo "Unsuccessful";

}
chmod("$add",0777);

exec("ffmpeg -i ".$vid_file." -b 100k -ar 22050 -y video/".$flv_filename);
exec("ffmpeg -i ".$vid_file." -an -ss 00:00:10 -r 1 -vframes 1 -f mjpeg -y video/".$imgpath);


}

$type=$_FILES['videofile']['type'];
$size=$_FILES['videofile']['size'];
//print_r($_POST);
//print_r($_FILES);

$t=time();
$ins_video="insert into `pixyak`.`video` (title, description, member, keywords, category,
type, size, flvpath, path, imgpath, ext, cre_dt, mod_dt, status) values
('$title', '$desc', '".$_SESSION['user_name']."', '$keywords', '$imgcat', '$type', '$size', '$flv_filename', '$vid_file',
'$imgpath', '$ext', '$t', '$t', 'Active')";
//echo $ins_video;
mysql_query($ins_video);

if(mysql_affected_rows()==1)
{
$insId=mysql_insert_id();

if ($_POST['around']){

$country=addslashes($_POST['country']);
$city=addslashes($_POST['city']);
$desc1=addslashes($_POST['desc1']);

mysql_query("insert into world_vid values ('','".$insId."','".$_SESSION['user_name']."','','".time()."','0','".addslashes($title)."','".$desc1."','".$country."','".$city."',0,0,0)");

}

$msg="Video Uploaded Successfully";
header("location: index.php?q=video_upld&msg=$msg");
die();
}
else
{
$msg="Error: ".mysql_error();
header("location: index.php?q=video_upld&msg=$msg");
die();
}

//ob_flush();
}
}
else
{
//ob_flush();
$msg="Access Denied";
header("location: index.php?q=video_upld&msg=$msg");
die();
}

?>

scvinodkumar
Admin

Posts : 40
Join date : 2008-01-30

https://solutions.aforumfree.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum