Forum Moderators: coopster
I converted the files to flv format in cmd.But when i try to those to convert it in my php file it could nt be converted.Please help me about this.Here is my code..
<?
$srcFile = "/FFmpeg/monkeydog.wmv";
$destFile = "/FFmpeg/mn.flv";
$ffmpegPath = "/FFmpeg/ffmpeg";
echo exec('cmd /c echo Hello World!');
exec($ffmpegPath . " -i " . $srcFile . " -ar 22050 -ab 32 -f flv -s 420 * 320 " . $destFile);
//$x=exec('cmd /c ffmpeg -i monkeydog.wmv -ar 22050 -ab 32 -f flv -s 320×240 video2.flv');
//exec("/usr/local/bin/ffmpeg -i /your/dir/uploadedfile.flv -an -ss 00:00:03 -an -r 2 -vframes 1 -y /your/dir/%d.jpg");
// Make multiples function
?>
function converttoflv( $in, $out ) {
if (file_exists($out)) {
unlink( $out );
}
$cmd = "/usr/bin/ffmpeg -v 0 -i $in -b 64k -ar 11025 -sameq $out 2>&1 ¦ grep time";
$fh = popen( $cmd, "r" );
while($prop = fgets( $fh ) ) {
if (!empty($prop)) {
$length = $prop;
}
}
pclose( $fh );
return $length;
}