PDA

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


ChristianHJW
21st May 2003, 01:31
I have the pleasure to announce that a new opensource project was started on corecodec.org today, aiming to offer a free alternative to existing AAC DirectShow decoder filters for educational purposes.

The bigger part of the code was taken from a similar project on http://borgtech.org/aacdec , which by itself is based on the FAAD2 decoder from the FAAC project ( http://sourceforge.net/projects/faac ). All sourcecode is released under the GPL license, just like the original projects.

The developers are aiming to add 5.1 multichannel playback now soon, being the first decoder filter with this capability. As an educational project the project admins have to remind everybody that distribution of compiled binaries of the decoder filter may violate the licensing shedule of the AAC (TM) license holders, depending on the country you are living in, and should not be undertaken by any means. The developers of this project can not be held responsible for such license violations by other people. They strongly advise everybody to compile the decoder filter only for its original intention, that is for educational purposes.

Christian HJ Wiesner
Germany, 20th May 2003

Original message :
https://corecodec.org/forum/forum.php?forum_id=63

avih
21st May 2003, 01:52
just 2 cool ;)

Animaniac
21st May 2003, 04:04
Awesome. ^_^

ChristianHJW
21st May 2003, 07:27
Ahemm, well, i have been a little bit too quick maybe :D !!

Toff hasnt uploaded any sourcecode to the CVS yet, so it was maybe not correct to make a great announcement already, but i was too tired last night to realize this and was almost acting automatically .. LOL. He told me that he first wants to get 5.1 playback working, and would then go upload the sourcecode. Hopefully i can convince him to upload the version he has right now also, or he will maybe have great fun watching me getting nervous :rolleyes: ...

BTW : the released binaries in the 'AAC in matroska' thread is a compilation of this existing source, but the link will be taken down latest by tonight. The filter is still using the borgtech wFormat tag of '0xAAC1', we will very likely change this to either '0x00FF' like 3ivx and Nic's filter are using, or '0xFAAD' as proposed by menno, the author of FAAC/FAAD ;) ....

Animaniac
21st May 2003, 07:40
Originally posted by ChristianHJW


BTW : the released binaries in the 'AAC in matroska' thread is a compilation of this existing source, but the link will be taken down latest by tonight. The filter is still using the borgtech wFormat tag of '0xAAC1', we will very likely change this to either '0x00FF' like 3ivx and Nic's filter are using, or '0xFAAD' as proposed by menno, the author of FAAC/FAAD ;) ....

I think using the tag 3ivx currently uses would be a better idea simply out of consistency. Introuducing a new tag would make things even more confusing, as they were when trying to get the Borg AACDec working. In addition, using the 3ivx tag would, in theory, yeild compatability with their MP4 parser. (Unless of course, this project includes the prospect of a more robust MP4 splitter.) Furthermore, if one tag becomes dominant, there's a good chance it will become the "official" tag. Then again, changing the tag to any official one declared by the powers that be is just a one line change... >.<

ChristianHJW
21st May 2003, 13:21
Ok, Toff uploaded the code to CVS

@Nic : pls. get an account on corecodec.org, you could help us a lot with making it 5.1 capable :) ....

BlackSun
21st May 2003, 13:34
Originally posted by ChristianHJW
Ahemm, well, i have been a little bit too quick maybe :D !!



I think so :eek: :D

DeXT
21st May 2003, 21:48
The first Multichannel, Open Source AAC DirectShow filter is finally born. Toff is the man to blame to, it's called CoreAAC, and it's 100% compatible with the 3ivx splitter. You can use it with MP4 files containing 5.1 audio, and it really works!

Of course, it will work flawlessly with Matroska files containing 5.1 AAC audio... but you'll have to wait a few days to allow Mosu updating his mkvtoolnix with full AAC support. You'll also need the new Matroska splitter in order to get AAC audio working from Matroska files.

Below you'll find a preview release for beta testers, of both AAC DSF and MKV DSF with 5.1 AAC support... to get future releases you'll have to rely on external sites (rarewares, anyone? ;)) as we lack a license for that.

Oh I forgot. You can't put AAC on AVI or OGM, so Matroska is the *only* way to go (besides MP4). So you just start to look at the benefits of Matroska... ;)

http://matroska.sourceforge.net/downloads/mkxds_aac_multichannel_20030521-2.rar

Enjoy it...

Koepi
21st May 2003, 21:55
Why can't you put aac into ogm? Any reason?

Regards
Koepi

DeXT
21st May 2003, 22:11
Well you could put it provided you have a tool for that... but AFAIK currently there's no way to put a standalone AAC file into OGM, stripping the ADTS headers and splitting it into separate frames. This is a complex process that Mosu had to work from scratch for mkvtoolnix and currently the only tool publically available that can do the same is mp4creator (for the MP4 container). Unfortunately only the raw portion of the AAC stream can be muxed inside the containter, and some extra information is needed (AAC profile, sample rate and the like).

The same for AVI. That was the main limitation of Nic's AAC filter: you could not put AAC into AVI/WAV easily, so it was of little use...

In case you manage to put an AAC track inside an OGM stream (or even AVI) it should work with the DSF above, of course. Sorry if I didn't put this clear on my last post..

DeXT

BoNz1
22nd May 2003, 06:57
Originally posted by DeXT
Well you could put it provided you have a tool for that... but AFAIK currently there's no way to put a standalone AAC file into OGM, stripping the ADTS headers and splitting it into separate frames.

You can encode in PysTEL without the adts headers use the -nh switch in the commandline this will give a raw output, nero also has an option for this and faac probably does too, so I guess you could work around that. As for splitting into seperate frames, I guess if you could make the decoder support audio chunks it would work. Then you wouldn't have to split into seperate frames, I guess. So I guess that is what you would have to do to get AAC working in ogm. That is how I understand it anyway. :)

Koepi
22nd May 2003, 07:10
bonz1, dext:

i did some research and found the -nh switch as well (never experimented with aac until now). I guess the problem is that AACMachine doesn't support that switch (yet).

