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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With