Log in

View Full Version : AAC in AVI possible now!


Pages : [1] 2

alexnoe
9th December 2003, 13:15
He can't speak about me, because I have not yet gone crazy: my AAC - in - AVI works (soon to be released as avi-mux gui 1.15.4. I'm currently working around another b0rk in the seekhead of VDM files).

Tuning
9th December 2003, 13:46
Originally posted by alexnoe
my AAC - in - AVI works (soon to be released as avi-mux gui 1.15.4.

Alexnoe, You are great!. Thanks for the effort. Yet another hack to avi. I'm sure this is going to be important for avi users.
Btw, i'm curious too, is there "AAC is SBR" or some other option need in avi?:)

alexnoe
9th December 2003, 13:57
Yes, you have to set it manually, just like with mkvmerge.

Of course, if there is anyone who can tell me how I can find out if a file is SBR or not, then tell me (and Mosu).

Stux
9th December 2003, 14:29
HE-AAC can be detected two ways

Implicitly and Explicitly, explicit detection requires you to parse the audioconfig (preferred). The problem is that when an aac.mp4 is extracted into an .aac file the audioconfig tends to get lost, and then the only way is to decode the first frame of the aac stream.

PS: hacking AAC into AVI is madness ;)

BUT if you are determined, all I can request is you make sure that whatever hack you do come up with is compatible with the various AAC decoder DS filters out there, and hopefully our MP4 Muxer

alexnoe
11th December 2003, 16:32
It's up.

This is what I have (unless there is a bug):
- ADTS headers are striped
- auto config is as defined here (http://cvs.sourceforge.net/viewcvs.py/*checkout*/faac/faad2/common/mp4av/aac.cpp?content-type=text%2Fplain&rev=1.2)
- one chunk contains one RAW data block
- if a file contains ADTS packets of different numbers of raw data blocks, the user is warned that muxing this into AVI is not recommended
- the RTFM.txt file tells the user to test his files
- as in mkvmerge, one raw data block is assumed to have 1024 samples

Doom9
12th December 2003, 22:44
@alex: I'm sure the anti-AVI crowd will hate you even more for this ;) Good job. If only more editing programs supported all the stuff your tool can mux into an AVI.

alexnoe
12th December 2003, 22:59
I'm sure the anti-AVI crowd will hate you even more for this Wrong tense :p

Tuning
13th December 2003, 11:01
Thanks alexnoe.:)

They started hating centuries ago when you posted above.:D

bond
13th December 2003, 21:34
i allowed myself to split the AAC in AVI part from the vdm thread as it deserves an own discussion imo :)

nice hack alexnoe ;)
you maybe want to edit the first thread

DKDIB
13th December 2003, 23:31
To AlexNoe
Will you implemente Vorbis muxing also? Isn' t it similar to AAC muxing?



P.S.:
:thanks:
___

Stux wrote:
> [...] to decode the first frame of the aac stream.

Thanks a lot: now I understand why foobar2000 recognizes HE AAC without mp4 container automatically! :D

Doom9
14th December 2003, 02:57
Wrong tense Well, to my defense, some might only learn about your latest achievement sometime in the future ;)

The Rabbit
14th December 2003, 08:16
Originally posted by alexnoe
He can't speak about me, because I have not yet gone crazy: my AAC - in - AVI works (soon to be released as avi-mux gui 1.15.4. I'm currently working around another b0rk in the seekhead of VDM files).

Hi,

Just curious...

I wonder what's the wFormatTag you use for AAC? What will you use for Vorbis? Is there an official way to choose wFormatTag for every newly developed audio codec? Or does some organization accept registration and maintain the list?

Thanks!

Latexxx
14th December 2003, 09:46
Originally posted by Tuning
Thanks alexnoe.:)

They started hating centuries ago when you posted above.:D

