Remove extension from lottie2ffmpeg and fix crash when lottieconverter not present

This commit is contained in:
Tulir Asokan
2019-10-03 10:14:58 +03:00
parent f430ed7169
commit a8982cf8c7
2 changed files with 7 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
TMPDIR=$(mktemp -d)
if [ ! -e $TMPDIR ]; then
>&2 echo "Failed to create temp directory"
exit 1
fi
trap "exit 1" HUP INT PIPE QUIT TERM
trap 'rm -rf "$TMPDIR"' EXIT
cd $TMPDIR
lottieconverter=$1
resolution=$2
cat > input
for i in {0..99}; do
padded="0$i"
$lottieconverter input frame-${padded: -2}.png png $resolution $((i+1))
done
ffmpeg -start_number 0 -framerate 30 -i frame-%02d.png -c:v libvpx-vp9 -pix_fmt yuva420p out.webm
cat out.webm