logo Sign In

Post #483363

Author
althor1138
Parent topic
Puggo Strikes Back! (Released)
Link to post in topic
https://originaltrilogy.com/post/id/483363/action/topic#483363
Date created
15-Mar-2011, 12:35 PM

Thorr, it adjusts itself.  As long as the frames are identical in each capture.

I've changed the script so that it automatically will align all three captures of the first reel.  I've added a couple steps but I did a test run last night and this way is far superior to the old version(i'd say it works perfectly). It goes like this.

Step1:  Save this as avs file, input paths, and open it in virtualdub:

#reel1cap3=avisource("PATH TO FILE") #This video will be altered to match source video. Trim so that frames match source.
reel1cap2 = avisource("PATH TO FILE") #This video will be altered to match source video. Trim so that frames match source.
reel1cap1 = avisource("PATH TO FILE") #This is the source video.
blank=reel1cap1.blankclip() #blankclip used for forced scenechange in next line
inter=interleave(reel1cap2,reel1cap1,blank) #This will force a scene change after every comparison of one set of frames.
#inter=interleave(reel1cap2,reel1cap1,blank,reel1cap3,reel1cap1,blank) #This will force a scene change after every comparison of one set of frames.
return(inter)

Step2:

Add the Deshaker filter and configure pass 1.  The only changes I made was this: Scale:FULL,UsePixels:ALL,DeepAnalysis:30%.

Take note of the destination for the log file and press ok. Then you can press F5 to preview output from start.  Let the whole thing finish and then close Vdub and move on to next step.

Step 3:

Save this script to an avs file and input path to files and path to deshaker log. The output will be the average of all 3 captures or you can output each capture individually.

#cap3=avisource("PATH TO FILE") #this video will be altered to match source video. Trim so that frames match source.
cap2=avisource("PATH TO FILE") #this video will be altered to match source video. Trim so that frames match source.
cap1=avisource("PATH TO FILE") #this is the source video.
blank=cap1.blankclip()
#reel1cap3=interleave(cap2,cap1,blank,cap3,cap1,blank).depan(subpixel=2,pixaspect=1.0,inputlog="**PATH TO DESHAKER.LOG**").selectevery(6,3)
#reel1cap2 = interleave(cap2,cap1,blank,cap3,cap1,blank).depan(subpixel=2,pixaspect=1.0,inputlog="**PATH TO DESHAKER.LOG**").selectevery(6,0)
reel1cap2=interleave(cap2,cap1,blank).depan(subpixel=2,pixaspect=1.0,inputlog="**PATH TO DESHAKER.LOG**").selectevery(3,0)
reel1cap1 = cap1

#cap3w=reel1cap3.Width()
#cap3h=reel1cap3.Height()
cap2w = reel1cap2.Width()
cap2h = reel1cap2.Height()
cap1w = reel1cap1.Width()
cap1h = reel1cap1.Height()
borw = (cap1w-cap2w)/2
borh = (cap1h-cap2h)/2
#reel1cap3=reel1cap3.AddBorders((654-reel1cap3.Width)/2, (480-reel1cap3.Height)/2, (654-reel1cap3.Width)/2, (480-reel1cap3.Height)/2, color=$000000)
reel1cap2= reel1cap2.AddBorders((654-reel1cap2.Width)/2, (480-reel1cap2.Height)/2, (654-reel1cap2.Width)/2, (480-reel1cap2.Height)/2, color=$000000)
cap1p = reel1cap1.AddBorders((654-reel1cap1.Width)/2, (480-reel1cap1.Height)/2, (654-reel1cap1.Width)/2, (480-reel1cap1.Height)/2, color=$000000)
int = Interleave(cap1p,reel1cap2)
#int1=Interleave(cap1p,reel1cap3)
est = int.depanestimate(range=1,pixaspect=1,zoommax=1.5,improve=false,trust=0)
#est1=int1.depanestimate(range=1,pixaspect=1,zoommax=1.5,improve=false,trust=0)
dep = int.depaninterleave(est,pixaspect=1,prev=0,next=1,subpixel=2,mirror=0,blur=0)
#dep1=int1.depaninterleave(est1,pixaspect=1,prev=0,next=1,subpixel=2,mirror=0,blur=0)
cap1out=reel1cap1
cap2out = dep.SelectEvery(4, 1)
#cap3out=dep1.SelectEvery(4,1)
#avgcap2cap3=overlay(cap2out,cap3out,mode="blend",opacity=0.5)
#avgcap1cap2cap3=overlay(avgcap2cap3,reel1cap1,mode="blend",opacity=0.33)
maskcap2=mask(cap2out.converttorgb32(),cap2out.converttorgb32()).showalpha().invert()
avgcap1cap2=overlay(cap1out,cap2out,mask=maskcap2.showalpha(),mode="blend",opacity=1,greymask=true)

#return(avgcap1cap2cap3)
return(avgcap1cap2)