|
|
| stephanV |
| Posted: Sep 10 2005, 04:53 PM |
 |
|
Spam killer ;)
  
Group: Moderators
Posts: 4348
Member No.: 8917
Joined: 18-February 04

|
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.
-------------------- useful links: VirtualDub, Input plugins and filters, AviSynth, AVI-Mux GUI, AC3ACM by fcchandler, VirtualDub FAQ |
 |
| fccHandler |
| Posted: Sep 10 2005, 06:20 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
@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.
-------------------- May the FOURCC be with you... |
 |
| levicki |
| Posted: Sep 10 2005, 11:12 PM |
 |
|
Unregistered

|
| QUOTE (fccHandler @ Sep 10 2005, 07: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. |
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? |
 |
| phaeron |
| Posted: Sep 11 2005, 02:13 AM |
 |
|

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

|
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. |
 |
| levicki |
| Posted: Sep 14 2005, 11:08 AM |
 |
|
Unregistered

|
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? |
 |
| phaeron |
| Posted: Sep 15 2005, 05:59 AM |
 |
|

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

|
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 ( most MPEG audio streams are mildly ABR, at least by one byte. The audio pipeline isn't suited to handling variable-size frames at the moment.
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. |
 |
| levicki |
| Posted: Sep 17 2005, 03:01 PM |
 |
|
Unregistered

|
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. |
 |
| levicki |
| Posted: Sep 17 2005, 03:14 PM |
 |
|
Unregistered

|
Here is a plugin I created some time ago for VirtualDub. Hope you like it. hxxp://earth.prohosting.com/~levicki/download/nightvision.zip |
 |