12

I have an AAC file which I want to tag with information (artist, title, track number, album title etc.) ; unfortunately - it seems AAC does not support most of these tags, and tagger apps refuse to write them.

Can I perhaps convert the file into a different format, with non-lossy conversion (hopefully copy-only), and such that I can have tags in this alternative format? And also open it easily in various media players?

Edit: As for what kind of AAC this is:

$ mediainfo myfile.aac
Complete name                            : myfile.aac
Format                                   : ADTS
Format/Info                              : Audio Data Transport Stream
File size                                : 1.23 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Codec ID                                 : 2
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 1.23 MiB (100%)
einpoklum
  • 8,783
  • 20
  • 84
  • 153
  • 5
    @YisroelTech OP said lossless. MP3 is not lossless. – Kalamalka Kid Jun 15 '23 at 18:15
  • FLAC the audio format. – cybernard Jun 15 '23 at 19:48
  • @cybernard: Why would I recode in a much larger format in order to have meta-data? – einpoklum Jun 15 '23 at 20:49
  • 2
    @KalamalkaKid I know he said lossless, but AAC isn't lossless either... (although maybe it's better than MP3.) So my question was basically for the OP to explain if there is any reason why he decided to have it compressed to ACC but not to the more universal MP3 – Yisroel Tech Jun 15 '23 at 21:09
  • 1
    @einsupportsModeratorStrike The OP wants metadata and did not say anything about space concerns. FLAC stands for Free Lossless Audio Codec The OP also wants a "non-lossy" solution. Hard drive, ssd, usb, or etc is so cheap size is meaningless just buy more, and your done. – cybernard Jun 15 '23 at 21:33
  • @YisroelTech AAC has significantly higher quality than MP3. On top of that, transcoding from one lossy format to another always loses you even more quality. I totally understand that to OP, transcoding to MP3 is unacceptable. – marcelm Jun 16 '23 at 12:15
  • @YisroelTech I don't really see the problem you're having with AAC? It's practically second in line for what counts as "universal" nowadays, and has been for quite a few years. (Look at iTunes, at YouTube, at the hardware players that do MP3 and "MP4"...) – u1686_grawity Jun 17 '23 at 07:56
  • No problem with it, and now understand that OP wants AAC. I was simply asking the OP if he considered converting to mp3 which is more universal and doesn't have the issue he was encountering. – Yisroel Tech Jun 18 '23 at 04:37

3 Answers3

39

.aac files are just a "raw" audio stream, they do not support MP3-style tag embedding because AAC is meant to be used with a separate "wrapper" container format to carry those tags instead. Typically¹ MP4 container files (.mp4 or .m4a) are used for AAC audio.

So if you have raw ".aac" files, repackage (remux) them into ".m4a" and then you can tag them:

ffmpeg -i Foo.aac -c:a copy Foo.m4a

With -c:a copy being specified, ffmpeg will use the existing audio stream as-is (i.e. it will not do a lossy AAC→AAC conversion). You can also add -metadata options to the same command if you want to attach a few standard fields.

You can get FFmpeg for Windows through the official website; on Linux it is typically available as a distribution package.

(I also found "Xmedia Recode" which appears to be a good GUI around FFmpeg; again, make sure you select copying/remuxing without reencoding.)


¹ (Other container formats such as Matroska .mkv/.mka would be possible too – though it would be highly unusual; AAC almost always goes in MP4.)

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
5

I have an AAC file which

I am unsure if the term "AAC" file is well defined. Better post the results of a media analyzing software such as GSpot or MediaInfo to determine if your file is

  1. a file containing a raw AAC stream
  2. AAC embedded in a transport stream format (what you get when you are recording some internet radio streams)
  3. AAC embedded in a mp4a (audio) hull.

My case was number two and those songs could not be played by a Shenzen mp4-Player.

I want to tag with information (artist, title, track number, album title etc.) ; unfortunately - it seems AAC does not support most of these tags, and tagger apps refuse to write them.

