View Full Version : film gate wave/shaking in part of frame
Dogway
29th April 2010, 18:51
Im working in this movie that shows some strange artifacts. I thought it was shaking, but if you pay attention to the second 8 you can see that the chimney moves related to the wall next to it. Is a bad deinterlace what made this? How can I fix it? I have no idea, so any help is more than welcome.
38 Mb
http://www.sendspace.com/file/olybyr
Guest
29th April 2010, 18:55
What is the title and region of the DVD?
lansing
30th April 2010, 01:15
All old anime have this problem, where the entire frame shakes on playback AND some of the objects in the frame shake up and down as well, it's just the way it is. The one in your sample wasn't that bad, I've seen worse in my collection.
I've a thread about this before and ended up with this (http://forum.doom9.org/showthread.php?p=1295429#post1295429), it works well on my 3 samples before. The stab function took care of the global shakes, and the rest of the script stabilize the inner shakes.
Dogway
30th April 2010, 13:40
Yes, I had read that thread too, but I thought you were dealing with deshake+denoise. Now trying to test it, Im converting everything to MVTools 2, but I dont know what refframes is supposed to be in MAnalyse.
I will use Deshaker by Gunnar also, as stab (that is Depan) never gave me good results.
Edit: I see, refframes is the Mdegrain2, Mdegrain3 thing, right? How can I translate that? So far this is how Im adapting it:
temporaldegrain()
strength = 1
mt_merge(last,
\ last.MDegrain(last.FFT3DFilter(sigma=strength*2,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3,ncpu=2).Manalyse(blksize=16,overlap=4),thSAD=strength*200),
\ last.mt_edge("min/max").removegrain(19),
\ U=3,V=3)
lansing
30th April 2010, 17:26
IIRC, the refframes parameter came from the multithreaded version of mvtools by Josey Wells, like version 1.9.7.7, should be around here somewhere in the forum.
Dogway
30th April 2010, 18:33
yes, I have it. But Id to stick to my everyday plugins. Cant it be done with MVTools 2.0?
lansing
30th April 2010, 22:28
for the conversion I don't know
Stephen R. Savage
30th April 2010, 22:42
yes, I have it. But Id to stick to my everyday plugins. Cant it be done with MVTools 2.0?
########################################################
_fft = 2
_thSAD = 100
_bs = 16
_ov = 4
osuper = MSuper()
asuper = FFT3DFilter(sigma=_fft, plane=4, bw=32, bh=32, ow=8, oh=8, bt=3, ncpu=2).MSuper()
b3v = MAnalyse(asuper, isb=true, delta=3, blocksize=_bs, overlap=_ov)
b2v = MAnalyse(asuper, isb=true, delta=2, blocksize=_bs, overlap=_ov)
b1v = MAnalyse(asuper, isb=true, delta=1, blocksize=_bs, overlap=_ov)
f1v = MAnalyse(asuper, delta=1, blocksize=_bs, overlap=_ov)
f2v = MAnalyse(asuper, delta=2, blocksize=_bs, overlap=_ov)
f3v = MAnalyse(asuper, delta=3, blocksize=_bs, overlap=_ov)
process = MDeGrain1(osuper, b1v, f1v, thSAD=_thSAD)
# process = MDeGrain2(osuper, b1v, f1v, b2v, f2v, thSAD=_thSAD)
# process = MDeGrain3(osuper, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD)
mt_merge(process, mt_edge("min/max").RemoveGrain(19), U=3, V=3)
########################################################
Basic copy/pasting skills. I am unsure why you want to do this, as it is essentially the same as the TemporalDegrain call 2 lines above.
Dogway
1st May 2010, 03:14
Basic copy/pasting skills. I am unsure why you want to do this, as it is essentially the same as the TemporalDegrain call 2 lines above.
Thank you! no, I didnt make the script, I borrowed from here (http://forum.doom9.org/showthread.php?p=1295429#post1295429). So do you mean that temporaldegrain does the same as mvmulti of that thread, or the mvtools 2.0 of your post? If both, its a question to lansing I guess. I think I can get by only with the Mdegrain routine...
The main points of Josey Wells' "Multi" modification are:
- less typing. Instead of writing several lines with "vector1= / vector2= / ...etcetcetc... / vectorNN=", it's just one line for MVAnalyseMulti, and the result contains all the different vector clips in one single monolothic clip.
- (much) wider temporal radius for MVDegrain is possible. With standard MVTools, you're basically limited to a temporal radius of maximally +/-3 frames. For ref=1/2/3, it's basically the same what you have with MVDegrain1/2/3. With the Multi version, you can easily use MVDegrain with a radius of 4, 5, 6, 7, ... (don't know how much are allowed at max). With standard MVtools, you'd have to do multiple instances of M(V)Degrain, and average them together. (Which BTW isn't exactly the same: averaging different MDegrain's gives more weight to the center frame.)
- Multithreading. IIRC, MVAnalyseMulti has the possibility to spawn several threads for the vector search for each single frame. IMHO this is definetly the preferred way of MT, as far as MVTools is concerned. Combining standard MVTools with MT() is a compromise that comes with a drawback (spatial limitations, and overhead due to slice overlap). Combining standard MVTools with SetMTMode() is a compromise that comes with a drawback (system ressources. From the basic idea, SetMTMode with 4 threads is similar to running 4 scripts in parallel.)
For my understanding, the way of MVToolsMulti is much nicer for Multi-Threading. When you're concerned it takes too long for one man to build one house, the solution of SetMTMode is to let 4 people build 4 houses simultaneously. The way of MVToolsMulti is to let 4 people build one house at a time.
At least for building houses, the latter way definetly is the preferred one. For multithreading Avisynth, I think it should be, too ... but I'm not fully sure, there's lots of pitfalls and technical sideaspects which I can't rate sufficiently.
Dogway
1st May 2010, 15:41
Im getting "wrong super clip (pseudoaudio) parameters" at first line of Manalyse. I fixed the blocksize to blksize, but the problem persists. By line checking I found out its FF3DFilter what triggers that message, but FF3DFilter works nice by itself if used alone so...
@ Didée: So up to vector3 its just the same that MVtools 2 quality wise, except the multithreading approach. I mean what do you normally use? Id stick with that lol
@ Didée: So up to vector3 its just the same that MVtools 2 quality wise, except the multithreading approach.
Basically, yes. In detail, of course there are differences. The multi version is based on MVTools v1.9.x, so surely there are differences compared to the actual v2.x branch.
I mean what do you normally use? Id stick with that lol
You mean, what I use [coming soon: did use] on this crappy 1core Celeron where x264 crf 20 preset slow, without Avisynth involved at all, encodes a native PAL source at ridiculous 1.5 fps? Where some light filtering yields to 0.x fps, and stronglord filtering yields to 0.0x fps??
- Tell you what, I use exactly nothing. Toying a little here a little there, but thats not "usage". The rig is (was) just too slow to do anything.
I can't help you with fixing it, but I can explain this issue (I think!)
It looks like a very juddery telecine transfer that has been poorly stabilised later. Basically, the film has slipped around a lot in the telecine device, and the stabilisation done afterwards has not been entirely effective, so you get some parts that still move around a little.
Film transfer technology has improved a lot since then.
Dogway
3rd May 2010, 02:43
I see, its called jitter (in a different mean of shake), I think it refers to the intra-shaking/waving artifacts. This (http://avisynth.org/vcmohan/DeJitter/DeJitter.htm) is one filter that removes it, but as my sample is not THAT bad Im unsure it would be worse than better. Normally is something to do with capturing signals interferences, which relies on hardware TBC stabilisation(?). This (http://forum.doom9.org/showthread.php?t=152706) is a cool thread discussing the same matter. This (http://pacific.mpi-cbg.de/wiki/index.php/BUnwarpJ) one is another plugin (for another image processor) for the described case.
No, that link you posted describes something totally different. "Jitter" as described there is due to a very poor quality video signal. It's often seen on Nth-generation VHS bootlegs.
Dogway
3rd May 2010, 20:10
And dont you think this is a captured VHS source packed into a DVD?
No, it's definitely not VHS. More likely some sort of old broadcast format like U-Matic or Betacam (I don't know the age of the material to make a better guess).
Even if it was from VHS, it doesn't have that problem.
Dogway
9th May 2010, 16:21
I have been nailing my script in respect of internal fluctuations. I found a script in the Despot (http://avisynth.org.ru/despot/despot.html) manual which relates to this same matter, Im using the last example together with the script (http://forum.doom9.org/showthread.php?p=1396262#post1396262) Stephen adapted for MVtools 2, in expect to get a strong stabilisation. Normally I pixel compare my frames with Photoshop, but I was getting a bit dizzy, so I tried ssim to get real values to check how much I was correcting. But I didnt get any change using both scripts together, although the first script alone works nice. I further checked and I couldnt manage to make the second script work alone, so Im missing a filter or something Im doing is wrong, any help to this?
#Stephen's
################################################
s=clip1
_fft = 6
_thSAD = 600
_bs = 16
_ov = 4
prefilt=s.FFT3DFilter(sigma=_fft,plane=4,bw=32,bh=32,ow=8,oh=8,bt=5,ncpu=2) # prefiltered for better motion analysis
osuper=s.MSuper() # super clip
asuper=prefilt.MSuper() # super filtered clip
b3v = MAnalyse(asuper, isb=true, delta=3, blksize=_bs, overlap=_ov)
b2v = MAnalyse(asuper, isb=true, delta=2, blksize=_bs, overlap=_ov)
b1v = MAnalyse(asuper, isb=true, delta=1, blksize=_bs, overlap=_ov)
f1v = MAnalyse(asuper, delta=1, blksize=_bs, overlap=_ov)
f2v = MAnalyse(asuper, delta=2, blksize=_bs, overlap=_ov)
f3v = MAnalyse(asuper, delta=3, blksize=_bs, overlap=_ov)
# process = MDeGrain1(osuper, b1v, f1v, thSAD=_thSAD)
# process = MDeGrain2(osuper, b1v, f1v, b2v, f2v, thSAD=_thSAD)
process = MDeGrain3(osuper, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD)
mt_merge(process, mt_edge("min/max").RemoveGrain(19), U=3,V=3)
########################################################
#Example at Despot manual
# analyse and compensate motion forward and backward (to current frame)
ml = 100 # mask scale
thscd1 = 400 # scene change
vf = asuper.MAnalyse(isb=false) # forward vectors
cf = s.MFlow(osuper, vf, thscd1 = thscd1) # previous compensated forward
sadf = s.MMask(vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.MT_Binarize() # binary inverted forward SAD mask
vb = asuper.MAnalyse(isb=true) # backward vectors
cb = s.MFlow(osuper, vb, thscd1 = thscd1) # next compensated backward
sadb = s.MMask(vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.MT_Binarize() # binary inverted backward SAD mask
msad = MT_Logic(msadf,msadb,"or") # combined inverted SAD mask
msad = msad.MT_Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
# This mask is high (255) where at least one motion estimation is good,
# so these areas will be protected
Interleave(cf,s,cb) # interleave forward compensated, source, and backward compensated
SelectEvery(3,1) # get filtered source
########################################################
@Lyris: Age is 1991 I think.
Dogway
14th May 2010, 16:41
As nobody tried to help me I blindly fiddled with the script and ended with this, ssim proves changes are greater than any of the scripts alone, my question is whether this concept is correct and if I can switch the mdegrain in bold with mflow or some kind of warper and how, as my intention is not to denoise at that stage but "unbake" "unwarp" "dejitter" or whatever you wanna call it. I cant desist!
#Dejitter
################################################
_fft = 6
_thSAD = 600
_bs = 16
_ov = 4
prefilt=s.FFT3DFilter(sigma=_fft,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3,ncpu=2)
osuper=s.MSuper()
asuper=prefilt.MSuper()
b3v = MAnalyse(asuper, isb=true, delta=3, blksize=_bs, overlap=_ov)
b2v = MAnalyse(asuper, isb=true, delta=2, blksize=_bs, overlap=_ov)
b1v = MAnalyse(asuper, isb=true, delta=1, blksize=_bs, overlap=_ov)
f1v = MAnalyse(asuper, delta=1, blksize=_bs, overlap=_ov)
f2v = MAnalyse(asuper, delta=2, blksize=_bs, overlap=_ov)
f3v = MAnalyse(asuper, delta=3, blksize=_bs, overlap=_ov)
process = MDeGrain3(osuper, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD)
########################################################
# analyse and compensate motion forward and backward (to current frame)
ml = 100
thscd1 = 400
vf = asuper.MAnalyse(isb=false)
cf = s.MFlow(osuper, vf, thscd1 = thscd1)
sadf = s.MMask(vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1)
msadf=sadf.MT_Binarize()
vb = asuper.MAnalyse(isb=true)
cb = s.MFlow(osuper, vb, thscd1 = thscd1)
sadb = s.MMask(vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1)
msadb = sadb.MT_Binarize()
msad = MT_Logic(msadf,msadb,"or")
msad = msad.MT_Expand()
msadi = Interleave(msad, msad, msad)
Interleave(cf,s,cb)
mdegrain()
SelectEvery(3,1)
mt_merge(process, mt_edge("min/max").RemoveGrain(19), U=3,V=3)
########################################################
2Bdecided
17th May 2010, 13:24
I think that if you changed the thread title to "film gate wave / shaking in part of frame" (or something like that), you might get more responses. I only clicked on it by accident, but it's exactly what I'm dealing with at the moment, so I'll take a proper look.
Cheers,
David.
Dogway
17th May 2010, 17:09
Thank you! It does work the first script, the second script comes from this (http://forum.doom9.org/showthread.php?p=1190501#post1190501) post. He says he is only motion compensating the clip, but I dont know at what stage of the process output (I dont want to Despot) the clip as I dont understand the method. This paper (http://www.cmla.ens-cachan.fr/fileadmin/Membres/nikolova/RT-DJ.pdf) explains very well my case I think, in the case of low frequence jitter artifacts. Anyways, I dont expect to go so far, fixing my actual script would be enough to start encoding.
Edit: What about this? I used the first "Despot Script" as the prefiltered clip of the second script. SSIM detects further changes. Now ideally I think that after the interleave command I should perform a strong temporal denoiser (temporalsoften?) to average those 3 frames. Problem is temporalsoften affects the 4th frame too thus creating an ugly blending.
#Despot Script
_fft = 6
_thSAD = 600
_bs = 16
_ov = 4
prefilt=s.FFT3DFilter(sigma=_fft,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3,ncpu=2)
osuper=s.MSuper()
asuper=prefilt.MSuper()
ml = 100
thscd1 = 400
vf = asuper.MAnalyse(isb=false)
cf = s.MFlow(osuper, vf, thscd1 = thscd1)
sadf = s.MMask(vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1)
msadf=sadf.MT_Binarize()
vb = asuper.MAnalyse(isb=true)
cb = s.MFlow(osuper, vb, thscd1 = thscd1)
sadb = s.MMask(vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1)
msadb = sadb.MT_Binarize()
msad = MT_Logic(msadf,msadb,"or")
msad = msad.MT_Expand()
msadi = Interleave(msad, msad, msad)
in=Interleave(cf,s,cb)
TemporalSoften(in,1,255,255,0,2)
SelectEvery(3,1)
#############
#stab script
bsuper=last.MSuper()
b3v = MAnalyse(bsuper, isb=true, delta=3, blksize=_bs, overlap=_ov)
b2v = MAnalyse(bsuper, isb=true, delta=2, blksize=_bs, overlap=_ov)
b1v = MAnalyse(bsuper, isb=true, delta=1, blksize=_bs, overlap=_ov)
f1v = MAnalyse(bsuper, delta=1, blksize=_bs, overlap=_ov)
f2v = MAnalyse(bsuper, delta=2, blksize=_bs, overlap=_ov)
f3v = MAnalyse(bsuper, delta=3, blksize=_bs, overlap=_ov)
process = MDeGrain3(osuper, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD)
mt_merge(process, mt_edge("min/max").RemoveGrain(19), U=3,V=3)
btw, results are far from being nice. An ideal script would be one that fixes pixels if temporally (frames span) spatial changes aren't greater than (threshold) (aimed at animation of course)
EDIT: I just wanted to point out the investigation these guys (http://colour-recovery.wikispaces.com/Current+work) are making on the subject using B-Splines with bUnwarpJ
Dogway
26th May 2010, 11:26
Thank you guys, at last I will use medianblur. I will start encoding in the next few days. Im also not using the mask as it was aimed at spot removal and cant load it with medianblurt nor any other filter.
Deshaker by Gunnar +
s=last
thescd1 = 400
_fft = 6
_thSAD = 600
_bs = 16
_ov = 4
#######################################
prefilt=s.FFT3DFilter(sigma=_fft,plane=4,bw=32,bh=32,ow=8,oh=8,bt=5,ncpu=2)
osuper=s.MSuper()
asuper=prefilt.MSuper()
vf = asuper.MAnalyse(isb=false)
cf = s.MFlow(osuper, vf, thscd1 = thescd1)
vb = asuper.MAnalyse(isb=true)
cb = s.MFlow(osuper, vb, thscd1 = thescd1)
Interleave(cf,s,cb)
medianblurt(0,0,0,1,markscenechange=true,mc=true,,thSCD1=130,thSCD2=90)
SelectEvery(3,1)
######################################
bsuper=last.MSuper()
b3v = MAnalyse(bsuper, isb=true, delta=3, blksize=_bs, overlap=_ov)
b2v = MAnalyse(bsuper, isb=true, delta=2, blksize=_bs, overlap=_ov)
b1v = MAnalyse(bsuper, isb=true, delta=1, blksize=_bs, overlap=_ov)
f1v = MAnalyse(bsuper, delta=1, blksize=_bs, overlap=_ov)
f2v = MAnalyse(bsuper, delta=2, blksize=_bs, overlap=_ov)
f3v = MAnalyse(bsuper, delta=3, blksize=_bs, overlap=_ov)
process = MDeGrain3(bsuper, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD)
mt_merge(process, mt_edge("min/max").RemoveGrain(19), U=3,V=3)
########################################################
Edit: Forget all these filters mess above here. I got something working much much better, actually using Stabilise (http://forum.doom9.org/showthread.php?t=100396&page=2) filter + the second routine of my above script. Result is here:
:)
1Mb mp4
http://www.sendspace.com/file/rpjuv5
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.