I'm looking for a way (a class, sorcerry) to reduce the size of MP3 file. I know MP3 is already optimized, for minimal size, so I wonder if I can somehow reduce the qual开发者_如何学City (maybe bitrate) so i'll have a tradeoff between quality and file size....
My server side language is PHP, Thanks alot, Yanipan
As comment kissmyfase, best way is exec ffmpeg:
<?php
exec("ffmpeg -b 128k -i input.mp3 output.mp3");
?>
or as answer sbrattla:
<?php
exec("lame --abr 128 input.mp3 output.mp3");
?>
I'd say that you need to convert your MP3 files to lower quality. However, I'm not aware of any PHP libraries capable of doing this. If you are allowed to install applications on the server you are at, then I'd recommend LAME which does a good job at converting MP3 files. It's also quick.
You could kick of LAME as an external program from PHP to do the work.
精彩评论