Matheus Prado Matheus Prado - 1 month ago 10
PHP Question

How can I convert videos in php without using ffmpeg?

I made a code in php that extracts mp3 audio track from a video file using the

exec
function to execute
ffmpeg
.

All works fine on a local server using WAMP on windows. But when deploying the script to the server, I can not run
ffmpeg
anymore because the server does not have the software.

Is there a class in pure PHP, or an API that is capable of the same or at least the basic ffmpeg functionality?

Answer

But when deploying the script to the server, I can not run ffmpeg anymore because the server does not have the software.

It's easy to get ffmpeg on your server:

  1. Download a static build of ffmpeg for Linux, Windows, or OS X.
  2. Point your script to it.
  3. Encode.

See FFmpeg Wiki: PHP.

Comments