diff --git a/README.md b/README.md index c646dfb..6f6ec24 100755 --- a/README.md +++ b/README.md @@ -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. diff --git a/vid2ani.cmd b/vid2ani.cmd index 54df8b4..68dd791 100755 --- a/vid2ani.cmd +++ b/vid2ani.cmd @@ -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 diff --git a/vid2ani.sh b/vid2ani.sh index 5353ad0..ec209af 100755 --- a/vid2ani.sh +++ b/vid2ani.sh @@ -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 ###