And well, a DSF can always buffer a bit of data ahead so it should be perfectly possible to add an aac to ogm (that's why i put it into oggmux in first place, people asked for it).

So let's stop this unjustified badmouthing (ogm can't cope with it) and single-sided advertisement for unfinished file containers(matroska rules the world). I'm a little disapointed that you're doing that.

I hope this changes in future.

Regards
Koepi

ChristianHJW
22nd May 2003, 08:46
Originally posted by Koepi So let's stop this unjustified badmouthing (ogm can't cope with it) and single-sided advertisement for unfinished file containers ( matroska rules the world ). I'm a little disapointed that you're doing that.
Are you maybe a little bit overreacting koepi ?
I had no idea that OGMmuxer can mux AAC into OGM, simply because i dont use this tool and the OGM container, and i am convinced that is the same for DeXT. A simple message that we wre wrong and OGM does support AAC already would have been fine, instead of reacting like a little kid and talk about 'badmouthing' and 'single sided advertisement', like DeXT being a mean person trying to 'hurt' OGM's reputation ...
I hope this changes in future. Regards Koepi
Thats what i hope also.
Please stop badmouthing matroska as being an 'unfinished container' ! The container IS finished, and the created files are spec compliant. We only have to add chapters and release a working DirectShow filter, but this doesnt make the container 'unfinished' ! With the current working speed we can fully replace all OGM features in latest 4 weeks from now, and then, we just have started .....

Best regards

Christian

[Toff]
22nd May 2003, 11:14
The container war continue again :D
If all this energy was used to improve each one preferred container I think we would have pretty good one now :)
My humble opinion is that by now it's better to works on something open even if it's still less usable ;) (at least in a particuliar OS)

Nic
22nd May 2003, 15:54
@Chris: Im glad you've got this far chris. Well done, your "helluva" project is definitely heading in the right direction :) I think if ive got any free time (after ive finished mpeg2dec3 changes). Ill look at helping fix your DShow filter for matroska.

One step at a time ;)

Cheers,
-Nic

MfA
22nd May 2003, 16:14
As an educational project the project admins have to remind everybody that distribution of compiled binaries of the decoder filter may violate the licensing shedule of the AAC (TM) license holders, depending on the country you are living in, and should not be undertaken by any means.

As someone who can read I must remind you that the knowledge of this fact, and the absence of country limitations to the license, makes the distribution rights granted under the GPL void. You are committing copyright infringement :)

robUx4
22nd May 2003, 20:48
Originally posted by MfA
As someone who can read I must remind you that the knowledge of this fact, and the absence of country limitations to the license, makes the distribution rights granted under the GPL void. You are committing copyright infringement :)

That's covered by the GPL :
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

MfA
22nd May 2003, 22:19
Indeed, but for that to be relevant I must have overlooked the country limitations menno added to FAAD2 ... where should I look?

ChristianHJW
23rd May 2003, 07:38
I dont remember that either Lame, XviD or FAAC put country limitations in their sources or licenses, so dont expect us to do that MfA .... please !

MfA
23rd May 2003, 15:17
You're wrong about XviD.

Id just prefer that you be truthfull, and warn that this software isnt really GPL whatever the license included says. By acknowledging the patent issues you are already doing this in a way, but in a very roundabout way. Lets be honest about it.

When corporations misuse the GPL in this way they usually do it for nefarious purposes. They pretend software is being released under the GPL, but dont license the patents so they can always have a stick to beat you with if you do something with it they dont like (an example is Lizardtech with the DjVu software). When the open source community starts playing the same charade because they are so eager to use the GPL they legitimize those companies ... which is not something to strive for.

ChristianHJW
23rd May 2003, 19:17
Originally posted by MfA ... which is not something to strive for.

Ok MfA, i do understand your concerns better now. So ... how do we get started here ? How can i find out in what countries Dolby labs have licenses for AAC ? Any help from your side was much appreciated here ....

MfA
23rd May 2003, 19:59
I dont so much take exception with it not being licensed right, there is nothing wrong with non legalese agreements ... what I object to is when people pretend the GPL is fully applicable when it isnt really.

Just add an extra notice in the readme after the warning about patents that despite this being in clear contradiction to clause 7 of the GPL you do allow further distribution of the software, and that you assume the original authors of GPL source used in the project give the same allowances.

It would be nice if authors of the original projects could exclude countries where software patents are valid, but I dont see it happening.

ooops!
24th May 2003, 00:12
Christian,

Excuse my ignorance, does this mean 6Ch .ac3 in = 6Ch aac out?

Or do you have to create and combine a load of single audio channels first, like you have to do, if you want to create a 6Ch .wma audio file?

ChristianHJW
25th May 2003, 22:32
John33 from the Hydrogenaudio.org board will host binaries now, for your convenience :

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

ChristianHJW
26th May 2003, 20:09
CoreAAC binary now hosted on

Rarewares !!! (http://rarewares.hydrogenaudio.org)

Thanks so much rjamorim :) !!

rjamorim
29th May 2003, 04:07
Originally posted by ChristianHJW
Thanks so much rjamorim :) !!

Anytime. :)

Griniaris
29th May 2003, 17:02
I tried to use the CoreAAC decoder but I cannot get it to play any AAC file on my pc... I am not so experienced so if you could please help me out a little bit I would appreciate it.
I have downloaded the files and registered the filter correctly.
I then try to open an AAC file but no player can handle it...
Any hints?

PS: When will the 5.1 feature work correctly?

Thanks a lot!

Gaia
29th May 2003, 17:10
Originally posted by Griniaris
I tried to use the CoreAAC decoder but I cannot get it to play any AAC file on my pc... I am not so experienced so if you could please help me out a little bit I would appreciate it.
I have downloaded the files and registered the filter correctly.
I then try to open an AAC file but no player can handle it...
Any hints?

PS: When will the 5.1 feature work correctly?

Thanks a lot!

What OS you have? I doesn't work with Win98 :confused:

