|
|
| fccHandler |
| Posted: Mar 26 2011, 04:57 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ale5000 @ Mar 26 2011, 12:28 PM) | | The AVI header must contain data to play correctly the LC profile of the AAC, to play SBR the decoder must multiply sampling rate * 2. |
I disagree with this regarding the AVI header.
| QUOTE (ale5000 @ Mar 26 2011, 12:28 PM) | | By specifying the full sampling rate you are breaking playback in "LC only decoders". |
I don't understand you. Who is breaking what exactly? What do you mean by "LC only decoders"?
What is happening with these AVI files is that the decoder (faad2) is detecting SBR and decoding at the full rate, but the clients (VirtualDub and AACACM) mistakenly perceive it as 24000 Hz due to the rate specified in the audio header. In my opinion the header is incorrect; it should specify the true playback rate of 48000 Hz.
But let me ask you; what do you expect to happen when playing one of these files in VirtualDub?
-------------------- May the FOURCC be with you... |
 |
| ale5000 |
| Posted: Mar 26 2011, 07:41 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
| QUOTE (fccHandler @ Mar 26 2011, 05:57 PM) | | QUOTE (ale5000 @ Mar 26 2011, 12:28 PM) | | The AVI header must contain data to play correctly the LC profile of the AAC, to play SBR the decoder must multiply sampling rate * 2. |
I disagree with this regarding the AVI header. | This is how avi with HE-AAC are created in other applications, certainly people that use ffdshow or VLC won't have any problems in both cases but your implementation disagree with the implementation in other apps.
| QUOTE (fccHandler @ Mar 26 2011, 05:57 PM) | | QUOTE (ale5000 @ Mar 26 2011, 12:28 PM) | | By specifying the full sampling rate you are breaking playback in "LC only decoders". |
I don't understand you. Who is breaking what exactly? What do you mean by "LC only decoders"?
What is happening with these AVI files is that the decoder (faad2) is detecting SBR and decoding at the full rate, but the clients (VirtualDub and AACACM) mistakenly perceive it as 24000 Hz due to the rate specified in the audio header. In my opinion the header is incorrect; it should specify the true playback rate of 48000 Hz. | "LC only decoders" => Decoders that support AAC but that don't support HE-AAC. Decoders that support HE-AAC doesn't use the sampling rate that it is in the AVI headers (so they simply don't care).
| QUOTE (fccHandler @ Mar 26 2011, 05:57 PM) | | But let me ask you; what do you expect to happen when playing one of these files in VirtualDub? | It could be that VirtualDub read the LC sampling rate (24000 Hz in this case) in the AVI header and report it to the AAC ACM Codec then the AAC ACM codec analyze the file, if it is HE-AAC then use sampling rate * 2 otherwise use sampling rate * 1.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| fccHandler |
| Posted: Mar 26 2011, 09:01 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
I know what the term "LC only decoders" means, actually, I should have said can you give me an example of one. Maybe some hardware devices, but I wouldn't know...
The big problem here is that we are trying to have our cake and eat it too, so to speak. I don't think that you are taking into consideration how the Windows Audio Compression Manager works.
If the MKV plugin lies to VirtualDub that the rate is 24KHz (when it is really SBR 48KHz) then you end up with an AVI with 24KHz in its header. VirtualDub will pass that on to the ACM, and the AAC codec is forced to work with that. He cannot return any other sampling rate but what the client specifies. In fact, that is the problem now with your AVI files; we are returning the true 48KHz but VirtualDub still thinks it is 24KHz.
Also due to the limitations of the ACM it is not possible for AACACM to detect implicit SBR or PS during the initial format negotiations. He does not have access to the audio data until the stream decoding begins, but by that time it is too late because input and output formats have already been decided.
As I see it there are three solutions:
1) AACACM must downsample HE-AAC before returning it to the client. But if we do that then you will never hear the enhanced quality that HE-AAC provides. Might as well just throw out all of that HE-AAC code in faad2.
2) VirtualDub must be made aware of SBR and deal with it on his side (not likely to happen).
3) Don't lie to VirtualDub; tell him the true output sampling rate of the audio so that he can negotiate for that rate with the AAC codec. The problem here is that he will also write that rate into the AVI header which (you say) is wrong.
Currently number 3 is what I have implemented. I do not like the other solutions. If I am breaking somebody's app then so be it, but so far you are the only one who has complained.
-------------------- May the FOURCC be with you... |
 |
