yermak / AudioBookConverter

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

Optionally just remux, not reencode MP3 #30

Closed Crissov closed 3 years ago

Crissov commented 4 years ago

If Iʼm reading FFMpegNativeConverter.java correctly, audio streams are only kept unchanged if they are already in AAC format. The standardized MP4 container format does support remuxed MP3 streams although Iʼm not sure which players do, iTunes in particular. FFmpeg seems to support this as well with -codec:a copy.

By the way, I could not see -f ipod being documented (anymore), perhaps it should be changed to -f mp4.

yermak commented 4 years ago

Hi Crissov,

Thanks for your notes. As for -f ipod, indeed it’s not properly documented feature, and it was needed to workaround early apple ipod issues - e.g. as described here https://www.metaltoad.com/blog/iphone-video-streaming-drupals-file-system. I used to find other evidences of it. I need to look in more details, it but it seems that on earlier version of ffmpeg output was different. I will need to retest output with different options on legacy ipod classic to verify.

As for mp4 container - you are absolutely correct, but i never seen m4b audiobook which contained mp3 codec inside, as far as i am concerned books normally encoded with AAC or ALAC. If you can give me scenario why this could be needed, i will consider adding this - otherwise please feel free to fork. Probably we could add list of just remux format to config - thus you could customize it for yourself. Note: i’m not trying to build universal audio convertor, but as simple as possible (for end user) audiobook convertor software.

Crissov commented 4 years ago

Like many others, I have several older audiobooks that consist of a bunch of individual MP3 files (for chapters). Only remuxing them into an MP4 container, instead of first transcoding them to AAC, should be much faster. The resulting MP3-in-MP4 file size will probably be larger than AAC-in-MP4, but not take more space than the individual MP3 files I have now (especially on an HDD with large clusters). The audio quality, however, will not improve with AAC, but stay the same at best.

If iTunes and other players have no problems with MP3-in-MP4 files, which is something I have not tested yet, I would see no need for the transcoding step, but I understand that others would also warmly welcome the file size decrease by using a more efficient codec like AAC.

yermak commented 4 years ago

Hi Crissov, I tryied to remux mp3 into mp4 container, however, -f ipod parameter required to workaround some apple specific gives following result from ffmpeg: [ipod @ 0000025ab1c68c40] Could not find tag for codec mp3 in stream #0, codec not currently supported in container

It seems ipod is not really mp4 container. Switching to -f mp4 actually works, but this will require compatibility tests. So, benefits are not clear for me - as reincoding is quite fast.

yermak commented 3 years ago

@Crissov , As a workaround, i could suggest mering all mp3 into 1 single mp3. You will lose chapters functionality, this feature #100 is requested, but not on roadmap yet.

yermak commented 3 years ago

I will close this issue, as i prefer to have 1-2-1 mapping between output containers and codecs: mp3-mp3 m4b-aac ogg-opus