Advertisement
sp00n

Avisynth Deshaker Script

Aug 22nd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.52 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4.  
  5. :: path to current directory is %~dp0
  6. SET mypath=%~dp0
  7. SET VirtualDubPath=D:\Programme\VirtualDub\
  8. SET VirtualDub="%VirtualDubPath%VirtualDub.exe"
  9.  
  10.  
  11. :: Create the encode.bat file
  12. echo @echo off > encode.bat
  13.  
  14. :: Clear the job list
  15. echo %VirtualDub% /c /min /x >> encode.bat
  16.  
  17.  
  18. :: Make two rounds to insert the encoding call in the bottom of the encode.bat file
  19. FOR %%a IN (*.mp4) do call :make_1 "%%a" "%%~na"
  20. FOR %%a IN (*.mp4) do call :make_2 "%%a" "%%~na"
  21. goto :end
  22.  
  23.  
  24.  
  25. :: **
  26. :: The make function
  27. :: **
  28. :make_1
  29. SET file=%mypath%%~1
  30. SET deshakerLogRaw=%mypath%Deshaker.%~2.log
  31. SET REPLACE=\\
  32. SET deshakerLog=%deshakerLogRaw:\=!REPLACE!%
  33.  
  34. :: Create the first AVS file
  35. echo LoadVirtualDubPlugin ("%VirtualDubPath%plugins32\Deshaker.vdf", "deshaker", preroll=0) > %2_1.avs
  36. echo FFMpegSource2("%file%", -1, -1) >> %2_1.avs
  37. echo ConverttoRGB32() >> %2_1.avs
  38. echo Deshaker("19|1|30|4|1|0|1|0|640|480|1|2|100|250|0|0|4|0|1|2|8|30|300|4|%deshakerLog%|0|1|360|360|0|0|0|0|0|0|0|0|0|1|7|15|0.1|0.1|1|1|1|1|0|0|1|0|1|1|1|5|1000|1|95|1|1|20|5000|100|20|1|0|ff00ff") >> %2_1.avs
  39.  
  40. :: Insert into the encode.bat file
  41. echo %VirtualDub% /s "I:\GoPro\Lagarith.RGB.vdscript" /p "%mypath%%~2_1.avs","%mypath%%~2%.Deshaker.avi" /min /x >> encode.bat
  42. goto :eof
  43.  
  44.  
  45.  
  46. :: **
  47. :: The second make function to insert the actual encoding to the bottom of the encode batch file
  48. :: **
  49. :make_2
  50. SET file=%mypath%%~1
  51. SET deshakerLogRaw=%mypath%Deshaker.%~2.log
  52. SET REPLACE=\\
  53. SET deshakerLog=%deshakerLogRaw:\=!REPLACE!%
  54.  
  55. :: Create the second AVS file
  56. echo LoadVirtualDubPlugin ("%VirtualDubPath%\plugins32\Deshaker.vdf", "deshaker", preroll=0) > %2_2.avs
  57. echo LoadPlugin("D:\Programme\VideoEditing\AviSynth\plugins\SimpleResize.dll") >> %2_2.avs
  58. echo FFMpegSource2("%file%", -1, -1) >> %2_2.avs
  59. echo ConverttoRGB32() >> %2_2.avs
  60. echo Deshaker("19|2|30|4|1|0|1|0|640|480|1|2|100|250|0|0|4|0|1|2|8|30|300|4|%deshakerLog%|0|1|360|360|0|0|0|0|0|0|0|0|0|1|7|15|0.1|0.1|1|1|1|1|0|0|1|0|1|1|1|5|1000|1|95|1|1|20|5000|100|20|1|0|ff00ff") >> %2_2.avs
  61. echo ConvertToYV12 >> %2_2.avs
  62. echo ConvertToYUY2 >> %2_2.avs
  63. echo WarpedResize(2560, 1440, 0.75, 1) # (width, height, hWarp, vWarp) >> %2_2.avs
  64. echo ConvertToYV12 >> %2_2.avs
  65.  
  66. :: Insert into the encode.bat file
  67. echo %VirtualDub% /s "I:\GoPro\Lagarith.RGB.vdscript" /p "%mypath%%~2_2.avs","%mypath%%~2%.Deshaker.16-9.avi" /min /x >> encode.bat
  68. goto :eof
  69.  
  70.  
  71.  
  72. :: **
  73. :: The ending function
  74. :: **
  75. :end
  76. :: Run the job list
  77. echo %VirtualDub% /r >> encode.bat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement