Jump to content
dsdsdsdsd

audio converter ... mp3, wav, ogg, webm

Recommended Posts

is there a library that can convert between these filetypes: mp3, wav, ogg, webm

 

 

thanks,

dsdsdsdsd

Share this post


Link to post
Share on other sites

I'd put my money on ffmpeg.

Share this post


Link to post
Share on other sites

to be honest, I still don't understand ffmpeg ... if you go to the wiki it doesn't even mention php. I keep seeing people refer to 'command line' software, but I am looking for a php script that can do all the conversions.

Share this post


Link to post
Share on other sites

You can get ffmpeg as a PHP extension to bridge the gap, but you aren't going to find something purely PHP to do this.

Share this post


Link to post
Share on other sites

to be honest, I still don't understand ffmpeg ... if you go to the wiki it doesn't even mention php. I keep seeing people refer to 'command line' software, but I am looking for a php script that can do all the conversions.

Most of the time things like this are handled by using exec() to execute an external application with the proper arguments to do the conversion you want. The ffmpeg CLI tool is offered on some hosts and is fairly easy to use. So what you'd do is create a PHP script that lets you specify all the different options you need and then just executes the fmpeg tool to do the actual conversion. Once the conversion is done you can have your PHP script do any further processing that may be necessary.

 

Trying to process the video data within a pure-php solution would likely be painfully slow, if it's possible at all. That is why these types of tasks are done via C either as a PHP extension (if available) or an external CLI tool.

Share this post


Link to post
Share on other sites

so is ffmpeg kind of like the GD engine that processes images on the server?

if I am not mistaken, GD is a server-based application, and php has an API to it ... it is the API that I interact with in php scripts.

IF so then getting ffmpeg is a process, really:
1 - download
2 - install onto server

3 - learn how to interface with it via php
... is this correct?

-- thanks.

Share this post


Link to post
Share on other sites

ffmpeg has nothing to do with PHP or GD, the latter of which is a library and not an application, but your conclusion is correct.

Share this post


Link to post
Share on other sites

from my webhosting company:

Unfortunately, we do not support FFmpeg on our servers and it is not possible to install it on our shared server.

 

Share this post


Link to post
Share on other sites

So now either you find a new hosting company, upgrade to dedicated hosting (where you can control the server and install your own software on it), or don't convert files.

Share this post


Link to post
Share on other sites

Use ffmpeg. I found a FFMPEG PHP class in GitHub. I forked it and I might do my own fixes to it if needed, it hasn't been updated in a long time (the last latest update was from 5 months ago)

 

The original repo is located at https://github.com/swider132/FFmpeg-PHP-Class

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.