Add gif2webm script
gif2webm converts gifs to webm using ffmpeg
This commit is contained in:
commit
6dd4925fe0
20
gif2webm
Executable file
20
gif2webm
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -n "${1}" && -n "${2}" ]]; then
|
||||
|
||||
filters="fps=15"
|
||||
|
||||
if [[ -n "${3}" ]]; then
|
||||
filters+=",scale=${3}:flags=lanczos"
|
||||
fi
|
||||
|
||||
|
||||
ffmpeg -i "$1" -c:v libvpx-vp9 -vf "$filters" -pass 1 -b:v 0 -crf 33 -threads 8 -speed 2 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -f webm -y /dev/null
|
||||
|
||||
ffmpeg -i "$1" -c:v libvpx-vp9 -vf "$filters" -pass 2 -b:v 0 -crf 33 -threads 8 -speed 2 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -f webm "$2"
|
||||
|
||||
exit;
|
||||
|
||||
fi
|
||||
|
||||
echo -e "Usage: ${0} <input-file> <output-file> <height:-1 or -1:width>"
|
Loading…
Reference in a new issue