Skip to content

Instantly share code, notes, and snippets.

@pixelchai
Last active August 23, 2020 12:08
Show Gist options
  • Save pixelchai/f7923c12fb6d0c76eb059c1217fa724b to your computer and use it in GitHub Desktop.
Save pixelchai/f7923c12fb6d0c76eb059c1217fa724b to your computer and use it in GitHub Desktop.
ffmpeg command to convert a gif into an instagram-compatible video. NB: it is assumed that the gif is already in the correct dimensions: Square video minimum resolution is 600 x 600. Max is 1080 x 1080.
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100
-i input.gif
-c:v libx264 -pix_fmt yuv420p -movflags +faststart
-filter:v fps=fps=30
-c:a aac -shortest
output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment