Hey, I'm just wondering if it would be possible to convert videos to mp3 files in php, if so, could someone point me in the right direction?
+5
A:
This is not possible in pure PHP. You will need to use the services of a command-line executable or a web service.
The most popular command-line executable for this is ffmpeg. Here is a tutorial on how to strip audio/video streams from it: ffmpeg audio/video manipulation
From that tutorial - looks pretty straightforward:
ffmpeg -i mandelbrot.flv -vn -acodec copy mandelbrot.mp3
of course, there are tons of options to adjust and fine-tune the operation.
ffmpeg needs to be installed on your web server for this, and your PHP instance needs to be able to execute it.
There are some web services around to convert video I think, but I know of no free ones.
Pekka
2010-04-17 18:52:47