Break up long encoding line

This commit is contained in:
2026-01-29 11:07:25 +01:00
parent ed1fb316d7
commit ac26b232ae
3 changed files with 12 additions and 7 deletions
+4 -3
View File
@@ -67,10 +67,11 @@ means less visible pattern at the cost of more banding.
## Notes
* The script will attempt to check for valid inputs, but will fall back to FFmpeg's error messages.
* The script will attempt to check for valid inputs, but will fall back to
FFmpeg's error messages.
* The APNG muxer does not support multiple input palettes, palettegen (-m) will fall
back to using diff mode if single mode is selected.
* The APNG muxer does not support multiple input palettes, palettegen (-m)
will fall back to using diff mode if single mode is selected.
* Since FFmpeg can convert between any format, it's also possible to convert
between for instance GIF to WEBP, although frame rates might be off.
+3 -1
View File
@@ -270,7 +270,9 @@ IF "%filetype%" == "webp" (
:: Executing the encoding command
ECHO %GREEN%Encoding animation...%OFF%
ffmpeg -v %loglevel% %trim% -i %input% -thread_queue_size 512 -i "%palette%" -lavfi "%filters% [x]; [x][1:v] %decode%%errordiff%%ditherenc%%bayer%" -f %filetype% %webp_lossy% -loop 0 -plays 0 -y "%output%"
ffmpeg -v %loglevel% %trim% -i %input% -thread_queue_size 512 -i "%palette%" ^
-lavfi "%filters% [x]; [x][1:v] %decode%%errordiff%%ditherenc%%bayer%" ^
-f %filetype% %webp_lossy% -loop 0 -plays 0 -y "%output%"
:: Checking if file was created and cleaning up if not
IF NOT EXIST "%output%" ECHO %RED%Failed to generate animation: %output% not found.%OFF% && GOTO :cleanup
+5 -3
View File
@@ -239,13 +239,15 @@ if [[ -z "$bayerscale" ]]; then bayer=""; fi
# WEBP pixel format and lossy quality
if [[ "$filetype" == "webp" && -n "$webp_lossy" ]]; then
webp_lossy="-lossless 0 -quality $webp_lossy -pix_fmt yuva420p"
elif [[ "$filetype" == "webp" && -z "$webp_lossy" ]]; then
elif [[ "$filetype" == "webp" && -z "$webp_lossy" ]]; then
webp_lossy="-lossless 1"
fi
# Executing the encoding command
echo ${GREEN}"Encoding animation..."${OFF}
ffmpeg -v "${loglevel}" ${trim:-} -i "${input}" -thread_queue_size 512 -i "${palette}" -lavfi "${filters} [x]; [x][1:v] ${decode}${errordiff}${ditherenc}${bayer}" -f "${filetype}" ${webp_lossy:-} -loop 0 -plays 0 -y "${output}"
ffmpeg -v "${loglevel}" ${trim:-} -i "${input}" -thread_queue_size 512 -i "${palette}" \
-lavfi "${filters} [x]; [x][1:v] ${decode}${errordiff}${ditherenc}${bayer}" \
-f "${filetype}" ${webp_lossy:-} -loop 0 -plays 0 -y "${output}"
# Checking if output file was created
if [[ ! -f "$output" ]]; then
@@ -259,7 +261,7 @@ fi
echo ${GREEN}"Done."${OFF}
}
}
### End Main ###
### Function to print the help message ###