Advertisement
nanogyth

Untitled

Jul 6th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.87 KB | None | 0 0
  1. :: feos, 2012 (cheers to Guga, Velitha amd nanogyth)
  2. :: This global batch is a part of "TAS Encoding Package":
  3. :: http://tasvideos.org/EncodingGuide/HybridEncodeScript.html
  4. :: Asks whether the console is handheld to autoset the SAR parameter.
  5.  
  6. @echo off
  7.  
  8. :: Restore AVS defaults ::
  9. "./programs/replacetext" "encode.avs" "pass = 0" "pass = 1"
  10. "./programs/replacetext" "encode.avs" "pass = 2" "pass = 1"
  11. "./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
  12. "./programs/replacetext" "encode.avs" "hd = true" "hd = false"
  13. "./programs/replacetext" "encode.avs" "handheld = true" "handheld = false"
  14.  
  15. :: Automatic TV based consoles SAR detection ::
  16. "./programs/avs2pipemod" -info encode.avs > "./temp/info.txt"
  17. FOR /F "tokens=2" %%G IN ('FIND "width" "./temp/info.txt"') DO (SET width=%%G)
  18. FOR /F "tokens=2" %%G IN ('FIND "height" "./temp/info.txt"') DO (SET height=%%G)
  19.  
  20. SET VAR=none
  21. :: gb/gbc/sgg 160x144
  22. if "%width%"=="160" if "%height%"=="144" (
  23.   SET VAR=1:1
  24.   "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
  25. )
  26. :: gba 240x160
  27. if "%width%"=="240" if "%height%"=="160" (
  28.   SET VAR=1:1
  29.   "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
  30. )
  31. :: ds 256x192x2
  32. if "%width%"=="256" if "%height%"=="384" (
  33.   SET VAR=1:1
  34.   "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
  35. )
  36. :: psp 480x272
  37. if "%width%"=="480" if "%height%"=="272" (
  38.   SET VAR=1:1
  39.   "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
  40. )
  41. :: 3ds 400x240x2 + 320x240
  42. :: vita 960x544
  43. if "%width%"=="960" if "%height%"=="544" (
  44.   SET VAR=1:1
  45.   "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
  46. )
  47.  
  48. set /A "SAR_w=4 * %height%"
  49. set /A "SAR_h=3 * %width%"
  50.  
  51. if "%VAR%"=="none" set VAR=%SAR_w%:%SAR_h%
  52.  
  53. :: if "%width%"=="256" if "%height%"=="224" SET VAR=7:6
  54. :: if "%width%"=="256" if "%height%"=="240" SET VAR=5:4
  55. :: if "%width%"=="320" if "%height%"=="224" SET VAR=14:15
  56. :: if "%width%"=="512" if "%height%"=="240" SET VAR=5:8
  57. :: if "%width%"=="320" if "%height%"=="240" SET VAR=1:1
  58. :: if "%VAR%"=="none" SET /P "VAR=Please input SAR: "
  59.  
  60. :: AUDIO ::
  61. "./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q2 - "./temp/audio.ogg"
  62. "./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 4672s | "./programs/neroAacEnc" -q 0.25 -if - -of "./temp/audio.mp4"
  63. "./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q10 - "./temp/audio_youtube.ogg"
  64.  
  65. :: Generate times ::
  66. "./programs/avs2pipemod" -benchmark encode.avs
  67. :: the benchmark takes the place of the x264
  68. :: "./programs/x264" --sar "%VAR%" --keyint infinite --crf 0 --range pc --input-range pc -o NUL encode.avs --preset ultrafast
  69. "./programs/replacetext" "encode.avs" "pass = 1" "pass = 2"
  70.  
  71. :: Primary downloadable ::
  72. "./programs/x264" --threads auto --sar "%VAR%" --crf 20 --keyint 600 --ref 16 --no-fast-pskip --bframes 16 --b-adapt 2 --direct auto --me umh --merange 64 --subme 10 --trellis 2 --partitions all --rc-lookahead 250 --no-dct-decimate --range pc --input-range pc --colormatrix smpte170m --tcfile-in "./temp/times.txt" -o "./temp/video.mkv" encode.avs
  73. PING -n 2 127.0.0.1>nul
  74.  
  75. :: 10bit444 downloadable ::
  76. "./programs/replacetext" "encode.avs" "i444 = false" "i444 = true"
  77. "./programs/x264-10" --threads auto --sar "%VAR%" --crf 20 --keyint 600 --ref 16 --no-fast-pskip --bframes 16 --b-adapt 2 --direct auto --me umh --merange 64 --subme 10 --trellis 2 --partitions all --rc-lookahead 250 --no-dct-decimate --input-range pc --range pc --tcfile-in "./temp/times.txt" -o "./temp/video_10bit444.mkv" --colormatrix smpte170m --output-csp i444 encode.avs
  78. PING -n 2 127.0.0.1>nul
  79.  
  80. :: Archive 512kb stream ::
  81. "./programs/replacetext" "encode.avs" "pass = 2" "pass = 0"
  82. "./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
  83. "./programs/x264" --threads auto --crf 20 --keyint 600 --ref 16 --no-fast-pskip --bframes 16 --b-adapt 2 --direct auto --me umh --merange 64 --subme 10 --trellis 2 --partitions all --rc-lookahead 250 --no-dct-decimate --range tv --input-range tv --colormatrix smpte170m -o "./temp/video_512kb.mp4" encode.avs
  84. PING -n 2 127.0.0.1>nul
  85.  
  86. :: YouTube HD stream ::
  87. "./programs/replacetext" "encode.avs" "hd = false" "hd = true"
  88. "./programs/x264" --qp 0 --keyint 600 --output "./temp/video_youtube.mkv" encode.avs
  89. "./programs/replacetext" "encode.avs" "hd = true" "hd = false"
  90.  
  91. :: MUXING ::
  92. "./programs/mkvmerge" -o "./output/encode.mkv" --timecodes -1:"./temp/times.txt" "./temp/video.mkv" "./temp/audio.ogg"
  93. "./programs/mkvmerge" -o "./output/encode_10bit444.mkv" --timecodes -1:"./temp/times.txt" "./temp/video_10bit444.mkv" "./temp/audio.ogg"
  94. "./programs/MP4Box" -add "./temp/video_512kb.mp4" -add "./temp/audio.mp4" -new "./output/encode_512kb.mp4"
  95. "./programs/mkvmerge" -o "./output/encode_youtube.mkv" --compression -1:none "./temp/video_youtube.mkv" "./temp/audio_youtube.ogg"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement