Upload and convert file using ffmpeg problem

Hello. i have a problem with php script who convert .mpeg uploaded file in .flv . i think the
code is good but somehow he dont work on my machine. pls help

upload.php

<html><body>
<?php
#require(“config/db_config.php”);
#$connection = mysql_connect($db_host, $db_user, $db_password) or die (‘wtf ?! mysqconn failed’);
#mysql_select_db($db_name, $connection);

function converttoflv( $in, $out )
{

unlink( $out );

$cmd = “ffmpeg -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 = “ffmpeg -i $in -pix_fmt rgb24 -vframes 1 -s 150x100 $out 2>&1”;
$fh = popen( $cmd, “r” );
while( fgets( $fh ) ) { }
pclose( $fh );
}

function flv_import( $upfile, $fname, $title )
{
$fname = preg_replace( ‘/…*$/’, ‘’, basename( $fname ) );
$flvpath = “$fname.flv”;
$thumbpath = “$fname.gif”;
converttoflv( $upfile, “movies/$flvpath” );
getthumbnail( $upfile, “movies/$thumbpath” );

#$query = “INSERT INTO movies (title,source,thumb,width,height) VALUES(’$title’,’$flvpath’,’$thumbpath’,‘150’,‘100’)”;
#mysql_query($query) or die(mysql_error());

}
echo $_FILES[‘movie’][‘tmp_name’];
echo “<br />”;
echo $_FILES[‘movie’][‘name’];
flv_import( $_FILES[‘movie’][‘tmp_name’], $_FILES[‘movie’][‘name’], $_POST[‘title’] );
?>
File sucessfully uploaded
</body></html>

i commented mysql lines cuz they work and didnt wanted to fill my db with records while i was testing convertion.