nu774 / fdkaac

command line encoder frontend for libfdk-aac
Other
260 stars 58 forks source link

How do I get from a gapless mp3 to a gapless m4a? #59

Open LFriedenthal opened 8 months ago

LFriedenthal commented 8 months ago

I have these files that play gapless in Vox and iTunes.

samplemp3.zip

I tried using ffmpeg to pipe them into CAF and then fdkaac to turn them into m4a.

ffmpeg -i 003_Deadly_Delivery.mp3 -f caf pipe:1 | fdkaac -b96 -G2 - -o /Users/lora/Downloads/Deadly/gapless/003_Deadly_Delivery.m4a

I also tried using -G1. The resulting m4a files do not play gapless like the mp3s. samplem4a.zip

Is it possible to get what I'm after?

nu774 commented 8 months ago

These MP3 files are encoded in iTunes and the metadata required for gapless playback is stored in the form of iTunSMPB tags. On the other hand, ffmpeg does support gapless decoding of MP3 files, but it only supports the Encoder Delay/Encoder Padding fields of the LAME header and not iTunSMPB. Therefore, ffmpeg cannot decode MP3 files encoded in iTunes gaplessly.

LFriedenthal commented 8 months ago

Thank you for the reply! I've been trying my best to learn what is and isn't possible when it comes to gapless. It surprises me a little that it isn't straightforward.

Is there any mp3 decoder that I could install into ffmpeg that would support iTunSMPB?