-
Notifications
You must be signed in to change notification settings - Fork 5
/
global.bat
171 lines (157 loc) · 6.77 KB
/
global.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
:: feos, 2013 (cheers to Guga, Velitha and nanogyth)
:: This global batch is a part of "TAS Encoding Package":
:: http://tasvideos.org/EncodingGuide/HybridEncodeScript.html
:: Asks whether the console is TV based to autoset the SAR parameter.
:: Allows to select the encode to make.
@echo off
:: Restore AVS defaults ::
"./programs/replacetext" "encode.avs" "pass = 1" "pass = 0"
"./programs/replacetext" "encode.avs" "pass = 2" "pass = 0"
"./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
"./programs/replacetext" "encode.avs" "hd = true" "hd = false"
echo.
echo -----------------------
echo Hybrid Encoding Batch
echo -----------------------
echo.
: SAR OPTIONS
echo Is this a TV based console? (y/n)
set /p ANSWER=
if "%ANSWER%"=="y" goto TV sar
if "%ANSWER%"=="n" goto handheld sar
echo I'm not kidding!
goto SAR OPTIONS
: TV sar
"./programs/replacetext" "encode.avs" "handheld = true" "handheld = false"
"./programs/replacetext" "encode.avs" "pass = 0" "pass = 1"
"./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 /a "SAR_w=4 * %height%"
set /a "SAR_h=3 * %width%"
set VAR=%SAR_w%:%SAR_h%
"./programs/replacetext" "encode.avs" "pass = 1" "pass = 0"
goto ENCODE OPTIONS
: handheld sar
set VAR=1:1
"./programs/replacetext" "encode.avs" "handheld = false" "handheld = true"
goto ENCODE OPTIONS
: ENCODE OPTIONS
echo.
echo What encode do you want to do?
echo.
echo Press 1 for Modern HQ MKV.
echo Press 2 for Compatibility MP4.
echo Press 3 for HD Stream.
echo Press 4 for All of the above.
echo Press 5 for extra HQ encodes.
: Set choice
set /p EncodeChoice=
if "%EncodeChoice%"=="1" goto 10bit444
if "%EncodeChoice%"=="2" goto 512kb
if "%EncodeChoice%"=="3" goto HD
if "%EncodeChoice%"=="4" goto 10bit444
if "%EncodeChoice%"=="5" goto ExtraHQ
echo.
echo You better choose something real!
goto Set choice
: 10bit444
:: Audio ::
"./programs/avs2pipemod" -wav encode.avs | "./programs/opusenc" --bitrate 64 - "./temp/audio.opus"
echo.
echo ----------------------
echo Generating timecodes
echo ----------------------
echo.
:: Timecodes ::
"./programs/replacetext" "encode.avs" "pass = 0" "pass = 1"
"./programs/avs2pipemod" -benchmark encode.avs
"./programs/replacetext" "encode.avs" "pass = 1" "pass = 2"
echo.
echo --------------------------------
echo Encoding 10bit444 downloadable
echo --------------------------------
echo.
:: Video ::
"./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 tesa --merange 64 --subme 11 --trellis 2 --partitions all --no-dct-decimate --input-range pc --range pc --tcfile-in "./temp/times.txt" -o "./temp/video.mkv" --colormatrix smpte170m --output-csp i444 encode.avs
:: Muxing ::
"./programs/mkvmerge" -o "./output/encode.mkv" --timecodes -1:"./temp/times.txt" "./temp/video.mkv" "./temp/audio.opus"
if "%EncodeChoice%"=="1" goto Defaults
: 512kb
:: Audio ::
"./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 4672s | "./programs/neroAacEnc" -q 0.25 -if - -of "./temp/audio.mp4"
echo -------------------------------
echo Encoding Archive 512kb stream
echo -------------------------------
echo.
:: Video ::
"./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 tesa --merange 64 --subme 11 --trellis 2 --partitions all --no-dct-decimate --range tv --input-range tv --colormatrix smpte170m -o "./temp/video_512kb.mp4" encode.avs
:: Muxing ::
"./programs/MP4Box" -hint -add "./temp/video_512kb.mp4" -add "./temp/audio.mp4" -new "./output/encode_512kb.mp4"
if "%EncodeChoice%"=="2" goto Defaults
: HD
:: Audio ::
"./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q10 - "./temp/audio_youtube.ogg"
echo.
echo ----------------------------
echo Encoding YouTube HD stream
echo ----------------------------
echo.
:: Video ::
"./programs/replacetext" "encode.avs" "hd = false" "hd = true"
"./programs/x264" --qp 5 -b 0 --keyint infinite --output "./temp/video_youtube.mkv" encode.avs
"./programs/replacetext" "encode.avs" "hd = true" "hd = false"
:: Muxing ::
"./programs/mkvmerge" -o "./output/encode_youtube.mkv" --compression -1:none "./temp/video_youtube.mkv" "./temp/audio_youtube.ogg"
echo.
echo -----------------------------
echo Uploading YouTube HD stream
echo -----------------------------
echo.
"./programs\tvcman.exe" "./output/encode_youtube.mkv" todo tasvideos < "./programs/ytdesc.txt"
start https://encoders.tasvideos.org/status.html
goto Defaults
: ExtraHQ
:: Extra 10bit444 ::
:: Audio ::
"./programs/avs2pipemod" -wav encode.avs | "./programs/opusenc" --bitrate 64 - "./temp/audio_extra.opus"
echo.
echo ----------------------
echo Generating timecodes
echo ----------------------
echo.
:: Timecodes ::
"./programs/replacetext" "encode.avs" "pass = 0" "pass = 1"
"./programs/avs2pipemod" -benchmark encode.avs
"./programs/replacetext" "encode.avs" "pass = 1" "pass = 2"
echo.
echo --------------------------------
echo Encoding ExtraHQ downloadable
echo --------------------------------
echo.
:: Video ::
"./programs/replacetext" "encode.avs" "i444 = false" "i444 = true"
"./programs/x264-10" --threads auto --sar "%VAR%" --crf 20 --keyint 600 --preset veryslow --input-range pc --range pc --tcfile-in "./temp/times.txt" -o "./temp/video_extra.mkv" --colormatrix smpte170m --output-csp i444 encode.avs
:: Muxing ::
"./programs/mkvmerge" -o "./output/encode_extra.mkv" --timecodes -1:"./temp/times.txt" "./temp/video_extra.mkv" "./temp/audio_extra.opus"
:: Extra 512kb ::
:: Audio ::
"./programs/avs2pipemod" -wav encode.avs | "./programs/sox" -t wav - -t wav - trim 4672s | "./programs/neroAacEnc" -q 0.25 -if - -of "./temp/audio_extra.mp4"
echo -------------------------------
echo Encoding ExtraHQ stream
echo -------------------------------
echo.
:: Video ::
"./programs/replacetext" "encode.avs" "pass = 2" "pass = 0"
"./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
"./programs/x264" --threads auto --crf 20 --keyint 600 --preset veryslow --range tv --input-range tv --colormatrix smpte170m -o "./temp/video_512kb_extra.mp4" encode.avs
:: Muxing ::
"./programs/MP4Box" -hint -add "./temp/video_512kb_extra.mp4" -add "./temp/audio_extra.mp4" -new "./output/encode_512kb_extra.mp4"
: Defaults
"./programs/replacetext" "encode.avs" "pass = 1" "pass = 0"
"./programs/replacetext" "encode.avs" "pass = 2" "pass = 0"
"./programs/replacetext" "encode.avs" "i444 = true" "i444 = false"
"./programs/replacetext" "encode.avs" "hd = true" "hd = false"