Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: feos, 2012 (cheers to Guga, Velitha amd nanogyth)
- :: This global batch is a part of "TAS Encoding Package":
- :: http://tasvideos.org/EncodingGuide/HybridEncodeScript.html
- :: Asks whether the console is handheld to autoset the SAR parameter.
- @echo off
- :: Restore AVS defaults ::
- "./programs/replacetext" "encode.avs" "pass = 0" "pass = 1"
- "./programs/replacetext" "encode.avs" "pass = 2" "pass = 1"
- "./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
- "./programs/replacetext" "encode.avs" "hd = true" "hd = false"
- "./programs/replacetext" "encode.avs" "handheld = true" "handheld = false"
- :: Automatic TV based consoles SAR detection ::
- "./programs/avs2pipemod" -info encode.avs > "./temp/info.txt"
- FOR /F "tokens=2" %%G IN ('FIND "width" "./temp/info.txt"') DO (SET width=%%G)
- FOR /F "tokens=2" %%G IN ('FIND "height" "./temp/info.txt"') DO (SET height=%%G)
- SET VAR=none
- :: gb/gbc/sgg 160x144
- if "%width%"=="160" if "%height%"=="144" (
- SET VAR=1:1
- "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
- )
- :: gba 240x160
- if "%width%"=="240" if "%height%"=="160" (
- SET VAR=1:1
- "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
- )
- :: ds 256x192x2
- if "%width%"=="256" if "%height%"=="384" (
- SET VAR=1:1
- "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
- )
- :: psp 480x272
- if "%width%"=="480" if "%height%"=="272" (
- SET VAR=1:1
- "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
- )
- :: 3ds 400x240x2 + 320x240
- :: vita 960x544
- if "%width%"=="960" if "%height%"=="544" (
- SET VAR=1:1
- "./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
- )
- set /A "SAR_w=4 * %height%"
- set /A "SAR_h=3 * %width%"
- if "%VAR%"=="none" set VAR=%SAR_w%:%SAR_h%
- :: if "%width%"=="256" if "%height%"=="224" SET VAR=7:6
- :: if "%width%"=="256" if "%height%"=="240" SET VAR=5:4
- :: if "%width%"=="320" if "%height%"=="224" SET VAR=14:15
- :: if "%width%"=="512" if "%height%"=="240" SET VAR=5:8
- :: if "%width%"=="320" if "%height%"=="240" SET VAR=1:1
- :: if "%VAR%"=="none" SET /P "VAR=Please input SAR: "
- :: AUDIO ::
- "./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q2 - "./temp/audio.ogg"
- "./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 4672s | "./programs/neroAacEnc" -q 0.25 -if - -of "./temp/audio.mp4"
- "./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q10 - "./temp/audio_youtube.ogg"
- :: Generate times ::
- "./programs/avs2pipemod" -benchmark encode.avs
- :: the benchmark takes the place of the x264
- :: "./programs/x264" --sar "%VAR%" --keyint infinite --crf 0 --range pc --input-range pc -o NUL encode.avs --preset ultrafast
- "./programs/replacetext" "encode.avs" "pass = 1" "pass = 2"
- :: Primary downloadable ::
- "./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
- PING -n 2 127.0.0.1>nul
- :: 10bit444 downloadable ::
- "./programs/replacetext" "encode.avs" "i444 = false" "i444 = true"
- "./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
- PING -n 2 127.0.0.1>nul
- :: Archive 512kb stream ::
- "./programs/replacetext" "encode.avs" "pass = 2" "pass = 0"
- "./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
- "./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
- PING -n 2 127.0.0.1>nul
- :: YouTube HD stream ::
- "./programs/replacetext" "encode.avs" "hd = false" "hd = true"
- "./programs/x264" --qp 0 --keyint 600 --output "./temp/video_youtube.mkv" encode.avs
- "./programs/replacetext" "encode.avs" "hd = true" "hd = false"
- :: MUXING ::
- "./programs/mkvmerge" -o "./output/encode.mkv" --timecodes -1:"./temp/times.txt" "./temp/video.mkv" "./temp/audio.ogg"
- "./programs/mkvmerge" -o "./output/encode_10bit444.mkv" --timecodes -1:"./temp/times.txt" "./temp/video_10bit444.mkv" "./temp/audio.ogg"
- "./programs/MP4Box" -add "./temp/video_512kb.mp4" -add "./temp/audio.mp4" -new "./output/encode_512kb.mp4"
- "./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