Log in

View Full Version : Deinterlacing video games


buhbah5525
8th September 2004, 11:54
Wasn't sure if I should post this in the capturing forum or here. Since I'm very much a newbie this is probably best.

Deinterlacing video seems to be a constant topic but i've haven't seen it come up in the area I'm curious about. Perhaps it makes no difference, but anyway, getting to the point.

When in the capture mode of virtual dub, or various other capture programs, the image (captured from various game consoles via s-video) is crisp and sexy. However, when I actually record the information, even at highest quality and no compression, crap ensues. Not that I didn't expect it from an interlaced signal, the ususal combing effect and some ghosting, but I can't seem to get rid of them. Combing is simple enough but the ghosting is getting to me. I've tried a lot of filters and read a lot of guides but I'm not getting very far. Hit some dead ends with bob filters and a quick foray into mjpeg. The help file in old virtual dub versions lists game consoles as a "special case" but doesn't help much beyond that, it even makes me question wether I should capture at 30 or 60 fps but I figure more is safer for the moment.

What I'm trying to do is get back that perfect image from the capture screen, 100% quality no downgrading accepted. Oh, and without losing those flicker effects you might remember from those older SNES, NES games. File size is irrelevant at this point, yes I know how big it will be. I'll deal with compression later.

Using an ATI AIW 9600 PRO if it helps any.

Any help would be appreciated.

killingspree
8th September 2004, 12:38
hi and welcome to the forum!

i think this better fits the capture forum, so i'll move it there ;)

kr
steVe

buhbah5525
9th September 2004, 09:11
I know you smart people are out there, i've read your posts :).

Ok, at the very least someone answer me this:

At the end of Nicky's deinterlacing guide he writes:"As a final note, the only truly 100% perfect deinterlace method I have seen seems to be the one that uses TMPGEnc. It is very hard to do but produces perfect results. My friend Doom9 has a guide on how to do it. Check him out Here."

Which guide is he referring to? I can't seem to find it.

Boulder
9th September 2004, 13:01
It always helps if you can provide a small sample of the unprocessed source.;)

jggimi
9th September 2004, 13:18
I haven't read Nicky's guide. Perhaps Nicky was referring to "finding the field order" using TMPG in this guide: http://www.doom9.org/mpg/tmpg_procedures.htm

Wilbert
9th September 2004, 13:31
I doubt that, how is finding the field order equal to deinterlacing?

http://nickyguides.digital-digest.com/interlace-test.htm

Perhaps he's referring to manual IVTC. But, how you should use that to 100% deinterlace PAL streams is beyond me :)

@buhbah5525,

His guides are 3-4 years old. Ie, not up to date anymore. It doesn't mean that they are bad (although I'm not happy with the quality of the deinterlacing link above), I also started with his guides a long time ago.

jggimi
9th September 2004, 16:09
When searching for an applicable TMPG guide, I also saw the IVTC one (http://www.doom9.org/mpg/tmpg-ivtc.htm), but didn't think it could possible apply to buhbah5525's sources, since they're not 24fps film.

He mentioned 30fps vs 60fps, therefore he's probably NTSC, not PAL. :cool:

buhbah5525
10th September 2004, 03:20
Yeah, I'm NTSC, some obvious info I forgot.

I saw that IVTC guide but that doesn't really apply to me.

Like I said before when in capture mode the video looks perfect, but when actually capturing it (even with 0 compression) the interlacing artifatcs happen. That kinda baffles me, seems like it should be easy to undo but it's not. It would be so much simpler if I just had component inputs ;). Then again older consoles don't support component so I'd be screwed there.

I should add that if I capture in low res (320x240), none of these problems occur. Problem is, low res looks like low res, fuzzy and not very good looking. Plus I also lose some of the flicker effects that is a trick with the fields I think. When at high res (640x480) I get the previous problems.

Boulder
10th September 2004, 07:17
Getting combing is a normal thing. The fact that a vertical resolution of 240 removes the combing means just that you only captured one field.

I'd simply process and encode as interlaced and enjoy the smoothness and sharpness.

buhbah5525
10th September 2004, 09:45
Originally posted by Boulder
I'd simply process and encode as interlaced and enjoy the smoothness and sharpness.

Just so I understand you correctly, you mean I should just leave it as is with the combing/ghosting effects? Perhaps that's not what you mean, but if it is, those effects don't make it look smooth and sharp at all, just bad.

Could you explain what you mean further?

Boulder
10th September 2004, 10:00
The question is, do you watch it on the PC or TV?

For TV it's recommended to keep it as it is as you won't see any combing unless you've got a incorrect field order.

And as I said before, a short sample would help in evaluating the problem.

buhbah5525
10th September 2004, 11:20
This is mostly for PC viewing so i'd like to remove those interlacing artifacts. Even if I were to watch it on TV at some point my TV supports progressive scan so I'd like to have it at highest quality possible. I would've thought it was impossible at first but since seeing it so crisp on the capture screen there has to be a way to record that quality...right?

I uploaded a 9 meg movie to a yahoo e-mail account.
"buhbah5525@yahoo.com" (no quotes) pass:nininini

It's in the consolemovie folder as an attachment to an e-mail.

I don't see how this could help though, but knock yourself out. Basic problem: Capturing video,looks good before capture, captured uncompressed avi looks bad. It's not a specific video that's the problem but all video that I capture from any console. The thing is, the issues are much more evident on the uncompressed file it came from. It's encoded with divx5 and it removes a fair amount of combing and such, pause the action to see the ghosting on various things.

If I could figure out what happens between me playing the game on virtual dub, and when I watch my uncompressed file afterwards I'd be set. Hmm, is the capture screen that I find shows high quality perhaps showing me the video in interlaced mode, while the avi I view afterwards is trying to show me that interlaced signal as progressive, which is why it looks bad? Am I making sense?


Re-reading I realise I sound like a raving noob, pleased forgive this :( .

Boulder
10th September 2004, 12:28
Firstly, how did you encode to DivX? By default, the codec expects progressive input which your source definitely isn't.

You can't have smooth good-looking progressive material out of your source because it's originally interlaced. If you deinterlace, you'll always have ghosts and/or blends.

You'll either have to encode as interlaced (use MPEG-2 for that!) and get exactly what the console outputs or deinterlace and live with the slight jerkiness and loss of detail and sharpness.

What codec did you use to capture?

jggimi
10th September 2004, 12:39
Well, one can certainly encode interlaced material, though the compression obviously isn't as good because it's done by frame rather than by field. But it was good enough to share a sample of the source with us.

I ran the sample through this AviSynth script:avisource ("consoledivx.avi")
separatefields()and I was surprised by the results when I scrolled field-by-field in VdubMod. The fields seem significantly shifted, which might account for the poor results of deinterlacing filters.

[Edit: I tried stacking two fields from one frame as images here, but it's not as obvious as when the images use the same window on your monitor. Try it with Vdub or VdubMod, and you'll see what I mean.

Is it possible this is caused by a 30fps capture rather than 29.97fps?]

Boulder
10th September 2004, 12:58
I assumed the weird fields were due to encoding as progressive in DivX since I don't know which option he used.

Capturing at 30fps could be an issue, good point! I've never tried capturing at anything else than 25fps so I don't know what would happen if I captured at 25.1fps for example. Probably Bad Things;)

EDIT: There's some rather weird stuff in the sample. It looks like there are duplicate frames at some scene changes - or is this simply due to DivX?

buhbah5525
11th September 2004, 07:44
Originally posted by Boulder
Firstly, how did you encode to DivX? By default, the codec expects progressive input which your source definitely isn't.


Opened the uncompressed avi with virtual dub, selected Divx 5.2.0 codec for compression, didn't play with any configuration options, just went to save as avi and off it went. Didn't play around with the settings really since it was just for a quick sample.

Originally posted by Boulder
You can't have smooth good-looking progressive material out of your source because it's originally interlaced. If you deinterlace, you'll always have ghosts and/or blends.


So I guess I'm correct in assuming that what I was seeing in the capture window that looked so good was being shown interlaced. When opening with video media player or any other PC program it's trying to show it progressive and that brings up the artifacts right? If this is correct, is there any way to force a file to be viewed interlaced from a PC?

Originally posted by Boulder
What codec did you use to capture?

Capturing from virtual dub it was an uncompressed avi in UYVY format, do you recommend another?

Originally posted by jggimi
Is it possible this is caused by a 30fps capture rather than 29.97fps?

I captured at 30fps there just for the hell of it, the problem is the same at 29.97. Truth be told I have no idea wether to capture at 29.97, 30 or 59.94, 60 for that matter. I figure one problem at a time but if anyone know a way to find this out I'd ove to know. I imagine I'll have to e-mail a game developper/manufacturer or something to get that kind of info.

buhbah5525
11th September 2004, 08:08
Late breaking news, I fiddled around with divx settings and in the video section changed interlacing to de-interlace source. You can check out the results at the same place as the last video "buhbah5525@yahoo.ca" pass: nininini in the console movie folder in the divxdeinterlace e-mail.

I set it to slow encoding and almost max bitrate, around 3600 kbps, and just about the same place in the demo as the last video for comparison. Had to limit the file size since yahoo doesn't allow attachments larger than 10 megs.

The results are astounding, to me at least :). No ghosting at all, no combing either, 100% perfect. Always the easiest solutions it seems, especially when you're dumb (I mean me of course).

