by frik · 9y ago · 0 comments
Definitely better a lot than ffmpeg with palette option. (are there other gif tools, how do they compare?)
GIF format may be really dated, but it's really light on resources.
I learned the hard way that playing dozens of small short MP4 video clips on a web page will chock your (mobile) browser, but displaying the same clips as GIF is no problem at all.
Edit: I wrote "dozens of clips", if you don't believe me, try it out yourself, and no video codecs like MP4 are more hardware intensive if your smartphone/tablet graphic card has to render more than a few.
There's also a lesser problem of chroma subsampling destroying fine saturated details. WebM/VP9 supports full-res chroma.
ffmpeg -r 30 -f image2 -i linear_gradient%02d.png -vcodec libx264 -preset slow -crf 22 -pix_fmt yuv420p -start_number 1 -vframes 2 linear_gradient.mp4
Firefox stretches it to 0x01 to 0xfe, and introduces obvious banding in the process. MPV does the same thing, although it has an optional debanding filter. The black and white levels are only a single unit off from the original, so I doubt I'd notice in real video. The banding is a much bigger problem (solved by 10-bit color spaces), but GIF has more banding in general use.