Closed sindresorhus closed 4 years ago
There are a couple problems:
The only framerates that GIF supports are: 100, 50, 33.33, 25, 20, 16.66, 14.3, 12.5, 11.11, 10, and lower (100/n
). There's no way to say you want 60fps. You can say you want some frames played at 100fps, some at 50fps, alternating so that it sort-of averages to about 60fps.
Because Netscape was slow, no matter how fast you said you want it to play, it managed something around 20fps. There are gifs set to 100fps that expect to be played at 20fps, because that worked in Netscape. Browsers now emulate that with a logic that if GIF asks to play "too fast" (exact definition varies between browsers), it'll be played very slowly.
The only framerates that GIF supports are: 100, 50, 33.33, 25, 20, 16.66, 14.3, 12.5, 11.11, 10, and lower (100/n).
What currently happens when a user sets it to, for example, 22 FPS? We have a slider in Gifski.app that can be set to any integer between 5 and 30. Does gifski-lib round it internally?
alternating so that it sort-of averages to about 60fps.
Does gifski-lib do this?
Browsers now emulate that with a logic that if GIF asks to play "too fast" (exact definition varies between browsers), it'll be played very slowly.
Any source/link about this? I wonder if it also applies to 30 FPS, or only much higher values.
It seems ffmpeg does indeed does this average trick to get an arbitrary FPS:
Currently the app rounds the delay, so it's not great: https://github.com/sindresorhus/Gifski/blob/5880fd34af55459f3bf1fbc9e538d6e77b36dd1e/Gifski/Gifski.swift#L190
The CLI version uses the alternating frame timing trick.
I plan to change the C API to take pts
(presentation timestamp) instead of a delay, so that it works better when decimating frames of a video. Conversion from video's framerate already adds uneven spacing between frames. For example, you can't take e.g. 24fps video and make it anything other than 12fps/8fps/6fps/etc. without dropping frames unevenly.
That's the original article I had in mind (RIP Tumlbr): https://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser
Here's explicit info from (no longer relevant) browser vendor: https://blogs.msdn.microsoft.com/ieinternals/2010/06/07/trivia-animated-gif-timing/
Hi Sindre Sorhus, Hope you are doing well. I am a big fan of Gifski and using it from past many months. Love the ease of use of the app and output is really good colour accurate. Just love it but I am a UI designer and animator and ask any animator we just love 60 FPS buttery smooth animations. I share my work on dribbble and free dribbble user can upload only GIF. Due to 30 FPS limitation, I can't able to show my actual work on dribbble and you can feel the frustration when you can't able to share your actual work with the world.
Request you please please please add an option of 60 FPS. There are very few apps available but all of them are crap. Big crap. If you will add this feature then it would be awesome. You might be getting few requests for 60 FPS but please add this option.
Keep it up the great work!
Much Love, Vatsal Mehta
from a physiological perspective film is 24 fps about he frame rate the brain processes stuff as motion so i say 25fps is a good default
I've gotten a couple of requests for 60 FPS. We currently limit it to 30 FPS. I do realize it doesn't even usually make sense with 30 FPS for GIF, but their use-case is very short clips to upload to https://dribbble.com.
Thoughts?