Skip to main content

Topic: MP3 is a Container or Codec alone (Read 10088 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • cernall
  • [*]
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?

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
MP3 is a Container or Codec alone
Reply #1
http://en.wikipedia.org/wiki/MP3#File_structure
Metadata is stored in ID3 tag(s).

MP3 is MPEG-1 Audio Layer 3. MPEG-1 can be a container of sorts, though I don't know if this applies to MP3 files, which have just one audio track: http://en.wikipedia.org/wiki/MPEG-1#Program_streams
  • Last Edit: 02 July, 2010, 04:40:38 AM by dv1989

  • odyssey
  • [*][*][*][*][*]
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

  • probedb
  • [*][*][*][*][*]
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

  • spoon
  • [*][*][*][*][*]
  • Administrator
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.

  • Aleron Ives
  • [*][*][*]
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.)

  • saratoga
  • [*][*][*][*][*]
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.

  • mjb2006
  • [*][*][*][*][*]
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.
  • Last Edit: 02 July, 2010, 05:57:23 PM by mjb2006