| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > General Discussion > Ac3 Question For Fcchandler |
| Posted by: levicki Aug 11 2005, 12:06 AM |
| I have a question about VirtualDub-MPEG2 and AC-3. You say on your page: If you need AC-3 support, try my AC-3 ACM Decompressor. That is nice if I want to recompress AC-3 to say mp3, but what to do if I just want to compress MPEG2 to DivX and interleave AC-3 into the resulting AVI file without recompressing sound? Can I do that with AC-3 ACM or I have to reach for my trusty VirtualDub 1.3c? If not possible at the moment with VirtualDub-MPEG2 and AC-3 ACM is there any chance to implement at least direct stream copy for AC-3 files? Thank you again for doing great job with VirtualDub-MPEG2, bump to 1.6.x has brought some terrific speed improvement especially in parsing MPEG2 files. |
| Posted by: Lazarus Aug 11 2005, 12:49 AM |
| If you would only have tried it, you would have known the answer. Yes, VirtualDub-MPEG2 + AC3ACM can direct steam copy AC3 into AVI. |
| Posted by: fccHandler Aug 11 2005, 01:06 AM | ||
|
| Posted by: levicki Aug 21 2005, 02:31 PM |
| Err, now I am confused... I have just opened a .VOB with VirtualDub 1.6.9 MPEG2 and it asked me to pick audio track -- 0x80 or 0x81 being English AC-3 5.1 and French AC-3 2.0 respectively?!? Now for the confusing part... I don't have AC-3 ACM installed? WTF?!? Never mind, it worked and I was able to interleave 5.1 AC-3 stream into AVI at the same time while compressing video to DivX. No more extra steps needed, GR8! @fccHandler: VirtualDub 1.3c was the last official version which supported AC-3 audio files via WAV Audio option in Audio menu. |
| Posted by: fccHandler Aug 21 2005, 03:06 PM | ||||||
The program doesn't know what languages are embedded, because that information isn't in the .VOB file. It only sees that there are two soundtracks. You have to listen to them to discover the languages, but for that you need AC3ACM.
You only need AC3ACM to decompress the compressed AC-3 audio. If you're just copying the stream directly, AC3ACM isn't needed.
You must be thinking of ASF. As far as I know, the official VirtualDub never had native support for raw AC-3, but you can load an AC-3 soundtrack via the WAV Audio option if it was previously saved from VirtualDub. That's still true in 1.6.10. |
| Posted by: levicki Aug 21 2005, 09:57 PM | ||||||||
Sorry for being so confusing. English is not my primary language.
I know that. That information is not too important for me anyway because I can check it myself.
True... but only if I perform a direct stream copy of a stream which is contained in a VOB file. Doesn't work for demuxed AC-3 streams.
No I am not thinking ASF -- I am talking about VirtualDub 1.3c build 0/debug. Let me try to explain by using pictures. When you open Audio|WAV Audio... and select AC-3 file in 1.6.10 you get this: ![]() And in 1.3c build 0/debug you get this: ![]() Now don't get me wrong, it is not such a big deal if 1.6.10 can't open AC-3 files when it can deal with AC-3 stream stored in VOB (and I didn't even know it can!), just it would be nice if external AC-3 could be used too meaning that you can take any AVI and interleave AC-3 soundtrack into it like you can do with 1.3c.
Err, how? Because as you can see I can't do that. My AC-3 files are produced with DVDDecrypter and 1.3c works fine with them. |
| Posted by: fccHandler Aug 22 2005, 04:37 AM | ||||
If that's true it's surprising. I seem to remember Avery saying he knew nothing about AC-3. I'll have to go back and look at the source code of 1.3c... If it can load AC-3 directly, that would be very useful code to add to VirtualDub-MPEG2.
Sorry if I confused you here. The key words (in my quote) were "if it was previously saved from VirtualDub." It won't load raw AC-3 streams created elsewhere. |
| Posted by: fccHandler Aug 22 2005, 05:55 AM | ||
Ah, I just noticed this "build 0/debug." It looks like what you have is a hacked version of the real 1.3c, because: - The real VirtualDub 1.3c was certainly not build 0, - Avery Lee doesn't release debug builds, - I double checked the source code of 1.3c (and built it) and it definitely won't load raw .ac3 files. |
| Posted by: levicki Aug 22 2005, 05:47 PM | ||||
In Change Log it says this: Build 10740 (Version 1.3c): [bug fixes] * WAV replacement audio works again. * Frameserver code now supports frame size changes properly. * Fixed frameserver client proxy mode under Win95/98. * No longer crashes if you load a config file without a video file loaded. * Moved tab stop over on audio compression dialog, so that audio codecs with really long format names will fit. In Version Information tab it shows: Comments = "Anime songs for this build: "7 o'clock news" from Kodomo no Omocha Opening theme for Natsuki Crisis "Watasi ni Happy Birthday" from Cat Girl Nuku Nuku" File Version = "1.3b" Special Build Description = "Debug build (i.e. big, fat, and slow)" Hopefully this could help you trace it back to the right source code or at least ask Avery about it (although I too believe that it is a hacked version because I have seen that there are some http://files.digital-digest.com/downloads/files/virtualdub/VirtualDub_148_AC3.exe with AC-3 support too -- hint: google). Let me know if you want me to send you the executable that I have. EDIT: I just tried to open ASF with it and guess what -- that works too! It is the same version as 1.3c 10740 release, only release version doesn't show that dialog above but it accepts the AC-3 file silently. EDIT2: I just found VirtualDub-MPEG2 AC3 1.5.4 build 16386/release by Avery Lee, fccHandler?!?!? @fccHandler: Could you explain how could there be a release of VirtualDub-MPEG2 with RAW AC3 support supposedly signed off by you and you not being aware of it not to mention not keeping that gem in your source code? |
| Posted by: fccHandler Aug 23 2005, 08:42 PM | ||
Why do you think I'm not aware of it? I made that a long time ago. I removed the embedded AC-3 decoder later, and it became the AC3ACM decompressor. That version won't load raw AC-3 audio by itself, nor will it allow Direct Stream Copy of AC-3 from VOB to AVI. |
| Posted by: levicki Aug 23 2005, 11:24 PM | ||||
Damn, you are right. It can't load raw AC-3. My mistake. And what about 1.3c 10740/release? Do you have a source code for that one? Or it is indeed some hacked build? |
| Posted by: fccHandler Aug 24 2005, 02:15 AM | ||
I do have that source code, but it's not the same as the "build 0/debug" version you have. Yours is certainly a hack since it loads raw AC-3. A long time ago I remember seeing mention of a program called "VirtualDubAc3" on the net, and I always wondered what it was. Maybe that's what you have. |
| Posted by: levicki Sep 9 2005, 09:16 PM |
| Does anyone know is there any particular reason why mono MPEG layer I audio cannot be direct stream copied to uncompressed AVI -- the audio gets decompressed too? |
| Posted by: stephanV Sep 9 2005, 09:18 PM |
| Have you tried opening with extended options in VirtualDub-MPEG2 and check the appropriate check box? |
| Posted by: levicki Sep 10 2005, 02:08 PM | ||
What would that check box be? Seriously, if I check direct stream copy in audio menu I expect direct stream copy and not decompressed audio. |
| Posted by: stephanV Sep 10 2005, 04:53 PM |
| VirtualDub has never allowed Direct Stream Copy for mpg files. Open the file via file-->open file, in the open dialog box check the extended opening options box in the lower left corner and then check allow direct stream copy for MPEG audio. Note that this is in VirtualDub-MPEG2. |
| Posted by: fccHandler Sep 10 2005, 06:20 PM |
| @levicki: Your complaint is justified, and I don't like it any more than you do. There are reasons why MPEG direct stream copy doesn't work as expected, but it's difficult to explain and even more difficult to fix. The way VirtualDub is written, the MPEG audio decompressor is visible only in the MPEG module, and not visible to the rest of VirtualDub. MPEG audio is always decompressed before it travels to any other part of the program, even in direct stream copy mode. My checkbox is an inelegant solution, but it's the best I could come up with. You'll notice that if you check the box, direct stream copy works, but playing MPEG Layer 1/2 audio fails because there is no ACM codec to handle it. It will behave the same as an AVI with MPEG Layer 1/2 audio. A better solution would be to fall back on the internal MPEG audio decompressor when Windows fails to provide one. I did try to implement that once, but I never got it to work properly. |
| Posted by: levicki Sep 10 2005, 11:12 PM | ||
Darn, looks like if whole audio part should be rewritten from scratch. I have just compiled vdub-mpeg2 source and did a quick check of the part you mention. You are right, it's nasty to say the least. I wasn't aware of the switch, I had to join 13 mpeg1 files and since vdub can't "append mpeg1 segment" like it can "append avi segment" (any idea why is that such a problem?) I had to unpack to raw avi taking ~5GB and to recompress the video but I was surprised that I have to recompress audio as well. To cut it short, vdub (any version) sucks at editing (cutting/joining) mpeg files and although I know that it's primary purpose is AVI editing I am failing to see the reason why? |
| Posted by: phaeron Sep 11 2005, 02:13 AM |
| One advantage to handling MPEG audio where it currently is is that the decoding is exact even after a seek, because the stream handler knows to seek backwards far enough to prime the overlapped transforms in the audio decoder. This can require seeking back several frames. ACM codecs cannot describe this situation, and basically the decoder has to punt and output dummy data until it has accumulated enough to begin decoding again. |
| Posted by: levicki Sep 14 2005, 11:08 AM |
| Best regards to phaeron (I believe that is you Avery Lee, right?). Many thanks for making such a great program. Please don't get my comments about the code wrong, most likely I wouldn't do it any better if at all. Would it be possible to adapt the audio system to have two audio streams at once? What I mean is one raw for direct stream copy and another one frame accurate like it is now with mpeg audio? Basically, vdub could then use one or the other depending on what the user is currently trying to do. For example if trying to save as AVI with audio set to direct stream copy it would use raw stream and if previewing or doing full processing it would use uncompressed stream. Also, another idea would be to create an interface to expose raw (compressed) audio data to audio plugins which would allow supporting new audio formats transparently. We could then implement mp3 or ac3 support as external to vdub. What do you say? |
| Posted by: phaeron Sep 15 2005, 05:59 AM |
| It already works like that somewhat internally, as there are separate paths in the upstream part of the pipeline depending on whether decompression is active or not. The real problems are that (a) the frame dependency for MPEG audio streams is complex, and ( That isn't to say the problem is insolvable, but it's another entry on the TODO list. Plugins don't generally make host code simpler. In fact, they usually complicate it quite a bit, due to the added flexibility. I'm generally a fan of maintaining stable APIs — properly written VirtualDub video filters written for as far back as 1.2 still work in 1.6.10. In fact, earlier ones would work too if I hadn't made a bad mistake in the API definition at the time. In this case doing so would amount to coming up with my own audio codec API, which is more than I'd like to bite off at the moment. |
| Posted by: levicki Sep 17 2005, 03:01 PM |
| Can someone recommend me some vob compliance testing tool because I have just stumbled upon a mpeg2 movie which latest vdub mpeg2 (1.6.10) opens but gets stuck at the end of parsing using 100% cpu and the only way is to kill it in task menager. It works fine in 1.5.4 and 1.5.10 though so I am wondering how to help fccHandler to iron it out. |
| Posted by: levicki Sep 17 2005, 03:14 PM |
| Here is a plugin I created some time ago for VirtualDub. Hope you like it. hxxp://earth.prohosting.com/~levicki/download/nightvision.zip |