Bateau

x264 BAT File (last known ver., working but never finished)

Jun 24th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.46 KB | None | 0 0
  1. set file="BECK Boot 02"
  2. set crf=18
  3. set mode=10
  4. set res="696x478"
  5. set fps=60
  6. set source="NTSC_F"
  7.  
  8.  
  9.  
  10. set error=false
  11. set rand=%random%
  12.  
  13. if not exist backup/ (
  14.     mkdir backup
  15. )
  16.  
  17. :while
  18.     if exist backup\%rand%_%file%.mkv (
  19.         set rand=%random%
  20.         goto :while
  21.     ) else (
  22.         echo %date% %time% - batch %rand% has started >> %file%_batlog.txt
  23.     )
  24.  
  25.  
  26.  
  27. set avs2pipemod="C:\TEMP\VID-PGM\avs2pipemod\avs2pipemod.exe"
  28.  
  29.  
  30. if %mode%==8 (
  31.     set x264="C:\TEMP\VID-PGM\x264\x264.exe"
  32.     set demux="avs"
  33.     set depth=8
  34.     set csp="i420"
  35.     set profile="high"
  36. ) else if %mode%==10 (
  37.     set x264="C:\TEMP\VID-PGM\x264\64\x264-10bit.exe"
  38.     set demux="raw"
  39.     set depth=10
  40.     set csp="i420"
  41.     set profile="high10"
  42. ) else if %mode%==444 (
  43.     set x264="C:\TEMP\VID-PGM\x264\64\x264-10bit.exe"
  44.     set demux="raw"
  45.     set depth=10
  46.     set csp="i444"
  47.     set profile="high444"
  48. ) else (
  49.     echo you forgot to set mode >> %file%_batlog.txt
  50.     set error=true
  51. )
  52.  
  53. if %fps%==24 (
  54.     set rate="24000/1001"
  55.     set key=240
  56.     set minkey=24
  57. ) else if %fps%==25 (
  58.     set rate="25000/1000"
  59.     set key=250
  60.     set minkey=25
  61. ) else if %fps%==30 (
  62.     set rate="30000/1001"
  63.     set key=300
  64.     set minkey=30
  65. ) else if %fps%==50 (
  66.     set rate="50000/1000"
  67.     set key=500
  68.     set minkey=50
  69. ) else if %fps%==60 (
  70.     set rate="60000/1001"
  71.     set key=600
  72.     set minkey=60
  73. ) else (
  74.     echo you forgot to set fps >> %file%_batlog.txt
  75.     set error=true
  76. )
  77.  
  78. if %source%=="NTSC_F" (
  79.     set color="smpte170m"
  80.     set ratio="4320:4739"
  81. ) else if %source%=="NTSC_W" (
  82.     set color="smpte170m"
  83.     set ratio="5760:4739"
  84. ) else if %source%=="PAL_F" (
  85.     set color="bt470bg"
  86.     set ratio="128:117"
  87. ) else if %source%=="PAL_W" (
  88.     set color="bt470bg"
  89.     set ratio="512:351"
  90. ) else if %source%=="BD" (
  91.     set color="bt709"
  92.     set ratio="1:1"
  93. ) else (
  94.     echo you forgot to set source >> %file%_batlog.txt
  95.     set error=true
  96. )
  97.  
  98. if %error%==true (
  99.     echo you have an error, check your bat >> %file%_batlog.txt
  100.     exit
  101. ) else (
  102.     echo %date% %time% - encode %rand% has started >> %file%_batlog.txt
  103. )
  104.  
  105.  
  106.  
  107. if %mode%==8 (
  108.     echo mode 8 not setup yet > error.txt
  109.     exit
  110. ) else if %mode%==10 (
  111.     %avs2pipemod% -rawvideo %file%.avs | %x264% --demuxer %demux% --input-depth %depth% --input-csp %csp% --input-res %res% --fps %rate% --profile %profile% --level 5.2 --preset placebo --crf %crf% --thread-input --threads 8 --deblock 0:0 --keyint %key% --min-keyint %minkey% --qcomp 0.75 --no-mbtree --merange 32 --me umh --subme 11 --psy-rd 1.0:0.10 --fade-compensate 0.5 --no-dct-decimate --no-fast-pskip --non-deterministic --colorprim %color% --transfer %color% --colormatrix %color% --sar %ratio% --output %file%.mkv - 2>%file%.mkv.log
  112. ) else if %mode%==444 (
  113.     %avs2pipemod% -rawvideo %file%.avs | %x264% --demuxer %demux% --input-depth %depth% --input-csp %csp% --input-res %res% --fps %rate% --profile %profile% --level 5.2 --preset placebo --crf %crf% --thread-input --threads 8 --deblock 0:0 --keyint %key% --min-keyint %minkey% --qcomp 0.75 --no-mbtree --merange 32 --me umh --subme 11 --psy-rd 1.0:0.10 --fade-compensate 0.5 --no-dct-decimate --no-fast-pskip --non-deterministic --colorprim %color% --transfer %color% --colormatrix %color% --sar %ratio% --output %file%.mkv - 2>%file%.mkv.log
  114. ) else (
  115.     echo you forgot to set a mode >> %file%_batlog.txt
  116.     exit
  117. )
  118.  
  119. echo %date% %time% - encode %rand% has finished >> %file%_batlog.txt
  120.  
  121.  
  122. copy %file%.mkv backup\%rand%_%file%.mkv
  123. copy %file%.mkv.log backup\%rand%_%file%.mkv.log
  124. echo %date% %time% - backup %rand% has been completed >> %file%_batlog.txt
Add Comment
Please, Sign In to add comment