Log in

View Full Version : VirtualDub 1.5.0 with MPEG-2 and AC3 support


DeXT
20th February 2003, 21:49
I uploaded to my site the binaries for fccHandler's latest MPEG-2/AC3 upgrade for VirtualDub 1.5.0. It now uses liba52 instead of libac3 so the audio quality is even better and it's faster, too.

Remember this has nothing to do with AC3 on AVI. This is just for true MPEG-2 video with AC3/MPA/PCM audio, such as those found on DVD and SVCD.

Unfortunately the "interlaced with split fields" support isn't in yet, but these are pretty rare anyways. Just use VDubMod for these.

Hope you like it...

http://es.geocities.com/dextstuff

DeXT

fccHandler
21st February 2003, 06:12
For anyone interested, the source code is here:

http://home.attbi.com/~blade66/Mpeg.cpp
http://home.attbi.com/~blade66/mpeg_decode.cpp

(AC3 decoding is disabled in the source.)

Josip Tosic
21st February 2003, 22:03
Got it yesterday - still works like a charm. I'm seriously considering switching to NTFS so I could rip one big VOB. [Hint, hint, nudge, nudge, wink, wink.] :D

DeXT
22nd February 2003, 15:45
VirtualDub 1.5.1 binaries with fccHandler's MPEG-2 upgrade are out. Works nicely with the 1.5.0 upgrade code, with no changes needed. This time I include the P4 binaries, too.

Hope you find it useful...

PS: Sorry about not posting the link to the new sources in my last update. That's fixed now.

http://es.geocities.com/dextstuff

DeXT

Josip Tosic
23rd February 2003, 00:17
Just noticed...

Audio and video are desynced when I open my test VOBs ("The Fellowship of the Rings" trailers). I can open it via AVISynth script (plus Decomb and everything) and it'll be synched with external WAV just fine. Opening VOBs directly in fccHandler's mod with external WAVs doesn't help either.

I'm getting black boxes on the green MPAA warning when I play the input/output but if I use [Left]/[Right] keys to browse through the frames there are no errors in decoding.

It takes up 100% of my ThunderBird @ 1,3 GHz when previewing input if I don't enable DirectDraw acceleration (and if I do enable it, it takes up "only" 70%). Is that normal?

PkmoNk
23rd February 2003, 00:30
Can someone or dext mirror the site? It is temporarily inaccessible, heh...:scared:

fccHandler
23rd February 2003, 04:34
Originally posted by Josip Tosic
Audio and video are desynced when I open my test VOBs ("The Fellowship of the Rings" trailers). I can open it via AVISynth script (plus Decomb and everything) and it'll be synched with external WAV just fine. Opening VOBs directly in fccHandler's mod with external WAVs doesn't help either.
Most likely the MPEG contains progressive film source, so try changing the frame rate in VirtualDub to 23.976. (The previous version for 1.4.13 tried to detect pulldown and would recalculate the frame rate automatically. Unfortunately, it didn't work properly most of the time and I removed that code.)

I'm getting black boxes on the green MPAA warning when I play the input/output but if I use [Left]/[Right] keys to browse through the frames there are no errors in decoding.
If it's only a few frames at the beginning, then it's probably because the first GOP isn't closed (i.e., there are a couple of B-frames without any forward prediction).

It takes up 100% of my ThunderBird @ 1,3 GHz when previewing input if I don't enable DirectDraw acceleration (and if I do enable it, it takes up "only" 70%). Is that normal?
That sounds normal. All MPEG video is YUV internally, and DirectDraw acceleration will use a YUV overlay whenever possible. Without DirectDraw, all frames must be converted to RGB for display which is slower and more CPU intensive. (For similar reasons "fast recompress" with an MPEG can be much faster than "full processing mode.")

Josip Tosic
23rd February 2003, 13:45
Yes, changing framerate helps but not completely - 23,55 seems to be about right. Hard to tell since there's not that much talk in these trailers...

Frames:

B-B-I-B-B-P-B-B-P-B-B-P-B-B-I...

It would seem so... What makes me wonder is how is it that when I "browse" through those frames "manually" I don't get black boxes? Also, MPEG-2 decoders for AVISynth don't experience such problems. It's easy to skip the first couple of frames but I curious why is it so.

P.S.: Try it a few times, PkmoNk. Got error the first time I've tried it also.

fccHandler
23rd February 2003, 17:11
Originally posted by Josip Tosic
Yes, changing framerate helps but not completely - 23,55 seems to be about right. Hard to tell since there's not that much talk in these trailers...
You could try "change so video and audio durations match." (This feature was broken in VirtualDub 1.5.0 so use version 1.5.1.)

What makes me wonder is how is it that when I "browse" through those frames "manually" I don't get black boxes? Also, MPEG-2 decoders for AVISynth don't experience such problems. It's easy to skip the first couple of frames but I curious why is it so.
It's complicated to explain, but there are two prediction buffers, for forward and backward predictions (B-frames use both). When you rewind the movie and push play, all the buffers get wiped (filled with black). The IBP sequence you showed has 2 B-frames with no forward prediction. The I-frame decodes into the backward prediction buffer, but at this point the forward prediction buffer is still black and you get black squares.

Later on, both buffers get filled with image data, so if you scrub backwards across the B-frames, they won't be fetching black squares anymore, but they'll still have blocks containing incorrect image data (look closely).

The whole problem falls under the category of "error concealment," which the MPEG specs don't cover, so every MPEG implementation may try to conceal such errors differently. (I guess the Avisynth decoder does a good job.) Honestly, I haven't written any error concealment at all into my code (yet), so if you put garbage in, you get garbage out.

ChristianHJW
24th February 2003, 06:34
Originally posted by PkmoNk Can someone or dext mirror the site? It is temporarily inaccessible, heh...:scared: ... i plan to mirror it, but Belgabor sent me the VdubMod 1.5 Pre via DCC on IRC, instead of his compile of fcchandler's mod ... lol.

DeXT, mate if you read this, i cant get your compile from your site, pls. send me a copy via email to chris at matroska dot org . Belgabor, you find the right compile on your HDD somewhere ?

Josip Tosic
24th February 2003, 12:09
Originally posted by fccHandler
You could try "change so video and audio durations match." (This feature was broken in VirtualDub 1.5.0 so use version 1.5.1.)
[...]
Yes, this fixes the problem completely.

If you have a moment to explain why this happens I'd be grateful. Yes, I know - I'm all questions today. :)

