Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 60 FPS? #161

Closed
sindresorhus opened this issue Nov 11, 2019 · 5 comments · Fixed by #173
Closed

Allow 60 FPS? #161

sindresorhus opened this issue Nov 11, 2019 · 5 comments · Fixed by #173

Comments

@sindresorhus
Copy link
Owner

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?

@kornelski
Copy link
Collaborator

kornelski commented Nov 11, 2019

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.

@sindresorhus
Copy link
Owner Author

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:

@kornelski
Copy link
Collaborator

kornelski commented Nov 12, 2019

  • 60hz monitors can support: 60, 30, 20, 15, 12, 10, 8.5, and lower (60/n)
  • "100hz" GIF supports: 100, 50, 33.33, 25, 20, 16.66, 14.3, 12.5, 11.11, 10 and lower
  • 20fps and 10fps are the only smooth framerates. Picking one of these as the default would be great.

Currently the app rounds the delay, so it's not great:

delay: UInt16(100 / fps)

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/

@sindresorhus sindresorhus mentioned this issue Nov 16, 2019
@mehtavatsal
Copy link

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

sindresorhus added a commit that referenced this issue Jan 29, 2020
The actual result will be 50 FPS, but I doubt the user will notice.

See: #161
@syonfox
Copy link

syonfox commented Nov 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants