Friday, October 10, 2008

Video Conversion Dynamically Using FFMPEG,PHP

Every programmer has an idea to convert the video file types dynamically into any formats on the fly. They all know there is a tool called FFMPEG to convert video formats to their desired formats which they want. In this tutorial i'll let you know how to use the FFMPEG tool during file upload dynamically.

1. Download FFMPEG.EXE from here
2. Extract the FFMPEG.EXE from the archive.
3. Place the FFMPEG.EXE in the webdirectory.
4. As you all know how to upload a file (So i'm moving to the next step).
5. After the file uploaded just put the below line
exec("ffmpeg -i recipe_videos/$path -f flv recipe_videos/$test[0].flv");
//Format exec("ffmpeg -i pathofthevideouploaded -f towhichformat wherethefiletobesavedwithextension");
6. If you want delete the old file.
7. Now you can view the video in the desired format.