Jochem Maas <jochem <at> iamjochem.com> writes:
>
> Apple7777 schreef:
> > Still can't fix it. I've checked everything like 20-30 times, I feel
like crazy.
> > Everything should work fine, but it doesn't. :(
> >
> > If anyone have an idea about what it can be, please let me know.
>
> what's you exact code? how [exactly] do you run the code?
>
> >
>
Did you ask me or Nathan? My current code is (modified little bit,
because Gmane doesn't allow to use lines longer than 80 characters):
error_reporting(E_ALL);
$conn = mysql_connect("localhost:3306", "login", "pass") or die('Could not
connect: ' . mysql_error());
mysql_select_db("geo", $conn);
mysql_query("SET NAMES 'utf8'");
$sql = "SELECT * FROM geo.video_temporary WHERE id = 1";
$trResult = mysql_query($sql, $conn) or die('Query failed: ' . mysql_error());
while ($trInfo = mysql_fetch_assoc($trResult)){
$mainStatus = $trInfo['status'];
}
if($mainStatus == 200){ exit; }
$sql = "SELECT * FROM geo.video_temporary WHERE status = 0";
$trResult = mysql_query($sql, $conn) or die('Query failed: ' . mysql_error());
while ($trInfo = mysql_fetch_assoc($trResult)){
$videoId = $trInfo['id'];
$videoUserid = $trInfo['userid'];
}
$userPath = "/home/re/video/".$videoUserid."/";
$sql = "UPDATE geo.video_temporary SET status = 200 WHERE id = 1";
$trResult = mysql_query($sql, $conn) or die('Query failed: ' . mysql_error());
$sql = "UPDATE geo.video_temporary SET status = 1 WHERE id = ".$videoId;
$trResult = mysql_query($sql, $conn) or die('Query failed: ' . mysql_error());
$inputFile = $userPath.$videoId."temp";
$outputFile = $userPath.$videoId.".flv";
print "input file: ".$inputFile."<br />";
print "output file: ".$outputFile."<br />";
$first = "/usr/local/bin/mencoder -really-quiet -vf scale=448:-3,expand=448:336
-sws 9 -of lavf -ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=1
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0
-channels 1 -srate 22050 -of lavf -lavfopts format=flv -o
".$outputFile." /home/re/ff/logo7.avi ".$inputFile;
$second = "/usr/local/bin/mencoder -really-quiet -vf scale=448:-3,expand=448:336
-sws 9 -of lavf -ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=2
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0
-channels 1 -srate 22050 -of lavf -lavfopts format=flv -o
".$outputFile." /home/re/ff/logo7.avi ".$inputFile;
print "first: ".$first."<br />";
print "second: ".$second."<br />";
print system("cd /usr/local/bin/");
print system($first);
print system($second);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php