digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Line TBC with Avisynth script? (https://www.digitalfaq.com/forum/video-restore/10099-line-tbc-avisynth.html)

jjdd 11-07-2019 05:14 AM

Line TBC with Avisynth script?
 
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)
}


lordsmurf 11-13-2019 11:45 PM

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.

jjdd 11-14-2019 12:05 AM

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

jjdd 11-14-2019 01:43 AM

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


All times are GMT -5. The time now is 06:58 PM

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