I have a script where it convert regular file such as mpg to flv. Now when I upload mpg it converts to flv fine. but when I upload avi it does not convert probably and the size of the file is 0. Here is the encoding part of the script. Does anyone see anything wrong.
//get Video
if(strtolower($this->VIDEO_EXT)!='flv')
{
//------Writing to the log file
$log_str = 'cALLING MENCODER FOR FLV CONVERSION:'."\r\n";
$log_str .= $this->CFG['admin']['video']['mencoder_path']."\" ".$source_filename." -o ".$store_dir.$this->VIDEO_NAME.".flv -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=".$this->CFG['admin']['video']['vbitrate'].":autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2:turbo:acodec=mp3:abitrate=56 -vf scale=320:240 -srate 22050 -af lavcresample=22050 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames";
//------Writing to the log file
$result = exec("\"".$this->CFG['admin']['video']['mencoder_path']."\" ".$source_filename." -o ".$store_dir.$this->VIDEO_NAME.".flv -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=".$this->CFG['admin']['video']['vbitrate'].":autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2:turbo:acodec=mp3:abitrate=56 -vf scale=320:240 -srate 22050 -af lavcresample=22050 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames", $p);
if(count($p))
{
foreach($p as $key=>$val)
$log_str .= $key.': '.$val."\n\r";
}
$this->writetoTempFile($log_str);
$result = exec("\"".$this->CFG['admin']['video']['flvtool2_path']."\" -UP ". $store_dir.$this->VIDEO_NAME.".flv");
$this->setFormField('playing_time', $this->getPlayingTime($source_filename));
}
else
{
if($this->FLV_UPLOAD_TYPE!='Normal')
{
$this->setFormField('playing_time', $this->getPlayingTime($source_filename));
unlink($source_filename);
}
else
{
$result = exec("\"".$this->CFG['admin']['video']['flvtool2_path']."\" -UP ". $source_filename);
$this->setFormField('playing_time', $this->getPlayingTime($source_filename));
}
}
$temp_file = $store_dir.$this->VIDEO_NAME;