-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bat
46 lines (40 loc) · 1.14 KB
/
run.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
@echo off
set fname=image
:parse_opts
if "%~1"=="" goto end_parse_opts
if "%~1"=="-o" (
shift
set fname=%~2
shift
goto parse_opts
)
shift
goto parse_opts
:end_parse_opts
if not exist ".\output\" (
mkdir ".\output\"
)
if exist ".\output\%fname%" (
rmdir /s /q ".\output\%fname%"
)
mkdir ".\output\%fname%"
mkdir ".\output\%fname%\temp"
mkdir ".\output\%fname%\energy"
pypy3 .\src\main.py %*
if %errorlevel% equ 0 (
echo ===RUN SUCCESS===
if exist ".\output\%fname%\%fname%.ppm" (
ffmpeg -loglevel quiet -y -i ".\output\%fname%\%fname%.ppm" ".\output\%fname%\%fname%.bmp"
if exist ".\output\%fname%\temp\0.ppm" (
ffmpeg -loglevel quiet -f image2 -r 20 -i ".\output\%fname%\temp\%%01d.ppm" ".\output\%fname%\%fname%.gif"
ffmpeg -loglevel quiet -f image2 -r 20 -i ".\output\%fname%\energy\%%01d.ppm" ".\output\%fname%\%fname%_energymap.gif"
)
) else (
if exist ".\output\%fname%\temp\0.jpg" (
ffmpeg -loglevel quiet -f image2 -r 20 -i ".\output\%fname%\temp\%%01d.jpg" ".\output\%fname%\%fname%.gif"
)
)
) else (
echo ===RUN FAIL===
exit /b 1
)