Help - Search - Members - Calendar
Full Version: @Ivan: Is MPEG-2 AAC MPEG-4 ISO-compliant?
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - General
Chibi Jasmin
I searched through a lot of more or less complicated posts and documents, but couldn't find a simple clear answer, if anyone knows, please help:

There is an MPEG-2 AAC standard and an extended MPEG-4 AAC standard. The question is: Is the "old" MPEG-2 AAC compliant to the MPEG-4 ISO specs?

For example, this is what I found:

"What about MPEG-4. Is there a relationship between AAC and MPEG-4?
Yes there is. AAC will be part of MPEG-4. So all future MPEG-4 decoders should be able to decode MPEG-2 AAC bitstreams as well, at least if provided as a raw data stream without any transmission protocol.

So MPEG-4 AAC will be the same as MPEG-2 AAC?
No, not exactly the same. MPEG-4 AAC will be a superset of MPEG-2 AAC. There are some additional features, namely a different predictor, a method called Perceptual Noise Substitution and a different coding kernel which facilitates scaleable systems, called BSAC (Bit Sliced Arithmetic Coding). For details, please visit our MPEG-4 web pages."

Or:

"MPEG-2 file (normal LC profile) is identical to MPEG-4 LC except 2 bytes in ADTS header. Raw mode without header is identical."
"The MPEG-4 systems layer allows codecs according to existing (MPEG) standards, e.g. MPEG-2 AAC, to be used."

But as I have no clue about this header thing, I don't know, if the MPEG-2 header is compliant also, or only MPEG-4 header...

Another one:

"The presence of the MPEG-2 AAC standard within the MPEG-4 tool set provides for general compression of audio in the upper bitrate range."

But does this refer to MPEG-4 Header? Or MPEG-2 Header. The problem is AACENC LC Profile gives you an MPEG-2 Header (any hidden settings to force it to MPEG-4?) and its raw mode doesn't work with mp4creator. That's why I am using LTP Profile at the moment, which is only part of mpeg-4 to ensure compatibility.

And much more...but it does never clearly state, if MPEG-2 AAC is in ISO-specs, so you can use it without modification (for example this ADTS header thing...is it also compliant with MPEG-2 header)...and there might be other differences between MPEG-2 AAC and MPEG-4 AAC, I don't even know of...
rjamorim
Lemessee if I can clarify things for you.

Theoretically, any player capable of playing MPEG4 AAC is able to play MPEG2 AAC. First, because MPEG2 AAC is identical to MPEG4 AAC - except for the famous 2 bits in the ADTS header. There isn't any kind of "MPEG2 AAC"-only technology - like the "MPEG4 AAC"-only technologies: PNS, LTP and, soon, SBR (I just finished coding the Huffman tables for SBR AAC. biggrin.gif)

MPEG2 AAC is completely compliant with MPEG4 AAC. They share the same compression algorithms. That's why I said somewhere that there's no sense in saying that a RAW AAC file is MPEG4 or MPEG2 - there's no difference! It's plain MPEG AAC.

The headers are the same too. The same structure, either ADIF or ADTS. And both MPEG2 and MPEG4 AAC use these headers.

The raw AAC mode doesn't work with MP4 creator for the simple reason that it's RAW! MP4creator can't guess how many channels there are in the stream, nor the sampling rate.

If you feed a raw AAC to the winamp plugin or FAAD, it will suppose it's 41kHz, 2channels, 16bit; and try to play.

I have already used MPEG2 AAC LC files with MP4creator, and they muxed and played fine. But LTP is fine, too.

Hope it helped.

Regards;

Roberto.
Chibi Jasmin
Thanx for your detailed answer!

I also had used MPEG2 AAC LC files with MP4Creator, but just that it works, doesn't mean it's compliant. But now you said, it is :-)

Is there any difference left in the muxed mp4-files, one from MPEG-2 AAC LC with its own header and one from the same as MPEG-4 AAC LC with its own header ? I mean is the 2 bits difference somehow carried over to the final file or is it only information for the muxer?

But if MPEG-2 AAC really is compliant, it makes no difference anyway...just asking...
rjamorim
QUOTE
Originally posted by Chibi Jasmin
I mean is the 2 bits difference somehow carried over to the final file or is it only information for the muxer?

But if MPEG-2 AAC really is compliant, it makes no difference anyway...just asking...


I'm not 100% sure, but I guess the difference is carried. The reason I believe it is that, if you open a MP4 file in MP4 Winamp plugin (in_mp4), the file info box will show if the audio stream is MPEG2 or MPEG4 AAC.