Animaniac
29th May 2003, 17:31
This filter doesn't parse raw AAC files they need to be muxed into MP4 (a.k.a M4A) or better yet, Matroska (a.k.a. MKA). 3ivx's Media Splitter filter also needs to be installed for MP4 support.

Using this new build from John33 seems to make WMP9 hang for a while when stopping mid-stream and playing. Pause also seems to be pretty sluggish. Thanks for all the hard work though.

Griniaris
29th May 2003, 17:47
Thanks! I did not know it had be muxed in a container to be playbacked... I was truing to play the audio file alone.
Just for the info I am using WinXP and I hate :angry: WMP9...
BTW, is the 5.1 sound working ok?

Thanks

hulkenstrong
2nd June 2003, 17:18
hmm tried latest coreaacdc from rarewares and plaid a matroksa contaning 5.1 aac and divx 5 video. TCMP whont open the file giving error it cant render it. WMP 6.4/9 plays using Directsound out and says it is a 6ch stream but only 2ch is audible. Would love to get 5.1 aac to work. Does the filter only work in directsound output as I get errors when trying waveout. Dunno if its my soundcards drivers thats messing things up (using KX 3533 with a SB 5.1).

bond
3rd June 2003, 22:29
very important info for Otto-Normal-User:

Originally posted by ChristianHJW
If you dont have a 5.1 setup ( like me ), you will need the great channel downmixer filter from trombettworks (http://trombettworks.com/directshow.php), or you cant hear sound
couldnt be the channel downmix included in CoreAAC!?
would be great and make CoreAAC a perfect aac decoder even for people with non 5.1 setups (which are many i think...)

perhaps you can use source code from valex' ac3filter (http://sourceforge.net/projects/ac3filter)!?

Defiler
3rd June 2003, 23:12
Is there a way to launch the Channel Downmixer configuration panel from the command line?
rundll32 "c:\blah\channeldownmixer.ax",configure
doesn't work as it would for, say, ffdshow.
I tried various other obvious names, like "properties", "setup", "matrix", etc.

Animaniac
3rd June 2003, 23:23
Originally posted by Defiler
Is there a way to launch the Channel Downmixer configuration panel from the command line?
rundll32 "c:\blah\channeldownmixer.ax",configure
doesn't work as it would for, say, ffdshow.
I tried various other obvious names, like "properties", "setup", "matrix", etc.
Just load the filter in GraphEdit.

hulkenstrong
4th June 2003, 16:49
Just wanted to notify´everyone that this filter doesnt work with KX drivers but with Creatives in 5.1. Dam only choise for me is to wait until that gets fixed.

And dam an matroska containing divx5 and 5.1 AAC is cpu demanding on my xp1800+ I have over 90% all the time when playing the movie. Is it normal. Not a to big problem as the xp2500+ is afordable nowdays.

Defiler
4th June 2003, 17:13
Originally posted by Animaniac
Just load the filter in GraphEdit. I'm looking for a way to make a shortcut that will launch the downmix configuration panel, along the lines of the "Configure ffdshow" link in the ffdshow program group.

CaptainCarrot
4th June 2003, 17:35
Originally posted by hulkenstrong
And dam an matroska containing divx5 and 5.1 AAC is cpu demanding on my xp1800+ I have over 90% all the time when playing the movie. Is it normal. Not a to big problem as the xp2500+ is afordable nowdays.
Try fddshow for playback, the DivXNetworks-decoder needs about 2x the cpu-power than fddshow (though the visual quality seems to be better, too). If you go for an anamorphic movie at 720x432 or something like that there's a lot to decode. And the cpu-consumption has in this case nothing to do with matroska or aac, it's just the divx.

[Toff]
4th June 2003, 18:11
Originally posted by hulkenstrong
Just wanted to notify´everyone that this filter doesnt work with KX drivers but with Creatives in 5.1. Dam only choise for me is to wait until that gets fixed.


It works great here and i use the KX drivers also.
I use the version 3528 which is kinda old now, but newer version are not stable on my computer it seems i get some BSOD :(

When you say it doesn't works, what's wrong excatly ?

Also you can try to use a downmixer filter:
http://matrix-mixer.sourceforge.net/
http://www.trombettworks.com/directshow.php

hulkenstrong
4th June 2003, 18:18
on creative i get 5.1 sound (all speaker play and it sounds correct) on kx latest only stereo no rear/center/lfe all quiet. Thats what I did base it on.´You wanna give more info on how you got it to work on KX? Are you using analouge or SPDIF out. What card do you have? What OS are you using? Why use a downmix filter when all i whant is 5.1 out i dont care about stereo for movies.

Can anyone direct me to a place with the latest compiled COREaacDC. Now Im using the one from rarewares.

My info:

OS tested XP SP1 and W2K sp3
Audio driver KX 3533 (only stereo)
Latest official driver for creative SB 5.1 (worked)
Soundblaster Live 5.1

[Toff]
4th June 2003, 19:04
Are you using analouge or SPDIF out? What card do you have? What OS are you using?
I have a sound blaster live on win2k in analogic mode.

Why use a downmix filter when all i whant is 5.1 out i dont care about stereo for movies.
Yes forget about it :)


Can you check that AC3 (or with any other 5.1 source) is ok with the KX drivers ?
Also check in the KXMixer the speaker configuration.
There are several modes.

hulkenstrong
4th June 2003, 19:08
yes ac3 using windvd plays normal,dvd plays normal....seems so weird. And playing the file in foobar2000 gives 5.1 also only not working is the mkv file the one file I whant to get 5.1 aac to work with =).


KX surrounder is set to 5.1 direct path. tested the speaker trough kx everyone sounded right.

Info: the cpu usage is fine untill i seek in the matroska file then it goes upp to 90-100% and stays there.

Does the older kx drivers handle 5.1 directsound streams different?? gonna try 3528 and if it work maybe I should inform the KX team instead.

Tested it. Couldnt use it...i set speakers to 5.1 then it auto upmixed a stereo file to 4.0 couldnt find the option to turn it of. Had to update again to 3533b. Now this is weirder. Foobar2000 plays AAC 5.1 perfet in Directsound mode 6channels and all. But when mixed togheter with divx video into a matroska I can only hear 2 channels but still wmp shows the audio stream as 6 channels.

Bsplayer does the same. Bsplayer says im using COREaacDC 1.1 is it the latest?

[Toff]
5th June 2003, 00:51
I think you should try "Channel Downmixer by Trombettworks" here :
http://www.trombettworks.com/directshow.php

Maybe i do something wrong and this filters will regenerate the output type the good way, so give it a try, and there are some things to configure so you can try different settings.

hulkenstrong
5th June 2003, 20:40
Giving up cant get this 5.1 aac filter to work. Waiting to test agin when filter/audio drivers get updated.

Both the filter and ds out says its 6 channels but still only 2 audible.

bond
6th June 2003, 14:40
1) get latest compile (including latest cvs changes) from here (http://homepage.ntlworld.com/jfe1205/COREaacDS.zip) (thanks to john33)!

2)Originally posted by [Toff]
A small update, some people seems to have problem with <=2 channels playing (big shhhhhhhhh).

The problem should be the same in CoreAAC and the fix is in CVS now.

For the technical things it's :
now <=2 channels output use a WAVEFORMATEX struct
and >2 channels output use a WAVEFORMATEXTENSIBLE struct

EDIT: @bond: maybe it was the original problem you had, as trombettworks downmixer do the same tricks to correct the problem.i guess this means that there shouldnt be the need for trombett anymore (although you wrote <=2 which means stereo or mono i think)?
i tried the latest compile but i get no sound (when i unregister trombett of course)! i tested it with christian's episode2 testfile with 5.1 aac

ChristianHJW
6th June 2003, 15:17
Originally posted by bond 2)i guess this means that there shouldnt be the need for trombett anymore (although you wrote <=2 which means stereo or mono i think)?

nope, this has nothing to do with downmixing, only with Directhow internal means to be able to interface to DirectShow drivers for soundcards ....

bond
6th June 2003, 15:21
thanks :)

hulkenstrong
8th June 2003, 15:51
Now I think I got enough info to say the coreaacdc is the problem to working 5.1 output on my system.

info:

MP4 with 5.1 played in foobar2000/winamp3 with 5.1 output (no video) mplayer2/wmp9/bsplayer 0.8 played it but only stereo output.

MKV with 5.1 played in mplayer2/wmp9/bsplayer 0.8 played it but only stereo output.

MP4 audio only 5.1 created with nero plays in mplayer2/wmp9 in stereo only but in winamp2/3/foobar2000 in 5.1 output.

So the files have working 5.1 AAC in them but somehow the filter doesnt work on my system.
Playing AC3 5.1/DTS 5.1 using windvd 4 works.
playing AAC 5.1 using Winamp2.x/3.x/foobar2000 works.
Playing WAV 5.1 using winamp/foobar2000/mplayer2/wmp9 works.
Playing AC3 5.1 using mplayer2 and AC3filter 0.68b in Directsound output mode works.

(MP4 using 3ivx DS filter and COREaacDC 1.0b3 based on FAAD 1.1.
MKV using Matrsoka DS filter 0.4.2 and COREaacDC 1.0b3 based on FAAD 1.1.)

The files muxed in mkv uses 80-90%cpu usage but in mp4 only 40-50% just some information.

Defiler
8th June 2003, 17:26
Arrgh.. I've been working on getting a proper 5.1 AAC file created all weekend, to no avail. AACMachine keeps crunching for half an hour, generates what looks to be a proper log, and yields a 0-byte AAC file. Nero "finishes" encoding the instant I click "Go", and doesn't create an output file.
This is harder than I thought. Heh.

Atamido
8th June 2003, 18:22
I have the speaker test AC3 converted to 5.1 AAC that someone gave me. I could send it to you if you PM me where to. (673KB)

Defiler
9th June 2003, 16:42
Originally posted by Pamel
I have the speaker test AC3 converted to 5.1 AAC that someone gave me. I could send it to you if you PM me where to. (673KB) 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.

bond
9th June 2003, 16: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, 22: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, 22: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, 22: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, 11: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, 11: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, 11: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, 11: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, 11: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, 11: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, 16: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, 20: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, 20: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, 22: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, 15: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, 15:25
why doesnt support mkvmerge (and hopefully virtualdubmod in the future too) .mp4 as input format?

Mosu
15th June 2003, 15: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, 15: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, 16: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, 16:21
:p

hans-jürgen
15th June 2003, 18: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, 19: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, 20: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, 21: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, 23: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, 09: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, 09: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, 09: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, 10: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, 11: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, 19: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, 19: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, 23: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
18th June 2003, 00: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
18th June 2003, 00: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, 07: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, 09: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, 10: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, 10: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, 16: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, 13: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, 14: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, 14:37
Originally posted by [Toff]
We just miss sbr handling now :D [/B]cant wait till friday any more ;)

rjamorim
15th July 2003, 02: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, 02: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, 07: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, 09: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, 15: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, 15: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, 16: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

Wilbert
15th July 2003, 16:23
A bunch of warnings:

1) Besweet (still ?) produces invalid 5.1 wav's if bitrate > 2Gb. Use HeadAC3he for this.

2) This problems holds for every AAC encoder (not just Nero's one).

3) The channels in 5.1 wav and 5.1 aiff are also ordered differently:

5.1 wav: FL, FR, C, LFE, RL, RR
5.1 aiff: FL, RL, C, FR, RR, LFE
5.1 aac: C, FL, FR, RL, RR, LFE

see: http://www.avisynth.org/index.php?page=GetChannel

DeXT
15th July 2003, 16:26
Originally posted by ChristianHJW
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 .... My fixed WAV plugin for Nero only solves the issue with large (> 2GB) WAV files, which are very common when more that 2 channels are being used. However it does not fix the channel remap issue. You can find it here (http://www.hydrogenaudio.org/index.php?showtopic=9944&st=25&#entry112418).

To manually remap the channels you may edit the *.mux file to match the required channel configuration as posted by Ivan on this thread (http://www.hydrogenaudio.org/index.php?showtopic=10986). However, note that you'll need an updated faad/CoreAAC/WinAMP/TCMP plugin compiled against the latest libfaad2 CVS release to be able to hear the channels on the right locations. And AFAIK binaries for these have not been made publically available yet (they should in few days).

tiki4
15th July 2003, 17:01
So that means that:

1) Channel reordering in a BeSweet .mux file may work,

but:

2) it's totally senseless to do so right now, until the new binaries are released (well, I don't feel like compiling right now)

Thanks for all the info,

tiki4

rjamorim
15th July 2003, 17:17
Originally posted by robUx4
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 :)

From what I know, they don't trust enough the GPL in keeping closed software from adopting it.

That's very bad, because this clone would most probably be automatically incompatible with the GPL. Then, all GPLd projects using FAAD2 (CoreAAC, DReaM, Mplayer...) would have to stop doing so.

For that reason, I urge whoever read this to mail Ahead (http://www.ahead.de/en/content/c1015424317180.html) explaining that the GPL is enough for what they need (heh, it's been surely more time and tested against loopholes than any "homebrewn" license) and the adoption of another license would make the sources incompatible with most software that has been written for them.

Mr. Richard Lesser (Ahead CEO) seems to be a nice, reasonable guy, so hopefully he'll listen before much damage is done. :)

bond
15th July 2003, 18:32
sent a mail

hopefully ahead will change their mind, so that aac-he will have a future...

DeXT
15th July 2003, 20:28
@Wilbert: you asked for some AAC standards. I found the following through Google:

http://www.tnt.uni-hannover.de/project/mpeg/audio/#mpeg4

Here you can find both MPEG-4 Audio V1 and V2 standards.

http://www.chiariglione.org/mpeg/working_documents.htm#MPEG-4

Here on the MPEG-4 Audio section, you'll find the ISO/IEC 14496-3:2001/FPDAM 1 ("Bandwidth extension") standard, also known as SBR.

I found pretty funny that the SBR specs are freely available on the web above. If I were an OSS Codec developer I'd want to take a look at it ASAP ;)

hans-jürgen
15th July 2003, 21:09
Originally posted by Wilbert
2) This problems holds for every AAC encoder (not just Nero's one). Not when the encoder (like FAAC) can read any input file (also transcoded multichannel AC-3) from its stdin, because then you don't need a temporary WAV file at all. This is e.g. possible when using foobar2000 as a GUI for that, see the Wiki page for more:

http://www.audiocoding.com/wiki/index.php?page=FAAC

3) The channels in 5.1 wav and 5.1 aiff are also ordered differently:

5.1 wav: FL, FR, C, LFE, RL, RR
5.1 aiff: FL, RL, C, FR, RR, LFE
5.1 aac: C, FL, FR, RL, RR, LFE FAAC v1.18 from July 13, 2003 can also remap different input multichannel layouts with its new -I switch that defines the position of the Centre and the LFE channel. The default configuration assumes a WAV file (i.e. "-I 3,4"), AC-3 would need "-I 2,6" and AIFF "-I 3,6", although the strange positioning of front and back stereo pairs might still cause M/S matrixing problems (correlating the wrong channels then maybe, would need some testing).

The FAAC source code is available as a package of a weekly CVS snapshot at http://www.audiocoding.com/download.php.

@DeXT: A foo_mp4.dll compiled on July 9, 2003 is available from Case's web site, so at least foobar2000 should handle this new multichannel layout in FAAD2 correctly:

http://www.saunalahti.fi/~cse/html/foobar0.7.html

I'm not sure if the downmixing is implemented already, but foobar can do the downmix independently with its own DSP modules, as far as I know.

And the sites you found with the ISO specifications are official ones from the MPEG, so nothing to be excited about. ;) But they only offer older standards as free downloads, the newest ones are only available from the ISO for a fee on a CD (~$50.00). So what you found are the Final Drafts (FD) from 2001, not the current specs from 2003. That's also the reason why a developer would have a hard time when using them and hoping the result would be compatible with e.g. Nero's HE AAC implementation.

ChristianHJW
15th July 2003, 21:36
Originally posted by rjamorim Then, all GPLd projects using FAAD2 (CoreAAC, DReaM, Mplayer...) would have to stop doing so.

There is no problem here meanwhile. Toff has rewritten all parts taken from the old GPL borgtech filter, so he can easily license CoreAAC with the same license as FAAD3 ....

DeXT
15th July 2003, 22:44
Originally posted by hans-jürgen
@DeXT: A foo_mp4.dll compiled on July 9, 2003 is available from Case's web site, so at least foobar2000 should handle this new multichannel layout in FAAD2 correctly:

http://www.saunalahti.fi/~cse/html/foobar0.7.html

Yes I can verify that the latest foo_mp4 plugin has support for the new channel mapping. I created a custom WAV using a modified *.mux file with the channel order required for AAC and fed Nero with it. The resulting mp4 sounds nicely using foo_mp4.

And the sites you found with the ISO specifications are official ones from the MPEG, so nothing to be excited about. ;) But they only offer older standards as free downloads, the newest ones are only available from the ISO for a fee on a CD (~$50.00). So what you found are the Final Drafts (FD) from 2001, not the current specs from 2003. That's also the reason why a developer would have a hard time when using them and hoping the result would be compatible with e.g. Nero's HE AAC implementation.
I already know that these are from the official site, and that they are not up to date. Wilbert was asking for freely available standards through the net, and I pointed him to it. However, my comment was due to the fact that despite all the secretism involved in the SBR code these days, the specs (well at least a working document) can be found freely on the net.

bond
16th July 2003, 00:32
Originally posted by ChristianHJW
Toff has rewritten all parts taken from the old GPL borgtech filter, so he can easily license CoreAAC with the same license as FAAD3 ....great to hear that :p

rjamorim
16th July 2003, 01:53
Originally posted by ChristianHJW
There is no problem here meanwhile. Toff has rewritten all parts taken from the old GPL borgtech filter, so he can easily license CoreAAC with the same license as FAAD3 ....

So no point in crediting BorgTech at RareWares anymore?

ChristianHJW
16th July 2003, 05:08
... please wait until this version will be in CVS and your compile is made from it Roberto ....

bond
18th July 2003, 12:16
any chance to get the latest coreaac version even without sbr, as it seems that sbr will still take some time
(menno on holiday, open license issues and nero6 release date was postponed to 25th july)...

rjamorim
24th July 2003, 06:48
Originally posted by bond
sent a mail

hopefully ahead will change their mind, so that aac-he will have a future...

It seems the bitching payed off. It's early to guarantee, but I have been told by an Ahead insider that FAAD2 and the SBR code will be released under the GPL. And it should happen next friday.

Animaniac
24th July 2003, 08:51
Originally posted by rjamorim
It seems the bitching payed off. It's early to guarantee, but I have been told by an Ahead insider that FAAD2 and the SBR code will be released under the GPL. And it should happen next friday.

Friday the 25th or the 1st.

Nic
24th July 2003, 11:15
Thanks for all the campaigning on our behalf Roberto :) And for keeping us informed :)

-Nic

rjamorim
24th July 2003, 13:45
Originally posted by Animaniac
Friday the 25th or the 1st.

It should be the same day Ahead officially releases Nero6. So, unless they postpone it once again, the 25th ;)

Thanks for all the campaigning on our behalf Roberto :) And for keeping us informed :)

No problem, dude.

Regards;

Roberto.

ChristianHJW
24th July 2003, 17:23
Thats really good news .. thanks for the info Roberto .... i am really looking forward to be able to test Nero 6, now if only all matroska team members would get licensed copies as a present from Ahead, just because we are so nice guys, that would be cool :D ...

rjamorim
25th July 2003, 03:01
Originally posted by ChristianHJW
now if only all matroska team members would get licensed copies as a present from Ahead, just because we are so nice guys, that would be cool :D ...

Hehe. I didn't get a free copy myself. Menno says I'm too unsafe because I'm warez addict and I might spread it.

Fucker. :B

ChristianHJW
25th July 2003, 11:14
Originally posted by rjamorim
Hehe. I didn't get a free copy myself. Menno says I'm too unsafe because I'm warez addict and I might spread it.
Fucker. :B

LOL !!! LMAO !! Not sure, but they would probably put us in the same corner of the spectrum, so i think we wont get it either :D .....

Nic
25th July 2003, 12:19
I remember the old days when I even had my name on the developers list of FAAC and was discussing improving its huffman bugs, and Ivan was barely releasing more than an improved ISO reference version of AACEnc? Do you reckon, I could get one with thoughts of nostalgia?....

...Nah, I didn't think so either.lol. ;)

-Nic

bond
29th July 2003, 12:50
now the sbr code is here (under gpl :) )!!!

go toff go :D


read menno's post on ha here (http://www.hydrogenaudio.org/index.php?showtopic=11753) (down atm)
johnv's announcement on doom9 is here (http://forum.doom9.org/showthread.php?s=&threadid=58473)

Wilbert
29th July 2003, 13:25
Roberto compiled a new FAAC (still without sbr code I guess, but with the channel remapping bug corrected): http://64.246.62.80/~hydrogenaudio.org/index.php?showtopic=11494
Guess he didn't update the version number on the RareWares site :)

bond
29th July 2003, 13:27
Originally posted by Wilbert
still without sbr code I guessthe sbr code will only be available for the decoder side!

[Toff]
29th July 2003, 14:47
The CoreAAC code is now in CVS :) and support SBR.
It's not tested a lot (for example channel remapping) and so probably not bug proof :D

a temporary experimental ;) build is available here

CoreAAC_1.0b4_20030729-1.exe (http://blacksun.corecodec.org/core/CoreAAC_1.0b4_20030729-1.exe)
CoreAAC_1.0b4_20030729-1.zip (http://blacksun.corecodec.org/core/CoreAAC_1.0b4_20030729-1.zip)

bond
29th July 2003, 15:07
great!

downmix to stereo works great
sbr decoding seems to work also

the bitrate isnt shown correctly -> 220kbps although sbr file at 65kbps...
the zip file isnt downloadable

sorry i cant say anything about channel remapping

[Toff]
29th July 2003, 15:13
Originally posted by bond

the bitrate isnt shown correctly -> 220kbps although sbr file at 65kbps...
the zip file isnt downloadable
sorry i cant say anything about channel remapping
Thanks,
Yes, bitrate display is wrong for sbr, i will fix that later, i still collect bug :) .
Thz zip link should be fixed now.

bond
29th July 2003, 15:49
just some small "optical" things:

1) perhaps it would look better if you the downmix option would show up under a "settings sub-headline" in the info tab like in corevorbis
i dont know if there is also postgain available for aac like for vorbis?
2) under about tab, after faad2 2.0 rc1 there seem to be too much spaces before the "-"
3) it seems that the info and the about tab dont have the same height, you can see that when you switch between the two

as i said nothing really important...

rjamorim
29th July 2003, 18:37
Winamp plugin and command line decoder, for anyone interested:

http://pessoal.onda.com.br/rjamorim/in_mp4.exe
http://pessoal.onda.com.br/rjamorim/faad.zip

hans-jürgen
29th July 2003, 19:15
Originally posted by Wilbert
Roberto compiled a new FAAC (still without sbr code I guess, but with the channel remapping bug corrected): http://64.246.62.80/~hydrogenaudio.org/index.php?showtopic=11494
Guess he didn't update the version number on the RareWares site :) The related bugfix happened on July 21, 2003 and the current FAAC version is still 1.18, because knik didn't update the number. This means that direct transcoding from AC-3 when combined with foobar2000 is possible now, and the -I switch is not needed, because foo_ac3.dll already reorders the channels to a 5.1 WAV layout which is the default mapping in FAAC 1.18. See also this thread:

http://forum.doom9.org/showthread.php?s=&threadid=55069&perpage=20&pagenumber=3

