Mercurial > codedump
comparison tenormoment.bat @ 12:b067eadd5715
Upload tenormoment.bat
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Fri, 26 Mar 2021 00:00:57 -0400 |
parents | |
children | 44a37d846d80 |
comparison
equal
deleted
inserted
replaced
11:4c47ea3a5b85 | 12:b067eadd5715 |
---|---|
1 @if [%1] == [] goto usage | |
2 @if not exist "%1" goto usage | |
3 @if not "%2" == "--debug" @echo off | |
4 setlocal enabledelayedexpansion | |
5 set "time=0" | |
6 :question | |
7 if not exist "%~n1" goto start | |
8 set /p "answer=The folder '%~n1' already exists. Would you like to overwrite or merge the contents? [o/m]: " | |
9 if "%answer%" == "o" ( | |
10 del /f /s /q "%~n1" | |
11 goto start | |
12 ) | |
13 if "%answer%" == "m" goto start | |
14 goto question | |
15 | |
16 | |
17 :start | |
18 if not exist "%~n1" mkdir "%~n1" | |
19 ffmpeg -i "%1" -y -t 5 -ss %time% -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "%~n1\gif_%time%.gif" | |
20 for /F "tokens=*" %%F in ("%~n1\gif_%time%.gif") do set "size=%~z1" | |
21 echo %~z1 and !size! | |
22 if "!size!" == "0" ( | |
23 del "%~n1\gif_%time%.gif" | |
24 exit /B | |
25 ) | |
26 set /a "time=%time%+5" | |
27 goto start | |
28 | |
29 :usage | |
30 echo usage: %0 ^<video^> |