Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quality of GIF videos is very poor #116

Closed
seanh opened this issue Mar 22, 2017 · 15 comments
Closed

Quality of GIF videos is very poor #116

seanh opened this issue Mar 22, 2017 · 15 comments
Labels

Comments

@seanh
Copy link

seanh commented Mar 22, 2017

I used to get great quality GIFs from Peek but now they're really poor:

peek 2017-03-22 11-20

The image is messed up, and the animation is speeded up too.

I'm using Peek 1.0.0 on Ubuntu Gnome 16.10. In Peek settings I have output format GIF, framerate 30, resolution downsampling 1.

Anything I can do to improve the quality?

@phw
Copy link
Owner

phw commented Mar 22, 2017

Can you give a screenshot of this area you recorded? My guess is that this short recording just had too many colors and this is the best palette ImageMagick could come up with. Does recording a different area make any differences?

Also please try starting Peek with peek --backend=ffmpeg and see if this changes the quality.

Some general recommendations for recording GIFs are in the FAQs at https://github.com/phw/peek#why-are-the-gif-files-so-big

@seanh
Copy link
Author

seanh commented Mar 22, 2017

Here's a screenshot of the web page I was recording:

screenshot from 2017-03-22 11-39-15

I don't think it's the colours of the web page or app, for example here's a recording of a different page in a different browser, same issue:

peek 2017-03-22 11-41

Here's a recording made with peek --backend=ffmpeg, I think you can still see the same colour issue but it's much less bad, and the speeding up seems to be gone:

peek 2017-03-22 11-43

I tried the avconv backend too, results look similar to ffmpeg.

Thanks for the link

@phw
Copy link
Owner

phw commented Mar 22, 2017

This is likely due to the fact that the gnome-shell backend currently works on a lossy encoded source video, and lossy encoding often leads to more colors. I will try to change that to record the raw RGB data before converting to GIF.

@phw phw added the bug label Mar 22, 2017
@phw
Copy link
Owner

phw commented Mar 22, 2017

What is a bit strange is that I cannot reproduce this at all (and I use the gnome-shell backend all the time). What version of Gnome Shell is that?

@phw
Copy link
Owner

phw commented Mar 22, 2017

And could also try recording the very same screen as WebM and post the result here?

@seanh
Copy link
Author

seanh commented Mar 22, 2017

Following the advice on the page you linked, if I set my framerate from 30 (which I had set it to) down to 15 and use the ffmpeg backend then I can get a GIF output with no visible problems:

peek 2017-03-22 12-12

@seanh
Copy link
Author

seanh commented Mar 22, 2017

Here's a webm video as requested (github won't let me upload it): https://www.dropbox.com/s/6h0mhl4q8vzwe3h/Peek%202017-03-22%2012-15.webm?dl=0

This was with the framerate set back up to 30 (so you can compare it to the early, problematic videos above) and with the default backend (no --backend arg passed to peek). Looks perfect.

@seanh
Copy link
Author

seanh commented Mar 22, 2017

I just double-checked that even with the framerate reduced to 15 the GIF output with the default backend is still very bad. To get a good GIF I need framerate down to 15 and ffmpeg backend. So that's what I'll do for now

phw added a commit that referenced this issue Apr 10, 2017
@phw
Copy link
Owner

phw commented Apr 10, 2017

I checked in a change I hope will help, recording to MP4 as intermediate format for GIF creation. Unfortunately I still cannot reproduce this myself. Can you try the latest version from the daily PPA at https://code.launchpad.net/~peek-developers/+recipe/peek-daily ? Should be updated in a few minutes.

@phw
Copy link
Owner

phw commented Apr 19, 2017

Still need a different solution, as the x264 codec is part of gstreamer ugly plugins and I don't want to hard depend on those for the core functionality.

@seanh
Copy link
Author

seanh commented Apr 21, 2017

Hi, I installed the daily PPA to try and test this for you but ran into another issue: #133

@spasarok
Copy link

Has this been resolved? I'm also having a problem with poor gif quality. My gifs are turning out grainy in some place and with green spots in others.
peek 2017-05-17 13-45

@phw
Copy link
Owner

phw commented May 22, 2017

@spasarok That's unrelated and something I cannot do much about. The GIF format is limited to 256 colors. If the image has more colors the colors might get substituted by similar colors or dithering might be applied. Color gradients, such as in the colored areas in your example, are really bad. In your case the green colors are added to the color palette, and reused in dithering for the greyish part on the left.

Try recording a scene with less colors or use a proper video format for output (WebM or MP4).

@spasarok
Copy link

Makes sense, thanks for the response.

@phw
Copy link
Owner

phw commented Jun 13, 2017

gnome-shell backend now also uses raw video as source for GIFs. I close this as fixed, please let me know if it still happens with latest master (will do a release soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants