Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FourCC error with aac files #204

Closed
noquierouser opened this issue Apr 28, 2019 · 8 comments
Closed

FourCC error with aac files #204

noquierouser opened this issue Apr 28, 2019 · 8 comments
Assignees
Labels
bug Bug, will addressed with high priority

Comments

@noquierouser
Copy link

Bug description
An exception is raised by a couple of .aac files, one untagged and the other two tagged with mp3tag and VLC, related to FourCC contains invalid characters. All files play without issue in VLC.

FourCC error sets:

  • 2e 7f fc 21 as invalid characters for untagged and VLC tagged files.
  • 00 00 00 00 as invalid characters for mp3tag tagged file.

Expected behavior
No exception raised and metadata read and available.

Audio file demonstrating the problem
TestFiles.zip

@Borewit Borewit self-assigned this Apr 28, 2019
@Borewit
Copy link
Owner

Borewit commented Apr 28, 2019

Thanks for reaching out @noquierouser.

The attached audio files MPEG-2/AAC.

The error is caused due to the fact these .aac files are currently interpreted as an MPEG-4.
But apparently .aac files can either be MPEG-2 or MPEG-4:

AAC has been standardized by ISO and IEC, as part of the MPEG-2 and MPEG-4 specifications.

source: wiki.

I guess I need to add MPEG-2/AAC support: #205

@Borewit Borewit added the bug Bug, will addressed with high priority label Apr 28, 2019
@noquierouser
Copy link
Author

Interesting, I didn't know this was a thing. I always thought aac files were MPEG-4. Guess I was wrong.

Thanks for the quick response. :)

@Borewit
Copy link
Owner

Borewit commented Apr 28, 2019

Interesting, I didn't know this was a thing. I always thought aac files were MPEG-4. Guess I was wrong.

I was not aware neither until today.

@Borewit
Copy link
Owner

Borewit commented Apr 28, 2019

It is extremely confusing. I intend to say that the atom based structure (as found in m4a, mp4) is the way an MPEG-4 audio container is structured. For MPEG-2 I expected the Audio Layer I/II/III.
Well, in your files they use ADTS which definitely not the atom structure, which looks like an extension of the Audio Layer I/II/III.

This MPEG Audio Layer I/II/III audio container format is used by MP3, still the most popular audio format around, but by far the most ugly container in my opinion.

In this ADTS header they re-assigned the MPEG 'version' to be able point to MPEG-2, MPEG-4.

Huh... MPEG-4 was the atom like structure, but this was the MPEG-2 like container, which is now called ADTS, is saying it is MPEG-4... 😕

@noquierouser
Copy link
Author

It sounds like there was an undocumented change of structure for MPEG-4 audio containers, or so I take from what you're telling. Or maybe an implementation off the standards that makes use of flags or something.

Maybe DASH related?

@Borewit
Copy link
Owner

Borewit commented Apr 29, 2019

So far the files seems to be according to their specs (although based on unofficial Internet specs, but it seems to be consistency with different sources). Problem is there are so many standards around, and the MPEG/ISO documentation is not public accessible (at east not free of charge), which doesn't help.

But I think the wiki page explains it well, AAC can be encoded in the following containers:

  1. MPEG/3GPP container
    extensions: .m4a, .mp4, .3gp

  2. Apple container
    extensions: .m4a, .m4b, .m4p, .m4r, .m4v

  3. ADTS stream
    extensions: .aac

I believe the first 2 are similar. The third category, the ADTS, the one used in your samples, are basically a kind of retro fit on the MPEG frames as used in MP3's.

Borewit added a commit that referenced this issue Apr 29, 2019
@Borewit
Copy link
Owner

Borewit commented Apr 29, 2019

Implemented in v3.7.0

@Borewit Borewit closed this as completed Apr 29, 2019
@Borewit
Copy link
Owner

Borewit commented Apr 30, 2019

Related sindresorhus/file-type#208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, will addressed with high priority
Projects
None yet
Development

No branches or pull requests

2 participants