How to adjust gif speed

Hi all. I wish to create high quality gifs from videos. I realised that shotcut is better than most in terms of output quality. File size is not my issue. Correct me if I am wrong but I think a speed control option is missing.

Earlier I thought that the fps option on advanced export settings would control the speed.

So for example. I had a 25fps 3 sec clip of 75 frames. Now i want a gif of it which runs slower. So i set fps at 18 and export.

NOW the result is a jittery gif of 18 fps but playing for only 3 sec which means it drops a lot of frames in between. So total frames go down from 75 to 54.

What I want is that it should play all of those 75 frames at 18 fps and since it is slowed the gif should run for more than 3 sec.

(I tried slowing down the source video by clicking ‘i’/properties but it results in a gif with duplicate frames.)

I am new so I may have missed something but is there any way to accomplish this within shotcut.

In Shotcut look at the GIF’s properties, there is a field there to change the speed. e.g. 0.5 will halve the speed, so the GIF will run for twice as long.

Thanks, kind sir for suggestion. I had already tried this and the gif IS slowed however as i mentioned it now has more duplicate frames.

For example setting speed to 0.5 results in a gif that has twice the number of frames to achieve the slow pace rather than increasing the delay between frames.

After you answered i tried it again and now i found that even with twice the frames the total size is exactly the same. I have edited many gifs before but never came across such a situation.

BTW- to know the number of frames i use gif editor pro on android. It is possible that virtually doubling the frames is a way of slowing the gif and this app is fooled into thinking that there actually are 2x frames.

However 2 things.

I imported same 2x gif into shotcut and it says it has variable framerate and is not reliable for editing and gives the conversion prompt.

Is this normal for gifs being imported to shotcut?

Also is it not weird that there is no dedicated speed setting at the time of export? Because most other gif related softwares have a simple frame delay field.

But also i wondered if there is a technical reasoning behind this approach. Maybe for when people combine multiple gifs in one and therefore their individual pace can be maintained/tweaked rather than applying equal frame delay to all of them? Makes sense???

I’m afraid I am unable to answer these questions. I have only used GIFs once or twice and haven’t gone into the detail you are asking. Your findings are interesting though but @Sfotcut would be more likely to be able to answer your queries than I.

Not quite. It only controls the number of frames per second. It does not control the number of seconds the video will last. The project timeline determines the length in seconds. Frames will be dropped or duplicated as necessary to meet the FPS target without changing the video length.

18 / 25 = 0.72

Going to clip > Properties > Speed = 0.72 as you did before will put the clip into slow motion. As you noticed, frames are duplicated to stretch the video runtime while remaining at 25fps. Once the FPS is dropped to 18, the duplication will disappear. It takes both modifications working together to change the delay between source frames.

The FPS can be set to 18 either with a custom Video Mode, or at the Export panel under Advanced. There are fewer bad surprises / easier troubleshooting / fewer layers of math when using the Video Mode to set FPS rather than the Export panel.

This is normal. GIF is not a traditional video format. It can have arbitrary timings from frame to frame, which is at odds with the constant frame rate of a video timeline. If you convert, use the highest quality mode.

It might be a notable omission for a dedicated GIF editor, perhaps. But for conventional video editors, this is not weird at all. Most people don’t edit a two-hour blockbuster movie, then at the very end decide to speed up the whole thing by 1.25x.

This could be tricky. As I’m sure you know, GIF uses a 256-color palette. Matching (optimizing) the palette to the colors that are actually used in a video is critical to achieving high quality. By nature, this is a two-pass operation (first to find the most common colors, then to encode the GIF using those colors), but Shotcut does not export GIF in two passes. Quality will suffer due to a more generic palette. A highest-quality GIF creation method using ffmpeg is described here:

Another option that’s much easier to use is Animated PNG instead of GIF, which also gets past the 256-color limitation. Shotcut can export directly to Animated PNG like this:

Great answers.

More practical is the one to calculate speed (desired fps ÷ original fps) However I would like to state that I had to set the desired fps (18) to BOTH the project settings and at the time of exporting to get the perfect gif i.e. Exact number of frames as the total of the timeline (no dublication) + running at a slower framerate (18).

So based on what Austin said, this seems to be the steps to slow down or speed up a gif w/o duplication or deletion of frames.

  1. Choose an appropriate lower or higher framerate depending on what you want to do.

  2. This is the desired fps. Divide it by original fps of the clip. Put this value as the speed in i/properties of the clip.

  3. Use the desired fps as the project fps and also while exporting.

Another thing - at a point in trial n error I made a slowed gif with twice the number of frames (duplication) however I saw that the file size was almost same as a neutral gif export at same quality setting.

Can you tell how is that possible?
Are there instructions to use frames twice rather than actually storing them?
Is this kind of gif stable when copying or moving.

Lastly I understand that making gif is not the main purpose but when I saw that it can export much more detailed (but heavy) gifs I wanted to see what all it could do so I asked in more details.

Thanks again Elusien and Austin

This topic was automatically closed after 90 days. New replies are no longer allowed.