Open pr8x opened 4 years ago
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.
I can actually look into implementing this. Shouldn't be too hard, tbh.
@pr8x I'd be happy to accept your contribution.
It seems easy to implement but there are a few things to take care of:
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
.
Include the license file in the licenses folder. I'm still not sure about license compatibility though.
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.
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.
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
Parsing the Gifski output to report progress from within IVideoConverter
.
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.
If you're fine with the license one could consider integrating Gifski. The current gif encoding is really unoptimized and produces giant files.