Last active
March 7, 2022 17:51
-
-
Save ofgulban/f888bc3e4173fb5bdb0601b5f2bf434c to your computer and use it in GitHub Desktop.
Make MP4 and GIF files from multiple PNGs using ffmpeg.
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
# Compile an MP4 from a folder containing PNGs | |
ffmpeg -y -i /path/to/movie_frame-%03d.png -vb 20M -c:v libx264 -vf fps=24 -pix_fmt yuv420p path/to/movie.mp4 | |
# Convert mp4 into a high quality gif | |
ffmpeg -y -i path/to/movie.mp4 -vf "fps=24, scale=768:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 path/to/movie.gif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment