Log in

View Full Version : encoding partial IVTC / interlaced


allynm
18th August 2003, 23:13
ok, so i'm encoding these sttng dvds. i fumble and initially encode as interlaced, then on playback i realize it was TC'd video (encoded video is jerky). i re-encode by turning off 'force film' in dvd2avi, and using the IVTC selection when making the avs in gordian knot. also checked that box that corrects the framerate (before hitting encode). everything is cool, and the encode is good (motion smooth in scenes where the ship goes across the screen, etc).

so then i get to disc 3 and encode a few of those episodes. play one back, and i've got jerky video again, but its not a consistent jerkyness, its as if something is confusing the IVTC filter.
see the following clip (http://www.malventano.com/9-ivtc.avi) : (2 meg divx 5.05 avi).
i check the previous videos, no problems. i check all settings, everything good. then i check out the source video. most of the video is TC'd, but space scenes with the ship going across the screen are pure interlaced. it only occurs in some of the space scenes in some of the episodes. this leaves me with a delema. how do i get the pure interlaced setions non-jerky while keeping the TC'd section smooth? I realize the framerates would be different between the 2 (interlaced @ 29.9 and IVTC @ 24). is there perhaps a 'smart' IVTC filter that is meant to deal with a mixed source like this? like one that could do normal IVTC on the TC'd frames, but sense the pure-interlaced section, and do something to keep it smooth by mixing 2 frames to create every other frame, bringing the output from 29.9 to 24 fps? (kinda like a backwards TC, if you can picture what im trying to say).

thanks for any input on this. i'm at a total loss.

Nel
19th August 2003, 04:00
I had the same problem. But it's too late for me since I've done 5 seasons of it. I did all mine IVTC using decimate mode 0 which keeps the normal parts of the movie smooth and once in a while the space scenes will get jerky but not all the time.

I also did all of the Lexx episodes but used mode 1 for that which causes it to slightly jerk all the time except on space scenes but it's not that bad. Kinda like some svcd's I've downloaded. If I did mode 0 on that then the space scenes would be horribly jerky. Mode 1 is kinda the opposite but not as extreme. That was all interlaced BTW. Haven't found a perfect solution yet.

I think the solution may lie in the decimate frame number. Instead of using 5 something else may be better. I got tired of experimenting after a week and just started doing them all. Too much trouble to try and get them perfect. But for star trek, try what I did:

Telecide(guide=1).Decimate(5, mode=0, quality=3)

I did that on every episode and I'm happy with it. Space scenes jerk like yours sometimes but not always. No idea why. I'm quite happy with it though since most of the scenes are not in space.

Manono got me through it and i'm satisfied with the results. Maybe he can offer some suggestions too.

manono
19th August 2003, 08:24
Hi-

I'm using Decomb500b16. You might have to adjust the settings if you're using a different version. I'd try mode 3 to see if it works for you. That will IVTC the telecined portions normally and do blending on the interlaced portions to make them also 23.976fps. So it should wind up similar to what you envisioned. It should be a definite improvement over the .avi you provided, but maybe not perfect. So, try some variation of this:

Telecide(Order=1,guide=1)
Decimate(mode=3,threshold=1.0)

Order=1 refers to Top Field First. You have to set the field order in recent versions of Decomb. See the Decomb docs for more information.

allynm
19th August 2003, 11:55
thanks much for the info guys.
i hate to say it, but i have no clue how to use an external filter with gordian.
is there a quick primer guide out there that will get me going?
then i can try what manono has suggested...
thanks again
Al

manono
19th August 2003, 14:40
Hi-

I think the version of Decomb included with GKnot is 410b4. To use Mode 3 in that version, you might try:

Telecide(guide=1,gthresh=30)
Decimate(mode=3,threshold=1.0)

But recently he has changed and improved the Mode 3. If you want to try Decomb500b16, you can get it here (http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?t=56). Rename the .dll as Decomb.dll and replace the one in the Gordian Knot folder with it, making sure to save the included one in case you want to go back to it.

But this isn't an external filter (it's external to AviSynth, but not to GKnot). Decomb410b comes with GKnot. It's the default IVTC. All you have to do is to edit the script. You make sure the Decomb.dll is loaded (LoadPlugin("decomb.dll")), and then open and edit the Telecide/Decimate lines. And read and study the Decomb docs. Working with that hybrid material requires some skill. Just ask Nel. It almost drove him nuts. :)

allynm
19th August 2003, 17:47
ok, so heres what i did:

ran GK, opened the d2v, hit 'save and encode', selected 'inverse telecine' and 'bilinear' (like always), saved the .avs, selected 'IVTC in avs -> correct frame count', then added the job to the queue. i then edited the .avs directly, replacing the appropriate line to read as follows:
Telecide(guide=1,gthresh=30).Decimate(mode=3,threshold=1.0)
i then saved the .avs, and started the job from GK.
i got the following error message:
Loadplugin: "decomb.dll" is not an avisynth 1.0 plugin.

might this have something to do with the fact that i am using avisynth 2.0.8? i am forced to use 2.0.8 because the newer avisynth that comes with the newer GK builds has this annoying cropping issue (on the right edge), where it doesnt crop cleanly.

...or was i messing something else up instead?

thanks in advance for your help
Al

manono
20th August 2003, 04:16
Hi-

Yeah, you can't use that version of Decomb with AviSynth 2.08. And the ones that work in 2.08 don't have Mode 3. So you'll have to use AviSynth 2.52 (or 2.51 or 2.50)

Try this to help with your cropping problem. Reinstall a newer AviSynth. Make a new .avs and name it Version.avs. Then inside have only this line:

Version()

Open it in VDubMod, and it'll tell you which version is now installed. That will confirm that a newer version is installed. Then in the .avs make sure that the crop width is divisible by 4 (also the crop height). So, something like:

crop(10,4,700,476)

is OK, while:

crop(10,4,698,476)

is not OK. And I also recommend that you keep the default 32/16 for the W and H Moduls in the Resolution Tab.

allynm
20th August 2003, 05:48
ok,

avisynth 2.52 installed (and verified installed).
new decomb.dll installed.

used these parameters:

Telecide(order=1,guide=1,gthresh=30).Decimate(mode=3,threshold=1.0)

video came out decent, with minor combing on the pure interlaced frames. im sure that can be fixed with some simple tweaking of the threshold, no biggie.

now for the other delema:
same thing i was talking about earlier, i get a soft edge on the right side of the cropped video. i use the default 32/16 in GK. here are the resulting crop/resize settings from the avs:

crop(20,0,690,480)
BilinearResize(544,416)

then i realized that width (690) wasnt /4, so i changed it to 688, same result. then i changed it to 400 for fun and it worked correctly. this makes no sense, especially since 688 is /8, actually its even /16. a little more expermentation and i found:

400 - works
680 - works
682 - nope
684 - works
686 - nope
688 - nope
690 - nope

i have verified this again by switching between 2.52 and 2.08, using the same avs for both. 2.08 crops cleanly every time, but 2.52 has seemingly random results.

so... to use the new filter i have to give up proper cropping...

im stumped as to whats causing the crop issue. it doesnt seem to follow any multiple of anything.

argh :angry:

p.s. i settled on the following for the decomb settings:

Telecide(order=1,guide=1,gthresh=15).Decimate(mode=3,threshold=1.0)

gthresh at 30 seemed to cause large jumps every so often, as if the filter was getting confused ot backed up or something.

manono
20th August 2003, 08:31
Hi-

You've got me stumped with that softness along the right side. I was going to suggest next that you make both the left and right crops multiples of four, but evidently you tried:

crop(20,0,688,480)
BilinearResize(544,416),

and if true, then the left crop is 20, and the right crop is 12. So that's not the answer. About all I can suggest now is to try the latest Decomb5 (Decomb500b16). I gave the link above. But some of the parameters change, and you can use the script I gave earlier as a starting point. And read the doc for further help. Here's some other things to try. Try a bicubic resizer and see if that helps. How are you determining that it's soft on the right side? Just by looking in VDubMod? By looking at the finished .avi in your player? Have you tried a different player (maybe try the BS Player)? What codec are you using and what are you using for decoding. If DivX5 with the DivX decoder, you might install and try ffdshow (http://www.doom9.org/Soft21/Filters/ffdshow-20021213.exe).

The reason I mention it is that improper crop values can do some nasty things, like the infamous green line along the side, but your problem is new to me, and you seem to be doing everything right. Maybe some others have seen the problem and can help out. Let us know how it goes.

Edit: I was thinking some more about this later on. Are you using any other filters (such as smoothers/denoisers) besides Crop, Resize, Telecide, and Decimate? Sometimes they can cause conflicts and/or require different crop parameters. If so, try and comment them out (put "#" in front) temporarily and see if it makes a difference. Also, maybe you can post the .avs (leaving out the lines beginning with "#") so I can try and duplicate the problem.