No, no, no...
They started hating him when he posted this (http://www.hydrogenaudio.org/index.php?showtopic=15232&view=findpost&p=160668) @ Hydrogenaudio.

Koepi
14th December 2003, 10:21
Vorbis in AVI will be _very_ hard to achieve properly, the bitstream format (OGG) is simply very weird. Ingo Ralf Blum tried it for 1 1/2 years, produced very impressive tools (he's a very good coder) but didn't manage to solve that.

I'd like to get proven wrong, but I fear that hack won't be possible :-/ (well, and if it worked i only needed chapter info in avi and would be happy :) )

Regards
Koepi

bilu
14th December 2003, 11:01
(I'm drooling to see ChrisHJW posting here... :D )

Bilu

Atamido
14th December 2003, 11:10
AAC in AVI is evil. Vorbis in AVI could come only from the dark lord himself. :devil:

You can't even imagine how hackish you have to get to get Vorbis in AVI working. Its a combination of Variable Bitrate AND Variable Framerate because not only are all of the packets different sizes, they also each contain a different number of samples.

Heck, Ogg really isn't even an ideal editing solution for it since you can't tell what timecode most of the packets should have without actually decoding it.

Yes, I think he could get it to work. He mentioned before what he wants to do, and it makes sense. But it is certainly not a good thing to be doing.

ChristianHJW
14th December 2003, 11:19
I dont hate Alex. He is acting very normal, like so many other developers before him. He has invested a lot of time into his tool, and there were never as many users as expected for it. As a result, he is making it more attractive to the users, by implementing new 'features' .

Still, i have my very own opinion about this, and spent a lot of time explaining myself on the thread linked above on HA.org, so please dont ask me to invest this time again.

Of course, everybody will assume that its only my involvement with matroska that makes me think like i do. Those who know me better know this isnt the only truth. I have been spending a lot of time helping video compression Newbies during the last 3 years, answering questions and helping frustrated users on various boards, and Nandub's VBR MP3 trick was definitely one of the main reasons for that, with little or no impact on quality IMHO.

Again, if i had to choose ( fortunately this isnt the case ;) ) between matroska disappearing and MOV/MP4 finally making AVI redundant, or AVI getting a 2nd Life, i'd rather see matroska die than AVI live ....

bond
14th December 2003, 12:38
btw grap avimux-gui 1.15.5 with aac in avi support here (http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/index-eng.html)

DAvenger
14th December 2003, 12:56
Originally posted by Pamel
AAC in AVI is evil. Vorbis in AVI could come only from the dark lord himself. :devil:

:D You never know ...

alexnoe
14th December 2003, 15:51
Will you implemente Vorbis muxing also? Isn' t it similar to AAC muxing?I will TRY to. And no, it is not similar to AAC. AAC has a constant frame duration within one file, Vorbis does not.

DKDIB
14th December 2003, 21:15
Koepi wrote:
> Vorbis in AVI will be _very_ hard to achieve properly, the
> bitstream format (OGG) is simply very weird. [...]

Pamel wrote:
> [...] Its a combination of Variable Bitrate AND Variable
> Framerate because not only are all of the packets
> different sizes, they also each contain a different number
> of samples.

AlexNoe wrote:
> [...] And no, it is not similar to AAC. AAC has a constant
> frame duration within one file, Vorbis does not.

Thanks for explanations! ^__^

mf
14th December 2003, 22:12
Originally posted by Pamel
You can't even imagine how hackish you have to get to get Vorbis in AVI working. Its a combination of Variable Bitrate AND Variable Framerate because not only are all of the packets different sizes, they also each contain a different number of samples.
Packed bitstream? :D

alexnoe
14th December 2003, 22:18
what are *typical* frame durations?

Stux
15th December 2003, 02:38
Originally posted by Pamel
You can't even imagine how hackish you have to get to get Vorbis in AVI working. Its a combination of Variable Bitrate AND Variable Framerate because not only are all of the packets different sizes, they also each contain a different number of samples.

You know.... MP4 support VFR and VBR ;)

Atamido
15th December 2003, 07:25
Originally posted by mf
Packed bitstream? :D Yes. But you have to vary the number of packets you pack because of how irregular Vorbis packets are. Really, its not pretty.

Atamido
15th December 2003, 07:27
Originally posted by Stux
You know.... MP4 support VFR and VBR ;) As does Matroska. ;) OGM does too, but its a little hackish, and Xiph has no plans to implement it as it would make the overhead higher.

mf
15th December 2003, 11:09
Originally posted by Pamel
Yes. But you have to vary the number of packets you pack because of how irregular Vorbis packets are. Really, its not pretty.
Good. So that would work. Alexnoe, I'm counting on you :D.

DAvenger
15th December 2003, 12:00
Originally posted by Pamel
Really, its not pretty.

Stop pretending you really care ;) You better put your famous "Just use Matroska" into your signature :p

Atamido
15th December 2003, 19:47
Originally posted by DAvenger
Stop pretending you really care ;) You better put your famous "Just use Matroska" into your signature :p I am intrigued by the idea, but I think that the distribution of a tool that could do this is a bad idea. As far as what container, I try to advocate what would be the best for each purpose, but it just happens that for many purposes Matroska is the best. But I have advocated the use of AVI, MPEG-1/2, MP4, etc. for specific circumstances.

mf
15th December 2003, 20:23
Originally posted by Pamel
I am intrigued by the idea, but I think that the distribution of a tool that could do this is a bad idea.
If it works, it works. No reason not to distribute a tool that produces working things.

ChristianHJW
15th December 2003, 23:05
Originally posted by mf If it works, it works. No reason not to distribute a tool that produces working things.
I dont agree. Technicians like to think that way, but they are wrong with that. Otto Hahn was possessed by the idea to get the chain reaction working. By publishing his results, he is partially responsible for the death of thousands of Japanese citizens, thats a fact.

Technicians like to do what is technically possible, but they tend to deny any form of responsibility for what they are doing. I cant stop that, but at least i can tell them they are making a mistake with that ....

mf
15th December 2003, 23:36
Originally posted by ChristianHJW
I dont agree. Technicians like to think that way, but they are wrong with that. Otto Hahn was possessed by the idea to get the chain reaction working. By publishing his results, he is partially responsible for the death of thousands of Japanese citizens, thats a fact.

Technicians like to do what is technically possible, but they tend to deny any form of responsibility for what they are doing. I cant stop that, but at least i can tell them they are making a mistake with that ....
Oh yeah. And alexnoe is going to kill thousands of Matroska files. Wait, that's not possible. Alexnoe is going to stop thousands of Matroska files from being made. Don't get into the RIAA reasoning of "potential losses" ;). My point is, his research is harmless.

Hiro2k
16th December 2003, 00:44
This is just a warning. I'm not addressing any one member in particular, so don't feel singled out. I do not want a repeat of what happened in the HA Forums to happen in this thread. I don't mind you sharing your views and ideas, but do it in a professional way (no name calling, or insults).

Thank You


I feel that what Alexnoe has done is great. AVI is not dead, Alexnoe just proved that. So that means the rest of you guys will have to try much harder to kill this format by making your's Superior. =P And I might add, AVI is much more popular so I suggest you start promoting whats new and innovative about your format, rather than saying how much crappier AVI is.

alexnoe
16th December 2003, 07:05
I dont agree. Technicians like to think that way, but they are wrong with that. Otto Hahn was possessed by the idea to get the chain reaction working. By publishing his results, he is partially responsible for the death of thousands of Japanese citizens, thats a fact.If he had not helped to develop it, someone else would.

The difference here is that i'm not sure if anyone else is going to try to get Vorbis into AVI...

IvS
16th December 2003, 11:54
I seriously don't understand why *developers* would choose to hang on to an outdated suboptimal container such as AVI.
Is it because of AVI being the currently most popular/used/widespread? If that's the reason then sorry, that's not a good enough reason.
Containers such as Matroska and MP4 are obviously much better/flexible/non-hack-demending. Instead of struggling to keep AVI alive just because it's the most used, better new formats that ease the life of developers and users should be focused on. Claiming that there's nothing wrong with AVI won't do, sorry. Since words i've read from every serious developer indicate how suboptimal and hellish AVI is. People need *better* things. If some don't care about what developers and users need, that's ok, it's their right. But other people should care about things other than themselves (especially users that is) and realize that newer better formats should be supported, and not the latest AVI hacking technology.
Anyway, i'm not claiming BS like "oh nos you can't distribute this. what yuo're doing si evil!" etc., this kind of remarks makes no sense.

And to those who choose to blame Christian for being some Matroska zealot or something, yeah he is highly involved in Matroska, but if you knew him just a little you'd know that he actually *cares* about giving people better things and supports Matroska, not just because it's Matroska, but because it's better, and it's for YOU and everybody.

ShyK, supporting the good of the majority.

alexnoe
16th December 2003, 11:58
I seriously don't understand why *developers* would choose to hang on to an outdated suboptimal container such as AVI.I've explained something like 10 times already: Someone, especially someone who does not code himself, claiming AAC in AVI being impossible is reason enough to implement it.

IvS
16th December 2003, 12:03
Originally posted by alexnoe
I've explained something like 10 times already: Someone, especially someone who does not code himself, claiming AAC in AVI being impossible is reason enough to implement it.
Wow that was a fast reply.
Yes i've read that. If you claim that *this* is a good enough reason, then that's pretty funny, because there are *always* people who say "that's impossible" and are completely clueless. So sorry i don't consider *this* a good enough reason. Do you have any better reason?

alexnoe
16th December 2003, 12:06
So sorry i don't consider *this* a good enough reasonAh....that's why you did not implement it :p

