digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   KVCD: Strange ghost effect on some scenes? (http://www.digitalfaq.com/archives/encode/4744-kvcd-strange-ghost.html)

AgNa 07-27-2003 10:20 PM

KVCD: Strange ghost effect on some scenes?
 
Ok I first though it was a problem caused by the use of AsumeFPS() line on my script but I tested it without it and I get this (right click and save as plz)

what is causing that efect? first time it happens to me, this is the 3rd movie I`m doing with AVS 2.5.x, and I didn`t noticed something like this in the others :?: heres my script
Code:

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf =  0 # Current frame.

#
AviSource("D:\Movies-videos\test\test.avi")
#
undot()
Limiter()
asharp(1, 4)
GripCrop(704, 480, overscan=2)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")

GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
##TextSub("D:\Movies-videos\test\subcity1.ssa")
##ChangeFPS(23.976)
Limiter()
##Sampler(length=24)
#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

thanx in advance

kwag 07-27-2003 10:59 PM

The guy is very cold :mrgreen:

I believe there's nothing in the script that would cause that. I believe it's a frame rate issue. UNLESS, that specific scene is right at the border of the treshold of the MA script filter switching point, and you are seeing a fast oscilation between TemporalSmoother and unfilter kicking in and out at a very high speed. The best analogy to this is "Histheresis" effect: http://ourworld.compuserve.com/homep...t/elect344.htm ( I guess my years in electronics always pay off, even in video :lol: )
So you can try something quick.
Change this line:
SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2 \
To read:
SwitchThreshold = (Width<=352) ? 10 : (Width<=480) ? 10 : 10 \
But just for a test, and encode that section again. If the problem is gone, then it is a hystheresis problem, and the way to correct it will be to implement a "SCHMITT TRIGGER" in the script ( which should be a piece of cake ;) )

Let me know :D

-kwag

AgNa 07-28-2003 02:55 PM

Ok this is weird
I use your line on my script, it worked, removed that ghost efect but added a noise line on the right edge. So I tried to experiment my self lowering the number and replaced you line by this
SwitchThreshold = (Width<=352) ? 8 : (Width<=480) ? 8 : 8

and the ghost was back there, so I rencoded with the line you gave me just to put a pic here and the ghost was ther and the line not 8O 8O

I did it several times, and with diferent resolutions but all the same. I`m going mad :?

BTW whats a SCHMITT TRIGGER??
I just noticed that it happens in other places of the movies too, ie a camera inside a parked car and ther woman that you can see in the dark has the same ghost efect :oops:

kwag 07-28-2003 05:12 PM

Quote:

Originally Posted by AgNa
BTW whats a SCHMITT TRIGGER??

I'll try to explain in a non technical context :D

Imagine you have a bucket of water (our frame motion difference range) with a single sensor (our treshold) like this:

Code:

|      |\ blurring range
 |      |/
 |      |<---- Sensor at this point
 |      |\
 |      |/ Temporal filter range
 --------

Now we fill it with water (frame motion differences), but it just so happens that the water is barely touching the sensor, and the next frame difference is just barely under the sensor (the water is moving). If this happens on a time lapse (as on your sample), we have one frame difference with one filter(water detected), and the next frame difference with another filter (water not detected) :!:
So you have an oscilation of alternating filters.
The way to fix that, is to add a SCHMITT TRIGGER circuit in software, just like it is designed in digital logic.
So what we do is this: If the water fed (the frame difference) just hit (tripped) over the sensor point, we LOWER the threshold point a tad. For example: If our sensor (treshold) measuring point is 2.0, we drop it (set it) to 1.8 on a "rising" transition of water (frame difference). If the water (frame difference) tripped BELOW 1.8 (lowering difference), we set the treshold back to 2.0.
What does this do :?: Simple :) It avoids oscilations (hysteresis), because once a point is tripped, the water level (our threshold) needs a higher (or lower) level change to switch, and this keeps the filters from switching back and forth (oscilating) on that boundary when that condition is met :D
I hope this was clear, as I tried to make it as non-technical as possible :?
If you want a simple technical (digital) explanation, here it is :D : http://www.photonics.com/dictionary/.../QX/lookup.htm

-kwag

Jellygoose 07-29-2003 10:57 AM

So where does the funny name come from? :P

jorel 07-29-2003 11:00 AM

Quote:

Originally Posted by Jellygoose
So where does the funny name come from? :P

SCHMITT?
is the name of the inventor that faster "flip-flop".
:wink:

great link Kwag :!:

AgNa 08-11-2003 09:53 PM

Ok first of all sorry for the delay to answer and thank you for the help I`ve been a little bussy but now I `m back.
I think I totally understood what did you say, and it`s what in audio it`s a GATE/compressor, now How do I change the value?? I tried changing the MaxTreshold = 1.5 line but it doesnt have any noticeable effect on this case, I moved it to the min. and the max (1.0 and 1.58) I also tried this combined to changing the line you said in your first reply, that makes it look a little bit better but the effect is still there. Thanx in advance :D

AgNa 08-18-2003 02:00 PM

and I solved it!!!!!!
It was FFdshow issue I unistalled it and downloaded the lates Koepis XVid codec and it worked like a charm :D


All times are GMT -5. The time now is 10:45 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.