PDA

View Full Version : Deinterlacing VOB, and General Quality Issues


Yakman
14th April 2006, 21:32
Hey, guys.
I'm not quite sure where to post this, since my host of questions touch on a number of subject in general with which I require help.

Now before we start, let just explain that I'm new to this and that if you feel like posting advice or solutions, please please could you do so in a manner that will be easy for me to understand? I just want a simple solution, since my needs aren't that advanced in the first place, and I won't be able to make any use of too great an amount of complicated info.

OK, so basically what I'm trying to do is to convert some of my DVDs to AVI (XviD).
I'm using DVDDecrypter to rip the VOBs to HDD. From there, I want to start processing directly in VirtualDubMod (in the spirit of trying to keep things simple).
I'm using 2-pass, and want to achieve exact file sizes in order to burn them to DVD. See attached for the rest of my settings:
XviD Settings (http://forum.doom9.org/attachment.php?attachmentid=5689&stc=1&d=1145042612)

For the most part I'm actually satisfied with the result, except for a few little things. First of all, the source seems to be interlaced:
Interlaced (http://forum.doom9.org/attachment.php?attachmentid=5690&stc=1&d=1145042513)

So then I used the Built-In VdubMod Deinterlace Filter (Blend) to fix it (enabling XviD's “Interlaced Encoding” in the options seems to be ineffective), but the result blurs the image slightly, and produces the following 'shadow' effect:
Blur (http://forum.doom9.org/attachment.php?attachmentid=5692&stc=1&d=1145042708)

So aside from the fact that the Vdub filter screws up the job, I also learned that I should ideally be using “Fast Recompress” instead of “Full Processing Mode”, so as to prevent converting over from YUV12 color space to RGB, which I've heard can 'reduce' quality a little (something about Chroma thingies being upsampled incorrectly, I think). So this effectively rules out the Vdub filters, then, in any case.

Next I learn about AviSynth, which seems to be the answer to all my troubles, only that I'm having trouble wrapping my head around the damn thing. I've never been good at coding anything.
I used Gordian Knot to create a basic AVS script that will deinterlace my video properly. But applying this script to my existing AVI file blows the file size *completely* out of proportion. I don't want to use Gordian Knot to do anything else except to help me create some sort of script, so if you have any better suggestions for creating scripts, I would really appreciate that.
Anyway, now it appears that my only option is to find some way of making AviSynth open a VOB file for me, so that I can apply the AVS script while processing in VDub. But as far as I can see, it doesn't seem to be a supported feature.
1.)How can get AviSynth to load VOBs?
2.)What would best be used to deinterlace the source (which is PAL @ 25fps)
3.)How would such a script look, then?

4.) I also noticed that playback on my AVI rips seems to take up a lot of CPU time. Anything
between 80% - 9x%
What could be causing this?

Now, just a few more short questions:
One of my AVIs, which didn't have an interlaced source, turned out quite well, except that it seems to produce some block noise (I think that's what it's called) during fast/high motion scenes:
Noise (http://forum.doom9.org/attachment.php?attachmentid=5691&stc=1&d=1145042609)

5.) When I increased the file size it reduced the severity of the affect a little. Is this a purely Bitrate related issue (my average bitrate is roughly 1392 for approximately 90 minutes of film), or am I doing something wrong here?

6.) What resolution is recommended for use, and what kind of influence does the resolution have on things like Bitrate and file size? Currently I'm simply sticking to the native DVD resolution of 720 x 576.

7.) Packed Bit Streams. I am uncertain whether this is a good thing or a bad thing.


Like I said before, please be gentle with me.
:p

Sorry for the long post.
The help is MUCH appreciated.
Regards.

manono
15th April 2006, 10:10
Hello and welcome to the forum-

1.)How can get AviSynth to load VOBs?

You make a D2V Project file from the vobs using DGIndex and open that in GKnot, which will then create the script for you. You can then open that script in VDubMod for encoding. You should have the DGMPGDec package if you installed GKnot. Read the 3 tutorials that come with it, especially the QuickStart Guide.

2.)What would best be used to deinterlace the source (which is PAL @ 25fps)

