Skip to content

Instantly share code, notes, and snippets.

@tonycn
Last active August 29, 2015 14:03
Show Gist options
  • Save tonycn/03e4cab3f8b00067d242 to your computer and use it in GitHub Desktop.
Save tonycn/03e4cab3f8b00067d242 to your computer and use it in GitHub Desktop.
gif to mp4
[ Finnaly with ffmpeg 2.2.4 ]
ffmpeg -f gif -i animation.gif -c:v libx264 -r 30 -pix_fmt yuv420p animation2.mp4
[ install ffmpeg ]]
sudo add-apt-repository ppa:samrog131/ppa
sudo apt-get update
sudo apt-get install ffmpeg-real
- To check if ffmpeg was successfully installed
cd /opt/ffmpeg/bin
./ffmpeg -version
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Step I generate images:
convert animation.gif animation%05d.png
Step II get gif rate
~/image-convert$ identify -format "Frame %s: %Tcs\n" animation.gif
Frame 0: 10cs
Frame 1: 10cs
Step III generate mp4
ffmpeg -i animation%05d.png animation.mp4
ffmpeg -i animation%05d.png -c:v libx264 -r 30 -pix_fmt yuv420p animation.mp4
Ref : https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment