Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg compresses upto 32 kbps only

Tags:

php

ffmpeg

I have created a PHP code which compresses mp3 while uploaded to 32kbps bit rate I have referred this thread

How to compress or convert to low quality Mp3 file from PHP

used this code

exec("ffmpeg -i inputfile.mp3 -ab 24000 outputfile.mp3") 

but the problem is I can't compress more than 32kbps .my code instruct to compress up to 24kbps but after execution, I can see the output file is 32kbps. can anyone tell what should I do so that I can compress more than 32kbps .or is there any limitation of ffmpeg ??

like image 760
raju Avatar asked Jun 10 '12 03:06

raju


1 Answers

The reason you cant achieve lower then 32kbps is because of the sample rate most likely is still 44100-Hz meaning larger stream size, you have a few options 44100-Hz, 22050-Hz, and 11025-Hz as valid frequency's.

Try (very low quality):

ffmpeg -i inputfile.mp3 -acodec libmp3lame -b:a 8k -ac 1 -ar 11025 outputfile.mp3

-b:a = audio bitrate

-ar = sample rate

like image 129
Lawrence Cherone Avatar answered Sep 25 '22 22:09

Lawrence Cherone