Regards;

Roberto.
Chibi Jasmin
Good idea to check with WinAmp info box... :-)

And you are 100% sure that even these files with MPEG-2 headers are MPEG4-ISO-compliant? I know you described it already...I understood that compression is the same and all that...but there is a slight difference in the header...I just want to be sure, even the files with MPEG-2 headers are 100% compliant...(imagine a player sticking strictly to the specs and the mpeg-2 headers are not in the specs...although it's the same compression algo, it would not play...)

Sorry, don't wanna bore you...
novocane
If a mpeg-4 aac player can play a mpeg-2 aac file because the coding schemes are identical, then a mpeg-2 aac player can play, at least, a mpeg-4 aac LC file. Am I right?
Chibi Jasmin
Well, if the mpeg-2 player understands the mpeg-4 header :-)

mpeg-2 was before mpeg-4, maybe it doesn't, who knows...I'm just trying to find out the opposite :-)
ssamadhi97
couldn't you change the type of the aac file by just modifying those two bits anyway? :confused: what's the problem?
rjamorim
QUOTE
Originally posted by Chibi Jasmin
And you are 100% sure that even these files with MPEG-2 headers are MPEG4-ISO-compliant? I know you described it already...I understood that compression is the same and all that...but there is a slight difference in the header...I just want to be sure, even the files with MPEG-2 headers are 100% compliant...(imagine a player sticking strictly to the specs and the mpeg-2 headers are not in the specs...although it's the same compression algo, it would not play...)


Well, I guess that a player that sticks 100% to the MPEG2 specs and only these specs would recognize those 2 bits as bad data. Maybe not. Besides those 2 bits, the headers are identical. Someone with an Expanium could clarify. (Although I doubt the Expanium sticks only to the MPEG2 specs)

QUOTE

Sorry, don't wanna bore you...


Hehe, no problem. smile.gif

QUOTE
Originally posted by ssamadhi97
couldn't you change the type of the aac file by just modifying those two bits anyway?  :confused:  what's the problem?


Yes, you could. But I never heard of a program to do that. You would probably need a Hex editor and some knowledge of the AAC file structure.

Regards;

Roberto.
menno
It's not that the 2 bits are different, they are just not there. So I guess it's impossible to hack it with a hex editor. Converting them should be possible, by copying the files bit for bit and skipping those 2 bits on every frame.

Menno
Chibi Jasmin
QUOTE
Originally posted by rjamorim


Well, I guess that a player that sticks 100% to the MPEG2 specs and only these specs would recognize those 2 bits as bad data. Maybe not. Besides those 2 bits, the headers are identical. Someone with an Expanium could clarify. (Although I doubt the Expanium sticks only to the MPEG2 specs)



:-) Wanted to know the opposite :-)

Does a 100% MPEG4-compliant player play an MPEG-2 AAC LC?

Although the difference is 2 bits, these 2 bits might be out of spec? In spec might be only the header with these 2 bits in MPEG4-format...anyone knows an answer: Is MPEG-2 AAC LC 100% compliant to MPEG4-ISO specs?
menno
Without the ADTS headers they are the same.

Menno
Chibi Jasmin
I know, but the question is:

Do the MPEG-4 specs for AAC audio include MPEG-2(!) AAC LC? Or only MPEG-4(!) AAC LC, although the difference is only in the headers, it's a difference and it could be only MPEG-4 headers are in the specs (although it would be stupid).
menno
The MPEG-4 ADTS headers are in the MPEG-4 spec only and the MPEG-2 ADTS headers are in the MPEG-2 AAC spec only.

Menno
Chibi Jasmin
Is that really true? Conclusion:

Psytel Enc default profile output is not MPEG-4 compliant as it is MPEG-2 AAC LC

Is there a possibility to use LC with AAC enc with MPEG-4 headers?
Ivan Dimkovic
Note:

Cisco's MP4Creator will make .mp4 object type ID to "MPEG-2 AAC LC" when it creates .mp4 files out of PsyTEL 2.15 AAC bitstreams (except LTP profile)

Although, there is absolutely no difference between these two streams except in one byte - Envivio Player won't play files with MPEG-2 flag!

I forwarded the problem to Envivio Staff, and I hope they'll react soon smile.gif
Chibi Jasmin
If the above is true, that MPEG-2 headers are not in MPEG-4 specs, I wouldn't call it a problem, if a player that claims to play MPEG-4 doesn't play mp4's with MPEG-2 AAC... :-) Of course, it doesn't hurt....I would be happy having a switch in aacenc to make it use MPEG-4 AAC LC. There might be more of these "MPEG4-Players" software or hardware, that stick to specs, I don't know...
Ivan Dimkovic
I would call it rather a bug in Envivio player (or missed feature) than sticking to specs.