If it's really interlaced, the best deinterlacer available in GKnot is KernelDeint. Make sure it's really interlaced. That is, make sure you see the actual interlacing, and even then it may just have shifted fields which can be fixed with a straight Telecide(Post-0). If it's a movie, the chances are it's not interlaced.

3.)How would such a script look, then?

LoadPlugin("C:\Path\To\DGDecode.dll")
LoadPlugin("C:\Path\To\KernelDeint.dll")
MPEG2Source("C:\Path\To\Movie.d2v")
KernelDeint(Order=1)

The GKnot generated scripts will have much, much more, but with a "#" to the left of the additional lines, meaning that the line doesn't do anything.

4.) I also noticed that playback on my AVI rips seems to take up a lot of CPU time. Anything
between 80% - 9x%
What could be causing this?

Depends on the speed of your processor, the resolution of the video, the format of the audio, and whether or not subtitles are being played. You didn't say what player you're using, but use one that doesn't use much of your computer's resources, such as BSPlayer or Media Player Classic (I think).

5). Is this a purely Bitrate related issue

That and a resolution issue. Maybe you're using a high resolution for that 1392 bitrate. In general though, macroblocking is caused by too low of a bitrate. Unless it's already in the source.

6.) What resolution is recommended for use?

No hard and fast answer on that one. If you have a fixed file size in mind (1 or 2 CDs, for example) then run the GKnot compression test to help determine the best resolution for the intended file size.

7.) Packed Bit Streams. I am uncertain whether this is a good thing or a bad thing.

I don't use it. Makes my DVD/MPEG-4 player stutter. It's neither a good thing nor a bad thing.

If you're just starting out, you might want to do a few encodes using AutoGK, and then study the log file afterwards to learn what you can.

Yakman
15th April 2006, 12:49
If it's really interlaced, the best deinterlacer available in GKnot is KernelDeint. Make sure it's really interlaced. That is, make sure you see the actual interlacing, and even then it may just have shifted fields which can be fixed with a straight Telecide(Post-0). If it's a movie, the chances are it's not interlaced.
THIS (http://forum.doom9.org/attachment.php?attachmentid=5696&stc=1&d=1145097604) is what GDIndex reports. I'm assuming this means that the video really is interlaced?

Depends on the speed of your processor, the resolution of the video, the format of the audio, and whether or not subtitles are being played. You didn't say what player you're using, but use one that doesn't use much of your computer's resources, such as BSPlayer or Media Player Classic (I think).
I'm running an AMD Athlon 2600 (Barton Core, for what it's worth), and using Media Player Classic.
Audio format is AC3 @ 128Kbps
No subtitles in this particular movie.

I suspect, though, that this Macroblocking you speak of is related to the resolution, which might also solve my CPU Usage issue. I hope.

Thanks for the Info, so far, however! I've toyed around with it a bit, and will give it a test run this evening. I'll report back on the results.

manono
15th April 2006, 14:03
I can't approve attachments in this forum. However, DGIndex only shows how the DVD was encoded (Interlaced) and not what the source is like. They can be 2 very different things. This is particularly true for PAL where most DVDs are encoded as interlaced, but the content is most often progressive (movies). The only real way to tell if your source is interlaced is to look at the frames. Make the D2V project file and open it in GKnot and look for interlacing during movement.

I'm assuming this means that the video really is interlaced?
Sadly, not necessarily, and for PAL, not usually. It's important that you determine whether or not it's interlaced. The last thing you want to do is to deinterlace a progressive video.

Audio format is AC3 @ 128Kbps

Huh? I don't think so. At least I don't think I've seen any AC3 like that, unless it's a mono track.

And you didn't yet give the resolution of the video.

And you called it block noise. If it's the video breaking up into squares during action scenes, it's also called macroblocking. MPEG-4 video is encoded by 16x16 pixel macroblocks. In the absence of enough bitrate, these blocks become visible. You might get other kinds of artifacts as well, such as color bleeding or mosquito noise outside of sharp edges. You might see wavy backgrounds during static scenes.

Yakman
15th April 2006, 16:27
Okay, I'll be very honest here. I don't really know what I'm looking at - How do I accurately recognize interlaced source video, as apposed to "...how the DVD was encoded"?

