Mercurial > codedump
annotate tenormoment.bat @ 133:0d8eabdd12ab default tip
create: write H:MM:SS timestamps, add option to fill with gaussian-blur instead of black
many albums are longer than one hour so writing H:MM:SS is a
necessity. if anything there will just be verbose info that
isn't important for my use-case.
however the gaussian-blur is simply broken. It works, and it plays
locally just fine, but YouTube in particular elongates the video
to fit the full width. I'm not entirely sure why it does this, but
it makes it useless and ugly.
| author | Paper <paper@tflc.us> |
|---|---|
| date | Sat, 03 Jan 2026 20:25:38 -0500 |
| parents | 04b0c3437ca1 |
| children |
| rev | line source |
|---|---|
|
14
44a37d846d80
make tenormoment.bat actually functional
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
12
diff
changeset
|
1 @echo off |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
2 setlocal enabledelayedexpansion |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
3 set "time=0" |
|
14
44a37d846d80
make tenormoment.bat actually functional
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
12
diff
changeset
|
4 |
|
15
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
5 if [%1] == [] echo usage: %0 ^<video^> |
|
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
6 if not exist %1 echo usage: %0 ^<video^> |
|
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
7 |
|
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
8 :foldercheck |
|
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
9 if not exist "%~n1" goto encode |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
10 set /p "answer=The folder '%~n1' already exists. Would you like to overwrite or merge the contents? [o/m]: " |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
11 if "%answer%" == "o" ( |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
12 del /f /s /q "%~n1" |
|
15
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
13 goto encode |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
14 ) |
|
15
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
15 if "%answer%" == "m" goto encode |
|
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
16 goto foldercheck |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
17 |
|
15
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
18 :encode |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
19 if not exist "%~n1" mkdir "%~n1" |
|
14
44a37d846d80
make tenormoment.bat actually functional
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
12
diff
changeset
|
20 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" |
|
44a37d846d80
make tenormoment.bat actually functional
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
12
diff
changeset
|
21 for /F "tokens=*" %%F in ("%~n1\gif_%time%.gif") do set "size=%%~zF" |
|
12
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
22 if "!size!" == "0" ( |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
23 del "%~n1\gif_%time%.gif" |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
24 exit /B |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
25 ) |
|
b067eadd5715
Upload tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff
changeset
|
26 set /a "time=%time%+5" |
|
15
04b0c3437ca1
Update tenormoment.bat
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
14
diff
changeset
|
27 goto encode |
