Advertisement
Guest User

TelecineExtracter

a guest
Sep 21st, 2012
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1. #Avisynth script to extract progressive frames super 8mm and postprocess from a modified eumig 610D with microswitch connected to microphone input of DSLR
  2. #Most of the good parts in this script is from VideoFred www.super-8.be
  3. # Info on the hardware setup: oysteineliassen.blogspot.com
  4.  
  5. SetMemoryMax(800)
  6.  
  7. #LoadPlugin("D:\telecine\Film_Extractor_v1\GetDups.dll")
  8. LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\qtsource.dll")
  9. LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\removedirt.dll")
  10. LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Antiflicker.dll")
  11.  
  12. Loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Depan.dll")
  13. LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DepanEstimate.dll")
  14. LoadPlugin("plugins/autolevels_06.dll")
  15.  
  16. Import("plugins/03_RemoveDirtMC.avs")
  17.  
  18. v= QTInput("MVI_4124.mov", audio=1 )+QTInput("MVI_4125.mov", audio=1 )
  19. fs_camera = 25
  20. fs_projector = 6
  21.  
  22. #v=FlipHorizontal(v)
  23. v=FlipVertical(v)
  24. start=0#(30)*fs_camera
  25. end=0#(17*60+53)*fs_camera
  26.  
  27. v=Trim(v,start,end)
  28.  
  29.  
  30. #v=ReduceBy2(v)
  31.  
  32. #STABILISING PARAMETERS, YOU REALY MUST USE STABS TO CHECK STABILISATION!
  33. #----------------------------------------------------------------------------------------------------------------------------
  34. maxstabH=20
  35. maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value
  36.  
  37. est_left=200 est_top=200 est_right=200 est_bottom=200 #crop values for special Estimate clip
  38.  
  39. trust_value= 1.0 # scene change detection, higher= more sensitive
  40. cutoff_value= 0.5 # no need to change this, but you can play with it and see what you get
  41.  
  42.  
  43. #COLOR AND LEVELS PARAMATERS
  44. #----------------------------------------------------------------------------------------------------------------------------
  45. saturation=1.2 #for all outputs
  46.  
  47. gamma= 1.2 # for all outputs
  48.  
  49. blue= -10 red= 0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative
  50.  
  51. black_level=0 white_level=235 output_black=0 output_white=255 # manual levels, when returning result4
  52.  
  53.  
  54. #AUTO LEVELS PARAMETERS
  55. #--------------------------------------------------------------------------------------------------------------------------------
  56.  
  57. autolev_low= 0 # limit of autolevels low output
  58. autolev_high= 235 # limit of autolevels high output
  59.  
  60. # SHARPENING PARAMETERS
  61. #--------------------------------------------------------------------------------------------------------------------------------
  62.  
  63. USM_sharp_ness= 38 USM_radi_us= 3 #this is the start value for the unsharpmask sharpening
  64. #do not set radius less then 3
  65. #the script will automatically add two other steps with lower radius
  66.  
  67. #CLEANING PARAMETERS
  68. #--------------------------------------------------------------------------------------------------------------
  69.  
  70. dirt_strenght=40 # set this lower for clean films.
  71.  
  72. #UNSHARPMASK AUTO_PARAMETERS
  73. #-------------------------------------------------------------------------------------------------------------------------------------------
  74.  
  75. USM_sharp_ness1 = USM_sharp_ness
  76. USM_sharp_ness2 = USM_sharp_ness+(USM_sharp_ness/2)
  77. USM_sharp_ness3 = USM_sharp_ness*2
  78.  
  79. USM_radi_us1 = USM_radi_us
  80. USM_radi_us2 = USM_radi_us-1
  81. USM_radi_us3 = USM_radi_us2-1
  82.  
  83. convertAudioTo16Bit(v)
  84.  
  85. n_total = framecount()
  86. n=n_total * fs_projector/fs_camera
  87.  
  88. source=GetDups(mode=1,show=0, audio=2, audio_thr=400, audio_shift =-8)
  89.  
  90. source1= source.trim(0,n).converttoYV12()
  91.  
  92. stab_reference= source1.crop(est_left,est_top,-est_right,-est_bottom).colorYUV(autogain=true)
  93.  
  94. mdata=DePanEstimate(stab_reference,trust=trust_value,dxmax=maxstabH,dymax=maxstabV)
  95. stab2= DePanStabilize(source1,data=mdata,cutoff=cutoff_value,dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15)
  96.  
  97. noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturation)
  98.  
  99. cleaned=RemoveDirtMC(noise_baseclip,dirt_strenght).unsharpmask(USM_sharp_ness1,USM_radi_us1,0).unsharpmask(USM_sharp_ness2,USM_radi_us2,0)
  100.  
  101. # FINAL SHARPENING
  102. #.................................................................................................................................................
  103. sharpened=cleaned.unsharpmask(USM_sharp_ness3,USM_radi_us3,0)
  104.  
  105. sharpened.coloryuv(autowhite=true).converttoRGB24().autolevels(output_low= autolev_low, output_high= autolev_high)\
  106. .converttoYV12()
  107.  
  108.  
  109. Crop(300,0,-400,-50)
  110. w=width()
  111. h=height()
  112. h2=720
  113. w2=h2*w/h
  114. border=(1280-w2)/2
  115. Lanczos4Resize(w2,h2)
  116. addborders(border, 0, border, 0)
  117. #ReduceBy2()
  118. KillAudio()
  119. AssumeFPS(18)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement