Log in

View Full Version : AAC compression (codec) for virtualdub? And .mp4 or .mkv containers support?


firebo14
21st December 2011, 16:04
How do i encode AAC with a vid in virtualdub? It would be nice if it can support 5.1 channels and in 48KHz or 44.1KHz.

And .mp4 or .mkv containers support?

Thanks. :thanks:

Midzuki
21st December 2011, 16:29
There exists an AAC ACM, but it only decodes, it cannot encode.

So far, the safest (¿only?) way to create .AVIs containing AAC is by using "AVI-Mux GUI". Also, "HE-AAC in AVI" is not a good idea.

LoRd_MuldeR
22nd December 2011, 01:04
AAC in AVI is facing the same problem as VBR MP3 in AVI, because AVI originally wasn't intended for VBR audio. Still it is possible - the way AVI-Mux GUI does it.

But why is HE-AAC more problematic than LC-AAC? HE-AAC is nothing but LC-AAC with special pre-processing (SBR) before the actual AAC encoding...

Midzuki
22nd December 2011, 01:19
HE-AAC is correctly identified and played for MKVs and FLVs in VirtualDub. For AVI files, HE-AAC still is played-back at half-speed. So the best option is, always use "normal" AAC streams in AVI files (OR remux these to MKVs,

if the goal is to reencode them with VirtualDub).

source:

http://www.videohelp.com/tools/AAC-ACM-Codec#usercomments

Keiyakusha
22nd December 2011, 05:11
HE-AAC is nothing but LC-AAC with special pre-processing (SBR) before the actual AAC encoding...
It is a bit different. HE-AAC has sampling rate divided by 2 compared to the source, plus SBR info.

Midzuki
Why they say "half-speed", shouldn't it be "2 times faster"?
I mean if source is 48000hz, it will be 24000hz+SBR. If SBR won't be recognised, 24000Hz will be played at 48000hz. Audio will be 2 times shorter, so it will play 2 times faster? Or what I'm saying here is a total nonsense? ^__^

Midzuki
22nd December 2011, 10:14
Keiyakusha:


1) Long answer: the explanation was already posted on the VirtualDub forums ( but I'm too lazy to look for it right now :) ). Grosso modo, and just as an example, the ACM decoder plays at 24kHz something that was encoded at 48kHz.

2) Short answer: just try and hear :)

3) Not an answer: "AVI sucks" :D

LoRd_MuldeR
22nd December 2011, 15:22
HE-AAC is simply LC-AAC with SBR. The format of the resulting AAC stream is no different. Actually SBR can be applied to MP3 just as well (known as "MP3pro").

SBR is pre-processing before the actual AAC encoding step. And indeed it will divide the the sampling rate by 2 (and thus "remove" the higher frequencies according to Nyquist Theorem).

As a result, you will get only 1/2 sampling rate (and thus worse quality) compared to the original, when using an AAC decoder that does not support HE-AAC (SBR).

When using an HE-AAC-capable decoder, the output will be upsampled to the original sample rate and the "missing" frequencies will be synthesized.

Still that is a property of the AAC format and is not related to AVI at all. Audio streams with varying sample size work just fine with AVI - if done in the right way.

Only some buggy AVI splitters don't handle it properly, because they make the (false) assumption that audio streams will always use fixed-size samples.

Whether the AAC decoder, which will be used to decompress the AAC data later, does support HE-AAC (SBR) or not, that is a completely different and AVI-unrelated question...

See also:
http://www.alexander-noe.com/video/amg/en_myths.html

(Have a look at "MP3-VBR-in-AVI is a dirty hack" and "AAC in AVI does not work")

roozhou
22nd December 2011, 18:51
I think 1/2 sample-rate is stored in AVI header for HE-AAC. If the splitter fails to let the decoder parse the wav header, it may assume the sample rate is 1/2. If the decoder output full sample-rate pcm, it may be played at 1/2 speed.

Keiyakusha
22nd December 2011, 19:28
1) Long answer: the explanation was already posted on the VirtualDub forums ( but I'm too lazy to look for it right now :) ). Grosso modo, and just as an example, the ACM decoder plays at 24kHz something that was encoded at 48kHz.
2) Short answer: just try and hear :)
3) Not an answer: "AVI sucks"
1) That's why I was asking. Because technically it is NOT encoded at 48kHz. Sampling rate is artificially doubled on decoding.
2) Are you saying that I should find and install some crappy decoder/splitter combination that will fail like that just to satisfy my curiosity? No thanks ツ
3) Agree.
I think 1/2 sample-rate is stored in AVI header for HE-AAC. If the splitter fails to let the decoder parse the wav header, it may assume the sample rate is 1/2. If the decoder output full sample-rate pcm, it may be played at 1/2 speed.
Yeah, this is makes sense.

Midzuki
22nd December 2011, 19:41
1) That's why I was asking. Because technically it is NOT encoded at 48kHz. Sampling rate is artificially doubled on decoding.

I stand corrected, sir. :stupid:

Originally posted by fccHandler (http://forums.virtualdub.org/index.php?act=ST&f=3&t=19757&st=30)

I have no control over the sample rate in an AVI file. If the AVI audio header declares that the sample rate is 22050 Hz (as this one does), then that is indeed what you will hear.

LoRd_MuldeR
22nd December 2011, 20:07
Originally posted by fccHandler (http://forums.virtualdub.org/index.php?act=ST&f=3&t=19757&st=30)

I have no control over the sample rate in an AVI file. If the AVI audio header declares that the sample rate is 22050 Hz (as this one does), then that is indeed what you will hear.

This heavily depends on the context. Maybe it applies to the VFW interface. But VFW is only one (out of many) specific software implementation to read AVI files. VFW is outdated/discontinued, as we all know.

At the same time AVI is only a container format. Hence it only specifies the the file format, but it does not specify how the software that reads the file has to behave.

For HE-AAC it makes sense to specify the "base" (not re-upconverted) sample-rate as the stream's sample-rate in the AVI header. That is exactly the sample rate that a Non-HE-capable AAC decoder would return.

Software that does supports HE-AAC must be aware that the final decoded + post-processed output sample-rate may be different from the "base" rate. And it obviously must be able to deal with that fact.

Consequently you must not blame the container format (i.e. specification), when the actual problem lies in one specific broken/outdated/incomplete software implementation of that format...

Midzuki
22nd December 2011, 20:29
1) Read again the title of this thread :)

2) Any plans to fix VirtualDub, the VfW/ACM thing itself, the AAC ACM codec, some of the above, all of the above? :devil:

firebo14
23rd December 2011, 01:15
3) Not an answer: "AVI sucks" :D

Hmm... why not add .mp4 or .mkv containers support to virtualdub and then now i can encode aac into those containers. These containers work very well with AAC. :] If they do that, then no more issues with AAC in .avi, ignoring .avi forever and go to a better container (.mp4 or .mkv). :D

So... is it possible to save .mp4 or .mkv in virtualdub? Any plugins that do that? o.o

1) Read again the title of this thread :)



New title! I wonder why virtualdub does not support .mp4 or .mkv 'save as...' output currently?

Thanks all....

clsid
23rd December 2011, 01:44
Use Avidemux...

firebo14
23rd December 2011, 03:48
Avidemux does not have VFW video encoder (very high quality) nor the resize filter with interlace 'check box' (this is to keep the interlaced vid interlaced if resizing vid). And i want to use some vid filters in vdub.

:(

LoRd_MuldeR
23rd December 2011, 04:06
Avidemux does not use VFW, because it's outdated and platform-specific. Also the claim that VFW is "very high quality" doesn't make any sense.

VFW is just the interface between the application (e.g. VirtualDub) and the individual VFW Codec (e.g. DivX). The quality depends on the Codec that you use.

Avidemux has two lossless encoders (FFV1 and HuffYUV) built-in, which is the best possible quality you can get - 100% lossless.

Moreover Avidemux comes with x264 as well as Xvid built-in. What other encoder do you need?

Last but not least: You must not resize interlaced video. You will have to deinterlace (in Bob mode!), then apply the resize filter and finally re-weave.

(The "interlaced" checkbox in VirtualDub's resize dialog probably is nothing but a shortcut for this procedure)

firebo14
23rd December 2011, 04:39
Not outdated... there is this one dude who just recently released the VFW in Dec 2011. And the 'very high quality' depends on settings of the encoder (it is a slow encode, but worth it). I dont like lossless as it is too big in size, so that is why im using this. :D

The 'interlaced checkbox' is quicker in vdub. One checkbox and done! I want to keep it interlaced because it saves size and the smooth 60fps if i deinterlace it in ffdshow vid decoder while watching it on a player (like kmp). ;)

Last but not least: You must not resize interlaced video. You will have to deinterlace (in Bob mode!), then apply the resize filter and finally re-weave.

I did not know that...

Anyways..... thanks for your help... i'll try your way out.

:thanks:







And Windows is the best OS. :D

LoRd_MuldeR
23rd December 2011, 14:53
It seems you don't know what VFW is. Nobody "releases" VFW, as VFW is a (deprecated) part of the Windows operating system.

You probably mean that somebody released a VFW Codec recently. That is possible. Still, the VFW interface itself is antiquated technology ;)

Also, just because somebody released some encoder as a VFW Codec, this doesn't make it any more (or less) "high quality".

firebo14
23rd December 2011, 19:12
Thanks.... i also did not know that... :]

Bloax
23rd December 2011, 19:28
This one can encode to AAC in VirtualDub, (http://free-codecs.com/download/AAC_ACM_Codec.htm) for all I remember.

Though it's about the same thing as Reply #3 links to, except that instead of
AAC ACM Codec is a AAC decoder codec.
It's more of an AAC ACM codec.

Wilbert
23rd December 2011, 23:00
It's more of an AAC ACM codec.
From the same page:

Note:

- Currently AAC ACM Codec can only decode AAC, it cannot encode AAC!

Bloax
24th December 2011, 11:28
Arghh, I'm stupid.

This (http://free-codecs.com/download/AC-3_ACM_Decompressor.htm) is what I was thinking of. Sorry for that one.