view tenormoment.bat @ 132:71df0cf3aa05 default tip

add create.py this is a script to render out video files from entire albums, singles, or EPs. eventually it can be edited to be more robust (such as automatically finding discogs/musicbrainz links) but I think it's pretty damn good for now. It's basically just an ffmpeg frontend with a few hardcoded options that are suitable for this kind of thing.
author Paper <paper@tflc.us>
date Fri, 02 Jan 2026 10:35:03 -0500
parents 04b0c3437ca1
children
line wrap: on
line source

@echo off
setlocal enabledelayedexpansion
set "time=0"

if [%1] == [] echo usage: %0 ^<video^>
if not exist %1 echo usage: %0 ^<video^>

:foldercheck
if not exist "%~n1" goto encode
set /p "answer=The folder '%~n1' already exists. Would you like to overwrite or merge the contents? [o/m]: "
if "%answer%" == "o" (
	del /f /s /q "%~n1"
	goto encode
)
if "%answer%" == "m" goto encode
goto foldercheck

:encode
if not exist "%~n1" mkdir "%~n1"
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"
for /F "tokens=*" %%F in ("%~n1\gif_%time%.gif") do set "size=%%~zF"
if "!size!" == "0" (
	del "%~n1\gif_%time%.gif"
	exit /B
)
set /a "time=%time%+5"
goto encode