allynm
20th August 2003, 18:41
SetWorkingDir("C:\PROGRA~1\GORDIA~1\")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("decomb.dll")
mpeg2source("E:\dvd\st\9.d2v")
trim(0,314)
Telecide(order=1,guide=1,gthresh=15).Decimate(mode=3,threshold=1.0)
crop(20,0,684,480)
BilinearResize(544,416)

thats the non-#'d part of my avs. the only part modified from GK's output is the telecide/decimate line. it also happens with no telecide/decimate, so you can leave that part out.

they are pretty standard settings i would imagine.

im using the normal ffdshow that comes with gknot, and playing videos back with media player classic.

other factors i have checked / eliminated:

- codec used doesnt matter (tried divx and xvid)
- player used doesnt matter (mpc and wmp)
- ffdshow in use or not doesnt matter
- resize method doesnt matter (i tried bilinear and lanczos) *more on this at end
- complete clean windows install on another partition, with a clean install of gknot (i did this back when the problem began showing in newer GK builds).

so its gotta be avisynth.

to reproduce:
take a vob (i've mainly been doing tv dvd's (4:3), no letterbox stuff, not sure if this is a factor), adjust crop with gknot, encode a short clip of it with whatever codec (i use divx 5.05), view encoded video in full screen and observe right edge. if you have a sharp edge, you may have (by luck) picked a width that works, change it by 2 and re-encode.

-----------------------------------------

side note, back to the decomb thing:

i've been using these settings:
Telecide(order=1,guide=1,gthresh=15).Decimate(mode=3,threshold=1.0)

on the pure interlaced sections, i get an alternating 2 clean frames / 2 combed frames.

i played the source vob with powerdvd, and even it has a hard time showing the space scenes correctly, but powerdvd does some sort of blur/bob filtering, which prevents the combing. you can tell its actively deinterlacing, but the result looks much better (not combed, but blured).

i tried:
Telecide(order=1,guide=1,gthresh=15,post=4).Decimate(mode=3,threshold=1.0)

post=4 is mentioned in the reference guide as far as working with hybrid material, but i got the same combing.

in fact, check this out, here is a zip of 5 sequential frames, showing both the combing and the improper right edge crop (used 688):

http://www.malventano.com/crop-comb.zip (1 meg)

* i did a run with resize disabled, here are the same frames:

http://www.malventano.com/crop-comb2.zip (1.3 meg)
^ easier to see combing, and crop is still an issue

so..., how do i get this thing to blur instead of comb? i figured the post=4 would work, but it didnt.

p.s. thanks so much for your time so far, anyone else would have given up on my by now :)
Al

----------------------------
update: i did some more experimenting with the non-resized video. using a width of 688 was not enough crop for the video (it was for avisynth 2.08, but not with 2.52 for some reason). this seemed odd, but its easily compensated for. so basically anything below 684 would crop correctly for this source video. looking at yesterdays chart:

400 - works (/4 and cropped enough)
680 - works (/4 and cropped enough)
682 - nope (cropped enough, but *not* /4)
684 - works (/4 and cropped enough)
686 - nope (not /4)
688 - nope (/4, but didnt crop enough (was enough for 2.08 though))
690 - nope (wrong on both counts, but this size did work with 2.08)

i'm going to submit a bug report to the GK guys, requesting that the x width increments comply with multiples of 4 vs. multiples of 2.

manono
20th August 2003, 22:42
Hi-

Check your PM. I don't see this as a GKnot problem any longer. So we'd better take it private. Thanks.

Wilbert
20th August 2003, 23:47
Two remarks:

1) Since you are cropping/resizing after deinterlacing, doing it mod2 should work in that case (mod4 is only necessary if you keep in interlaced).

2) Could you try DivX502?

3) Could you upload a small vob somewhere? (You can split it with vobsplitter from the download page.)

allynm
22nd August 2003, 17:39
Originally posted by Wilbert
1) Since you are cropping/resizing after deinterlacing, doing it mod2 should work in that case (mod4 is only necessary if you keep in interlaced).


since some scenes are pure interlaced, some of those frames of those scenes make it through the IVTC filter, since IVTC is only looking to remove some (not all) of the interlaced frames.


2) Could you try DivX502?


the codec is not the cause of the problem, it happens internally, within avisynth. manono and i are getting this resolved.