Your tagger does not get by with the outer hull of your file - if there is any.

Can I perhaps convert the file into a different format, with non-lossy conversion, and such that I can have tags in this alternative format? And also open it easily in various media players?

Try to embed your aac-file in an mp4-container. That could be

  1. a mp4a-container or
  2. a regular mp4-container (allows for video and audio tracks)

and try to tag them. I suppose number two should work. Your tagger will most likely try to tag the container instead of tagging individual tracks.

mp3-conversion requires reencoding your aac source, blowing your target file size up and degrading the audio quality.

r2d3
  • 3,298
  • 1
  • 8
  • 24
  • 3
    To complicate matters even further, a "raw" AAC stream can actually be in two completely different formats, ADTS and LATM/LOAS. But I guess that's too much information :-) – TooTea Jun 16 '23 at 07:24
  • @TooTea: If you can wrap any of them in an .mwa, then it doesn't matter. – einpoklum Jun 16 '23 at 20:21
-1

Files marked as .aac, whatever their container format, do support as many tags as any music file, when using the right tagger product. It's only Windows Explorer that doesn't display them.

Explorer does not show the tags for files with the .aac suffix for some reason, perhaps because .aac is not taken as a multimedia file. Renaming a .aac file to .mp3 (without any conversion) will cause Explorer to show an empty list of all the tags.

Under Windows/NTFS, file-properties can be included in Alternate data stream (ADS), which is a data extension to the file that doesn't modify its visible data. Some Windows taggers use it to append audio tags to multimedia files, although with this technique any file can be tagged.

Specifically for the poster, his files contain audio encoded in the Advanced Audio Coding (AAC) and encapsulated within Audio Data Transport Stream (ADTS) containers. Moving the AAC audio into MP3 containers, may yet have some effect on the quality when playing the music, even if a very small one (the two container formats are not identical in features).

There exist very many tagger products, although the best ones are payware. One free product is the donationware Mp3tag that can manage the tags on many formats of files (in spite of its name).

