Tuesday 9 October 2018

ffmpeg - Do 60 FPS GIF's actually exist? Or is the maximum 50 FPS?


I've been recently playing around with FFmpeg and I was trying to convert .avi to .gif since other methods I've tried to so far didn't work so well.


What I noticed is that, when I use this command:


ffmpeg -I filename.gif

I can see some of the file information, including the FPS.


And I saw that the highest FPS that is possible so that the video you convert into a gif does not become slower, is 50 FPS.


Now is that correct though? Is the highest FPS amount you can have in a GIF, so that it doesn't become slower 50 FPS?


So do 60 FPS GIF's not exist?



Answer



The GIF98a specification says in the section about the Graphics Control Extension



vii) Delay Time - If not 0, this field specifies the number of hundredths (1/100) of a second to wait before continuing with the processing of the Data Stream. The clock starts ticking immediately after the graphic is rendered. This field may be used in conjunction with the User Input Flag field.



Which means the smallest value is 1 for a image rate of 100 FPS (this will be difficult to render on most monitors...), and the next smallest value is 2 for an image rate of 50 FPS, and the next value is 3 for an image rate of 33.3 FPS. So exactly 60 FPS is not possible.


Note that this extension was meant for a handful of frames with a delay on the order of seconds (maximum delay is about 600 seconds), so 1/100 seconds resolution was ample. It certainly wasn't meant for video, and that's why the field encodes delay, and not frame rate.


Making video GIFs is really an abuse of the specification (even though it's now so common that most people probably don't realize that, just as most people don't realize GIFs and JPEGs use different kinds of compression, and are meant to be used on different kind of images).


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...