It's important that you determine whether or not it's interlaced. The last thing you want to do is to deinterlace a progressive video.
...
I'm assuming this is not adviseable, then? Dare I ask why? I can understand the logical reasoning behind it, but what sort of negative impact would it have on my AVI?

Huh? I don't think so. At least I don't think I've seen any AC3 like that, unless it's a mono track.
Apologies. That's the Audio format of my rips (this is still concerning my high CPU usage during playback), not the VOB.

Video resolution is 720 x 576. It remained unchanged as I converted it to AVI format.

Anyway, guess we'll just have to wait and see when someone approves my attachments. But in the meantime I've done a little test on a small portion of the movie - That which I *think* is interlacing, is now gone. And my CPU usage is down to 60%-70% (max), which, I think, is alright. This time, though, I encoded the Audio as MP3 (LAME). I also resized the video by a factor of 80 on both X and Y. Perhpas this is what made the difference?

P.S. - On that note: Is Lanczos (or whatever) decent, or should I stick to Neutral Bicubic for resizing my Encodes?

manono
16th April 2006, 03:38
Hi-

Are you saying you don't know what interlacing looks like? If you have it, during motion scenes you'll see fine parallel black lines that indicate the 2 fields weren't taken from the same point in time. If you go to the second pic, you'll see interlacing, and then deinterlacing using a blend deinterlacer. The entire document is worth a read:

http://www.doom9.org/ivtc-tut.htm

I'm assuming this is not adviseable, then? Dare I ask why? I can understand the logical reasoning behind it, but what sort of negative impact would it have on my AVI.

At the very least, deinterlacing an already progressive stream will cause it to lose detail/sharpness.

Video resolution is 720 x 576. It remained unchanged as I converted it to AVI format.

You didn't resize for AVI? Did you purposely encode it anamorphically so your player would resize it? No offense, but the kinds of questions you're asking don't indicate anything of the kind. So, doesn't it play with bad aspect ratio? Don't people look tall and thin? Anyway, that's a fairly high resolution and could be the reason you're getting stuttery playback. Either that or you did something stupid like change the framerate to 20fps by using Force Film in DGIndex.

Ordinarily, for AVI, you have to resize the video. Another reason I would recommend you use AutoGK until you get the hang of it.

On that note: Is Lanczos (or whatever) decent, or should I stick to Neutral Bicubic for resizing my Encodes?

Lanczos is a better resizer than is Bicubic. Although it's harder to compress, it retains more detail.

I also resized the video by a factor of 80 on both X and Y. Perhpas this is what made the difference?

That's not how you do it if the source is DVD and the output is AVI. DVDs are either 4:3 or 16:9 and get resized by the player, and AVIs are 1:1 and just get scaled.

Yakman
16th April 2006, 18:06
Well, what I actually meant, is that I don't know how to distinguish between something like Telecined content and Interlaced content. But thanks for that link:
I went through the guide, so I played back (frame by frame) a motion scene for roughly 10 frames - An in every single one I noticed the Interlacing artifacts.

So, doesn't it play with bad aspect ratio? Don't people look tall and thin?
You're right. I didn't notice it before, but I just compared the original VOB (in PowerDVD) with my rip, and the characters do appear a little stretched, tall, and thin.

Then I notice that when I create a D2V project with DGIndex, and open that with GNot to create an AVS file, that it automatically inserts a resizing filter into the AVS script (using some resolution that I *never* specified). Is this, then, meant to maintain the aspect ratio?

I'll have a look at AutoGK when I'm back at work, where I can actually download stuff. That is, as apposed to now where I'm dialing up with my mobile phone, which can get expensive quickly.

-Edit-
Thanks for the help so far, though. Boy, who would've thought that this would turn out to be this much trouble.
:)

manono
16th April 2006, 18:37
Hi-

...I don't know how to distinguish between something like Telecined content and Interlaced content.

Well, you're PAL (I guess), so ordinarily you wouldn't see telecined material. Unless maybe a silent film telecined from 20->25fps.

OK, you see interlacing in every frame. Is this thing a movie? Then perhaps it has shifted fields, not all that uncommon with PAL stuff. To check, you put on Telecide(Post=0) by itself (no Decimate). If it's no longer interlaced after that, then it had shifted fields. Or maybe you have a blended source. To check you separate the fields using (as one way) KernelBob (part of KernelDeint). If it's not a movie (a sports event, TV show, music concert, etc), maybe it really was shot with interlaced video cameras.