I'd say that the problem is solved... partly.

Artifacts are gone but divx only allows 4mbps max bitrate, which is good but not "I'm crazy about quality" good ;). Especially since if I ever capture at double the framerate, 59.94 or 60, the detail for each frame will be halfed since I'm maxed out at 4mbps right? Is there any way to bump up this quality on divx? Or perhaps there is another magical codec that has a de-interlace source button? I haven't seen any out of the 17 that I have. Even better, is there something that won't compress the file but fix it the way divx did?

Boulder
11th September 2004, 09:21
OK, I'll try to help some more;)

1. Use HuffYUV to capture. It's lossless but will compress usually 2:1. Use YUY2 colorspace. You can find a fixed version somewhere on this board, be careful as there was also some version posted which is supposedly buggy. Also capture at 29.97fps to be safe.

2. Don't use the internal DivX deinterlace. Use Avisynth for that, you can also use it for noise reduction and resizing etc. You'll get much better quality this way. If you don't know which deinterlacer to use, I recommend KernelDeint.

3. Use XviD for encoding, IMHO it offers better quality. Encode at constant quant 2 and it should look good;) You'll find the latest codec at http://www.koepi.org

I didn't look at the sample yet, but I'll download it and see how it looks.

Good luck!

buhbah5525
11th September 2004, 09:48
I liked the divx thing cause it was idiot proof. Time to learn avisynth now...wuh, no gui...yar, she be a cruel mistress.

Boulder
11th September 2004, 10:09
Nah, it's easy:D

buhbah5525
12th September 2004, 12:16
Ok, so I figured out a good part of avisynth. I'm using Kerneldeint with threshold 0, why would someone use higher I don't know.

However, going back into the older consoles the flicker effect doesn't appear with KernelDeint. I found KernelBob and that keeps the effect but i'm getting this up and down vibration to the video, I'm guessing from the shifting to each field. Is there a way to fix this?

Also, is it just me or does Kernelbob ignore the "Trim" line I put before it?

Boulder
12th September 2004, 12:49
KernelBob will give you a double-rate output, it's mostly used when processing and encoding as interlaced. So just forget that.

KernelDeint doesn't deinterlace the parts of the image which do not move, that is, parts that do not have any combs. That's why it provides better quality compared to non-area based deinterlacers. If you use threshold=0, it deinterlaces the whole image which is not the best thing to do so you should try with a threshold of 5-10. You may see some combs in a still image but it's highly unlikely that you'll see any when playing the clip.

