Can i use php to convert video file to .flv or .swf file … i want to let the user upload video with any format and then my server convert the video on me website to .flv or .swf
i know that i can use the ffmpeg tool on my server, but it must be installed on me webserver
exec("ffmpeg -i ...");
Is there any php framework to help me in doing that ? any better solution would be appreciated ?
thanks
The correct way to approach this is to have a process on your server (could be your web server, could be a separate application server) that looks for videos uploaded to a given folder, converts them, and perhaps copies the result to a new folder.
Video conversion can take a long time. Processing a video in the context of a user’s request with a PHP wrapper (i.e. having them wait for a page result until conversion is complete) is impractical. YouTube certainly doesn’t work that way.
You could accomplish this in a number of ways (having a wrapper around
ffmpegis probably a reasonable approach), but all of those ways involve having the ability to install a program on a server that either runs continuously (e.g. as a service/daemon) or awakens periodically to look for work (e.g. via cron).