I mean, AVISynth script opens as 02:26,522 (if I use Decomb - 02:26,547 if I don't use it) and VOBs open as 01:55,248.

Also, I was wondering if your MPEG-2 reader engine detects audio/video offset in VOBs?

[...]
The whole problem falls under the category of "error concealment," which the MPEG specs don't cover, so every MPEG implementation may try to conceal such errors differently. (I guess the Avisynth decoder does a good job.) Honestly, I haven't written any error concealment at all into my code (yet), so if you put garbage in, you get garbage out.
Well, fair's fair... :)

Belgabor
24th February 2003, 12:25
Originally posted by ChristianHJW
... i plan to mirror it, but Belgabor sent me the VdubMod 1.5 Pre via DCC on IRC, instead of his compile of fcchandler's mod ... lol.

DeXT, mate if you read this, i cant get your compile from your site, pls. send me a copy via email to chris at matroska dot org . Belgabor, you find the right compile on your HDD somewhere ?

Well, if you had told me you wanted to mirror the original, I would have compiled that ;)

I don't have the right one on hd, but I could compile it. If you don't have it till tonight, catch me on IRC and I'll do it.

fccHandler
24th February 2003, 18:21
Originally posted by Josip Tosic
If you have a moment to explain why this happens I'd be grateful. Yes, I know - I'm all questions today. :)

I mean, AVISynth script opens as 02:26,522 (if I use Decomb - 02:26,547 if I don't use it) and VOBs open as 01:55,248.
I'm not really sure, but maybe the VOBs contain a hybrid mix of 23.976 progressive FILM content and 29.97fps interlaced NTSC. My code is no good for this type of stream, and it's closely related to the "field picture" MPEG-2 problem (#1 on my todo list). If I can work that out, hybrids will work OK too.

Also, I was wondering if your MPEG-2 reader engine detects audio/video offset in VOBs?
Nope. It is assumed that the audio and video begin at the same time.

Josip Tosic
25th February 2003, 11:49
Yes, it's the bothersome Film/NTSC mix - that's why I use Decomb. I've always assumed that it's really 23,976 FPS - didn't know that the actual framerate can vary. Thanks for the explanation.

Audio/video offset is not a big issue as it can be fixed with "Audio skew correction" in "Interleaving...".

ChristianHJW
25th February 2003, 15:51
Originally posted by Belgabor
[B]Well, if you had told me you wanted to mirror the original, I would have compiled that ;)

Uh !! Oh !! The 1.5.1 Pre has fcchandlers MPEG2 handling built in !! I admit i didnt test it, as i had no idea this was done already ... you're a wizzard Belgabor !! Also, i very much like the new video in the 'about' box ... ;) ...

I don't have the right one on hd, but I could compile it. If you don't have it till tonight, catch me on IRC and I'll do it.

No need, DeXT sent me the binary via email and i uploaded them to

http://christian.matroska.org/downloads/virtualdub-151-mpeg2-ac3.zip

I will keep the Pre on my HDD, only for myself :P

DeXT
9th March 2003, 13:03
fccHandler published an updated MPEG-2 patch to VirtualDub 1.5.1. This one should take rid of the separate fields issue and has other improvements, too.

See the original post with more information here:

http://virtualdub.everwicked.com/index.php?act=ST&f=11&t=2024&st=15#entry9601

Get the thing here (fccHandler's homepage):

http://home.attbi.com/~blade66

Good work!

DeXT