SBR won't be implemented in FAAC (the open source encoder) as long as no one takes a look at the ISO reference software and specifications for MPEG-4 HE AAC (when available) and tries it... ;)

bond
31st July 2003, 14:49
one more thing about the info tab:

i mentioned that when the downmix option is ticked it is always shown that the aac streams have 2 channels (even if they have 6 channels)
i think it would be better if always 6 channels are shown under the info tab when a 6 channel file is used (even if they get downmixed)...

Herske
1st August 2003, 01:54
Hello all,

I read this thread carefully but I still do not know how to extract the *correct* HE .aac out of mp4 container.

I have tried:
-mp4ui 0.95 - the extracted HE .aac file is recognised as LC in foobar2k and winamp

-mp4creator60 (v0.9.8.6 ) - the same problem.

I'm using the SBR decoders for both winamp and foobar, the .mp4 file plays perfectly; I've also tried forcing mpeg-4 conversion, in mp4creator and mp4ui: still no luck.

Thanks in advance for any help,
/herske.

rjamorim
1st August 2003, 04:50
MPEG4ip still doesn't recognize HE AAC. That's why it doesn't work well with this profile.

CruNcher
1st August 2003, 05:44
@Herske

Nero has buildin .aac creation you have to activate the checkbox that says Export to ISO AAC file and then also a .aac file is created.

Herske
1st August 2003, 09:20
Thanks for the replies.

Cruncher, I tried this, and the .aac file is still reported (in foobar 2k) as being LC instead of HE.

So, is it any way to mux HE files in mkv?

Thanks,
/herske.

tiki4
1st August 2003, 11:05
Hi there,

I got a serial for Nero 6 some days ago and have the same problem. It seems that even Nero exports a LC AAC file and just strips off the SBR part of the file (Menno?). However, there is a rather simple way to mux your files if you are a little bit experienced with Graphedit. Just install the 3ivx codec from 3ivx.com. This codec comes with a MP4 splitter filter (I think this was mentioned before). Now render your HE-AAC-MP4 files in Graphedit, remove the CoreAAC and DirectSound output filters and connect the pin of the MP4 splitter with Gabest's MatroskaMuxer and that one with the FileWriter. I tried this with the Ogg Muxer from Tobias and it plays perfectly. This is not the most newbie friendly solution at the moment, but I think Koepi and Nic will come up with a solution shortly.

Regards,

tiki4

[Toff]
1st August 2003, 11:39
Don't forget that HE AAC is still backward compatible.
A decoder that can't handle the SBR part will still decode the AAC LC part of the file. So make sure that the decoder you use support SBR or you file will be seen as a classic AAC LC file.

Also it's not possible to detect if a .aac file has SBR information or not in it without decoding it (there is no information in the headers about SBR). So if foobar display the file information before decoding it will probably show AAC LC.

About matroska, there is the same problem at the muxer level, currently mkvmerge makes no difference between AAC LC and HE AAC. It use the same ID. The current version of CoreAAC will not handle that correctly (dshow need to know the output sample rate before decoding). I have now a version that works using a little tricks but we are still discussing the use of a different ID.

Nic
1st August 2003, 12:22
@Toff: Could you please state some more info on this (the tricks your using, etc)? Else ill catch you on IRC and talk more about it ;) (when you say ID are you refering to the same kind of ID you get in ADTS headers?) (Thanks alot :) )

@Tiki: At worst, ill have to wait to see how mkvmerge does it, then do it the same way, but ill look into it tonight :)

-Nic

Herske
1st August 2003, 12:27
Toff: I was using the correct SBR decoders, it was the first thing I checked.


Great advice, tiki, it worked perfectly. The resulting .aac files plays ok with CoreAAC, which recognises it corectly as having SBR.

PS. Foobar 2k and winamp can't play the resulting file, error: "Max number of scalefactor bands exceeded" and mkvmerge doesn't recognise the resulting .aac file, but I have finally managed to mux everything correctly using Graphedit and MatroskaMuxer filter form Gabest.

tiki4
1st August 2003, 13:28
@[Toff]:

Now I'm a little bit confused:

Does that mean that Nero 6 exports AAC files with MPEG-2 ADTS headers (where high efficiency profile isn't defined) that still contain the SBR information but e.g. the new Winamp 2 plugin compiled by John33 doesn't see the SBR content of the file because, well, because of what? I tried to mux such a file that was exported by Nero but the resulting video wasn't decoded with SBR by CoreAAC. Really confusing :confused:

However, the Graphedit method is working, we'd just need a MP4 parser filter independent from 3ivx, so that CVS OggMux just has to build a filter graph. As I said, it works perfectly when demuxed with the MP4 splitter and muxed into OGM or Matroska via DirectShow.

Regards,

tiki4

tiki4
1st August 2003, 13:31
Just to mention that: One can hear if is decoded correctly or not quite easily. Try for yourself: encode in Nero 6 and export ISO-AAC thingie. Load the resulting AAC into Winamp, or extract from MP4 with patched mp4creator from RareWares (--mpeg-version=4 switch). Both resulting AAC files are played wrongly by the in_mp4 plugin.

tiki4

CruNcher
1st August 2003, 14:30
@tiki4


resulting video wasn't decoded with SBR by CoreAAC. Really confusing


nope not really the problem is all muxer like MP4UI, mp4creator and also mkvmerge have to be made compatible to support the HE AAC profile, with the workaround CoreAAC version every muxed aac file is sampled*2 @ decoding. It works fine in my encodes only problem is the 3ivx Mp4 splitter it doesn't connect to the newest ffdshow maybe its ffdshows fault though in VLC its working fine but sound is not sampled*2 but i allready contacted a VLC developer and he will look @ it this evening :). i think in at least 1 week we will see that interoperability @ muxing and playing for HE AAC is fully given in the major muxer/players :)

[Toff]
1st August 2003, 16:53
Originally posted by Nic
Could you please state some more info on this (the tricks your using, etc)? ... when you say ID are you refering to the same kind of ID you get in ADTS headers?

I was talking about the matroska ID used. (A_AAC/MPEG2/LC, A_AAC/MPEG4/SBR ...)
Currently mkvmerge, with or without SBR always use A_AAC/MPEG2/LC because it use .aac as input format and in .aac there is nothing in the header to know if the file contain SBR informations.
In fact it's not really a problem for the decoder. The decoder will find the information in the frame data. But for example in dshow, we need to know the output samplerate to create the mediatype before decoding.

In mp4 this information is present so there should be no problem.

The trick i was talking about is at the decoder level.
If i don't have enough information about the SBR presence and if the input samplerate is <= 24Khz i create a media type with samplerate * 2. Then when i decode, if i found that SBR is not present, i double the samplerate.

When the muxer will use the right ID (by adding a command line switch, or by decoding the first frame, or by some more advanced detection on frame data) the demuxer will be able to recreate a mediatype with more information so the resampling trick will not be needed anymore.

Originally posted by tiki4 Does that mean that Nero 6 exports AAC files with MPEG-2 ADTS headers (where high efficiency profile isn't defined) that still contain the SBR information ...

Yes that's what nero is creating.
And about winamp2 plugin it's maybe updated only for mp4 and not for AAC.

Originally posted by tiki4
However, the Graphedit method is working, we'd just need a MP4 parser filter independent from 3ivx, so that CVS OggMux just has to build a filter graph. As I said, it works perfectly when demuxed with the MP4 splitter and muxed into OGM or Matroska via DirectShow.

One comment about the graphedit method, just to let you know that the file created will then use the windows ACM compatibility mode. And so maybe not be supported on x-platform.

robUx4
1st August 2003, 17:01
We need AAC+ encoders be able to write in matroska directly. It will be easier... :D

tiki4
4th August 2003, 07:54
@robUx4: :D

@[Toff]:

Right now I'm not caring too much about *nix compatibility, but you're surely right. I'd really like to see MKV based on an OS-independent solution (well, is UCI making progress?). On the other hand, Nic is making steady progress with OggMux and OGMuxer including AAC support :cool:

Cheers, and thanks for clarification,

tiki4

mikeson
15th December 2003, 02:03
@CoreAAC devels:

May I ask what is the current status of supporting replaygain in CoreAAC? Is it supported now? My tests didn't prove that, so if it is not, will it be supported in future?

Thanks.

[Toff]
15th December 2003, 13:53
The problem is to get those replaygain values which are stored at container level.
The decoder only get the AAC frames, so the splitter need to give those information to the decoder. I don't know if any splitter do this at the moment (mp4, matroska, ogm, avi).

bond
17th December 2003, 19:19
so we need to get muxer developers (cyrius, mosu, shitowax and alexnoe ;) ) to pass this info, when muxing into their formats

Atamido
18th December 2003, 01:40
It would probably be better if someone made a generic ReplayGain DirectShow filter that connected between the codec and the AudioRenderer. Then that could have a simple interface to accept a replaygain value from the splitter and adjust the audio levels accordingly.

I don't imagine this would be that hard to do.

shitowax
18th December 2003, 09:41
I didn't find the time to code that yet, but this replay gain can be easily set from the splitter (before streaming, retrieve the volume interface of the graph and set it to the right level). And anyway, at least for .mp4 and .mov, it's contained in the file format, not in the audio bitstream, so, my opinion is that it's the business of the splitter to set that, not the audio decoder.

Originally posted by Pamel
It would probably be better if someone made a generic ReplayGain DirectShow filter that connected between the codec and the AudioRenderer. Then that could have a simple interface to accept a replaygain value from the splitter and adjust the audio levels accordingly.

I don't imagine this would be that hard to do.

Atamido
18th December 2003, 09:50
Good, looks like we're in agreement then. :)

[Toff]
18th December 2003, 11:51
I'm afraid that changing the volume level of the graph will not works correctly as the player is going to override this volume just after you load the file.
I was more thinking about something like : the decoder ask for the replaygain values to the filter he is connected to and apply the gain on the PCM data it output.

Originally posted by shitowax
I didn't find the time to code that yet, but this replay gain can be easily set from the splitter (before streaming, retrieve the volume interface of the graph and set it to the right level). And anyway, at least for .mp4 and .mov, it's contained in the file format, not in the audio bitstream, so, my opinion is that it's the business of the splitter to set that, not the audio decoder.

shitowax
18th December 2003, 11:59
The question is when precisely will the volume be set by the player ? I would say it's just after the graph has been built. If it's the case, then my method would work (cause I propose that the splitter set the volume when it start streaming). Of course if there is daemon in the player resetting the volume to the appropriate value all the time, then it's fucked up =).

Originally posted by [Toff]
I'm afraid that changing the volume level of the graph will not works correctly as the player is going to override this volume just after you load the file.
I was more thinking about something like : the decoder ask for the replaygain values to the filter he is connected to and apply the gain on the PCM data it output.

Atamido
18th December 2003, 19:08
I think that altering the PCM data directly so that the volume is always relative to whatever the user has set in the player is a better idea.

ChristianHJW
18th December 2003, 19:57
Originally posted by Pamel I think that altering the PCM data directly so that the volume is always relative to whatever the user has set in the player is a better idea.

I take it that most decoders will output 16 Bit Integer PCM ? If so, we could convert this to 32 Bit FP PCM in the replaygain filter, giving us a lot of headroom to adjust loudness during playback ? The standard DShow audio renderers should be able to handle this just fine ?

[Toff]
19th December 2003, 15:30
Changing the graph volume has another major drawback : you can only have a gain <= 1.0, in fact you can't amplify the sound, only reduce it.
And at the user interface level I'm not sure the user will understand why his volume slider is moving :D

Doing a replaygain standalone filter would be great but I'm not sure it's really possible to tell the filter when to load exactly, especially with all those audio filters (channel downmixer, audio switcher) around. You need to find the right MERIT.
Too bad because it would be the best solution as it will works for all codecs.

bond
19th December 2003, 15:37
perhaps valex can implement something like that in his matrix mixer?