dsdsdsdsd Posted May 29, 2013 Share Posted May 29, 2013 is there a library that can convert between these filetypes: mp3, wav, ogg, webm thanks, dsdsdsdsd Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/ Share on other sites More sharing options...
requinix Posted May 29, 2013 Share Posted May 29, 2013 I'd put my money on ffmpeg. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433055 Share on other sites More sharing options...
dsdsdsdsd Posted May 29, 2013 Author Share Posted May 29, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433066 Share on other sites More sharing options...
requinix Posted May 29, 2013 Share Posted May 29, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433076 Share on other sites More sharing options...
kicken Posted May 29, 2013 Share Posted May 29, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433082 Share on other sites More sharing options...
dsdsdsdsd Posted May 30, 2013 Author Share Posted May 30, 2013 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 - download2 - install onto server 3 - learn how to interface with it via php... is this correct?-- thanks. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433129 Share on other sites More sharing options...
requinix Posted May 30, 2013 Share Posted May 30, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433131 Share on other sites More sharing options...
dsdsdsdsd Posted May 30, 2013 Author Share Posted May 30, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433138 Share on other sites More sharing options...
requinix Posted May 30, 2013 Share Posted May 30, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433237 Share on other sites More sharing options...
xenLiam Posted June 1, 2013 Share Posted June 1, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1433533 Share on other sites More sharing options...
Lukeidiot Posted May 31, 2015 Share Posted May 31, 2015 I used it to make http://youtube-2-mp3.org Quote Link to comment https://forums.phpfreaks.com/topic/278570-audio-converter-mp3-wav-ogg-webm/#findComment-1512880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.