ScreenToGif icon indicating copy to clipboard operation
ScreenToGif copied to clipboard

[Bug] gifski can't work properly

Open minos9277 opened this issue 9 months ago • 1 comments

Describe the bug the gif created with gifski seems a little sped-up and there is a long pause at the end of the gif i tried several version of gifski.dll extracted from gifski-XX.0.tar.xz and it happened everytime only the gifski.dll downloaded by default can work but it's rather outdated

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • Version [e.g. [2.41.2]]

minos9277 avatar Mar 18 '25 02:03 minos9277

Image

and the latest gifskiImage

minos9277 avatar Mar 18 '25 02:03 minos9277

Yes, I'm experiencing the same issue when exporting via gifski in ScreenToGif. The exported GIF's frame delays don't match the preset values - the last frame becomes abnormally long while other frames get shortened.

The new gifski.dll delivers better quality and smaller size. Hope ScreenToGif could adapt its frame delays handling. Much appreciated!

  • ScreenToGif Version: [2.41.5.Portable.x64]
  • gifski.dll Version: [from gifski-1.34.0.tar.xz]
  • OS: Windows 10

GHhhhk avatar Jul 22 '25 05:07 GHhhhk

The current version of gifski.dll remains at v1.2.0, and unfortunately, it is the only choice at this time. Any newer gifski.dll might cause compatibility issues since the API has been changed.

For example, in current code, the GifskiSettings is: https://github.com/NickeManarin/ScreenToGif/blob/42eadd5a03f4edfa16c492c8aa5fdd2a2eebf125/ScreenToGif/Util/GifskiInterop.cs#L20-L27

It only supports v1.2.0 and earlier versions, since the code in gifski v1.2.0 is:

pub struct GifskiSettings {
    /// Resize to max this width if non-0
    pub width: u32,
    /// Resize to max this height if width is non-0. Note that aspect ratio is not preserved.
    pub height: u32,
    /// 1-100, but useful range is 50-100. Recommended to set to 100.
    pub quality: u8,
    /// If true, looping is disabled. Recommended false (looping on).
    pub once: bool,
    /// Lower quality, but faster encode.
    pub fast: bool,
}

But starting from v1.3.0, it's updated:

pub struct GifskiSettings {
    /// Resize to max this width if non-0.
    pub width: u32,
    /// Resize to max this height if width is non-0. Note that aspect ratio is not preserved.
    pub height: u32,
    /// 1-100, but useful range is 50-100. Recommended to set to 90.
    pub quality: u8,
    /// Lower quality, but faster encode.
    pub fast: bool,
    /// If negative, looping is disabled. The number of times the sequence is repeated. 0 to loop forever.
    pub repeat: i16,
}

fz0000 avatar Jul 23 '25 14:07 fz0000

I tried to fix this with minimal modifications, but it turned out to be impossible. Supporting both current version and the newer official versions of of gifski.dll requires significant changes. So I suggest waiting for ScreenToGif v3.

Instead of the final export step, you can use the GUI version of gifski, or use the CLI version for advanced options. For example: gifski.exe --fps 10 --quality 100 --output my_output.gif "C:\Users\xxx\AppData\Local\Temp\ScreenToGif\Recording\2025-08-20 21-18-25\*.png"

fz0000 avatar Aug 20 '25 14:08 fz0000

I fixed the gifski interop code, now it works with the latest version. It also downloads the dll directly from the correct repo.

NickeManarin avatar Sep 28 '25 20:09 NickeManarin