I'm working on a video tube site where users can upload videos. I'm using mencoder to automatically convert any of their videos to FLV so that it can be played in our flash player. Most videos work fine, but with WMVs for some reason it makes them run really fast (as though somebody was holding down fast-forward).

Here's the PHP we use to generate the encode command:
Code:
public static function getEncodeCmd($input_file, $output_file, $reEncode = true, $height = 0)
{
	global $config;
		
	if (!$height)
		$height = VIDEO_RESIZE_Y;
		
	if ($reEncode) {
		$aCodec = "mp3lame -lameopts abr:br=56";
		$vCodec = "lavc -lavcopts vcodec=flv:vbitrate=" . VIDEO_BITRATE .
			":mbd=2:mv0:trell:autoaspect:v4mv:keyint=10:cbp:last_pred=3";
	}else{
		$aCodec = "copy";
		$vCodec = "copy";
	}
		
	$encodeCmd = "mencoder " . $input_file . " -o " .
		$output_file . " -of lavf -oac " . $aCodec . " -ovc " . $vCodec .
		" -vf scale=" .
		VIDEO_RESIZE_X . ":" . $height . " -srate " . SOUND_BITRATE . " -idx ";
		
	return $encodeCmd;
}
I'm no mencoder expert by any means. I still looking through the manual but since it's huge, I figured I'd ask real quick to see if anybody has stumbled across this before.