Log in

View Full Version : Project announcement : New opensource AAC DirectShow filter, hosted on corecodec.org


Pages : 1 [2] 3 4

bond
9th June 2003, 15:52
Originally posted by Defiler
Have you had any luck converting longer files than that? Nero chokes, even with the replacement WAV plugin, and once the file gets large enough to need BeSplit, I can't get anything. Hrurrhrrhg. i started a thread about an ac3 plugin for nero, which would enable direct ac3->mp4 conversion.
look here (http://forum.doom9.org/showthread.php?s=&threadid=55173) (not much response till now, but i think such a plugin will solve the problems with nero!)

ChristianHJW
9th June 2003, 21:17
Originally posted by Defiler Have you had any luck converting longer files than that? Nero chokes, even with the replacement WAV plugin, and once the file gets large enough to need BeSplit, I can't get anything. Hrurrhrrhg.

It is simple :

BeSweet rockkks !

In the BeSweet output options, set '5.1 AIF' instead of '5.1 WAV', and the new Nero will read it nicely, even 10 GB files :) ....

Defiler
9th June 2003, 21:31
Originally posted by ChristianHJW
In the BeSweet output options, set '5.1 AIF' instead of '5.1 WAV', and the new Nero will read it nicely, even 10 GB files :) .... Oh my God. Trying this when I get home. Thanks. Heh.

CaptainCarrot
9th June 2003, 21:57
Originally posted by ChristianHJW
In the BeSweet output options, set '5.1 AIF' instead of '5.1 WAV', and the new Nero will read it nicely, even 10 GB files :) ....
At least if you have 512MB RAM... cause with 256MB NERO kept crashing at ~50% with a 2,7GB aiff-file, and I tried often. Then I added another 256MB, and haven't had one crash since.

Wilbert
11th June 2003, 10:09
I don't get it to work with Nero. aiff --> mp4 --> AAC (with modified mp4creator on rarewares) works fine, except that the bitrate is always 128 kbps (no matter what you choose). But if you mux it (tried both: aac and mp4 (using 3ivx)) with mkv (using mkvmerge of course) the audio stream is converted/identified to/as a mp3 track. If needed I can post an example tomorrow.

The aac's made with aacenc or faac work fine :)

Mosu
11th June 2003, 10:16
Originally posted by Wilbert
But if you mux it (tried both: aac and mp4 (using 3ivx)) with mkv (using mkvmerge of course) the audio stream is converted/identified to/as a mp3 track. If needed I can post an example tomorrow.

I think I've already fixed that bug with the file type detection - but please do upload a short sample (1 megs is more than enough) to be sure. I'll release a new version soon which will contain that bug fix, so please be patient a bit longer. Thanks :)

ChristianHJW
11th June 2003, 10:16
@ Wilbert : dont use mp4creator to demux the AAC from the MP4 that Nero creates. Its much easier :D : in the Nero 'properties' page, tick the box

'Export to ISO xyz AAC stream'

After it is finished with creating the MP4, Nero will automatically generate a 2nd file, being a valid AAC stream, and mkvmerge muxes it fine :)

BTW :

If your source AVI has an audio stream already ( maybe MP3 ? ), dont forget the '-A' switch in the CLI, like

mkvmerge.exe -o output.mkv -A input.avi audio.aac ( edited :rolleyes: )

else your MP3 from the AVI will be muxed into the final mkv also, and have first position in it ( audio track #1 ), so a player without audio stream switcher will always play the MP3 only ;) ...

Check the HTML docs coming in the 0.4.2 binaries of mkvmerge, its explaining every switch in detail, and where to place it ....

bond
11th June 2003, 10:22
Originally posted by ChristianHJW
dont use mp4creator to demux the AAC from the MP4 that Nero creates. Its much easier :D : in the Nero 'properties' page, tick the box

'Export to ISO xyz AAC stream'

After it is finished with creating the MP4, Nero will automatically generate a 2nd file, being a valid AAC stream, and mkvmerge muxes it fine :)this will create a mpeg-2 aac stream in the .aac file whereas in the .mp4 file there is the mpeg-4 stream!

as most tools will use only .mp4 as audio container (and not the old .aac format) it will be really important imho to support .mp4 audio stream input in matroska tools (like mkvmerge and virtualdubmod).
it is also important because newer (mpeg-4) codec technologies like sbr (aac+) are not mpeg-2 compliant (only mpeg-4)!

more info on that on audiocoding.com...

Mosu
11th June 2003, 10:24
Oh my, never let Chris use a command line interface ;)

Originally posted by ChristianHJW
BTW :

If your source AVI has an audio stream already ( maybe MP3 ? ), dont forget the '-A' switch in the CLI, like

mkvmerge.exe -o output.mkv input.avi -A audio.aac

