Page 1 of 1

convert video files into .flv using ffmpeg

Posted: Tue Jul 08, 2008 6:07 am
by vanik
Hi All,

I convert the video files into .flv format in cmd by using ffmpeg.Whether i did it in my php file i didnot get the converted file.Please tell me how i can use cmd in my file.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.exe -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
?>

Re: convert video files into .flv using ffmpeg

Posted: Tue Jul 08, 2008 10:57 am
by Christopher
PHP runs as the same user as the webserver. That user may not have the path settings of regular user accounts. You may want to try using absolute paths to the executable and data files.

Re: convert video files into .flv using ffmpeg

Posted: Fri Jul 25, 2008 1:23 am
by vanik
Hi,

echo exec('cmd /c echo Hello World!');

It runs successfully.

exec('cmd /c ffmpeg.exe -i monkeydog.wmv -ar 22050 -ab 32 -f flv -s 320×240 video2.flv');

i tried like this also.But i didnt get any output or error.

Please help me about this problem.

Thanks in advance.

Re: convert video files into .flv using ffmpeg

Posted: Tue Aug 26, 2008 4:03 am
by arturgrigor
I think you cannot execute ffmpeg because ffmpeg binary is not installed on system's folder (bin) or where linux stores them.
You must have the absolute path to the ffmpeg to execute it like: /var/www/yoursite/FFmpeg/ffmpeg.

Something like this.

I also building a website based on watching flv movies but the thing is that I do not know how to execute ffmpeg to tell me when the conversion is done. :(

Re: convert video files into .flv using ffmpeg

Posted: Thu Aug 28, 2008 3:06 am
by izero
Try using FFlib.NET from http://www.intuitive.sk/fflib/ :drunk: