audiamus / AaxAudioConverter

Convert Audible aax files to mp3 and m4a/m4b
GNU General Public License v3.0
1.51k stars 115 forks source link

MP3 Compression Settings Leave Hiss on Output #184

Closed andspenrob closed 1 year ago

andspenrob commented 1 year ago

I've been exporting from Audible with BookLibConnect and attempting to convert with AAX Audio Converter using default settings. The resulting MP3 files have a constant hiss that is not present in the *.m4b files generated during the BookLibConnect export. Both files were tested using VLC on Windows 11.

audiamus commented 1 year ago

AAX Audio Converter delegates all audio processing FFmpeg. Using the defaults in AAC Audio Converter will also use the defaults of FFmpeg. Did the book in question have unusual bit and sample rates?

andspenrob commented 1 year ago

These are coming straight from Audible - most are 64kbps 22khz stereo (or so says BookLibConnect). I'm wondering if AAC defaults are trying too hard to re-compress? Hank Green's An Absolutely Remarkable Thing starts at 257MB in M4B with no hiss or clipping and actually ends up larger at 259MB in MP3. Is it going from VBR to CBR or something?

audiamus commented 1 year ago

You can use a tool like MediaInfo to check the meta data. All Audible audio files I have seen are CBR, FFmpeg does not apply VBR on its own, that has to be set explicitly (which you can do with AAX Audio Converter). And I believe that the default setting in FFmpeg takes the input bit and sample rates from AAC and applies them to MP3 encoding.

Have you tried to use the .m4b files with your favourite audiobook player? Most multimedia or music players these days support MPEG4 and AAC.

andspenrob commented 1 year ago

Hey, so I checked out the input (M4B) and output (MP3) files, and I found that the Audible M4B is, in fact, VBR at 64 kbps thru AAC-LC, while the MP3 output is Joint Stereo CBR at 64kbps. That explains the inflated file size, at least!

Now, it turns out my audiobook player can read M4B, so I don't personally need the second re-compression to MP3 or the auto-folders, but I thought you might want to know about the discrepancy. Not sure what best practice is, since recompression is lossy - maybe compress in VBR with more headroom like 96kbps for 64kbps files? Thanks for working thru it with me!

audiamus commented 1 year ago

If possible, I would always stick with .m4b. The AAC stream is the original from Audible, with no transcoding involved. On the other hand, any transcoding, to MP3 and/or modifying VBR/CBR, sample or bit rate, will slightly degrade quality. The human ear may not be able to notice it, but the underlying physical laws say so. No matter what you do during conversion, you will never be able to enhance the audio quality.

Apart from the audio stream, the other question is meta data. MP3 and MPEG4 meta data are implemented differently, although both serve the same purpose. Many tags are similar, but not necessarily recognized by every player. Many players cannot read MP3 chapters, although they are in the specs. AAX Audio Converter writes them, and MPC-HC, for instance, also reads them. For MPEG4, AAX Audio Converter writes both chapter variants, "Nero" and "Quicktime". At least one of them is usually supported by a player. To be correct here, all meta tag writing is delegated to the excellent ATL.net library. So again with meta data, .m4b (MPEG4 with audio stream only) has an advantage.