Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th April 2010, 18:51   #1  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
film gate wave/shaking in part of frame

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
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 17th May 2010 at 16:56. Reason: title
Dogway is offline   Reply With Quote
Old 29th April 2010, 18:55   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
What is the title and region of the DVD?
Guest is offline   Reply With Quote
Old 30th April 2010, 01:15   #3  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
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, 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.
lansing is offline   Reply With Quote
Old 30th April 2010, 13:40   #4  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
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:

Quote:
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)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 30th April 2010 at 13:57.
Dogway is offline   Reply With Quote
Old 30th April 2010, 17:26   #5  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
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.
lansing is offline   Reply With Quote
Old 30th April 2010, 18:33   #6  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
yes, I have it. But Id to stick to my everyday plugins. Cant it be done with MVTools 2.0?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 30th April 2010, 22:28   #7  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
for the conversion I don't know
lansing is offline   Reply With Quote
Old 30th April 2010, 22:42   #8  |  Link
Stephen R. Savage
Registered User
 
Stephen R. Savage's Avatar
 
Join Date: Nov 2009
Posts: 327
Quote:
Originally Posted by Dogway View Post
yes, I have it. But Id to stick to my everyday plugins. Cant it be done with MVTools 2.0?
Code:
########################################################
_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.

Last edited by Stephen R. Savage; 1st May 2010 at 21:59. Reason: Typo
Stephen R. Savage is offline   Reply With Quote
Old 1st May 2010, 03:14   #9  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Quote:
Originally Posted by Stephen R. Savage View Post
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. 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...
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 1st May 2010, 13:38   #10  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 1st May 2010, 15:41   #11  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
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
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 1st May 2010, 16:47   #12  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Dogway View Post
@ 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.

Quote:
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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 1st May 2010, 21:07   #13  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
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.
Lyris is offline   Reply With Quote
Old 3rd May 2010, 02:43   #14  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
I see, its called jitter (in a different mean of shake), I think it refers to the intra-shaking/waving artifacts. This 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 is a cool thread discussing the same matter. This one is another plugin (for another image processor) for the described case.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 3rd May 2010, 19:12   #15  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
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.
Lyris is offline   Reply With Quote
Old 3rd May 2010, 20:10   #16  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
And dont you think this is a captured VHS source packed into a DVD?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 4th May 2010, 00:20   #17  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
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.
Lyris is offline   Reply With Quote
Old 9th May 2010, 16:21   #18  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
I have been nailing my script in respect of internal fluctuations. I found a script in the Despot manual which relates to this same matter, Im using the last example together with the script 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?
Quote:
#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.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 9th May 2010 at 16:40.
Dogway is offline   Reply With Quote
Old 14th May 2010, 16:41   #19  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
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!

Quote:
#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)
########################################################
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 17th May 2010, 13:24   #20  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
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.
2Bdecided is offline   Reply With Quote
Reply

Tags
bake, dejitter, deshake, stab, wave

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.