Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Support saving to GIF format #15

Open
NathanBnm opened this issue Jun 9, 2020 · 6 comments
Open

Support saving to GIF format #15

NathanBnm opened this issue Jun 9, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@NathanBnm
Copy link
Contributor

I was using the original Screen Recorder app from Mohelm97 which is supporting saving recordings to the GIF format. This is a handy format when recording short demos in order to upload them directly on GitHub or in any messaging apps like Slack, Discord or even Facebook Messenger and it would be great if you could support it back.

@dr-Styki
Copy link
Owner

That's already on my to do list. I need to find a way to do that with Gstreamer.

@onsah
Copy link

onsah commented Jun 28, 2020

I am also interested in this feature. So I did some research and found that there is no gif encoder in GStreamer. They seem to purposely disabling gif encoder in here:
https://github.com/GStreamer/gst-libav/blob/e1928898c8d49fe287d73db21c4ba5bed41bcf8e/ext/libav/gstavvidenc.c#L966-L970
So I thought one solution may be using ffmeg to convert from another video format. It is not the best solution but I can't think of a better solution.

@onsah
Copy link

onsah commented Jul 9, 2020

I have somewhat working solution with ffmpeg. To try it out you can checkout my fork (gif-output branch). But it outputs huge sizes (~25mb per seconds for 1920x1080 screen). Also convert speed is very slow. Any tips on which flags to use with ffmpeg would be welcomed. Because I don't have much knowledge about ffmpeg. In the meantime I will learn more about ffmpeg and find out some better output configuration for speed and file size.

@dr-Styki
Copy link
Owner

Hi,
using ffmpeg could be a solution. But effectively the output file size is huge. O_O

Also, the video to GIF conversion is async and give no information to the user about the process. A progress window like the one of the switchboard-plug-locale would be great for that.

@onsah
Copy link

onsah commented Jul 13, 2020

I made some improvements afterwards (with finding some clues from https://github.com/phw/peek). Using a palette made great improvement on the gif size(~700KB per second on 1920x1080) and quality. It is not great but acceptable I think. For the processing time, I put GtkSpinner to video preview. Save button is also disabled during processing. When the conversion finishes callback hides the GtkSpinner and enables the save button. But a ProgressBar may be better solution because conversion may take long times for a recording longer than 30 seconds.

Also surprisingly video preview for gif works out of the box! However for some reason it doesn't work for large resolution gif videos. For example, a small area works but the entire screen record breaks the preview. Problem seems to be the player because it manages to display the first frame but fails to play.

@dr-Styki dr-Styki added the enhancement New feature or request label Oct 10, 2020
@Brin-o
Copy link

Brin-o commented Jul 17, 2021

If you still dont think file sizes are acceptable it could be worth looking into using gifski

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants