vanik Posted July 8, 2008 Share Posted July 8, 2008 Hi All, I converted all the video files to .flv format by using ffmpeg in cmd.When i call this in my file it was not converting.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.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 ?> Link to comment https://forums.phpfreaks.com/topic/113713-covert-video-files-to-flv-format-using-ffmpeg/ Share on other sites More sharing options...
rhodesa Posted July 8, 2008 Share Posted July 8, 2008 try using passthru() instead of exec(), it does the same thing, except it will send any output directly back to the screen. that may help you find where it is erroring out Link to comment https://forums.phpfreaks.com/topic/113713-covert-video-files-to-flv-format-using-ffmpeg/#findComment-584362 Share on other sites More sharing options...
vanik Posted July 9, 2008 Author Share Posted July 9, 2008 i used passthru instead of exec but i wont be converted.I am new to this one.Can u help about this. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/113713-covert-video-files-to-flv-format-using-ffmpeg/#findComment-585143 Share on other sites More sharing options...
rhodesa Posted July 9, 2008 Share Posted July 9, 2008 use this, and post what the output is (by output i mean text generated by the script): <?php $srcFile = "/FFmpeg/monkeydog.wmv"; $destFile = "/FFmpeg/mn.flv"; $ffmpegPath = "/FFmpeg/ffmpeg"; if(!is_executable($ffmpegPath)) die("Bad ffmpegPath"); print "ffmpegPath: ".realpath($ffmpegPath)."\n"; if(!is_readable($srcFile)) die("SrcFile not readable"); print "srcFile: ".realpath($srcFile)."\n"; if(!is_writable(dirname($destFile))) die("Can not write to destination folder"); $cmd = $ffmpegPath . " -i " . $srcFile . " -ar 22050 -ab 32 -f flv -s 420 * 320 " . $destFile; print $cmd."\n\n"; passthru($cmd,$rval); print "\nReturn Value: $rval"; ?> Link to comment https://forums.phpfreaks.com/topic/113713-covert-video-files-to-flv-format-using-ffmpeg/#findComment-585561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.