Log in

View Full Version : Ghosting Problems


lilreyrey
30th January 2006, 19:00
im having a problem with my xvid... im trying to create an xvid but the video always seems to have ghost frames.

http://server6.theimagehosting.com/image.php?img=ghost.13c.JPG

how can i get rid of this? is this an avisynth problem? what do i do?

ChronoCross
30th January 2006, 19:58
how are you deinterlacing? This seems very much a filtering issue rather than a codec issue. please post your avs.

lilreyrey
30th January 2006, 20:07
# Created with Gordian Knot
#
# http://gknot.doom9.org

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\decomb.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\KernelDeInt.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\UnDot.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\dgbob.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\Convolution3d.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\FluxSmooth.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\TomsMoComp.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\VSFilter.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\SimpleResize.dll")

# SOURCE
mpeg2source("C:\Documents and Settings\Jeff\Desktop\VIDEO_TS\VTS_01_1.d2v")

# TRIM
#trim(startframe,endframe)

# IVTC
#Telecide(order=1,guide=1).Decimate()
# or use
#IVTC(44,11,95)
#GreedyHMA(1,0,4,0,0,0,0,0)

# DEINTERLACING (1)
#FieldDeinterlace()
#FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)

# DEINTERLACING (2)
#KernelDeInt(order=1,sharp=true)
# or maybe
#DGBob(order=1,mode=0)

# DEINTERLACING (3) - special requests
#GreedyHMA(1,0,0,0,0,0,0,0)
#Telecide()
#SeparateFields()

# CROPPING
crop(42,78,636,324)

# SUBTITLES
#VobSub("FileName")

# RESIZING
LanczosResize(544,304)

# DENOISING: choose one combination (or none)
Undot()

# 1) little noise
#Temporalsoften(2,3,3,mode=2,scenechange=6)
#mergechroma(blur(1.3))
#FluxSmoothST(5,7)

# 2) medium noise
#Temporalsoften(3,5,5,mode=2,scenechange=10)
#Convolution3d("moviehq")
#FluxSmoothST(7,7)

# 3) heavy noise
#Temporalsoften(4,8,8,mode=2,scenechange=10)
#Convolution3d("movielq")
#FluxSmoothST(10,15)

# BORDERS
#AddBorders(left,top,right,bottom)

# COMPRESSIBILITY CHECK
# !!!!Snip Size now has to be 14 for use in GKnot!
#SelectRangeEvery(280,14)

# FOOL CCEnc
#empty = BlankClip()
#AudioDub(last,empty)

lilreyrey
30th January 2006, 20:07
thats my avs ^

