Last active
December 25, 2018 10:44
-
-
Save RPing/0fd5cf524a1b551b7da23c01d083dc84 to your computer and use it in GitHub Desktop.
gif to mp4 and loop it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# sh gif2mp4.sh <gif url/local file> <loop count> | |
# output file will be out.mp4 | |
ffmpeg -f gif -i $1 -pix_fmt yuv420p -vcodec libx264 tmp.mp4 | |
for (( i = 0; i <= $2; i++ )) | |
do | |
printf "file tmp.mp4\n" >> list.txt | |
done | |
ffmpeg -f concat -i list.txt -c copy out.mp4 | |
rm -f list.txt tmp.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment