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
?>
convert video files into .flv using ffmpeg
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: convert video files into .flv using ffmpeg
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.
(#10850)
Re: convert video files into .flv using ffmpeg
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.
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.
-
arturgrigor
- Forum Newbie
- Posts: 3
- Joined: Mon Aug 25, 2008 9:39 am
Re: convert video files into .flv using ffmpeg
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.
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
Try using FFlib.NET from http://www.intuitive.sk/fflib/ 