deadbeef icon indicating copy to clipboard operation
deadbeef copied to clipboard

Some MP4/AAC codings don't play gapless

Open Oleksiy-Yakovenko opened this issue 9 years ago • 7 comments

Original issue 1063 created by Alexey-Yakovenko on 2014-02-24T14:07:00.000Z:

What steps will reproduce the problem? Какие шаги приводят к воспроизведению проблемы?

  1. Encode some AAC tracks from a live album using Nero
  2. Play in Deadbeef

What is the expected output? What do you see instead? Какой ожидаемый вывод? Что вы видите вместо него? Tracks should play continuous music with no gaps between, but a small (less than a second) blank appears between tracks.

What version of the product are you using? On what operating system and CPU architecture? Какую версию продукта вы используете? На какой операционной системе и архитектуре CPU? 0.6.1 Linux Crunchbang (Debian plus Openbox) Pentium 4

How did you install the product? Как вы установили продукт? Build from source

Please provide any additional information below. Пожалуйста, предоставьте любую дополнительную информацию ниже. Tracks encoded using faac seem to play gapless. AAC and FFMPEG plugins both the same, I guess both ultimately using faad code. Audacious (and apparently foobar in windows) plays both faac and Nero aac files gapless, but most other players don't manage either. Other formats (FLAC, OGG, etc) all play gapless.

More discussion: http://crunchbang.org/forums/viewtopic.php?id=31803

Possible explanation of the different frame encodings: http://www.hydrogenaudio.org/forums/index.php?showtopic=87847

Oleksiy-Yakovenko avatar Mar 12 '15 23:03 Oleksiy-Yakovenko

Comment #1 originally posted by Alexey-Yakovenko on 2014-02-24T15:07:56.000Z:

it's a known bug in deadbeef's MP4 parser (which uses mp4ff). affects both ALAC and AAC files in MP4 container.

Oleksiy-Yakovenko avatar Mar 12 '15 23:03 Oleksiy-Yakovenko

Nero tracks use chapters to declare delay and padding, while iTunes uses a special comment atom.

kode54 avatar Aug 29 '15 02:08 kode54

@kode54 it's not only about delay and padding.. last time I checked, deadbeef could not seek at sample-precision in ALAC files.

What that means is that even cuesheet tracks didn't play gapless.

At the time I could not figure out why it didn't work.

Now I'm working on a new mp4 parser, and integrating another aac decoding lib (everything works now, except tag editing).

I hope that I'll be able to figure out this issue as well, while I'm at it.

Oleksiy-Yakovenko avatar Feb 08 '17 14:02 Oleksiy-Yakovenko

What's the status of this one? Just FYI, there's another way of indicating gapless encoding information: elst boxes, containing a single edit that indicates the valid range of samples and the start offset within the stream.

kode54 avatar Apr 04 '20 02:04 kode54

No update on this one. I still didn't get the new AAC implementation fully working. Last time I worked on this, I got a weird issue that half of the test files I have cause fdk-aac to fail, and I couldn't figure why. Clearly, I didn't get to the point of implementing gapless support. Next time I look into this, I might reconsider the use of fdk-aac, and go back to faad2, but first I need to make sure it's not caused with a problem in my code.

Oleksiy-Yakovenko avatar Apr 04 '20 09:04 Oleksiy-Yakovenko

You may also wish to consider that fdk aac also supports adts and adif stream formats, which do not require the out of band setup block, but do require passing the entire frames to it. You’re welcome to look at my semi ugly foobar2000 packet decoder in case it inspires your own input code: https://g.losno.co/chris/foo_pd_aac ... don’t mind the service flood cheat too much, I wanted to make sure my component cheated the service prng for top priority. Maybe I can convince Peter to implement a priority list for packet decoders as well in the future.

kode54 avatar Apr 05 '20 03:04 kode54

Oh, crud. If you look at that, please look at the previous commit, I need to eliminate the latest one. It should still be enough to get a basic idea of packet decoding though.

kode54 avatar Apr 05 '20 03:04 kode54