| fccHandler |
| Posted: Mar 26 2011, 09:15 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ale5000 @ Mar 26 2011, 03:41 PM) | PS: I have noticed another problem, I remux an .mkv file (with HE-AAC audio) to .avi with VirtualDub; then I try to remux the resulting avi with MKVtoolnix, it say "This AAC track does not contain valid headers. The extra header size is 7 bytes, expected were 2 or 5 bytes." Edit: Added test file with bad extra header size created by VirtualDub + Matroska input plugin: http://www.multiupload.com/I07JPARCWZ |
The extra bytes are the AudioSpecificConfig defined in the AAC spec, presumably taken straight from the Matroska file. It is 7 bytes because it contains explicit signalling of HE-AAC v2 Parametric Stereo in a second extension field. (Actually it signals that PS is NOT present, which is a bit weird but not out of spec.)
Was the Matroska file created with MKVtoolnix? If so then it is strange that he would write a 7-byte AudioSpecificConfig, but not be able to read it back...
-------------------- May the FOURCC be with you... |
 |
| phaeron |
| Posted: Mar 26 2011, 10:38 PM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
| QUOTE | | It could be that VirtualDub read the LC sampling rate (24000 Hz in this case) in the AVI header and report it to the AAC ACM Codec then the AAC ACM codec analyze the file, if it is HE-AAC then use sampling rate * 2 otherwise use sampling rate * 1. |
ACM codecs don't work this way -- they have to be able to report the sampling rate based on the header prior to seeing any audio data. This usage of the WAVEFORMATEX structure definitely sounds questionable and I'd say it's broken. Even DirectShow would have problems with this in some circumstances, I'd say.
|
 |
| ale5000 |
| Posted: Mar 27 2011, 03:06 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
| QUOTE (phaeron @ Mar 26 2011, 11:38 PM) | | QUOTE | | It could be that VirtualDub read the LC sampling rate (24000 Hz in this case) in the AVI header and report it to the AAC ACM Codec then the AAC ACM codec analyze the file, if it is HE-AAC then use sampling rate * 2 otherwise use sampling rate * 1. |
ACM codecs don't work this way -- they have to be able to report the sampling rate based on the header prior to seeing any audio data. This usage of the WAVEFORMATEX structure definitely sounds questionable and I'd say it's broken. Even DirectShow would have problems with this in some circumstances, I'd say. |
Well, I'm not the one that decided it but it is like this. You can try it yourself with both ffdshow-tryout and VLC, they ignore the sampling rate and channels number in the avi header and always get the right values (this is for HE-AAC and HE-AACv2 I don't know for other formats).
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| ale5000 |
| Posted: Mar 27 2011, 03:10 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Edit: Problem fixed
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| fccHandler |
| Posted: Mar 27 2011, 03:56 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ale5000 @ Mar 26 2011, 11:10 PM) | | The result file has 7-byte extra header. |
Umm, I don't know how I can state this any more clearly. The extra 7 bytes is the AudioSpecificConfig taken from the Matroska file. If mkvtoolnix is telling you that AudioSpecificConfig cannot be 7 bytes, then it is mistaken, and you will need to contact the author.
Incidentally, it is possible for AudioSpecificConfig to be a size other than 2, 5, or 7 bytes (for example, if it contains a custom sampling rate).
-------------------- May the FOURCC be with you... |
 |