buhbah5525
13th September 2004, 02:31
I uploaded plenty of examples to the usual account, smaller files this time too. "buhbah5525@yahoo.com" pass:nininini

Agreed that KernalBob is useless for modern consoles, KernelDeint is fine. However it produces the flicker for older games that KernelDeint does not. See the vids I uploaded for what I mean, both in 29.97 and 59.94 flavors the effect is the same.

KernalBob gives me the effect i'm looking for but with some backing up of the frames which produces the vibration. I trided using order=1 instead of 0 but didn't change anything. Perhaps i'm misusing KernelBob? Basically I just replaced KernelDeint with KernelBob so it looks like this.

AVISource("c:\sm5994.avi")
Trim(200, 330 )
KernelBob(order=0, threshold=0)

So now I need a way to calm that vibrating.

Anyway, I also saw that recommendation for not setting threshold to 0 while looking it up but I can't say I understand it. Why wouldn't I want to remove all the artifacts? I can still see it at 5 by the way, i'm an eagle eye :).

Here's an oddity I noticed. In the KernelDeint odd outline e-mail, check out frames 60, 62-63. Notice the outline to the left (60) and above (62-63) the taxi, from the previous frame I guess. Is there anyway to get rid of those kinds of errors?

buhbah5525
13th September 2004, 03:31
Hmmm, I just found that KernelBob might be desireable for modern consoles as well. A segment at 59.94 fps that lasts 80 frames with KernelDeint lasts 160 with KernelBob, so i'm getting a real 59.94 video.
While watching with virtual dub I could indeed pick out extra screens. This would be perfect for fast moving games. Just have to fix the jerkyness. edit: ok forget the 59.94 thing, no difference from 29.94 to 59.94 with KernelBob, it's the KernelDeint to KernelBob that adds the frames, which is good cause I tend to drop frames when capturing at 59.94

buhbah5525
13th September 2004, 04:51
It seems the vibrating issue I was having with my older console was because of the console itself, either the power supply that's giving uneven power (likely IMO) or the console is simply getting old. Other than that, all frame related issues have been dealt with.

Just two things left to fix now.

The thing I mentionned above with the weird outlines from the previous frame, a clip of that is online.

And a new issue, which is more of an oddity than anything else:
Uncompressed avi, perfect sound
Avi goes through KernelBob, sound is jerky and skips.
Compressed xvid of avi, perfect sound

What the heck happened to the in-between file?

edit: maybe my SNES is fine after all... I don't know, I've got a headache from this. See for yourself in an e-mail called vibration at the usual place. Last post from me today I swear :)

Boulder
13th September 2004, 07:09
Hey, could you keep those samples in there for a while? I'm going on a vacation today and will be back on Wednesday next week.

buhbah5525
13th September 2004, 07:19
Sure, no problem. I was thinking of putting this on the back burner for a bit anyway.

buhbah5525
13th September 2004, 08:09
I've determined that the vibration has nothing to do with the console. I'ts actually because of KernelBob. At first I didn't notice on my other captures because they were mostly action, but after paying close attention the vibration is present there too. It's the most evident on the metroid video that I put up though.

Kalicrys
14th September 2004, 02:07
KernelBob is a Bob, buhbah5525. It will Bob.

buhbah5525
14th September 2004, 03:46
Well yeah, but I need to calm it down a bit :).

buhbah5525
26th September 2004, 03:01
Well, I've been at this for over a week now and still no luck. Been through almost all discussions on the forum that mention KernelBob and none of them mention the vibration problem I have. This leads me to believe that i'm missing something obvious. This is really my last sticking point since all other problems i've found a workaround for.

So I'll ask again if anyone knows how to fix the vibration (vid is at my above mentioned account). The problem isn't the frame order because i've fixed that. It's just vey fast up and down vibration of the whole screen.

buhbah5525
5th October 2004, 04:28
Thought I'd mention that I found out what the vibration was. It's because I was using a threshold of 0 with KernelBob. Setting it at 3 makes everything great.