Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MP3 is a Container or Codec alone (Read 17733 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MP3 is a Container or Codec alone

We can se files with MP# extension. Is MP3 a container also, or it is a codec alone?

If its a codec alone, then how can we play and have some meta information in the mp3 files?


MP3 is a Container or Codec alone

Reply #2
I understand your confusion.

mp4 is a container, usually containing aac audio and/or avc video.
mp3 is audio probably with a sort of it's own container, allowing tags etc to be stored.
Can't wait for a HD-AAC encoder :P

MP3 is a Container or Codec alone

Reply #3
But it's not actually a container as such, audio formats have headers and such so I'm guessing tags are essentially just extra data in the headers?

Of course I could be completely wrong

MP3 is a Container or Codec alone

Reply #4
I think the definition of a container (m4a, wav, aiff, etc) is that it should be able to contain different audio formats. Mp3 (if you ignore the mp3 surround distraction), only holds mp3.

MP3 is a Container or Codec alone

Reply #5
I think the definition of a container (m4a, wav, aiff, etc) is that it should be able to contain different audio formats. Mp3 (if you ignore the mp3 surround distraction), only holds mp3.

Yeah, the naming convention isn't consistant, which is rather confusing to people. MP3 is just a codec, because a file with the .mp3 extension is always MP3 audio. The successor to MP3 is AAC, and files with the .aac extension are "raw" AAC audio the same way MP3 audio is always presented. Unfortunately, AAC is often stored in MP4, which is a container, not a codec. MP4 can hold AAC audio, AVC video, or both, but MP4 itself is not content. It always has to hold something else, which is what makes it a container. (MP4 can also hold MP3 audio, XviD or DivX video, and any other number of formats. AVC/AAC are just the most common contents of MP4 containers.)

MP3 is a Container or Codec alone

Reply #6
We can se files with MP# extension. Is MP3 a container also, or it is a codec alone?

If its a codec alone, then how can we play and have some meta information in the mp3 files?


MP3 is basically a raw bitstream (similar to .AAC) with tags stuck into it by exploiting how the mp3 spec says a bitstream should be parsed to hid extra data in a semi-backwards compatible way.  Its not really a container in that its not officially standardized, but rather grew organically over the years.

MP3 is a Container or Codec alone

Reply #7
Answering the original questions... [this is basically just a longer version of saratoga's reply, which came in while I was typing]
Quote
how can we play and have some meta information in the mp3 files?
Quote
I'm guessing tags are essentially just extra data in the headers?

MP3 data is just the audio data segments ('frames') which, in series, compose a 'stream'. Each frame has its own header containing technical metadata about that frame (format version, bitrate, stereo mode, etc.), but nothing about the entire stream - no artist, title, etc.; AFAIK that kind of metadata was deliberately omitted from the MP3 spec, perhaps because it was thought that if a container format were needed, a suitable one would be properly developed by the industries that were interested in MP3.

So instead, at least for the way most of use MP3, various ad-hoc, not-very-well-thought-out-or-standardized methods have been devised to append or prepend chunks of formatted data ('tags') to a given stream. The most popular tag format has long been ID3, of which there are several versions, but APEv2 seems to be increasingly popular. These tags are basically garbage (in that they're not MP3 data) on the ends of the stream, but the programmers' maxim "be strict in what you produce and lenient in what you accept" dictates that consumers of ".mp3" files concentrate on whatever MP3 frames are there, and either properly handle or just ignore any garbage—er, tags. You can think of the file as being a 'container', then, but really it's just an MP3 stream possibly with other stuff embedded. Generally, you should expect that any MP3 file you run across will have no tags, or one tag, or many tags, all in different formats, and possibly at inconsistent locations.