ssr icon indicating copy to clipboard operation
ssr copied to clipboard

Animated GIF output?

Open samv opened this issue 10 years ago • 21 comments

Hey there,

I notice you can select gif as a container format, but it doesn't seem to work, failing when you hit start recording. Any hints?

samv avatar Jun 10 '14 00:06 samv

SSR only supports the YUV color space, but the gif encoder probably expects RGB images. You're not really supposed to use that container. Even if it would work, the quality would be terrible (because the palette wouldn't be optimized). You should record to a normal format and convert it to a gif later if you want that.

MaartenBaert avatar Jun 10 '14 17:06 MaartenBaert

In general the ffmpeg gif encoder is crap. Given a few days I could come up with something better, but, well, would you actually stream full HD gifs at 60fps? I don't think so.

MaartenBaert's point stands.

iamgreaser avatar Jun 14 '14 01:06 iamgreaser

Aha, I had problems recording to gif as well. If I was to use ssr to record to another format before converting to gif later, which format would be optimal? And if ffmpeg is a bad gif encoder, is there another one you would suggest? (sorry if these questions are irrelevant in an issue comment..)

Ploppz avatar Jun 18 '14 10:06 Ploppz

Stick with the defaults (MKV, H.264 superfast CRF=23, audio irrelevant) and you should get something good enough.

I don't know what other gif encoders there are, unfortunately. I wrote a python script to encode 30 frames which did a better job, but it's a very tailor-built job, and is quite slow.

iamgreaser avatar Jun 18 '14 10:06 iamgreaser

gif also doesn't work for me. It doesn't even start to record something (something like: error , can't write a header). wouldn't it then be better to completely remove the gif container from SimpleScreenRecorder?

hermann-san avatar Jan 29 '15 11:01 hermann-san

You don't want to use gif these days - webm is the future. Gif has a big file size and poor quality. Just ignore the IE-people.

Lucki avatar Jan 30 '15 10:01 Lucki

Good idea. Thanks. I noticed there are services like imagehack.us (for jpg, png, gif) on which one can upload WebM for free , e.g. webmshare.com.
Also a IE Plugin from Google exists for playing WebM on IE.

hermann-san avatar Jan 30 '15 10:01 hermann-san

SSR simply shows a list of all available codecs in FFmpeg/Libav. 'gif' is in there because it exists, not because I picked it. If you choose 'other' as the codec, these kinds of things are to be expected.

MaartenBaert avatar Jan 30 '15 23:01 MaartenBaert

Can't it use truecolour?

brmbrmcar avatar Oct 20 '16 17:10 brmbrmcar

No, GIF only supports 256 colors. Use a different format like WebM instead.

MaartenBaert avatar Oct 20 '16 21:10 MaartenBaert

I mean like https://en.wikipedia.org/wiki/File:SmallFullColourGIF.gif.

brmbrmcar avatar Oct 21 '16 08:10 brmbrmcar

It's a horrible hack and you end up with something bigger than a raw RGB 24bpp image.

iamgreaser avatar Oct 21 '16 08:10 iamgreaser

It's still useful for some I guess (not me)

brmbrmcar avatar Oct 21 '16 08:10 brmbrmcar

First of all, thanks for your great tool.

About this issue, maybe it's worth looking into how byzanz does this (or if it proves too intricate, just have byzanz an additional dependency and invoke it for GIFs). It manages to create GIFs with good quality and very small file size (see https://askubuntu.com/a/123515/495331).

The source code is available at https://gitlab.gnome.org/Archive/byzanz.

ranolfi avatar Apr 20 '18 17:04 ranolfi

GIFs are sadly still relevant. Excellent for e.g. small recordings to post on github issue (where webm doesn't seem to be supported) or in slack. I use 10 fps and convert afterwards...

fiddur avatar Jun 29 '18 07:06 fiddur

I'm somewhat confused. I obtain good [enough] quality animated gifs via commandline ffmpeg:

ffmpeg -i "$1" -vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop -1 "${1%.*}.gif"

now, since this conversion is performed via ffmpeg itself, wouldn't it be possible to add support for this setup to SSR via a combination of container, codec and codec custom options?

64kramsystem avatar Feb 08 '20 11:02 64kramsystem

Sadly, GIF is apparently only way to make a screenshot video attached to github comments.

jarovo avatar Oct 26 '20 22:10 jarovo

I´d love to have support to easily save to GIF output. Sometimes it´s just what I need.

rulrok avatar Apr 14 '21 23:04 rulrok

just a thumps up and wondering how to do it with least effort... any has anyone figured out a reasonable "record screenshot to gif" workflow?

timschloe avatar Sep 15 '22 16:09 timschloe

has anyone figured out a reasonable "record screenshot to gif" workflow?

For extremely simple use-cases, when I need something as quickly as taking a screenshot, https://github.com/phw/peek worked for me. Feel free to figure out how peek does it, and extract from it the commands needed to record and convert to GIF.

denilsonsa avatar Sep 15 '22 23:09 denilsonsa

peek doesn't allow resizing the window to a very small size: the titlebar stuff has to fit. (I was trying to record around 100x80 or so.) byzanz works, it just needs command-line options to set the region to capture; and with the -c option, it seems to miss the mouse cursor if I don't move it around a bit before starting an interaction.

ec1oud avatar Feb 20 '23 16:02 ec1oud