Search code examples
javaaudioffmpegaac

Adding Gapless Playback information to AAC


im currently trying to develop an Video / Audio encoding pipline. My goal is it to encode mp4 files containing an h264 video track and an AAC audio Track. These files should be played one after another without any gaps in between.

Currently im converting the videos with ffmpeg. Unfortunately my input files are missing the gapless playback metadata, which will be needed for gapless playback of the AAC track.

Infact im looking for a way to add the iTunSMPB udta comment, as it is needed by the Exoplayer. (See Parser for Details: GaplessInfoHolder.java )

I could not find a way to add this via ffmpeg ( ffmpeg AAC encoder doc), did i maybe missed something?

Even Wikipedia only lists two converters that should be able to do that: Nero Digital and Itunes. But this infomation could be outdated.

Do anyone of you know a java library or (linux) command that can add this metadata to an mp4 file?

I hope some of you might be able to help me. Thank you.


Solution

  • My Information here was wrong!

    Here what I have learned the last days, in case anyone stumbles on this entry:

    There are two different methods how the gapless information could be saved within an aac track. The one i was mentioning above is an old handling from the iTunes converter. This has later been (re)defined within an ISO standard, this will save the gapless information within the edts + sgpd atoms.

    For test with the different AAC Data you can use fdkaac

    The ISO standard atoms will also automatically be added by ffmpeg's default aac encoder.

    Hope this information helps anyone.