Quantcast Line TBC with Avisynth script? - digitalFAQ Forum
  #1  
11-07-2019, 05:14 AM
jjdd jjdd is offline
Free Member
 
Join Date: Jul 2012
Posts: 33
Thanked 1 Time in 1 Post
Hi maby someone know how to tweak this line tbc sortof or it align all field lines after a reference clip

itīs very slow

example Clip A is a bad align clip and Clip B is the good align clip of the same video or movie as Clip A

NonlinUSM you can find here http://avisynth.nl/index.php/NonlinUSM

Code:
#SetMemoryMax(1920)
#SetMTMode(1,8)

a=AVISource("D:\titanic\titanicSvideo_EDIT720.avi").Trim(463,2463)
b=AVISource("D:\titanic\titanicES10NoTBC_EDIT720.avi").Trim(17,2017)#.crop(0,0,-70,-0).AddBorders(70,0,0,0)# ES10 Capture

aa=a.AssumeTFF().SeparateFields()
bb=b.AssumeTFF().SeparateFields()

#287 or 288x2=576 Lines PAL
return stackverticaln(aa,bb,287).FlipVertical().Weave()

function stackverticaln(clip v,clip vv, int n) {
  n<1?get_line(v,vv,n):stackvertical(get_line(v,vv,n),stackverticaln(v,vv,n-1))
}

function get_line(clip aa,clip bb,int field_line)
{
line=field_line
top=line
bottom=287-line
clipf=aa.crop(0,top,-0,-bottom)

a_ref = aa.ConvertToYV12().NonlinUSM(60.0,2.6,6.0,8.5).greyscale().ConvertToYUY2().crop(0,top,-0,-bottom).AddBorders(0,0,0,1)
b_ref = bb.ConvertToYV12().NonlinUSM(60.0,2.6,6.0,8.5).greyscale().ConvertToYUY2().crop(0,top,-0,-bottom).AddBorders(0,0,0,1)

c_ref = Interleave(a_ref, b_ref)
mdata = DePanEstimate(c_ref,trust=0.01,dxmax=80,dymax=0)

c_stab = DePan(Interleave(clipf,clipf), data=mdata,offset=1,subpixel=2)

bb_stab = c_stab.SelectEvery(4, 1)
bbb_stab = c_stab.SelectEvery(4, 3)

return Interleave(bb_stab,bbb_stab)
}
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
11-13-2019, 11:45 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,587
Thanked 1,418 Times in 1,244 Posts
I'm not really clear on what's happening here. It separates fields, blurs/sharpens and stabilizes.

That's not TBC.

At very best, that may hide timing errors, but that's true of any temporal blurring, or blurring in general. It's not pretty, but it can sometimes make terrible video more tolerable. Not enjoyable, just tolerable.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #3  
11-14-2019, 12:05 AM
jjdd jjdd is offline
Free Member
 
Join Date: Jul 2012
Posts: 33
Thanked 1 Time in 1 Post
Hi SeparateFields() i use it to deinterlace so i can compare line after line to the reference clip

about this avisynth script i was thinking if itīs possible to run the same video or movie 2 times one time without ES10 and one time with ES10

and then align line by line the clip without ES10 to get it as good as with ES10 clip but without ES10īs DNR effects




Code:
a_ref = aa.ConvertToYV12().NonlinUSM(60.0,2.6,6.0,8.5).greyscale().ConvertToYUY2().crop(0,top,-0,-bottom).AddBorders(0,0,0,1) 
b_ref = bb.ConvertToYV12().NonlinUSM(60.0,2.6,6.0,8.5).greyscale().ConvertToYUY2().crop(0,top,-0,-bottom).AddBorders(0,0,0,1) 

c_ref = Interleave(a_ref, b_ref)

mdata = DePanEstimate(c_ref,trust=0.01,dxmax=80,dymax=0)

#this compare one line from Clip A to Clip B(the reference clip)
stackverticaln function calls get_line function 287 times to get a full frame so stackverticaln function stacks vertical all the lines it gets from the get_line function line by line

get_line function returns one line from Clip A but with the horizontal Offset that Clip B has




the sharpens that i do does not effect the final frame at all i only do the sharpens because the compare funtion DePanEstimate works better to compare the clips

if i understand correct DePanEstimate returns only the offset data that can be use to other functions

Last edited by jjdd; 11-14-2019 at 12:45 AM.
Reply With Quote
  #4  
11-14-2019, 01:43 AM
jjdd jjdd is offline
Free Member
 
Join Date: Jul 2012
Posts: 33
Thanked 1 Time in 1 Post
if you edit like this for example it only stacks 10 lines in the middle of the frame and works mush faster to good for testing

Code:
return stackverticaln(aa,bb,135).FlipVertical().Weave() 

function stackverticaln(clip v,clip vv, int n){
 n<125?get_line(v,vv,n):stackvertical(get_line(v,vv,n),stackverticaln(v,vv,n-1))
}

stackverticaln function loops and stack vertical line number 135,134,133,132,131,130,129,128,127,126,125
Reply With Quote
Reply




Tags
align, tbc

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth can't open script? What am I doing wrong? unclescoob Restore, Filter, Improve Quality 14 03-27-2019 11:03 AM
Doubling Avisynth script to remove comets? sirbyron Restore, Filter, Improve Quality 19 01-20-2019 08:55 PM
Problem with custom script in Avisynth to stabilize video? benzio Restore, Filter, Improve Quality 0 03-07-2018 11:27 AM
VCR simulator script, Avisynth fake VHS look! jmac698 Restore, Filter, Improve Quality 1 02-12-2018 06:17 AM
Avisynth script to fix offset interlacing? lordsmurf Restore, Filter, Improve Quality 4 02-10-2018 05:34 PM

Thread Tools



 
All times are GMT -5. The time now is 08:14 AM