I have AACEnc that generates MPEG-4 profiles only - but I will add a separate switch to a new release.
Chibi Jasmin
Not that I think, it's a good idea to have a player that refuses to play Mpeg2-aac lc but plays mpeg4-aac lc happily....but as you can see by this example there are people implementing it that way....while I have you here Ivan, do you also say that mpeg-2 aac lc is not in mpeg-4 specs but only mpeg-4 aac lc (yeah sure, the one byte difference, but that's what I mean)? You should be the one to know for sure...

And thanx for adding the switch :-)
Ivan Dimkovic
MPEG-2 AAC LC/Main stream is identical to the MPEG-4 AAC LC/Main stream in the .mp4 container. The only difference is Object Type ID byte field.

Although it is not required by the standard - but it would be ridiculous not to support MPEG-2 AAC streams, because of one byte (?!)
M
QUOTE
Originally posted by Ivan Dimkovic
I have AACEnc that generates MPEG-4 profiles only - but I will add a separate switch to a new release.


Hmm? I thought AACEnc 2.15 was already capable of generating MPEG-4 LC streams. At least, those seem to be what I was getting with the "--profile 4" switch (no longer documented in the info, but still there!). Did I miss something?

- M.
Ivan Dimkovic
Hmm.. damn - I will have to take a look at that part of the code (command-line processor) - I haven't done it for a while... smile.gif
ralf
QUOTE
Originally posted by Ivan Dimkovic
Note:

Cisco's MP4Creator will make .mp4 object type ID to \"MPEG-2 AAC LC\" when it creates .mp4 files out of PsyTEL 2.15 AAC bitstreams (except LTP profile)

Although, there is absolutely no difference between these two streams except in one byte - Envivio Player won't play files with MPEG-2 flag!


I know about the difference between MPEG-4 AAC and MPEG-2 AAC, and the difference only in ADTS. Just you said.

But I don't know about the .mp4 file header, And where can I get Cisco's MP4Creator? PLS help.
Ivan Dimkovic
MP4 files don't have ADTS header - this header is stripped out in the MP4 file, because there is no need for it.

So, there is no difference between AAC streams in MP4 file (if no MPEG-4 tools like PNS or LTP are used) except one byte in the file header - so there is no need for any changes to play MPEG-2 AAC

www.mpeg4ip.net
Chibi Jasmin
I thank you for your information...and sure, I think so, too...no need not to play the files...I just thought some people might implement their players not playing it with mpeg-2-"byte"...and you told me I was right (see Envivio)...

Learned a lot... :-)
ralf
QUOTE
Originally posted by Ivan Dimkovic
MP4 files don't have ADTS header - this header is stripped out in the MP4 file, because there is no need for it.


So means: file header + raw data?

QUOTE
Originally posted by Ivan Dimkovic

So, there is no difference between AAC streams in MP4 file (if no MPEG-4 tools like PNS or LTP are used) except one byte in the file header - so there is no need for any changes to play MPEG-2 AAC


Ya, I cut the MP4 file header, and can play as MPEG-2 AAC.
Which document can I find the definitions of .mp4 file header?
Does it like the ADIF?

Thanks your help!
Ivan Dimkovic
QUOTE
Originally posted by ralf

So means: file header + raw data?



Technically, yes - it is ordered slightly different, and AAC bitstream is so-called "audio atom", but its structure is same as 'raw' (headerless) AAC stream.


QUOTE


Ya, I cut the MP4 file header, and can play as MPEG-2 AAC.
Which document can I find the definitions of .mp4 file header?
Does it like the ADIF?

Thanks your help!


Hmm.. check out the mp4v2 library in the MPEG4IP project, it has a very nice documentation. ISO documentation for the libisomediafile (ISO MP4 LIB) is completed, but I am affraid that it is still available to MPEG members only.

Useful link: http://www.mpeg4ip.net
http://www.m4if.org


-- Ivan
ralf
Thanks very much!!!

You are very kind man!

Thanks again^_^
enry2k
I own a Philips expanium exp 301. It only playies aac lc file with mpeg-2 header not mpeg-4 type. So the two bits in the header makes the difference. I want to work on a software tool to convert mpeg-2 header to mpeg-4 and viceversa.
Reguards
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.