| fccHandler |
| Posted: Mar 27 2011, 04:01 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ale5000 @ Mar 26 2011, 11:06 PM) | it is like this. You can try it yourself with both ffdshow-tryout and VLC, they ignore the sampling rate and channels number in the avi header and always get the right values (this is for HE-AAC and HE-AACv2 I don't know for other formats). | Yes, but we are talking about playback within VirtualDub. He does utilize those values from the AVI header and there is no getting around it.
-------------------- May the FOURCC be with you... |
 |
| ale5000 |
| Posted: Mar 27 2011, 04:04 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Edit: Problem fixed
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| L.H.V.F. |
| Posted: Mar 27 2011, 04:06 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 49
Member No.: 28822
Joined: 19-October 10

|
Hi, fccHandler
I've used your latest version WMV Input Plugin, and I have installed the codecs adequately of microsoft, and in my experience, I saw a problem with a framerate in videos above of "15.000 fps". It shows wrong the framerate in VirtualDub, in my tests for .wmv. Fortunately, now in my videos .wmv, don't show a green screen in the first key frame, only happens if I open another window of the video board and it gets gray in some moments. I would like to say that video have one problem in "File Information" in VirtualDub, because the video in question, have 29.970 fps, as I can see in MediaInfo, and VirtualDub show that has "29.995 fps".
Could you indicate what is the fail, or correct this in your plugin? I need to use your plugin for convert with some Filters, exclusive for VirtualDub, this video with low resolution: Video Enhancer: http://www.infognition.com/VideoEnhancer/ in test for me, for while. In another video, in earlier version of your plugin, I can make the resolution better with RGB 24 in one video, but when I went tried to convert the framerate (15.000 fps to 30.000fps) (with Lagarith codec), maybe for incorrect schema of framerate, the video output converted stood with something as "30,092 fps" (in my research the maximum of framerate accepted is 30.000 fps in CRT television), but this video was the unique with sucessfully converted framerate that I could make. I will post this video one day, when I install and configure better my codecs, after configuring one more complicated video ( I can open this video in VirtualDub one time.. , but the file in Direct Stream Copy was a .wav with the original file .wma inside, that only can be open in Sound Forge). It showed "???" for codec in tentative of Direct Stream Copy, in SUPER, earlier version. Now in the latest version of SUPER, I can do a direct stream copy of this video finally... VirtualDub doesn't open this audio of video so easily (it made a .wav, with .wma original file inside).
Video with problems: http://www.4shared.com/video/OE0y3D4v/Proj...ontinuidad.html
Before install microsoft official codecs: http://img193.imageshack.us/i/problemwmvcodec.png/
After install codecs: http://img835.imageshack.us/i/snapshotafte...terinstall.png/
I thank your return, L.H.V.F. |
 |
| ale5000 |
| Posted: Mar 27 2011, 04:18 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
| QUOTE (fccHandler @ Mar 27 2011, 05:01 AM) | | QUOTE (ale5000 @ Mar 26 2011, 11:06 PM) | it is like this. You can try it yourself with both ffdshow-tryout and VLC, they ignore the sampling rate and channels number in the avi header and always get the right values (this is for HE-AAC and HE-AACv2 I don't know for other formats). |
Yes, but we are talking about playback within VirtualDub. He does utilize those values from the AVI header and there is no getting around it. |
What about setting a custom comunication between VirtualDub and the ACM codec? Like this: 1) VirtualDub get a request to open an .avi file 2) It looks for an ACM codec 3) Check in the export table of the ACM codec an additional API (for example DriverProcCustom) 4) If it find the API then call it (requesting the two sampling rate and the two channels number, they will be equal for normal aac files) before open the file in the normal way (but with the correct data returned before) otherwise it just behave like usual.
One sampling rate/channels number is for storing in the AVI headers while the others (real values) are for everything else.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| fccHandler |
| Posted: Mar 27 2011, 04:26 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
I have uploaded version 2.8 of the Matroska plugin: http://fcchandler.home.comcast.net/Plugins/Matroska
There are a lot of little changes and some big new features, so let the bug reports commence. 
-------------------- May the FOURCC be with you... |
 |
| ale5000 |
| Posted: Mar 27 2011, 04:29 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
| QUOTE | | Added experimental support for MPEG-2 video and Vorbis audio. | I must cry for joy (before even try it)
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| fccHandler |
| Posted: Mar 27 2011, 04:31 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ale5000 @ Mar 27 2011, 12:04 AM) | | is it possible to remove automatically the useless things like when it signals that PS is NOT present? | No, it is not out of spec and it is not necessarily useless either. Who knows, someday someone may want this information.
-------------------- May the FOURCC be with you... |
 |