@ECHO OFF
@COLOR 02
@TITLE The Secret of the Nautilus (ND)
@ECHO ------------------------
@ECHO Encode videos? [ y / n ]
@ECHO ------------------------
@SET /P QUEST=
@IF NOT "%QUEST%"=="y" EXIT
@IF %PROCESSOR_ARCHITECTURE%==x86 GOTO ERROR_NOTSUPOS
@CLS
@CD /d "%~dp0"
@IF NOT EXIST "%CD%\Video\_tmp\_encode.exe" SET TARGETFILE=Video\_tmp\_encode.exe & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\_tmp\Intro_tmp.wmv" SET TARGETFILE=Video\_tmp\Intro_tmp.wmv & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\_tmp\Extro_tmp.wmv" SET TARGETFILE=Video\_tmp\Extro_tmp.wmv & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\_tmp\Intro_tmp.wav" SET TARGETFILE=Video\_tmp\Intro_tmp.wav & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\_tmp\Extro_tmp.wav" SET TARGETFILE=Video\_tmp\Extro_tmp.wav & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\*.wmv" SET TARGETFILE=Video\*.wmv & GOTO ERROR_NOTFOUND
@IF NOT EXIST "%CD%\Video\_backup" MD "%CD%\Video\_backup"
@FOR %%a IN ("%CD%\Video\*.wmv") DO MOVE /Y "%%~fa" "%CD%\Video\_backup"
@FOR /D %%a IN ("%CD%\Video\*.wmv") DO MOVE /Y "%%~fa" "%CD%\Video\_backup"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CF_01_Bo.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CF_01_Bo.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\DF_01_Do.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\DF_01_Do.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_06_Pz.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_06_Pz.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\AE_02_Ex.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\AE_02_Ex.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_03_Ba.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_03_Ba.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\AA_02_Lo.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\AA_02_Lo.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CF_01_Gl.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CF_01_Gl.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CD_02_KC.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CD_02_KC.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CB_03_La.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CB_03_La.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CG_01_Ro.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CG_01_Ro.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\DB_01_Kr.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\DB_01_Kr.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CG_05_M2.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CG_05_M2.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_04_Vo.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_04_Vo.wmv" 
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CF_02_DC.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CF_02_DC.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CA_01_Ev.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CA_01_Ev.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\EG_01_Di.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\EG_01_Di.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CF_03_DB.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CF_03_DB.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BB_01_Gr.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BB_01_Gr.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\CA_02_IA.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\CA_02_IA.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\AD_03_Di.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\AD_03_Di.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_02_NI.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_02_NI.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_01_Sc.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_01_Sc.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\BA_05_Tr.wmv" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\BA_05_Tr.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_backup\Logos.wmv" -r 25 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\Logos.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_tmp\Intro_tmp.wmv" -i "%CD%\Video\_tmp\Intro_tmp.wav" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\Intro.wmv"
@"%CD%\Video\_tmp\_encode.exe" -y -i "%CD%\Video\_tmp\Extro_tmp.wmv" -i "%CD%\Video\_tmp\Extro_tmp.wav" -r 30 -c:v libvpx-vp9 -lossless 1 -c:a copy "%CD%\Video\Extro.wmv"
:ALL_DONE
@CLS
@RD "%CD%\Video\_tmp" /S /Q
@ECHO All done! & PING -n 3 127.0.0.1 > nul & DEL "%~f0" & EXIT
:ERROR_NOTFOUND
@COLOR 04
@CLS
@ECHO -----------------------------------------------
@ECHO ERROR! File not found: %TARGETFILE%
@ECHO -----------------------------------------------
@PAUSE
@EXIT
:ERROR_NOTSUPOS
@COLOR 04
@CLS
@ECHO ----------------------------------------------
@ECHO ERROR! This app can't run on a 32-bit system.
@ECHO ----------------------------------------------
@PAUSE
@EXIT