Take the 2-minute tour ×

I have several questions and would really appreciate your help. And it is quite urgent.

I am working on one CMS in PHP. I am developing some audio/video conversion. I am developing it under Windows 7. And eventually this CMS will run on Linux server.

I need ffmpeg to convert audio/video.

How can I use it on Windows? Do I need to install ffmpeg as php extension so that I can use it in my projects? Since I can't manage to do it. It won't recognize it as php extension. I copied files to php_ext folder and system32. I also edited php.ini file. But nothing.

Can I use ffmpeg without previous step and how?

And eventually if I get it to work what problems can I expect when I move CMS to Linux server ( I know that ffmpeg should work under Linux because it is easier to install.). Do I need to look around for paths for ffmpeg when I move from Windows to Linux and vice versa.

What is your suggestion for me?

Thanks in advance. Denis

share|improve this question
You could use the external ffmpeg binary which is much easier to set up. –  Pekka 웃 May 19 '11 at 20:17
There is ffmpeg-php, but I've never used it, so no idea how well/up-to-date it is: ffmpeg-php.sourceforge.net –  Marc B May 19 '11 at 20:20
add comment

1 Answer

The easiest thing to do is to just use FFMpeg as an executable. Build a command line, then exec it.

However... this is a bad idea. If you start chaining together multiple concurrent FFMpegs, you're likely to pretty much kill the machine, even if you nice the processes.

What you need to do is to build a daemon queue system. You can put media to be encoded all day long into a folder, and the ffmpeg will just run the next item in the queue (which also implies the need for priority). This way, you can properly nice the commands.

In Unix, we'd just set up a cron job which checked a DB every minute or so (you'd use Windows Task Scheduler)... if there is something in the queue, mark status as 'encoding', begin the encode process, then check again once finished. When the queue is empty, unmark status. This way, other applications (say, the Web site itself) can also be aware of encode status, which is just better in every way.

share|improve this answer
add comment

Your Answer


