Advertisement
Guest User

Untitled

a guest
Nov 6th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. @Echo offSetlocal enableextensions
  2. ::******************************************************************************​***************
  3. ::*** AutoRipDVD is brought to you by Spinalcracker
  4. ::******************************************************************************​***************
  5. ::
  6. ::******************************************************************************​***************
  7. ::*** Change the following variables to match your setup
  8. ::******************************************************************************​***************
  9. ::
  10. ::*** DriveLetter=The drive letter of your DVD or Blu-Ray drive ie. D: or G: etc
  11. ::
  12. ::------------------------------
  13. Set DriveLetter=D:
  14. ::------------------------------
  15. ::
  16. ::*** RipDir=Where you want your DVD ripped to ie. your xbmc movie folder *BE SURE TO INCLUDE TRAILING \
  17. ::
  18. ::------------------------------
  19. Set RipDir=C:\Documents and Settings\user1\My Documents\My Videos\
  20. ::------------------------------
  21. ::
  22. ::*** IntDir=Where you installed MakeMKV to
  23. ::
  24. ::----------------------------------------
  25. Set IntDir=C:\Program Files\MakeMKV\
  26. ::----------------------------------------
  27. ::
  28. ::*** ScriptPath=Where the files for this script are located with trailing "\" ie. Where AutoRipComplete.vbs & Beep.vbs are located *BE SURE TO INCLUDE TRAILING \
  29. ::
  30. ::------------------------------------
  31. Set ScriptPath=C:\Program Files (x86)\AutoRipDVD\
  32. ::------------------------------------
  33. ::
  34. ::*** RipMinSeconds=Minimum time in seconds that should be ripped off disk to avoid getting previews etc. Default is 3600 seconds or 1 hour
  35. ::
  36. ::---------------------
  37. Set RipMinSeconds=3600
  38. ::---------------------
  39. ::
  40. ::*** Using Handbrake to compress - Yes or No?
  41. ::
  42. ::------------------------------------
  43. Set Handbrake=yes
  44. ::------------------------------------
  45. ::
  46. ::*** Sets the install path to handbrake
  47. ::
  48. ::------------------------------------
  49. Set Handbrakepath=C:\Program Files\Handbrake
  50. ::------------------------------------
  51. ::
  52. ::*** Sets the level of compression in Handbrake so unless you really know what you are doing, do NOT adjust this next setting!
  53. ::
  54. ::------------------------------------
  55. Set X264=b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all
  56. ::------------------------------------
  57. ::
  58. ::*** Sets the format of the new compressed file, so again, unless you know what you are doing, please leave it as mkv!
  59. ::
  60. ::------------------------------------
  61. Set FORMAT=--optimize --format mkv
  62. ::------------------------------------
  63. ::
  64. ::*** Sets the quality to something visually appealing but in a small files size - play with this if your outcome isn't to your liking
  65. ::
  66. ::------------------------------------
  67. Set QUALITY=--ab 160 --mixdown stereo --quality 23 -e x264 -x %X264%
  68. ::------------------------------------
  69. ::
  70. ::*** Sets the output to 720p resolution - change if you prefer something else
  71. ::
  72. ::------------------------------------
  73. Set SIZE=--width 1280 --height 720
  74. ::------------------------------------
  75. ::
  76. ::******************************************************************************​***************
  77. ::******************************************************************************​***************
  78. ::******* DO NOT EDIT ANYTHING BELOW THIS!!!!!!************************************************
  79. ::******************************************************************************​***************
  80. ::******************************************************************************​***************
  81.  
  82.  
  83.  
  84. ::For /f %%# In ('Mountvol^|Findstr [d-z]:\\') Do (
  85. :: Fsutil fsinfo drivetype %%#|Find "CD-ROM">Nul&&(Set "CDROM=%%~d#"))
  86. ::If Not Defined CDROM call :NoDrive
  87.  
  88.  
  89. for /f "tokens=1-5*" %%1 in ('vol %DriveLetter%') do (
  90. set volid=%%6 & goto processcontd
  91. )
  92.  
  93. :processcontd
  94. set nospace=%volid%
  95. echo [%nospace%]
  96. echo.
  97. for /f "tokens=* delims= " %%A in ('echo %nospace% ') do set nospace=%%A
  98. set nospace=%nospace:~0,-1%
  99. echo [%nospace%]
  100. set volid=%nospace%
  101. echo: %volid%
  102.  
  103. set str=%volid%
  104. echo.%str%
  105. set str=%str:_= %
  106. echo.%str%
  107. set volid=%str%
  108. If "%volid%"=="_= " call :NoDrive
  109.  
  110. Echo:Ripping %volid% now...
  111.  
  112. mkdir "%RipDir%%volid%"
  113.  
  114. cd /d "%ScriptPath%"
  115. OSDAutoRip.hta
  116.  
  117. cd /d "%IntDir%"
  118. makemkvcon.exe --minlength=%RipMinSeconds% mkv disc:0 all "%RipDir%%volid%"
  119.  
  120. SET _tmpPath="%RipDir%%volid%"
  121. cd /d %_tmpPath%
  122. for %%i in ("title*.mkv") do (set fname=%%i) & call :rename
  123.  
  124. If %Handbrake%==Yes call :HBEncode
  125.  
  126. cd /d "%ScriptPath%"
  127. AutoRipComplete.vbs
  128. cscript Beep.vbs
  129. exit
  130.  
  131. :NoDrive
  132. cd /d "%ScriptPath%"
  133. cscript Beep.vbs
  134. NoDiskDrive.hta
  135. AutoRipComplete.vbs
  136. exit
  137.  
  138. :HBEncode
  139. cd /d "%Handbrakepath%"
  140. HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
  141. cd /d %_tmpPath%
  142. del "%volid%_*.mkv"
  143.  
  144. :rename
  145. ::Cuts off 1st 5 characters of fname, then appends prefix
  146. ren %fname% "%volid%"_%fname:~5%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement