Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need an automatic mp3-conversion script, probably using Lame

Prime_66Prime_66 Posts: 1Member
I need to have a function on my website which takes high quality mp3s and convert them into low quality mp3, made for streaming. The process should take place automatically when a new mp3-file is uploaded.

Ive begun working with lame but I cant get it quite right. The lame.exe works fine when I start the application manually in a command-promt window (WIN XP). But when I try to call the program from a PHP-script the mp3-conversion stops after just a few seconds:

$bitrate = 48;
exec("lame -a --mp3input --resample $bitrate hej.mp3 12.mp3");

If I write that code directly to lame in a command prompt window it works fine, the conversion completes. But as I said, when I try to do the same thing from PHP it stops before the conversion is finished.

Ive checked the php.ini and its not the time for how long a a script can "act" which is too short. So what can it be?

I also need a way to close down lame.exe after the conversion is complete. Otherwise new lame.exes will be started each time I call the program from my PHP-script.

If anyone have any ideas I would be grateful!

Sign In or Register to comment.