4

I am trying to convert a video to an animated gif, and I actually want it to have banding, so I'm trying to turn off dithering.

Here's what I've tried:

ffmpeg -ss 1:24 -t 2 -i *.mkv -filter_complex "[0:v] fps=15,scale=sws_dither=none:w=480:h=-1,split [a][b];[a] palettegen=max_colors=4:stats_mode=single [p];[b][p] paletteuse=new=1" avengers3.gif

Here's what the output from the above looks like:

enter image description here

It seems to me that definitely still has dithering, so how to turn it off?

It said in the docs that sws_dither is the flag to set to "none" to disable dithering - perhaps I'm passing that wrong?

1 Answer 1

4

https://ffmpeg.org/ffmpeg-scaler.html tells you the sws_dither is the dither algorithm whereas https://ffmpeg.org/ffmpeg-filters.html#paletteuse tells you to turn the dither off.

The answer to your question is to set

paletteuse=dither=none

BTW, http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html gives you the result of the paletteuse settings.

4
  • Thank you, that solved it. For future note, I needed to change paletteuse=new=1 to paletteuse=new=1:dither=none
    – Bemmu
    Commented Nov 18, 2020 at 9:22
  • Thanks for this; annoyingly the paletteuse docs don't list none as an option (confirmed they didn't on Nov 17 2020, either, just as a sanity check). 🤷‍♂️ It works though (in 4.3.2 at least).
    – Jason C
    Commented Sep 29, 2022 at 13:24
  • trac.ffmpeg.org/ticket/9950 re: documentation
    – Jason C
    Commented Sep 29, 2022 at 15:07
  • It's been added to the docs as of today, according to the ticket.
    – Jason C
    Commented Mar 28, 2023 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.