View Single Post
Old 06-07-2009, 09:18 AM   #1 (permalink)
ebot
The Visitor
Newcomer 
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
ebot is on a distinguished road
Default upload video convert it to flv and then move the file to a folder,

$ffmpegpath = "../tool/ffmpeg.exe";

function converttoflv( $in, $out )
{
unlink( $out );
$cmd = "$ffmpegpath -v 0 -i $in -ar 11025 $out 2>&1";
$fh = popen( $cmd, "r" );
while( fgets( $fh ) ) { }
pclose( $fh );
}

function getthumbnail( $in, $out )
{
unlink( $out );
$cmd = "$ffmpegpath -i $in -pix_fmt rgb24 -vframes 1 -s 300x200 $out 2>&1";
$fh = popen( $cmd, "r" );
while( fgets( $fh ) ) { }
pclose( $fh );
}

function flv_import( $upfile, $fname, $title )
{
$fname = preg_replace( '/\..*$/', '', basename( $fname ) );
$target = "../video/";
$target = $target . basename( $_FILES['vid']['name']);

$flvpath = "$fname.flv";
$thumbpath = "$fname.gif";

converttoflv( $upfile, "videos\\$flvpath" );
getthumbnail( $upfile, "videos\thumbs\\$thumbpath" );

$DateAdded = date("Y-m-d H:i:s");
$sql = "INSERT INTO videos (name, thumb, video_path, eng, fr, ger, date_added) " .
"VALUES (\"$title\", \"$thumbpath\", \"$flvpath\", \"$eng\", \"$fr\", \"$ger\", \"$DateAdded\")";
$result = mysql_query($sql) or die("Error: " . mysql_error());
}


the problem now is , i get a message: "


Warning: unlink(videos\29052009012.flv) [function.unlink]: No such file or directory in C:\xampp\htdocs\toura\internal\video.php on line 16

Warning: unlink(videos humbs\29052009012.gif) [function.unlink]: Invalid argument in C:\xampp\htdocs\toura\internal\video.php on line 25" crazy.gif

and the video and thumbnails files are not moved to the folders i'd want,
i will appreciate any help and information. blink.gif
thanks
Ebot Evans
ebot is offline  
Reply With Quote