How do you generate 'replace' gifs with ffmpeg instead of 'cumulative(combined)'?

0

I'm using the following code to generate a gif using ffmpeg:

src="input.flv"
dest="output.gif"
palette="/tmp/palette.png"

ffmpeg -i $src -vf palettegen -y $palette
ffmpeg -i $src -i $palette -lavfi paletteuse -y $dest

The gif that is produced is 'cumulative'. How can I change it so that the gif produced is 'replace' (where each image is independent of the previous)?

I realize this would result in a gif with a larger file size.

Jet Blue

Posted 2017-11-15T01:31:44.140

Reputation: 207

Answers

1

You have to disable picture offsetting.

ffmpeg -i $src -i $palette -lavfi paletteuse -gifflags 0 -y $dest

Gyan

Posted 2017-11-15T01:31:44.140

Reputation: 21 016

Thanks! How did you find out about gifflags? It's not mentioned in the docs...

– Jet Blue – 2017-11-15T21:22:33.377

Still gives the same cumulative result for me, even when using -gifflags 0. Is there another way? ffmpeg 4.1 on Windows 10. – Pyroglyph – 2018-12-19T18:27:47.633