$ ffmpeg -ss 1:23 -i input.mp4 -frames:v 100 image-%03d.png
-ss 1:23
-frames:v 100
-t 2
-frames:v
)After reviewing the images and deciding I want frames 7 through 19:
$ ffmpeg -start_number 7 -i image-%03d.png -frames:v 12 -vf scale=480:270 imagescaled-%03d.png
-start_number 7
-frames:v 12
If we don’t do this, ffmpeg will guess and screw up all the colors.
$ ffmpeg -i imagescaled-%03d.png -filter_complex "[0:v] palettegen" palette.png
$ ffmpeg -i imagescaled-%03d.png -i palette.png -filter_complex "[0:v][1:v] paletteuse" output.gif
Generate palette, as above:
$ ffmpeg -i input.gif -filter_complex "[0:v] palettegen" palette.png
Scale and reapply palette: (ffmpeg gets confused and makes a 10MB gif if you only use scale)
$ ffmpeg -i input.gif -i palette.png -filter_complex "[0:v] scale=800:480:flags=neighbor [tmp]; [tmp][1:v] paletteuse" input_2x.gif