IvS
16th December 2003, 12:13
Originally posted by alexnoe
Ah....that's why you did not implement it :p
Hehe. OK. That's pretty funny too. I assume you care more to implement this beacuse some clueless people say it's impossible than the fact that you're helping to preserve AVI and slowing down the acceptance of MP4 and Matroska. Anyway that doesn't really matter, someone would have done it anyway. Funny that you don't mind being actually the person who "did it anyway".

Christos
16th December 2003, 13:35
@alexnoe
If you are looking for respect and admiration for your coding skills, and brainpower, then I think you certainly got it.
Now, maybe you should find a better way to put them in use.
But, on the other hand, who am I to tell you what to do...

@everyone
The majority of people don't even care what container they are using (they don't even see the file extention on their WinXP), and what kind of sound format that container supports. They only see the video and hear the sound that's within the container. So AAC in .avi doesn't really mean anything to them.
On the other hand, they will be able to see DVD like menus in .mp4, and they will like them a lot. Thats the kind of feature that makes a difference for containers. Thats what the matroska team should be focusing on if they hope for "global domination". Not fighting poor old .avi

ChristianHJW
16th December 2003, 14:10
Originally posted by Christos @alexnoe
If you are looking for respect and admiration for your coding skills, and brainpower, then I think you certainly got it.
Now, maybe you should find a better way to put them in use. .. couldnt have said it better :). There is one very very positive aspect about alexnoe implementing AAC support into avi-mux GUI, and this is that now his tool can also write AAC into MKV. Looking forward to same happening with Vorbis, actually avi-mux GUI can do things like appending different MKV tracks already, and the more codecs are being supported the more people will actually start using it, as an alternative to mkvmerge. matroska is all about choices, instead of being fixed on a combination of codecs, and for matroska users having the choice for different muxing tools is just cool IMHO :) !


On the other hand, they will be able to see DVD like menus in .mp4, and they will like them a lot. Thats the kind of feature that makes a difference for containers. Thats what the matroska team should be focusing on if they hope for "global domination". Not fighting poor old .avi .. if people like it or not, if they claim i'm stupid or not, i dont care, AVI IS the VfW container. Hacking things into AVI which can not be supported by the VCM or ACM API makes no sense IMHO. To make this clear, i am not fighting AVI, not at all. It certainly has his use, and things will stay like this for a pretty long time for sure. I am simply turning against putting more and more non-VfW compliant stuff into AVI, because this perverts the read main advantage of AVI, being the wide spread support in many different tools. And it 'artificially' prolongues the life of AVI, without any necessity or sense behind it, because there are much better alternatives already, and these are getting better and better support already. Get my point ?

ChristianHJW
16th December 2003, 14:16
Originally posted by alexnoe I've explained something like 10 times already: Someone, especially someone who does not code himself, claiming AAC in AVI being impossible is reason enough to implement it.

Just curious, who was the moron ? You cant be talking about me, because i know since a couple of month that AAC can be put into AVI ( CBR would be even pretty easy, via an ACM codec ) , and i certainly never was stating differently. Still, its my right to question the sense behind doing that, but being the precise mathematical person you are always presenting yourself, you certainly didnt swob the one with the other, no ?

alexnoe
16th December 2003, 14:20
( CBR would be even pretty easy, via an ACM codec )Cyrius tried that: The DirectShow AAC Decoder b0rks if you try to feed it with 'CBR'-AVI headers and, consequently, assume byte-access on the stream...

ChristianHJW
16th December 2003, 14:27
Originally posted by alexnoe Cyrius tried that: The DirectShow AAC Decoder b0rks if you try to feed it with 'CBR'-AVI headers and, consequently, assume byte-access on the stream... ... you ran out of arguments meanwhile ? You wonna tell us if i can make an ACM codec to write CBR AAC in AVI ( and menno from Ahead told me this would be feasible ), there is no way to make a DShow filter to play those AVI files ? Just because current decoders dont work, this doesnt mean its impossible to do, no ? Oh, i understand, if such ACM codec existed, people would start using VdubMod again, instead of avi-mux GUI ;) ...