I realize I'm describing things brand new to you. Can you maybe cut a small section of a vob out and make it available for us to examine?

...it automatically inserts a resizing filter into the AVS script...

Yeah, if you go into the Resolution Tab of GKnot, you'll see the default resolution it gave you. What you want to do is to make sure the Input Pixel Aspect Ratio is correct (4:3 or 16:9, open the D2V if you don't remember), crop away the black bars, and choose a resolution, keeping the Aspect Error low with a little more cropping, if necessary. To help choose the correct resolution for the file size and audio you want, running the Compression Test is recommended. This is all thoroughly explained in the guides.

The guides can be found here:

http://forum.doom9.org/showthread.php?t=92089

Yakman
18th April 2006, 07:51
Is this thing a movie?
Yes. I should probably also mention that it's a digitally remastered version of a *really* old (1978, I think) Jackie Chan movie.

Right, so I tried serving an AVS script into VDub using both Telecide(Order=1,Post=0) and KernelBob(Order=1). Not sure if my usage is correct, but in both cases it removed the Interlacing that I previously saw. If I compare the two using a quick scan of the eye, however, the Telecide version seems to produce a more desirable result.
Also, when I test for Blended Source using KernelBob, VDub effectively reports that the number of frames has *doubled* for the entire movie. When I advance frame by frame, I can even see the extra/ghosted frames where there previously were none.

Hmm, seems like it was never interlaced then...

The DVD is Anamorphic, and I've already set that correctly in GNot.

keeping the Aspect Error low with a little more cropping, if necessary.
My current Aspect Error = -1.1%. I don't yet know how to interpret this. And I also have a couple more questions about some of those Info Blocks turning red when I adjust the output resolution etc. But I guess I'll just have to read the guides and documentation at home once I've downloaded them.

manono
18th April 2006, 09:31
OK, now we're getting somewhere. You've just proven that it's really progressive (not interlaced), but just had shifted fields which was corrected by using Telecide(Post=0). To explain turther, ordinarily a progressive movie will have its fields lined up into frames like so (where the capital letter represents the top field and the small letter the bottom field):

A B C D E F G
a b c d e f g

With shifted fields, one of the fields is shifted over to the next frame:

B C D E F G
a b c d e f

So you see interlacing. What Telecide does is to line them up properly again. KernelBob was applied to look for blended fields, possible evidence of a bad NTSC to PAL transfer. If you see blending/ghosting/double images, then that's the proof. You didn't see any. KernelBob, and others like it, is a Smart Bobber. A bobber splits the frames into their component fields, and then resizes them to the original reolution. A Smart Bobber does the job better than the standard AviSynth Bob command. But yes, it doubles the framerate, as there are 2 fields in each frame. Each frame is repeated, as you'll see if you were to step through it frame by frame. Since you're looking at fields, then you don't see interlacing.

Your final Telecide portion of the script should probably be:

AssumeTFF()
Telecide(Guide=2,Post=0)

To find the field order, open a vob in DGIndex and run the Preview. It'll tell you if you have Top or Bottom field first in that Information screen that opens up. Almost all DVDs are TFF. If it's BFF, then change to AssumeBFF(). Add Guide=2 inside of Telecide because it tries to keep a lock for PAL material. Read the DecombReferenceManual included in the Decomb package. Actually, I don't see it in there. If you don
't have the manuals that come with Decomb, then get it again from here:

http://neuron2.net/decomb/decombnew.html

Our own neuron2 (Don Graft) writes some of the best filters, and definitely the best manuals in the AviSynth world. Post=0 disables the postprocessing deinterlacer, which you shouldn't need for this job. If you see any interlacing when done, you can put it back on

And good for you. I wasn't sure you'd be able to do the things I asked of you, which is why I asked for a sample.

I can even see the extra/ghosted frames where there previously were none.

I'm assuming you mean to say you see duplicate frames. If you really see ghosted frames when stepping through the KernelBob one, then we're (especially you) in trouble.

My current Aspect Error = -1.1%.

It should be pretty easy to get it down below 0.5% by cropping a couple of pixels into the video. If you don't want to do that, then you can leave it alone. It's said that round things like balls or suns/moons begin to look like slight ovals at around 2% Aspect Error.