else your MP3 from the AVI will be muxed into the final mkv also, and have first position in it ( audio track #1 ), so a player without audio stream switcher will always play the MP3 only ;) ...

While the description is correct the syntax is not :) Options on the command line apply to the FOLLOWING input file. So in this case -A would be safely ignored (mkvmerge will also print a warning about that) and the sound from the AVI will still be used. The corrent command line is:

mkvmerge.exe -o output.mkv -A input.avi audio.aac

Wilbert
11th June 2003, 10:34
Thanks for all the comments,


'Export to ISO xyz AAC stream'

After it is finished with creating the MP4, Nero will automatically generate a 2nd file, being a valid AAC stream
I checked that iso option, but I didn't see it also creates an AAC stream (although I installed the latest update). I will try it again ...


If your source AVI has an audio stream already ( maybe MP3 ? ), dont forget the '-A' switch in the CLI, like

mkvmerge.exe -o output.mkv -A input.avi audio.aac

else your MP3 from the AVI will be muxed into the final mkv also, and have first position in it ( audio track #1 ), so a player without audio stream switcher will always play the MP3 only ...
Except my mkv (XviD) didn't have any audio stream ...

I will look at it again tonight ...

Wilbert
13th June 2003, 15:21
Some tests/comments:

all files are located here: http://www.geocities.com/wilbertdijkhof/Surround.zip

faac v1.17:
bugs:
- don't know, anyone?

PsyTel aacenc 2.15:
bugs:
- can't handle large 5.1 WAV files

nero plugin (make sure 'Export to ISO xyz AAC stream' is checked, so that a mp4 and an aac is created):
bugs:
- can't handle 5.1 WAV files (needs 5.1 AIFF)
- samplerate fixed to 44.1 kHz (your samplerate will be converted to 44.1 kHz)
- older versions of Nero have a sampler bug, so it is better to feed it with 5.1 AIFF 44.1 kHz
- bitrate fixed to 128 kbps (whatever you choose)

Anyway: muxing of all the three aac's with a mkv stream went fine. Only the following doesn't work:

Create aac stream from mp4 using the patched mp4creator60: http://rarewares.hydrogenaudio.org/mp4.html
I used the following command lines:
mp4creator60 -extract=1 sample.mp4 sample.aac -mpeg-version 2 [works fine]

merge this aac file with a mkv stream:

mkvmerge.exe -o output.mkv -A input.avi audio.aac [doesn't work]

both the audio files are in the zip file (the AC3 is the original one).

Mosu
13th June 2003, 19:04
Originally posted by Wilbert
Create aac stream from mp4 using the patched mp4creator60: http://rarewares.hydrogenaudio.org/mp4.html
I used the following command lines:
mp4creator60 -extract=1 sample.mp4 sample.aac -mpeg-version 2 [works fine]

merge this aac file with a mkv stream:

mkvmerge.exe -o output.mkv -A input.avi audio.aac [doesn't work]

Thanks for your feedback. Obviously mp4creator only writes the ADTS headers once at the beginning of the file. Unfortunately I don't know how to find frame boundaries in the raw AAC stream and do need the ADTS headers for each packet. That's why it does not work.

hans-jürgen
13th June 2003, 19:27
Originally posted by Wilbert
faac v1.17:
bugs:
- don't know, anyone? Of course not... ;) At least not any known ones except lacking coding tools like channel coupling or resampling that would help with a lower bitrate for multichannel files and probably also improve the sound quality for stereo files at or below 64 kbps/channel. But this will hopefully happen in the future when knik (or someone else) finds the time for implementing them.

PsyTel aacenc 2.15:
bugs:
- can't handle large 5.1 WAV files More important for multichannel usage: it mixes up the channels in the M/S matrix, so the sound is very weird, and these bugs will not be fixed anymore.

nero plugin (make sure 'Export to ISO xyz AAC stream' is checked, so that a mp4 and an aac is created): I've read this several times now and don't understand what's wrong here, because it should be possible to use the MPEG-4 version of an AAC file, either as *.aac or *.mp4, because other MP4 players don't know a MPEG-2 AAC file (like QuickTime 6) and will not be able to play it if someone decides to convert the *.mkv to *.mp4 for example.

bugs:
- can't handle 5.1 WAV files (needs 5.1 AIFF) It can with the fixed WAV input plugin from RareWares, but only up to 2 GB.

- samplerate fixed to 44.1 kHz (your samplerate will be converted to 44.1 kHz)
- older versions of Nero have a sampler bug, so it is better to feed it with 5.1 AIFF 44.1 kHz Never heard of those ones...

- bitrate fixed to 128 kbps (whatever you choose) Definitely wrong, or you are using a very outdated Nero version (there was a bug that influenced the VBR bitrate by reading the CBR setting, too) or you are doing something wrong.

Animaniac
13th June 2003, 21:55
Originally posted by hans-jürgen


Definitely wrong, or you are using a very outdated Nero version (there was a bug that influenced the VBR bitrate by reading the CBR setting, too) or you are doing something wrong.

I think he's referring to the fact that it doesn't remember your previous settings and defualts to 128 kBps CBR.

tiki4
15th June 2003, 14:05
@hans-jürgen:

There seems really a problem with MPEG4-AAC as I got that problem, too. I don't know why, but when I encode a multichannel AIFF to MP4 in NERO (by the way latest version has no problem with 48 kHz files) and I extract the AAC in the MP4 with latest mp4UI I get very weird values in the ADTS header when I choose MPEG4. AACInfo from Menno shows the right bitrate and things when I export to MPEG2-AAC. The MPEG4-AAC shows bitrate 0 and length is totally wrong. Those files are of course not accepted by mkvmerge.

Dunno, where the problem is.

tiki4

bond
15th June 2003, 14:25
why doesnt support mkvmerge (and hopefully virtualdubmod in the future too) .mp4 as input format?

Mosu
15th June 2003, 14:43
Originally posted by bond
why doesnt support mkvmerge (and hopefully virtualdubmod in the future too) .mp4 as input format?

'cause I don't have the time to code a MP4/Quicktime parser at the moment. And no, I don't want to rely on yet another external library like mp4v2 or something like that...

Besides personally I don't care enough about AAC. mkvmerge can read AAC files with ATDS headers, faac can produce those, so MP4 does not have such a high priority as you might wish. Sorry.

bond
15th June 2003, 14:57
Originally posted by Mosu
Besides personally I don't care enough about AAC. mkvmerge can read AAC files with ATDS headers, faac can produce those, so MP4 does not have such a high priority as you might wish. Sorry.:(
faac isnt the best possibility by far to create aac files at the moment! quicktime (Dolby Consumer Encoder), nero (its own encoder) and sorensen (FhG's Professional encoder) produce much better quality especially at low bitrates and they all produce .mp4 output (ok nero can output old mpeg-2 aac files too)
i guess new aac+ (mpeg-4 standard) will also be available in .mp4 files only but we will see...
nobody can be forced to do what he doesnt want ;)

Mosu
15th June 2003, 15:04
I didn't want to say that I won't implement a MP4 at all, I just won't do it right now ;)

bond
15th June 2003, 15:21
:p

hans-jürgen
15th June 2003, 17:44
Originally posted by tiki4
I don't know why, but when I encode a multichannel AIFF to MP4 in NERO (by the way latest version has no problem with 48 kHz files) and I extract the AAC in the MP4 with latest mp4UI I get very weird values in the ADTS header when I choose MPEG4. Hmm, does this only happen with Nero AAC files that are extracted from the MP4 container? Then there might be something wrong with Nero's MP4 header...

Or does this also happen with PsyTEL or FAAC files that had been muxed earlier to MP4 with either mp4UI or mp4creator (latest versions)? Then there could be someting wrong with these tools, since Mosu claimed that there would be only one ADTS header at the beginning of an extracted AAC file which would be a new bug of course (every frame in an AAC file should get an own ADTS header while extracting). But I don't think that this is really the case, otherwise there would have been much more bug reports in the meantime, also for normal audio-only files. And Enrico tested this usage of the -mpeg-version switch quite thoroughly in the past, because he needs it for his QuickTime MP4 files that he wants to play on a Philips Expanium portable.

AACInfo from Menno shows the right bitrate and things when I export to MPEG2-AAC. The MPEG4-AAC shows bitrate 0 and length is totally wrong. Those files are of course not accepted by mkvmerge. I'm not sure that you can further rely on AACInfo, because this tool hasn't been updated for a very long time and doesn't know of the MPEG revision for ADTS header for example. So a better way to look at an AAC file header is probably Winamp 2.x or foobar2000 (with the latest input plugins) using their file info then.

Does this broken MPEG-4 AAC file play in any audio player perhaps? If it is really screwed up, it might be the same problem that once happened with extracted QuickTime 6.0 MP4 files. Enrico had to hexedit them, because the channel configuration was wrong, but after the next QT update this error did not occur any longer. By the way, the "ISO..." AAC files from Nero never have similar problems, or do they?

hans-jürgen
15th June 2003, 18:41
Originally posted by bond
:(
faac isnt the best possibility by far to create aac files at the moment! Hohooo, did you help Roberto doing the statistical analysis of his AAC comparison? :p

quicktime (Dolby Consumer Encoder), No multichannel or VBR support, probably for some more months at least...

nero (its own encoder) Buggy till eternity... ;)

and sorensen (FhG's Professional encoder) produce much better quality especially at low bitrates and they all produce .mp4 output (ok nero can output old mpeg-2 aac files too) Most of this is true (don't know about multichannel support in Sorenson though, but it can't do VBR either), and I also wonder if the CoreAAC filter recognizes MPEG-4 AAC files perhaps which would make things a bit easier already (the FAAD2 source enables this). Playing MP4 files on its own without the help of the 3ivx/Open QuickTime media splitter would probably be better, too, if it wants to be taken seriously as a DS filter, otherwise people might as well stay with 3ivx (when it's able to play multichannel AAC audio), mpegable or EnvivioTV. But this is only my opinion, no harm or pushing intended.

i guess new aac+ (mpeg-4 standard) will also be available in .mp4 files only but we will see... No, the MPEG at least plans to add High-Efficiency AAC (i.e. AAC+) to the MPEG-2 AAC standard, too.

nobody can be forced to do what he doesnt want ;) Right, but some people just can't stop trying... ;)

rjamorim
15th June 2003, 19:15
Originally posted by hans-jürgen
Hohooo, did you help Roberto doing the statistical analysis of his AAC comparison? :p

He didn't need to. FAAC was fated for doom even before the test started. Everybody knew it couldn't compete well with well-tuned encoders.

No multichannel or VBR support, probably for some more months at least...

Still, QT CBR at 128 is better than Psytel and Nero -streaming according to a quick test conduced by Guruboolez

For that reason, it'll probably be used in the extension test.

Buggy till eternity... ;)

You can still use AACenc. It's not as buggy and supports multichannel.

Most of this is true (don't know about multichannel support in Sorenson though, but it can't do VBR either)

Sorenson is stereo only.

and I also wonder if the CoreAAC filter recognizes MPEG-4 AAC files perhaps which would make things a bit easier already (the FAAD2 source enables this). Playing MP4 files on its own without the help of the 3ivx/Open QuickTime media splitter would probably be better, too, if it wants to be taken seriously as a DS filter, otherwise people might as well stay with 3ivx (when it's able to play multichannel AAC audio), mpegable or EnvivioTV. But this is only my opinion, no harm or pushing intended.

I think that is a very bad idea.

For example: OK, you can play MP4 audio files with the filter. But what if you want to play an MP4 audio+video file? The video would have to be passed through the audio decoder to then be fed to the video decoder. That can potentially lead to synchronization issues.

Besides, a demultiplexer and a decoder really belong to separate places. If people are too lazy and would rather stay with 3ivX, that is based on a deprecated decoder and has no multichannel support, it's their problem. Choice is good. And I chose CoreAAC, because it's much better and faster than 3ivX.

Regards;

Roberto.

Mosu
15th June 2003, 20:02
Originally posted by hans-jürgen
Hmm, does this only happen with Nero AAC files that are extracted from the MP4 container? Then there might be something wrong with Nero's MP4 header...

Or does this also happen with PsyTEL or FAAC files that had been muxed earlier to MP4 with either mp4UI or mp4creator (latest versions)?

I don't know if this is a bug. It does not happen with faac 1.1 (the official version), but it happens with a CVS build of faac which I've made a couple of weeks ago - but then again only with mpeg4, not with mpeg2.

Then there could be someting wrong with these tools, since Mosu claimed that there would be only one ADTS header at the beginning of an extracted AAC file which would be a new bug of course (every frame in an AAC file should get an own ADTS header while extracting). But I don't think that this is really the case, otherwise there would have been much more bug reports in the meantime, also for normal audio-only files. And Enrico tested this usage of the -mpeg-version switch quite thoroughly in the past, because he needs it for his QuickTime MP4 files that he wants to play on a Philips Expanium portable.

Maybe I just don't know the AAC specs well enough. The MPEG4 ADTS header is 58 bits long which is not byte-aligned. So the data itself has to be shifted, and maybe the next header is not byte aligned either? On the other hand my ADTS search function probes each byte of the stream, so after 4 packets the ADTS header would be aligned again and my function would find a header. But the resulting files all contained exactly one packet, so my guess is that there is definitely only one ADTS header.

DeXT
15th June 2003, 22:40
Originally posted by Mosu
I don't know if this is a bug. It does not happen with faac 1.1 (the official version), but it happens with a CVS build of faac which I've made a couple of weeks ago - but then again only with mpeg4, not with mpeg2.

Maybe I just don't know the AAC specs well enough. The MPEG4 ADTS header is 58 bits long which is not byte-aligned. So the data itself has to be shifted, and maybe the next header is not byte aligned either? On the other hand my ADTS search function probes each byte of the stream, so after 4 packets the ADTS header would be aligned again and my function would find a header. But the resulting files all contained exactly one packet, so my guess is that there is definitely only one ADTS header.

According to the Wiki (http://www.audiocoding.com/wiki/index.php?page=ADTS) at Audiocoding, the new MPEG-4 ADTS headers no longer have the emphasis field, thus making them 56 bits long instead of 58. Both mp4UI and the latest faac create such AAC files, which are standard-compliant, so I think the following lines (from aac_common.cpp)

if (id == 0)
bc.get_bits(2, bits); // emphasis, MPEG-4 only should be removed in order to properly read them.

tiki4
16th June 2003, 08:14
O.K.,

thanks for the info that aacinfo is also outdated now. Maybe that one should be updated or removed from RareWares. Anyway it was a very usefull tool to get some quick info about the files. AFAIK all those MPEG4-AAC files play well in Winamp or foobar2000. I just couldn't add them to Matroska files with mkvmerge up to 0.4.2, I didn't yet test the new version. I always extracted with mp4UI 0.95a, I don't know about the patched version of mp4creator. Anyway MPEG2-AAC always worked so far and threy're really the same.

tiki4

Does DeXT lastest post indicate that the problem is in mkvmerge?

hans-jürgen
16th June 2003, 08:15
Originally posted by DeXT
According to the Wiki (http://www.audiocoding.com/wiki/index.php?page=ADTS) at Audiocoding, the new MPEG-4 ADTS headers no longer have the emphasis field, thus making them 56 bits long instead of 58. Right, thank you for helping out in the meantime... :)

Both mp4UI and the latest faac create such AAC files, which are standard-compliant, Err... mp4UI can extract AAC files from a MP4 container (just like mp4creator), but cannot create them, as far as I know. Or did Markus add an encoder to his GUI? And FAAC produces 56 bit long MPEG-4 AAC ADTS headers since version 1.16, as far as I remember.

so I think the following lines (from aac_common.cpp)

if (id == 0)
bc.get_bits(2, bits); // emphasis, MPEG-4 only should be removed in order to properly read them. Looks correct to me (i.e. you're right), and these lines are probably also responsible for the other problems reported with AAC, MPEG-2 and 4 and CoreAAC. So please don't use outdated sources from the FAAC project anymore (including FAAD2), because there have been a lot of changes in the last few months. You can find new source packages in the download section of Audiocoding.com and informations about these changes in the Wiki and the forum.

Mosu
16th June 2003, 08:50
Originally posted by DeXT
According to the Wiki (http://www.audiocoding.com/wiki/index.php?page=ADTS) at Audiocoding, the new MPEG-4 ADTS headers no longer have the emphasis field, thus making them 56 bits long instead of 58. Both mp4UI and the latest faac create such AAC files, which are standard-compliant, so I think the following lines (from aac_common.cpp)

if (id == 0)
bc.get_bits(2, bits); // emphasis, MPEG-4 only should be removed in order to properly read them.

Interesting. When implementing the reader I've used that very Wiki - and at that time it still contained the emphasis field. So after removing those two lines and fixing some other stuff it seems to work (I'm at work at the moment and compiling at home via SSH, so I can only judge by the file size, but it looks ok for the Surroundtest(mp4creator).aac file that failed before).

So expect a new release 0.4.5 tonight which might work (or not, we'll see ;)).

hans-jürgen
16th June 2003, 09:00
Originally posted by tiki4
thanks for the info that aacinfo is also outdated now. Maybe that one should be updated or removed from RareWares. Anyway it was a very usefull tool to get some quick info about the files. Right, but at least my version from Sep 4, 2002 shows these informations about a test file done with FAAC 1.17 (default settings except for the added -m4 switch):

MPEG version: 4
channels: 2
sampling_rate: 44100
bitrate: 570200
length: 0.000
object_type: LC
headertype: ADTS

while foobar2000 shows this correct file info:

codec = AAC
stream type = ADTS
bitrate = 129
channels = 2
samplerate = 44100

But I admit that there should be some more lines here, e.g. length, object type and MPEG version of course, maybe an ID for FAAC instead of just "codec" etc....

I always extracted with mp4UI 0.95a, I don't know about the patched version of mp4creator. Anyway MPEG2-AAC always worked so far and threy're really the same. You might also want to try the new "Ivan & Menno" from Speek (v1.7), because he added all possible new conversion options from mp4creator, too, and also found the flaws with codecs not starting immediately etc. The new version already comes with mp4creator, so you don't have to get it separately from RareWares.

Does DeXT lastest post indicate that the problem is in mkvmerge? Probably, yes (see my answer to DeXT).

hans-jürgen
16th June 2003, 10:06
Originally posted by rjamorim
He didn't need to. FAAC was fated for doom even before the test started. Everybody knew it couldn't compete well with well-tuned encoders. "Fated for doom9", you mean? ;) You know that most of the talk here and in other threads is dealing with multichannel AAC audio, so it's also important to keep an eye/ear on the different capabilities of the AAC codecs in this respect. And you also know what opinion I have about the FAAC sound when encoding samples with almost no mono-like content (like in Mahler.wav, but probably also in 5.1 WAV files with a separate centre channel), so I don't agree with this generalized comment. But I also think that knik (or someone else) still has some work to do (joint stereo, resampling) when FAAC is supposed to encode normal stereo files, that's why I mentioned it on its Wiki page, too.

Still, QT CBR at 128 is better than Psytel and Nero -streaming according to a quick test conduced by Guruboolez How quick was that, i.e. how many samples? Did he also compare the -streaming preset with the -br 128 setting of both codecs? That would be interesting to read indeed.

You can still use AACenc. It's not as buggy and supports multichannel. First, did you perhaps disable smilies in your preferences somehow? ;) Second, PsyTEL is the buggy multichannel AAC codec, not Nero (anymore) or FAAC... ;) ;)

Sorenson is stereo only. OK, thanks.

Besides, a demultiplexer and a decoder really belong to separate places. If people are too lazy and would rather stay with 3ivX, that is based on a deprecated decoder and has no multichannel support, it's their problem. Choice is good. And I chose CoreAAC, because it's much better and faster than 3ivX. OK, fine, but there are probably more lazy people than other ones, and if they can have multichannel AAC/MP4 audio and MPEG-4 video support in one freeware DS filter without bugs (like in an updated 3ivx filter), they will probably choose that one. But like I mentioned earlier, only my opinion, nothing else... :)

DeXT
17th June 2003, 18:20
Originally posted by hans-jürgen
Err... mp4UI can extract AAC files from a MP4 container (just like mp4creator), but cannot create them, as far as I know. Or did Markus add an encoder to his GUI? And FAAC produces 56 bit long MPEG-4 AAC ADTS headers since version 1.16, as far as I remember.I mean, as the AAC streams contained into a MP4 file are always header-less (no ADTS or ADIF header, only raw data) the demuxing tool must add an ADTS header when writing the elementary stream to a standalone file. Since 0.95, mp4UI creates "new" 56-bit long ADTS headers for MPEG-4 AAC streams instead of the "old" 58-bit not-anymore-standard-compliant headers, when demuxing from a MP4 file.

Thanks to this update, the MPEG-4 AAC files now share the same ADTS header as the MPEG-2 ones, only with a different object type.

The problem is, this change is not backwards-compatible, as there's no easy way to identify and support reading both 58-bit and 56-bit ADTS headers. So basically an "old" MPEG-4 AAC ES file is useless unless converted to the new format, once the players are updated to support the new headers.

Looks correct to me (i.e. you're right), and these lines are probably also responsible for the other problems reported with AAC, MPEG-2 and 4 and CoreAAC. So please don't use outdated sources from the FAAC project anymore (including FAAD2), because there have been a lot of changes in the last few months. You can find new source packages in the download section of Audiocoding.com and informations about these changes in the Wiki and the forum. Fortunately enough, CoreAAC is always based on the latest FAAD2 CVS release.

Mosu
17th June 2003, 18:32
Originally posted by DeXT
The problem is, this change is not backwards-compatible, as there's no easy way to identify and support reading both 58-bit and 56-bit ADTS headers. So basically an "old" MPEG-4 AAC ES file is useless unless converted to the new format, once the players are updated to support the new headers.

I now have the same problem. What I'll probably do is try to rely on two AAC frames being right behind each other in the file so that I can do a simple detection (only for MPEG4, of course):

1. Assume that the emphasis field is not present, read the header, jump to the next packet.
2. Find the next ADTS header - if it is 1 byte further than anticipated then it's probably the 58 bit header.

You can repeat this test as often as you like, of course, and also check packets three, four etc.

hans-jürgen
17th June 2003, 22:46
Originally posted by DeXT
I mean, as the AAC streams contained into a MP4 file are always header-less (no ADTS or ADIF header, only raw data) the demuxing tool must add an ADTS header when writing the elementary stream to a standalone file. Since 0.95, mp4UI creates "new" 56-bit long ADTS headers for MPEG-4 AAC streams instead of the "old" 58-bit not-anymore-standard-compliant headers, when demuxing from a MP4 file. That's right, because it is based on the mp4creator source code which has been updated some weeks ago to this new standard. By the way, just to make it clear again: it's one ADTS header for each frame inside of the AAC file, not one ADTS header for the whole AAC file. That would be an ADIF header, but this header format is not supported by mp4creator/mp4UI (or FAAC).

The problem is, this change is not backwards-compatible, as there's no easy way to identify and support reading both 58-bit and 56-bit ADTS headers. So basically an "old" MPEG-4 AAC ES file is useless unless converted to the new format, once the players are updated to support the new headers. There is no such thing as an MPEG-4 AAC ES file (you said it yourself at the beginning), only a raw elementary stream without ADTS or ADIF headers inside the MP4 container (so 58 vs. 56 bits doesn't matter anymore) and an extracted (or encoded) AAC file with ADTS headers that have 56 bits since 2003. :-)

So if you have extracted MPEG-4 AAC LC files from a MP4 container with an outdated mp4creator/mp4UI version, your files have the old ADTS header, but will play in a decoder that is also outdated and assumes 58 bits for that header. They won't play in a decoder that has been updated to the new header format though, so you have two choices: keep the outdated mp4creator and the outdated decoder and don't care for compatibility of your MPEG-4 AAC files with other players or update mp4creator and decoder, so you can produce standard-compliant MPEG-4 AAC files right away.

With a new version of mp4creator you can even "repair" these AAC files with the old ADTS header while muxing a new MP4 container, because it has a new switch -aac-old-file-format exactly for these files. With the GUI "Ivan & Menno" this is also possible in a batch operation, so you only need to press one button after choosing the correct conversion option from a drop-down list. For the usage in CoreAAC you would have do reconvert them back to AAC of course, so another batch operation is needed, this time to standard-compliant MPEG-4 AAC files (you can also choose the desired MPEG version from the list while extracting).

DeXT
17th June 2003, 23:06
Originally posted by hans-jürgen
There is no such thing as an MPEG-4 AAC ES file (you said it yourself at the beginning), only a raw elementary stream without ADTS or ADIF headers inside the MP4 container (so 58 vs. 56 bits doesn't matter anymore) and an extracted (or encoded) AAC file with ADTS headers that have 56 bits since 2003. :-) Sorry, I meant a standalone file (with ADTS headers).

With a new version of mp4creator you can even "repair" these AAC files with the old ADTS header while muxing a new MP4 container, because it has a new switch -aac-old-file-format exactly for these files. With the GUI "Ivan & Menno" this is also possible in a batch operation, so you only need to press one button after choosing the correct conversion option from a drop-down list. For the usage in CoreAAC you would have do reconvert them back to AAC of course, so another batch operation is needed, this time to standard-compliant MPEG-4 AAC files (you can also choose the desired MPEG version from the list while extracting). It's probably trivial writing a small tool to convert old-ADTS header files to new ones. Anyways, I personally like most having my AAC files muxed into MP4, as these are much easier and faster to read and parse (it's a pain to seek into a VBR AAC standalone file, from a plugin point of view) and also there are no header incompatilities here. The only drawback is, you need libmp4v2 (and mosu doesn't want to link against another library).

Mosu
17th June 2003, 23:20
Originally posted by DeXT
Sorry, I meant a standalone file (with ADTS headers).

It's probably trivial writing a small tool to convert old-ADTS header files to new ones. Anyways, I personally like most having my AAC files muxed into MP4, as these are much easier and faster to read and parse (it's a pain to seek into a VBR AAC standalone file, from a plugin point of view) and also there are no header incompatilities here. The only drawback is, you need libmp4v2 (and mosu doesn't want to link against another library).

Well yes, I don't need a full-blown MP4 support IMHO. I'll see that mkvmerge will be able to read AAC-in-MP4 sometime, but this does not require the full load of MP4/Quicktime features that libmp4v2 offers.

The thing is that I personally don't like to force the user compiling my software to install some obscure library that no Linux distri contains (which is the case for libmp4v2). I've included avilib in my sources for exactly this reason. All other libs (libogg, libvorbis, wxwindows, iconv) are part of most of the current distros.

I think I'll take the same approach as H.J. has described: I'll add a parameter for old-style MPEG4 ADTS headers with the emphasis field and assume new-style headers from now on. If anyone has old files that switch should be enough for him.

And as soon as I have that AAC-in-MP4 parser you'll have even more options ;)

Heading to bed now.

hans-jürgen
18th June 2003, 06:28
Originally posted by Mosu
I think I'll take the same approach as H.J. has described: I'll add a parameter for old-style MPEG4 ADTS headers with the emphasis field and assume new-style headers from now on. If anyone has old files that switch should be enough for him. By the way, it shouldn't be that much extra work for those people to extract standard-compliant MPEG-4 AAC files from a MP4 container again with your fixed mkvmerger now - if they really need it.

And as soon as I have that AAC-in-MP4 parser you'll have even more options ;) This would be interesting to implement in Mpxplay, my favorite audio player, because the developer also didn't want to compile the full MPEG4IP library for an audio-only support of MP4 files. Will you release it somewhere so I can address him to that place?

Mosu
18th June 2003, 08:56
Originally posted by hans-jürgen
This would be interesting to implement in Mpxplay, my favorite audio player, because the developer also didn't want to compile the full MPEG4IP library for an audio-only support of MP4 files. Will you release it somewhere so I can address him to that place?

As soon as I've coded it you (and everyone else) can have a look at it in my sources on my home page. But keep in mind that I write GPL'ed code, so if Mpxplay is not GPL then he cannot use my code in his project.

hans-jürgen
19th June 2003, 09:06
Originally posted by Mosu
As soon as I've coded it you (and everyone else) can have a look at it in my sources on my home page. But keep in mind that I write GPL'ed code, so if Mpxplay is not GPL then he cannot use my code in his project. He publishes the sources on his homepage, but I don't know which license he used for that:

http://mpxplay.cjb.net/

By the way, John33 has updated FAAD2 with direct playback capabilities for both AAC and MP4 (the same way he did it earlier in his aacDECdrop GUI), so there is a command line version of FAAD2 now that can play these files without the need of an external audio player simply by using the new -p switch. Thus it will be implemented in the next version of Speek's "Ivan & Menno" GUI, probably named v1.8 then. A public thanks to both developers from me again! :)

http://homepage.ntlworld.com/jfe1205/faad.zip

At the moment it only exists as a Windows binary, but John33 wrote that he'll send the changes to Menno, so they will be part of the CVS probably soon. Maybe you can even use them directly for your DS filter without the need to program something else on your own?

Mosu
19th June 2003, 09:27
Originally posted by hans-jürgen
He publishes the sources on his homepage, but I don't know which license he used for that:

http://mpxplay.cjb.net/

Hmm no license that I can see. But if it isn't GPL'ed then he's already violating it as part of the software is taken from other GPL'ed software (ac3dec). But as he distributes his sources freely my guess is that he's not too aware of the licensing issues.

http://homepage.ntlworld.com/jfe1205/faad.zip

At the moment it only exists as a Windows binary, but John33 wrote that he'll send the changes to Menno, so they will be part of the CVS probably soon. Maybe you can even use them directly for your DS filter without the need to program something else on your own?

Apart from me not making a DS filter I'll take a look at the sources. Hopefully this weekend, but no promises.

Wilbert
6th July 2003, 15:37
To anyone who converts its 5.1 WAV/AIFF to 5.1 AAC with Nero. You have to reencode them again, because the channel ordening is messed up. (front left and front center is switched) Have a look at the following thread: http://www.hydrogenaudio.org/index.php?showtopic=10986

bond
14th July 2003, 12:58
any updates on coreaac (it seems that the sources are still not available on corecodec.org)?

menno has added the possibility to downmix to stereo into libfaad (no sbr until now i think)!

[Toff]
14th July 2003, 13:26
Originally posted by bond
any updates on coreaac (it seems that the sources are still not available on corecodec.org)?
menno has added the possibility to downmix to stereo into libfaad (no sbr until now i think)!
I already updated CoreAAC to handle the channel remapping.
And i have also added an option to use the libfaad stereo downmixer.
Source will be available soon in CVS again.
We just miss sbr handling now :D

bond
14th July 2003, 13:37
Originally posted by [Toff]
We just miss sbr handling now :D [/B]cant wait till friday any more ;)

rjamorim
15th July 2003, 01:25
Originally posted by bond
cant wait till friday any more ;)

the sources will take some time to be released (they were to be released yesterday) due to some licensing issues.

bond
15th July 2003, 01:39
Originally posted by rjamorim
the sources will take some time to be released (they were to be released yesterday) due to some licensing issues. nooooooooo plz not what i am thinking of
i hope that ahead didnt change their mind according to releasing their deocder sources under gpl and publishing them as open source (which was really a wise idea)

rjamorim
15th July 2003, 06:50
Originally posted by bond
nooooooooo plz not what i am thinking of
i hope that ahead didnt change their mind according to releasing their deocder sources under gpl and publishing them as open source (which was really a wise idea)

The sources will be open, but won't be released under the GPL because of high management cluelessness, as I understand it.

Instead, they will release it under some GPL clone that will make it automatically incompatible with the GPL.

robUx4
15th July 2003, 08:35
Yet another GPL clone ? The QPL is a bit like that. I suggest using that. And if you want compatibility with GPL, just dual-license it :)

tiki4
15th July 2003, 14:11
@Wilbert:

Sorry,

but can you point out how to easily change the channel order in a multichannel WAV file. If I demux with BeSweet into 6 mono WAV files and use a mux file to remux, I get wrong channel mapping in the AAC with NERO (same with AIFF). I think the .mux-file from BeSweet has a fixed L,C,R,SL,SR,LFE channel order which can't be changed. Is there any easier way?

Thanks,

tiki4

ChristianHJW
15th July 2003, 14:24
IIRC then DeXT has made a fixed WAV input plugin for nero 5.5 or 6, not sure here. He posted about it on hydrogenaudio.org AFAIK, search their board for posts from DeXT or De_xt, and you'll find it for sure ....

tiki4
15th July 2003, 15:07
@ChristianHJW:

Thanks, mate. I think I found it, but dext' post says 'no channel reordering yet' :(

@bobsc:

Thanks. I will try that.

Cheers,

tiki4