unskinnyboy
30th January 2006, 20:24
You have the IVTC and Deinterlacing steps commented out, so in effect you are only doing crop+resize+undot. No wonder it has ghosting. You need to IVTC it or deinterlace it, as the case may be. You need to analyze your source to see what exactly you should be doing. Look here (http://www.doom9.org/ivtc-tut.htm) for more info.

lilreyrey
30th January 2006, 20:49
thanks, ill read it and hopefully it will fix my prob

lilreyrey
31st January 2006, 01:11
hmm it still doesnt work :\

my source is a telecined NTSC DVD. so i didnt do force film... but i did ivtc. is still has ghost frames.. im really stumped

ChronoCross
31st January 2006, 05:58
Well if this is a continuing problem with ghosting you may need to use a more advanced IVTC to combat the ghosting. I wish I could point you to a good thread about it but I can't so use search and lots of results will show up for this type of problem.

You might consinder Restore24(). It worked well on the Star Trek DVD's

manono
31st January 2006, 10:56
Yeah, separate the fields and have a look. If you see blending/ghosting/double images in the fields, then no IVTC will work well. You'll need, as ChronoCross suggested, Restore24, or maybe RePAL, to make it progressive again.

my source is a telecined NTSC DVD

You're real sure about that, are you?

but i did ivtc. is still has ghost frames.. im really stumped

Decomb's Telecide has a post-processing deinterlacer on by default. It may or may not be creating the ghosting. Depends on whether or not the fields themselves are ghosted. Turn off the deinterlacer with Post=0 added into Telecide and then look again. If you still see the ghosting, then it's blended in the source. If you now see only interlacing, then something else is at work. If you could post a short unprocessed clip showing the problem, that might help.

shon3i
31st January 2006, 16:07
Maybe sounds stupid but you sould be try FieldDeinterlace(blend=false) or KernelDeInt(order=1)

lilreyrey
31st January 2006, 23:43
FieldDeinterlace(blend=false) or KernelDeInt(order=1) doesnt work :\

yes im sure its a telecined ntsc dvd

Restore24 and RePal... how do i do that? do i have to download some plugins?

can you help me out?

lilreyrey
1st February 2006, 00:25
http://rapidshare.de/files/12271518/video.mpg.html

that is a sample straight from the vob

if you go frame by frame on vdub you'll notice a lot of frames arent normal... i want to fix that problem but i dont know where to start.. if someone could help me out that would be great :D

Teegedeck
1st February 2006, 08:30
Perhaps this thread fits better into the AviSynth forum.

manono
1st February 2006, 10:39
Yes, the AviSynth Forum is better. I had a look at your sample, and it's not what I thought. It's 30fps progressive, with every 5th frame created by blend deinterlacing the previous and next frame. There's a tool that I thought was supposed to fix it, but I didn't have any luck. You might post in the FixBlendIVTC thread here:

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

What you really need is a simple way to detect the blends and just remove them, instead of fixing them before removal. I tried using SelectEvery on it, but the pattern seems to change at every scene change. When I see that kind, I just delete them from the hard drive, because they were created by idiots.

By the way, 60 MB might be too much for some people to download. In addition, you could have chosen a better scene, one with more motion.

foxyshadis
1st February 2006, 11:58
unblend().decimate().

I didn't check your sample to see how bad it was, though. If that doesn't work try removeblend(threshold=8,dthresh=.1).decimate(), or CDeblend. Oh, and if it's anime you need decimate(mode=2).

MOmonster
1st February 2006, 13:03
Yes, itīs no source for FixBlendIVTC, but a modified version for your case wouldnīt be a big problem. Removeblend should work for you. Cdeblend isnīt recommed for this source. Maybe with the right settings you will get nice results, but the motion influence should limit very hard. Itīs no anime, so decimate() should be absolutly ok.

lilreyrey
2nd February 2006, 00:48
hmm i put unblend().decimate() and it told me that its not a valid command when i opened it up on vdub and same with removeblend(threshold=8,dthresh=.1).decimate()

what am i doing wrong? is there a plugin im supposed to install?

foxyshadis
2nd February 2006, 02:13
http://www.avisynth.org/warpenterprises

lilreyrey
2nd February 2006, 21:57
i tried both of them and they still dont work :\

any other suggestions?

lilreyrey
3rd February 2006, 03:58
i noticed thats is 3 clean frames then 2 blended ones... i really dont know how to fix this

does anyone know how to fix it

its a 29.97 fps video but i think it was telecined... so the original fps is 23fps

MOmonster
3rd February 2006, 09:28
i noticed thats is 3 clean frames then 2 blended ones... i really dont know how to fix this
Hmm, I have to take a closer look on your sample with virtualdub. This should be the source for FixBlendIVTC if the blendweights are accurate.
Iīm just working on the new version with a better blenddetection. Iīll will also test your sample. But I donīt have internet on weekend so I canīt report back before monday.:o

MOmonster
6th February 2006, 10:29
I canīt notice two blends together anywhere in your source. The deinterlacing is really bad, maybe this is the reason for the bad blenddetection of unblend and removeblend. I coulnīd test, because I didnīt have the filters on my pc. Iīll do today. It should be also no problem to create you a function against these singleblends. If you really have doubleblends anywhere in your source, please upload a small sample.

foxyshadis
6th February 2006, 14:34
Momonster, there are areas where the ghosts of frames show up repeatedly, like 80/20, then 20/70/10, and so on, though the 12 fps makes it hard to see sometimes. I wasn't able to find a useful pattern out of it. I'd give you frame numbers, but I only glanced at it yesterday and deleted it, it's beyond my experience.

MOmonster
7th February 2006, 11:54
Hmm, my monitor at home is really bad and the clip is long, with less motion, I didnīt realize it. A sample with more motion will be really helpful to analyse the problem.

So or so, yesterday I tested removeblend and I also failed.
Thatīs why a created a simple modification of FixBlendIVTC v0.8. If foxyshadis is right and the function doesnīt work for you, maybe another modification will help.

This is my script. The only parameters I keep in this modification are clip2 (blenddetectionclip for preprocessing) and mthresh (motion threshold to avoid wrong detection in low motion scenes). Yesterday it worked dor me.:confused:
LoadPlugin("G:\marko\dgmpgdec\DGDecode.dll")
LoadPlugin("G:\marko\filters\Decomb521.dll")
LoadPlugin("G:\marko\filters\removedirts.dll")
LoadPlugin("G:\marko\filters\mt_masktools.dll")


MPEG2Source("G:\marko\samples\dvd.d2v")

a = last.crop(40,72,-40,-72).bilinearresize(480,352).removedirt()

FixSingleBlendIVTC(clip2=a)
decimate(cycle=5,quality=0)



Function FixSingleBlendIVTC(clip input, float "mthresh", clip "clip2")
{
###### PREPARATION ######
global source = input
global blendc = default(clip2, input)
global dupframe = input.trim(1,0).tweak(hue=0.1)

global mthresh = default(mthresh, 0.0)

f_diff = mt_lutxy(blendc.duplicateframe(0), blendc, yexpr="128 y + x -", uexpr="x", vexpr="x")
global rev_diff = mt_lutxy(f_diff, f_diff.trim(1,0), yexpr="x y - 2 ^ 2 -", uexpr="x", vexpr="x")
global ssdiff = mt_lut(f_diff, yexpr="x 128 - 2 ^ 6 -", uexpr="x", vexpr="x")

###### VAR.. ######
global revdiffb = 1.0
global revtemp = 1.0
global revdiffn = 1.0
global revdiffn2 = 1.0
global counter = 3

###### Conditional Function Chain, evaluated from bottom to top (!) ######
d99=scriptclip(source, "counter==0 ? dupframe : source")

d4=FrameEvaluate(d99," global counter = revdiffc < revdiffn && revdiffc < revdiffb &&
\ revdiffc < revdiffb2 && revdiffc < revdiffn2 || revdiffc*6 < revdiffn && revdiffc*6 < revdiffb ?
\ (AverageLuma(ssdiff) > mthresh ? 0 : counter+1) : counter+1")

d3=FrameEvaluate(d4, " global revdiffn2 = AverageLuma(rev_diff.trim(2,0))
global revtemp = revdiffc")

d2=FrameEvaluate(d3, " global revdiffn = revdiffn2
global revdiffb = revtemp")

d1=FrameEvaluate(d2, " global revdiffc = revdiffn
global revdiffb2 = revdiffb")
return(d1)
}

The filters you need to run the script you can see in the loadplugin-list.