Captura icon indicating copy to clipboard operation
Captura copied to clipboard

Evaluation of gifski

Open pr8x opened this issue 5 years ago • 3 comments

If you're fine with the license one could consider integrating Gifski. The current gif encoding is really unoptimized and produces giant files.

pr8x avatar Nov 12 '19 15:11 pr8x

fine with the license

As far as I'm aware, MIT and AGPL are compatible, both being on the more permissive end of the spectrum. IIRC, using code from the Gifski program would mean you'd need to to add that to your license notice.

vatterspun avatar Nov 16 '19 15:11 vatterspun

I can actually look into implementing this. Shouldn't be too hard, tbh.

pr8x avatar Jan 16 '20 16:01 pr8x

@pr8x I'd be happy to accept your contribution.

It seems easy to implement but there are a few things to take care of:

  1. We need the project to be as modular as possible. So, start by creating a new .NET C# project in the solution folder, preferably named Captura.Gifski.

  2. Include the license file in the licenses folder. I'm still not sure about license compatibility though.

  3. We'll be using Gifski as an executable and not as a library to avoid licensing issues. An option is needed to specify the path to gifski.exe which fallbacks to some defaults if not specified like what we have for FFmpeg.

  4. We'll not be distributing Gifski with Captura to avoid increasing download sizes. Optionally, we could implement a Gifski downloader, as we have done for FFmpeg.

  5. Now, getting to the implementation. Start by inheriting from the IVideoConverter interface. See FFmpegVideoConverter for example.

    We'll follow the usage mentioned on Gifski README.

    Use ffmpeg command to convert any video to PNG frames:

    ffmpeg -i video.webm frame%04d.png
    

    and then make the GIF from the frames:

    gifski -o anim.gif frame*.png
    
  6. Parsing the Gifski output to report progress from within IVideoConverter.

  7. There might be some things that I missed but these are the ones I feel are the most important to get started. I'll update if anything else comes to mind.


PS: I'm a bit busy with my studies right now, this being my pre-final year and all. But, I'll try to help you to the best of my ability as time permits.

MathewSachin avatar Jan 19 '20 18:01 MathewSachin