Yakman
19th April 2006, 07:31
Okay, I actually already checked whether it's TFF or BFF, by using AssumeTFF and AssumeBFF in an AVS script, which I ran through VDub. Stepping through the frames on BFF produced a stuttering effect, whereas TFF played perfectly fine. This, from what I've read, is another way of telling? Though by the looks of it, also a far more complicated way.

I seem to have found the Decomb reference manual on my PC. So I'll just have to make some sense of it a little later on.

I'm assuming you mean to say you see duplicate frames.
Uhm, well, it's a bit hard to explain really, which is probably why it's still a good idea to provide you with a sample. But I can't do that since I've nowhere to host it. I'd like to post you an image, but my attachments seem to be stuck in 'Approval Oblivion'. Anyway, let me try and explain this coherently:
Say we have 4 frames of some dude (let's call him Kernel Disaster, or KD for short) moving steadily across the screen, right? When I use KernelBob, the first frame advancement (i.e. frame number 2) sees him moving one step. However, in frame 3 he doesn't actually move any further, as opposed to Telecide, where he does move with every frame. The thing is that frame 3 will produce a slight 'shift' in the image where you can spot a vague (hardly noticeable, unless you're studying it closely) image of the *next* frame, not the previous frame. It's like seeing a distant phantom of frame 4 while you're still stuck in frame 3. A slight glimpse into the future, if you will. In other words, movement from frame 4 will 'fall into place' of the vague phantom image you see in frame 3.
Heheheh, does that make any sense at all?

If you really see ghosted frames when stepping through the KernelBob one, then we're (especially you) in trouble.
Oh goody. I can't wait to hear this. (<--- Sarcasm)
Though to be honest, I think I might have glanced over this problem somewhere on the Doom9 site. Guess I was kinda hoping it wouldn't happen to me, so I probably didn't pay too much attention to it.

manono
19th April 2006, 07:54
Hi-

The easiest way to tell if you have TFF or BFF is to open the vobs in DGIndex and run the Preview. The information screen that opens up will tell you top or bottom. That script is also foolproof. In general, DVDs are TFF, and captures are BFF. In general. There are exceptions to every rule, and if you get it wrong all kinds of very bad things happen.

So, I don't know at this point if you have field blending or not. The reason I said you're in trouble is that field blending is very difficult to undo.

Yakman
19th April 2006, 13:12
Alright... So what if I do a test encode tonight, using Telecide?
Surely if the DVD is actually Blended Source, and not Shifted Fields, then encoding the film using Telecide should do something wrong, right? Something that I'd be able to see?

Otherwise, if there's no other way, I'll try and find some place where I can maybe upload a very small portion of the VOB.

manono
19th April 2006, 16:50
Sure, go ahead and encode. I'm surprised you haven't been encoding all along. You must be anxious to get some results after all these days of talking.

Yakman
20th April 2006, 09:59
Very much so. You can imagine my frustration when I found that I have to wait 5 days before I can post. It was agonizing, I tell you. But there's no point in continuing to encode if I'm just gonna have to do everything all over again when I find that I should have done things differently.

Anyway, it is busy encoding right now, so by the time I get home, I should be able to to view the finished product. Or some of it, at least - The DVD is a little more screwed up than that. The first section of the DVD seems to be Progressive, while the rest contains (presumably) Shifted Fields. Not to mention that the black borders also change at least once during the movie.

But I mean, If Telecide produces good quality, without any artifacts, then I see no reason to struggle with this any more.

I'll let you know how things turn out. But hopefully this will be the last you hear of me, assuming that I don't run into any complicated issues with future rips.

Thanks for babysitting me all this time!

manono
20th April 2006, 14:34
Sure, glad to oblige. Good luck.

Yakman
20th April 2006, 15:31
I see my attachments have been approved. Not sure if maybe you want to have a look at them? Though I'm not sure if they're going to do any good now - Except maybe my XviD Settings...

ammck55
20th April 2006, 18:00
yakman--Your attachment approvals slipped by me. You might find it more convenient to attach images if you create a free account at ImageShack (http://imageshack.us/), then post a link in the thread to your "outsourced" images. ;)

ammck55