SHARE
TWEET

Dreamcast Guides : Family Guy's KVCD SFD Script (FIXED)

atreyu187 Jan 4th, 2013 468 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @ECHO OFF
  2.  
  3.  
  4. REM 0:no  1:yes
  5. SET %downaudio=0
  6. SET %adxsample=22050
  7. SET %adxchannel=2
  8.  
  9. REM 0:no  1:yes
  10. SET %downvideo=1
  11. REM Keep -r and -b to change, blank to use dafault values (source fps, 200k bitrate)
  12. SET %m1vfps= -r 24
  13. SET %m1vbitrate= -b 1500k
  14.  
  15. REM kvcd quantization matrix for optimal quality and compression, thanks atreyu187 for the tip!
  16. set %inter_matrix=-inter_matrix 16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44
  17. set %intra_matrix=-intra_matrix 8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
  18.  
  19.  
  20. ECHO.
  21. ECHO Demuxing...
  22. ECHO.
  23.  
  24. cd in
  25. for %%1 in (*.sfd) do ..\demux %%1 ..\out\%%~n1
  26. cd ..\out
  27. ren *.m2v *.m1v
  28. ren *.m2a *.sfa
  29.  
  30. IF %downvideo%==0 goto AUDIO
  31.  
  32. ECHO.
  33. ECHO Downsampling video ...
  34. ECHO.
  35.  
  36. mkdir old
  37. move *.m1v old >nul
  38. cd old
  39. FOR %%1 in (*.m?v) do (
  40. cd ..\..
  41. ffmpeg -y -i out\old\%%1 -pass 1 -passlogfile log %m1Vbitrate% %m1vfps% %intra_matrix% %inter_matrix% junk%%~x1
  42. ffmpeg -y -i out\old\%%1 -pass 2 -passlogfile log %m1Vbitrate% %m1vfps% %intra_matrix% %inter_matrix% out\%%1
  43. cd out\old
  44. )
  45. cd ..\..
  46. del *.log >nul
  47. del junk.*
  48. rmdir /s /q out\old
  49.  
  50.  
  51.  
  52. :AUDIO
  53.  
  54. IF %downaudio%==0 GOTO END
  55.  
  56. ECHO.
  57. ECHO Downsampling audio ...
  58. ECHO.
  59.  
  60. cd out
  61. mkdir old
  62. move *.sfa old >nul
  63. cd old
  64. copy ..\..\adx2wav.exe adx2wav.exe >nul
  65. copy ..\..\sox.exe sox.exe >nul
  66. copy ..\..\adxencd.exe ..\adxencd.exe >nul
  67. FOR %%1 in (*.sfa) do adx2wav %%1
  68. FOR %%1 in (*.wav) do sox %%1 -r %adxsample% -c %adxchannel% ..\%%1
  69. cd ..
  70. FOR %%1 in (*.wav) do adxencd %%1 .\
  71. del old\adx2wav.exe >nul
  72. del old\sox.exe >nul
  73. del adxencd.exe >nul
  74. del *.wav >nul
  75. rmdir /s /q old
  76. cd ..
  77.  
  78. ECHO.
  79. ECHO.
  80. ECHO Now please run ADXConverter.exe on the out folder in ADX to SFA mode!
  81. ECHO Press a key when done!
  82. ECHO.
  83. ECHO.
  84. pause >nul
  85.  
  86. :END
  87.  
  88. ECHO.
  89. ECHO Multiplexing sfd files ...
  90. ECHO.
  91.  
  92. copy sfdmux.exe out\sfdmux.exe >nul
  93. copy sfdmux.dll out\sfdmux.dll >nul
  94. cd out
  95. FOR %%1 in (..\in\*.sfd) do sfdmux -A=%%~n1_c0.sfa -V=%%~n1_e0.m1v -S=%%~n1.sfd
  96. del *.sfa >nul
  97. del *.adx >nul
  98. del *.m1v >nul
  99. del sfdmux.exe >nul
  100. del sfdmux.dll >nul
  101. cd ..
  102.  
  103. ECHO.
  104. ECHO DONE!
  105. ECHO.
  106.  
  107. pause
  108.  
  109.  
  110. @ECHO OFF
  111.  
  112.  
  113. REM 0:no  1:yes
  114. SET %downaudio=0
  115. SET %adxsample=22050
  116. SET %adxchannel=2
  117.  
  118. REM 0:no  1:yes
  119. SET %downvideo=1
  120. REM Keep -r and -b to change, blank to use dafault values (source fps, 200k bitrate)
  121. SET %m1vfps= -r 24
  122. SET %m1vbitrate= -b 1500k
  123.  
  124. REM kvcd quantization matrix for optimal quality and compression, thanks atreyu187 for the tip!
  125. set %inter_matrix=-intermatrix 16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44
  126. set %intra_matrix=-intramatrix 8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
  127.  
  128.  
  129. ECHO.
  130. ECHO Demuxing...
  131. ECHO.
  132.  
  133. cd in
  134. for %%1 in (*.sfd) do ..\demux %%1 ..\out\%%~n1
  135. cd ..\out
  136. ren *.m2v *.m1v
  137. ren *.m2a *.sfa
  138.  
  139. IF %downvideo%==0 goto AUDIO
  140.  
  141. ECHO.
  142. ECHO Downsampling video ...
  143. ECHO.
  144.  
  145. mkdir old
  146. move *.m1v old >nul
  147. cd old
  148. FOR %%1 in (*.m?v) do (
  149. cd ..\..
  150. ffmpeg -y -i out\old\%%1 -pass 1 -passlogfile log %m1Vbitrate% %m1vfps% %intra_matrix% %inter_matrix% junk%%~x1
  151. ffmpeg -y -i out\old\%%1 -pass 2 -passlogfile log %m1Vbitrate% %m1vfps% %intra_matrix% %inter_matrix% out\%%1
  152. cd out\old
  153. )
  154. cd ..\..
  155. del *.log >nul
  156. del junk.*
  157. rmdir /s /q out\old
  158.  
  159.  
  160.  
  161. :AUDIO
  162.  
  163. IF %downaudio%==0 GOTO END
  164.  
  165. ECHO.
  166. ECHO Downsampling audio ...
  167. ECHO.
  168.  
  169. cd out
  170. mkdir old
  171. move *.sfa old >nul
  172. cd old
  173. copy ..\..\adx2wav.exe adx2wav.exe >nul
  174. copy ..\..\sox.exe sox.exe >nul
  175. copy ..\..\adxencd.exe ..\adxencd.exe >nul
  176. FOR %%1 in (*.sfa) do adx2wav %%1
  177. FOR %%1 in (*.wav) do sox %%1 -r %adxsample% -c %adxchannel% ..\%%1
  178. cd ..
  179. FOR %%1 in (*.wav) do adxencd %%1 .\
  180. del old\adx2wav.exe >nul
  181. del old\sox.exe >nul
  182. del adxencd.exe >nul
  183. del *.wav >nul
  184. rmdir /s /q old
  185. cd ..
  186.  
  187. ECHO.
  188. ECHO.
  189. ECHO Now please run ADXConverter.exe on the out folder in ADX to SFA mode!
  190. ECHO Press a key when done!
  191. ECHO.
  192. ECHO.
  193. pause >nul
  194.  
  195. :END
  196.  
  197. ECHO.
  198. ECHO Multiplexing sfd files ...
  199. ECHO.
  200.  
  201. copy sfdmux.exe out\sfdmux.exe >nul
  202. copy sfdmux.dll out\sfdmux.dll >nul
  203. cd out
  204. FOR %%1 in (..\in\*.sfd) do sfdmux -A=%%~n1_c0.sfa -V=%%~n1_e0.m1v -S=%%~n1.sfd
  205. del *.sfa >nul
  206. del *.adx >nul
  207. del *.m1v >nul
  208. del sfdmux.exe >nul
  209. del sfdmux.dll >nul
  210. cd ..
  211.  
  212. ECHO.
  213. ECHO DONE!
  214. ECHO.
  215.  
  216. pause
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top