Belgin Fish
Belgin Fish

Reputation: 19857

Convert Video To MP3 in php?

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?

Upvotes: 5

Views: 8250

Answers (1)

Pekka
Pekka

Reputation: 449783

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.

Upvotes: 11

Related Questions