Suiryc
16th December 2003, 14:33
Originally posted by alexnoe
Cyrius tried that: The DirectShow AAC Decoder b0rks if you try to feed it with 'CBR'-AVI headers and, consequently, assume byte-access on the stream...
In the HydrogenAudio thread I asked menno directly and here is what I could understand : faad (i.e. the most used AAC decoder out there - in CoreAAC, and the 3viX AAC decoder IIRC) can only properly decompress AAC when you give it a full frames (if there is crap before the frame then faad will likely return an error).
In every implementation of AAC in a container (that I know of, i.e. AVI, OGM, MP4 and MKV) the ADTS headers (see the AAC specs) are stripped from the stream and the RAW data blocks (attached to each ADTS header) are muxed in one entity of the container (chunk for AVI, Packet for OGM, atom for MP4, Block for MKV). This is the only safe way so that full frames are given to the decoder when playing back the file.

On the contrary to other containers (which by default support without hacks ;p VBR audio) you need to change a bit the AVI headers (a way similar to the one used for MP3 VBR).
The problem : while other containers will likely keep their "full AAC RAW data blocks per entity" rule, AVI won't with standard tools (i.e. VirtualDub). With such tools the AAC stream will be rewritten as CBR ... and you know what happens with faad in this case : no full RAW data blocks, error returned, no audio (actually it even crashed for me when I tried to play the file).

alexnoe
16th December 2003, 14:34
there is no way to make a DShow filter to play those AVI files ?Not with the current decoders. You'd need one that does not require to be fed with whole frames. If you wanna write one, then write one...

Suiryc
16th December 2003, 14:35
Originally posted by ChristianHJW
... you ran out of arguments meanwhile ? You wonna tell us if i can make an ACM codec to write CBR AAC in AVI ( and menno from Ahead told me this would be feasible ), there is no way to make a DShow filter to play those AVI files ? Just because current decoders dont work, this doesnt mean its impossible to do, no ? Oh, i understand, if such ACM codec existed, people would start using VdubMod again, instead of avi-mux GUI ;) ...
If I read correctly menno (or someone else) said that the ADTS headers were kept in the ACM codec. But both CoreAAC and the 3viX decoder froze when I tried to mux an AAC stream with ADTS headers inside an OGM file ...

SSIXS
16th December 2003, 17:08
Alexnoe,

I like to take a moment to applaud you for your development achievements and hope that the narrow mindedness of some individuals does not diminish your perseverance to push the limits as far as you can. I've tested your method and it worked out great. TY for the time you spent in implementing it.

Now, I seriously cant believe that one individual who wishes to expand the capabilities of the AVI container would be verbally persecuted for his efforts and told that it’s just a “hack”. How do you think this all started? If memory serves me correctly, the first widely distributed divx codec was in itself nothing more than a “hack” and look where that has taken us.

The AVI container, some individuals seem to want to write it off as archaic and outdated and yet, there still doesn’t appear to be anything quite as universally used to take its place. Is it feasible to capture huffyuv into the OGM or Matroska container yet, or directly open one of these other containers in Adobe Premier or any other commercial editing suite (without the use of Avisynth)? not that I’ve seen. For the sake of pure simplicity and expandability, the AVI container seems to be the choice for quite a few people, otherwise why would we have such programs as Virtualdub, Nandub, AutoGK etc…which cater to the majority of people out here.

“Technicians like to do what is technically possible, but they tend to deny any form of responsibility for what they are doing.”

I really like that statement, spoken like a true conservative :D Let’s be honest for a moment shall we. If we didn’t have any technicians that thought “outside the box” where would the world be today or even more specifically, where would the audio/video encoding community be? In my experience around here, if someone has a problem with how to accomplish something, rarely does that question go unanswered, either by the developer or someone familiar with what the individual is proposing. Just because a new technique is introduced, doesn’t mean any one individual is on the hook for solving all the worlds’ problems. That’s why we have a community here, to help each other out in our endeavors, not to “pimp” any new software or container while ridiculing the efforts of others. That, in my opinion, is just juvenile and bad form.

There’s a saying…one mans sugar is another mans poison. If you don’t like something, that doesn’t mean it's bad for everyone else.

I thank all the developers that have given us all such great tools to work with and hope that they continue to think “outside the box” for that is what enables this hobby and community to thrive.

Derek

mf
16th December 2003, 18:05
Originally posted by SSIXS
If we didn’t have any technicians that thought “outside the box” where would the world be today or even more specifically, where would the audio/video encoding community be?
We probably wouldn't have interlacing in our TVs, because the problem would have been solved in a more conservative way, like a signal doubling unit to convert 30Hz progressive to 60Hz progressive to match the mains frequency.

bill_baroud
16th December 2003, 18:13
in Adobe Première 6.0 : "can't open file, file use an unknow compressor"
in After Effect 5.0 : "After Effect Error : no such AVI compressor"

but my avi play fine in WMP :confused:
how can this happen ?