home ~ socials ~ projects ~ rss

Extract Images From A GIF With ffmpeg

May 2023
ffmpeg -i input.gif -vsync 0 -y frames/frame-%d.png

This pulls the individual frames from a GIF out into individual files. The -y allows it to overwrite files if you start over. The %d numbers each image starting with 1 and going up.

Using %00d adds leading zeros to the filenames which can be nice for sorting in some situations. That example adds two leading zeros (e.g. frame-%00d.png outputs frame-001.png, frame-002.png, etc..) A single zero can be used or more zeros added to adjust the number.

end of line
Share link:
https://www.alanwsmith.com/en/2p/wn/vk/qm/?extract-images-from-a-gif-with-ffmpeg