Hey guys!

I didn't know where to post this!

I run a video sharing site http://www.viefex.com, Im using mencoder to convert videos.

I need the best setting for quality and lowest space as possible.

This is my current settings:

passthru("/usr/bin/mencoder -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=732800:mbd=2:mv0:trell:v4mv:cb p:last_pred=3redia=2:dia=2recmp=2:cmp=2ubcmp=2reme=2:turbo:acodec=libmp3lame:abitrate=56 -vf scale=400:300,harddup -srate 22050 -af lavcresample=22050 $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid.".flv &");

This is the code I believe needs changing!

This is the entire code:

//unlink("$config[flvdodir]/".$vid.".flv");

// Ala bun
//exec("/usr/bin/ffmpeg -y -i $config[vdodir]/$vdoname -sameq -b 1000 -ar 44100 -r 25 $config[flvdodir]/".$vid.".flv",$p);
//Ala mod
//echo "Please wait while encoding the file ... <div style='display:none;'>";
passthru("/usr/bin/mencoder -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=732800:mbd=2:mv0:trell:v4mv:cb p:last_pred=3redia=2:dia=2recmp=2:cmp=2ubcmp=2reme=2:turbo:acodec=libmp3lame:abitrate=56 -vf scale=400:300,harddup -srate 22050 -af lavcresample=22050 $config[vdodir]/$vdoname -o $config[flvdodir]/".$vid.".flv &");
//echo "</div>";

/*$mimetype=explode(".",$vdoname);
$mimetype=$mimetype[count($mimetype)-1];

//if(filesize("$config[flvdodir]/".$vid.".flv")==0){
if ($mimetype == "mov") {
$outputfile = "";
$filename_toext = "";
$filename_toext = explode(".", $vdoname);
if (strtolower($filename_toext[1]) == "mov") {
$outputfile = $filename_toext[0].".avi";
//exec("/usr/local/bin/mencoder $config[vdodir]/$vdoname -ofps 15 -vf scale=320:-2 -oac lavc -ovc lavc -lavcopts vcodec=msmpeg4v2:abitrate=48:vbitrate=500 -o $config[vdodir]/$outputfile");
//exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -sameq $config[vdodir]/$outputfile");
exec("/usr/bin/mencoder $config[vdodir]/$vdoname -vf scale=320:-2 -oac lavc -ovc lavc -lavcopts vcodec=msmpeg4v2 -o $config[vdodir]/$outputfile");
$vdoname = $outputfile;
exec("/usr/bin/ffmpeg -y -i $config[vdodir]/$vdoname -sameq -b 1000 -ar 44100 -r 25 $config[flvdodir]/".$vid.".flv");

echo "/usr/bin/ffmpeg -y -i $config[vdodir]/$vdoname -sameq -b 1000 -ar 44100 -r 25 $config[flvdodir]/".$vid.".flv
";


}
}*/
//}

//exec("/usr/local/bin/mplayer $config[vdodir]/$vdoname -vf framestep=30 -ss 1 -nosound -vo jpegutdir=$config[TMB_DIR]/".$vid);
exec("/usr/local/bin/mplayer $config[flvdodir]/".$vid.".flv -vf framestep=30 -ss 1 -nosound -vo jpegutdir=$config[TMB_DIR]/".$vid);


video_to_frame("$config[vdodir]/$vdoname",$vid,true);

//Tahity exec("/usr/bin/flvtool2 -UP ". $config[flvdodir]."/".$vid.".flv");

//@unlink("$config[flvdodir]/".$vid."x.flv");

//GET DURATION
exec("/usr/local/bin/mplayer -vo null -ao null -frames 0 -identify $config[vdodir]/$vdoname", $p);
while(list($k,$v)=each($p))
{
if($length=strstr($v,'ID_LENGTH='))
break;
}
$lx = explode("=",$length);
$duration = $lx[1];

//unlink($config['vdodir']."/".$vdoname);

}



Please help!
I really dont know what else to do!