Small fixes
This commit is contained in:
+9
-9
@@ -31,7 +31,7 @@ SET "output=%~n1"
|
||||
|
||||
:: Validate input file
|
||||
IF NOT EXIST "%input%" (
|
||||
ECHO %RED%Input file not found: "%input%"%OFF%
|
||||
ECHO %RED%Input file not found: !input! %OFF%
|
||||
GOTO :EOF
|
||||
)
|
||||
|
||||
@@ -199,7 +199,7 @@ MD "%WD%"
|
||||
:: Putting together command to generate palette
|
||||
SET palette=%WD%\palette_%%05d.png
|
||||
SET "filters=fps=%fps%"
|
||||
IF DEFINED crop (SET "filters=%filters%,crop=%crop%")
|
||||
IF DEFINED crop ( SET "filters=%filters%,crop=%crop%" )
|
||||
SET "filters=%filters%,scale=%scale%:-1:flags=lanczos"
|
||||
|
||||
:: FFplay preview
|
||||
@@ -235,8 +235,8 @@ IF !mode! EQU 3 SET "encode=palettegen"
|
||||
|
||||
:: Max colors
|
||||
IF DEFINED colormax (
|
||||
IF !mode! LEQ 2 SET "mcol=:max_colors=%colormax%"
|
||||
IF !mode! EQU 3 SET "mcol==max_colors=%colormax%"
|
||||
IF !mode! LEQ 2 SET "mcol=:max_colors=!colormax!"
|
||||
IF !mode! EQU 3 SET "mcol==max_colors=!colormax!"
|
||||
)
|
||||
|
||||
:: Storing FFmpeg version string
|
||||
@@ -256,7 +256,7 @@ ffmpeg -v %loglevel% %trim% -i "%input%" -vf "%filters%,%encode%%mcol%" -y "%pal
|
||||
|
||||
:: Checking if the palette file is in the Working Directory, if not cleaning up
|
||||
IF NOT EXIST "%WD%\palette_00001.png" (
|
||||
ECHO %RED%Palette generation failed: %palette% not found.%OFF%
|
||||
ECHO %RED%Palette generation failed: !palette! not found.%OFF%
|
||||
GOTO :cleanup
|
||||
)
|
||||
|
||||
@@ -298,7 +298,7 @@ IF DEFINED bayerscale SET "bayer=:bayer_scale=%bayerscale%"
|
||||
:: WEBP pixel format and lossy quality
|
||||
IF "%filetype%"=="webp" (
|
||||
IF DEFINED webp_lossy (
|
||||
SET "type_opts=-lossless 0 -pix_fmt yuva420p -quality %webp_lossy_q%"
|
||||
SET "type_opts=-lossless 0 -pix_fmt yuva420p -quality !webp_lossy_q!"
|
||||
) ELSE SET "type_opts=-lossless 1"
|
||||
)
|
||||
|
||||
@@ -310,7 +310,7 @@ ffmpeg -v %loglevel% %trim% -i "%input%" -thread_queue_size 512 -i "%palette%" ^
|
||||
|
||||
:: Checking if file was created and cleaning up if not
|
||||
IF NOT EXIST "%output%" (
|
||||
ECHO ECHO %RED%Failed to generate animation: %output% not found.%OFF%
|
||||
ECHO %RED%Failed to generate animation: !output! not found.%OFF%
|
||||
GOTO :cleanup
|
||||
)
|
||||
|
||||
@@ -335,7 +335,7 @@ ECHO:
|
||||
ECHO %GREEN%Arguments:%OFF%
|
||||
ECHO -o Output file. Default is the same as input file, sans extension
|
||||
ECHO -t Output file type: 'gif' (default), 'apng', 'png', 'webp'
|
||||
ECHO -r Resize (scale) output width in pixels. Default is original input size
|
||||
ECHO -r Resize output width in pixels. Default is original input size
|
||||
ECHO -l Enable lossy WebP compression and quality, range 0-100 (default 75)
|
||||
ECHO -f Framerate in frames per seconds (default 15)
|
||||
ECHO -c Maximum colors usable per palette, range 3-256 (default 256)
|
||||
@@ -348,7 +348,7 @@ ECHO -b Bayer Scale setting, range 0-5 (default 2)
|
||||
ECHO -m Palettegen mode: 1 (diff, default), 2 (single), 3 (full)
|
||||
ECHO -k Enables paletteuse error diffusion
|
||||
ECHO -y Preview animation using FFplay (part of FFmpeg)
|
||||
ECHO Useful for testing cropping, but will not use exact start/end times
|
||||
ECHO Useful for testing cropping, but will not use exact start/end time
|
||||
ECHO -p Opens the resulting animation in the default image viewer
|
||||
ECHO -v Set FFmpeg log level (default: error)
|
||||
ECHO:
|
||||
|
||||
+3
-3
@@ -311,7 +311,7 @@ $(basename "$0") [input_file] [arguments]
|
||||
${GREEN}Arguments:${OFF}
|
||||
-o Output file. Default is the same as input file, sans extension
|
||||
-t Output file type: 'gif' (default), 'apng', 'png', 'webp'
|
||||
-r Resize (scale) output width in pixels. Default is original input size
|
||||
-r Resize output width in pixels. Default is original input size
|
||||
-l Enable lossy WebP compression and quality, range 0-100 (default 75)
|
||||
-f Framerate in frames per seconds (default 15)
|
||||
-c Maximum colors usable per palette, range 3-256 (default 256)
|
||||
@@ -323,8 +323,8 @@ ${GREEN}Arguments:${OFF}
|
||||
-b Bayer Scale setting, range 0-5 (default 2)
|
||||
-m Palettegen mode: 1 (diff, default), 2 (single), 3 (full)
|
||||
-k Enables paletteuse error diffusion
|
||||
-y Preview animation using FFplay (part of FFmpeg)
|
||||
Useful for testing cropping, but will not use exact start/end times
|
||||
-y Preview animation using 'FFplay' (part of FFmpeg)
|
||||
Useful for testing cropping, but will not use exact start/end time
|
||||
-p Opens the resulting animation in the default image viewer
|
||||
-v Set FFmpeg log level (default: error)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user