REM  Drag and drop a file onto this script



REM  GIF or VIDEO  (scales proportionally if you use -2:height or width:-2)
"%~dp0ffmpeg.exe" -i "%~1" -vf "scale=-2:240" -an -pix_fmt yuv420p -preset medium -movflags +faststart "%~d1%~p1_OUT_%~n1%~x1"

REM  GIF  (ensures successful video conversion, by making width and height multiples of 2)
"%~dp0ffmpeg.exe" -i "%~1" -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p -preset medium -movflags +faststart "%~d1%~p1_OUT_%~n1.mp4"

REM  IMAGE  (always scales proportionally to fit within the size)
REM "%~dp0convert.exe" "%~1" -background none -resize "320x240>" -gravity center "%~d1%~p1_OUT_%~n1%~x1"

pause