fastest way to convert any audio file to low bitrate?

8

2

using ffmpeg I'd like to have some directions/parameters to:

  • encode any audio file to a poor bitrate
  • strip artwork from file
  • optimize for speed
  • optimize for size

My goal is to have a bare-bone file encoded in mp3 in the fastest time possible, quality does not matter (even 96kbps or less), it just needs to be extremely fast.

Claudio Poli

Posted 2013-02-15T23:49:45.657

Reputation: 183

did you try to read this docs http://www.ffmpeg.org/documentation.html

– hakkikonu – 2013-02-16T00:07:30.423

In the future, please don't cross-post. Thank you. – slhck – 2013-02-17T20:17:43.733

Answers

8

ffmpeg -i input.file -map 0:a:0 -b:a 96k output.mp3

...will convert any file with audio into a Constant Bit Rate MP3 @ 96 kbit/s. Music files normally store cover images as a video stream, which will be stripped by this command; M4A files do this differently, but ffmpeg is currently not able to access that data, so it will be stripped whatever you do. This will also select the first audio stream, if there are multiple audio streams.

CBR mode should be faster than VBR, and using a low bit rate should be faster than a higher one.

Of course, file size can be easily calculated from the bit rate. A one-minute CBR MP3 @96 kbit/s will have a file size of 60s*96000bit/s=5760000 bit, /8192=703.125 KB.

evilsoup

Posted 2013-02-15T23:49:45.657

Reputation: 10 085

I run this command with 48k bitrate, but the resulting file had a shorter duration, by about a quarter. Why does the lower bitrate distort the length of the audio? – Mirror318 – 2017-05-17T09:15:17.363

in my setup, the above command runs at ~15x relative speed, while the default command in the wiki:

" ffmpeg -i input.file -codec:a libmp3lame -qscale:a 2 output.mp3 "

runs at ~19x relative speed; so I don't think this is the fastest way to convert.

if I find any faster way I'll report back here with an answer =) – Vinícius M – 2018-08-14T20:12:23.907

This actually made the mp3 bigger in size, what could be the reason? – Madeo – 2020-02-25T06:59:12.767

1

Give this a try sir

ffmpeg -i aa.mp3 -b:a 96k -map a bb.mp3

-map a strips artwork

ref

Steven Penny

Posted 2013-02-15T23:49:45.657

Reputation: 7 294