yermak / AudioBookConverter

Improved AudioBookConverter based on freeipodsoftware release (mp3 to m4b converter)
GNU General Public License v2.0
726 stars 46 forks source link

Merged file is bigger, with smaller cover art #312

Closed yermak closed 2 years ago

yermak commented 2 years ago

Discussed in https://github.com/yermak/AudioBookConverter/discussions/311

Originally posted by **AudiobookListener** November 12, 2021 Was merging 39 M4B chapter files (1.01GB total) with AudioBookConverter, and noticed that the resulting file was larger (1.02GB). Not much, but strange as the 39 chapter files all had 66K of cover art. The the merged file seems to only have one copy but strangly the cover art size is now 50K. Ran the same merge with inAudible and the resulting file size was a bit smaller than the individual chapter (1.00GB) files as expected. Precise data for analysis Cover art 39*66K=2574K/.33MB, 39*50K=1950K/.25MB (1,084,541,330 bytes) 1084.5MB (on Disk 1,084,542,976 bytes) Merged by inAudible, 30 second merge time (1,087,196,048 bytes) 1087.2MB (on Disk 1,087,275,008 bytes) 39 M4B files, each with 66K cover art (1,096,307,629 bytes) 1096.1MB (on Disk 1,096,310,784 bytes) Merged by AudiobookBookConverter, cover size now 50K, 80 second merge time Seemingly, this paid product took 3x longer and expanded the result, whereas the freeware was faster and produced a smaller file. http://malich.ru/duplicate_searcher which has the option to compare media files minus the metadata found merged audio not equal. Perhaps we can make some sense of this? Thanks, -AudiobookListener

So, more testing.... Not sure why the cover art shrank from 66K to 50K on the merge, but found a solution for the file-size expansion. It is resolved with the MP3tag "Optimize MP4" utility. It shrinks the combined MP4 down to a competitive size. Here's a discussion of the utility...

**Question: Does the MP3tag optimize mp4 utility have to do with moving the metadata block from the end of the file to the beginning to make the files "fast start streaming" compatible?

Answer: "This function removes all "free" MP4-atoms and relocates the "moov" and "tags" MP4-Atoms in front of the audio data. This reduces the size of the files and may solve some problems with not displayed tags in other programs."**

It would appear that AudioBookConverter does not optimize the MP4 metadata as it is merging the files. In the case of 39 files totaling 1GB, it added nearly 12MB of bloat. I suspect the amount of bloat is proportional to the amount of data and the number of chapters merged. -AudiobookListener


  1. Need to remove optimisation during merging (This will also speedup performance)
  2. Apply art work
  3. Optimize resulting file at the very end.
gh0sti commented 2 years ago

I'm also running into this issue trying to make sure combining the files keeps the audio the same and similar size but recent one I did made it 5-6x times bigger. I ran it in mp3tag to optimize like you suggested and the file did not shrink down. Going from 6 mp3s into one m4b made it larger and I can't get it to shrink.

yermak commented 2 years ago

fixed in 5.6.1