Converting to MP3 is an option, but I tend to avoid conversions just for the purpose of adding tags, and because the support of Explorer for tags is very minimal. A good tagger product can do much more than Explorer.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • 2
    Not... quite. AAC can mean multiple things. A file with an AAC extension can be a raw AAC stream (no metadata) or an MP4 container containing AAC stream(s) - with metadata. – Luaan Jun 16 '23 at 06:22
  • @Luaan: I refer to `.aac` files. – harrymc Jun 16 '23 at 07:30
  • 4
    @harrymc The file extension doesn't reliably tell you what the actual filetype is. A file ending in `.aac` can still be both of the things Luaan described. – marcelm Jun 16 '23 at 15:03
  • Converting to MP3 will definitely lower the quality at least a tiny bit. And will worsen the quality-per-bitrate compression efficiency, if you throw a ton of bitrate at it to so the degradation is as small as possible. Even converting to Opus, where the standard encoder is at least on par with AAC for rate-distortion, would be lossy. – Peter Cordes Jun 16 '23 at 17:45
  • @marcelm: I know all that, and this wasn't the point in my answer. I added more information to explain that the problem is the tool, not the file format. – harrymc Jun 18 '23 at 08:00
  • 1
    @harrymc But according to other answers here, raw AAC streams (which is what OP may have) don't support tags. If you argue they do, could you cite a source? – marcelm Jun 18 '23 at 08:07
  • @marcelm: There doesn't exist anything like a raw AAC stream, this bullshit is based on the misunderstanding of the difference between codec and container. Read [Advanced Audio Coding (AAC)](https://en.wikipedia.org/wiki/Advanced_Audio_Coding). AAC is just a high-quality codec that encodes the audio that in turn can be integrated inside containers of various formats. It cannot exist as a valid music file without being stored inside *some* container. Explorer doesn't like the `.aac` suffix, but then Explorer was never meant to be a tagger. – harrymc Jun 18 '23 at 08:15
  • @harrymc Verbatim from your own link: _"These containers, as well as a raw AAC stream, may bear the .aac file extension."_ – marcelm Jun 18 '23 at 10:38
  • @marcelm: Everything is possible, just that the file needs to be playable. – harrymc Jun 18 '23 at 10:44
  • 1
    "Without being stored inside some container" is generally how MP3 works; the contents of an .mp3 file are nothing more but a series of "raw" MP3 audio frames, with the metadata tags being disguised as invalid frames (not sure if that still applies to ID3v2.4 but that's how ID3 used to work in the past). The same goes for .aac files, at least the specific kind that OP has – they consist of a series of ADTS audio frames without any surrounding "container" structure, but unlike with MP3 there's no *agreed-upon* way to stash any metadata in that, which is why taggers aren't able to do it. – u1686_grawity Jun 18 '23 at 10:48
  • @user1686: All multimedia containers are organized in blocks. Audio Data Transport Stream (ADTS) specifically is itself a container format specified by MPEG-4 Part 3 for audio data, intended to be used for streamed audio such as Internet radio. Playable raw audio does not exist, although raw audio can be generated artificially for use while dubbing etc. – harrymc Jun 18 '23 at 12:08
  • 1
    Playable raw audio does exist – that's PCM, there are plenty of cases where you just put raw PCM values in a file as a series of uint16 values without any further structure. There are no blocks and no containers in that. (Unless you call the file itself a container, which really stretches the goalposts.) – u1686_grawity Jun 18 '23 at 14:06
  • @user1686: Close, but no. To be playable even Linear PCM audio needs a container, even if that's trivially only a header. The player needs *something* to know what it's playing. Most PCM files need a container structure with a block structure for multi-channels. Super-simple containers are not very common. – harrymc Jun 18 '23 at 14:55
  • Well, no, that _something_ doesn't necessarily have to come from within the file. It could just as well be indicated by the file's name/extension (just like the file extension already has to indicate what kind of container the player should attempt parsing), e.g. `.au` files used to be headerless and players just knew that all .au files had audio stored in that specific format, and tools like sox/ffmpeg can work with `ffmpeg -f s16le -c:a pcm_s16le` or `sox -f raw`. – u1686_grawity Jun 18 '23 at 20:20
  • @user1686: No point in continuing in searching for a format, when for this post this is already wrong. A pity that in the end this post and its accepted answer will only propagate the poster's wrong conceptions to future readers. – harrymc Jun 19 '23 at 07:42
  • 2
    Right, I see you're going to stick to "I'm not wrong despite specific proof of me being wrong" like you always do. It's insulting. – u1686_grawity Jun 19 '23 at 09:46
  • @user1686: I always stick to what I believe is right, and I think that I have proven my point here. We all believe in what we say, but usually only one person is right, which doesn't detract from the other answers. You shouldn't feel insulted when the other person is being polite. I have proffered no insult that I can see, but I offer my apologies if you feel this way. This wasn't my intention at all. – harrymc Jun 19 '23 at 09:58
  • This answer misses the forest for the trees and doesn't really solve the problem. @user1686 hits the nail on the head, emphasis mine: *The same goes for .aac files, **at least the specific kind that OP has** – they consist of a series of ADTS audio frames without any surrounding "container" structure, but **unlike with MP3 there's no agreed-upon way to stash any metadata in that**, which is why taggers aren't able to do it.*. In what way is using an m4a container for the stream instead (where there is agreed-upon tagging) not the most straightforward solution? – Mark Sowul Jun 19 '23 at 22:04
  • @MarkSowul: The standard does not support metadata, but non-standard extensions do exist, as always by adding non-audio blocks. I have been able to add metadata using third-party taggers to such files, although naturally Explorer doesn't show them. I suspect that `.aac` files are not recognized by Explorer as multimedia files, which is part of the problem. – harrymc Jun 20 '23 at 07:50