README.md
1# Peek - an animated GIF recorder
2[![GitHub release](https://img.shields.io/github/release/phw/peek.svg)](https://github.com/phw/peek/releases)
3[![License: GPL v3+](https://img.shields.io/badge/license-GPL%20v3%2B-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
4[![Packaging status](https://repology.org/badge/tiny-repos/peek.svg)](https://repology.org/metapackage/peek/packages)
5[![Build Status](https://travis-ci.org/phw/peek.svg?branch=master)](https://travis-ci.org/phw/peek)
6[![Translation Status](https://hosted.weblate.org/widgets/peek/-/svg-badge.svg)](https://hosted.weblate.org/engage/peek/?utm_source=widget)
7
8![Peek recording itself](https://raw.githubusercontent.com/phw/peek/master/data/screenshots/peek-recording-itself.gif)
9
10Simple screen recorder with an easy to use interface
11
12<!-- START doctoc generated TOC please keep comment here to allow auto update -->
13<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14## Contents
15
16- [About](#about)
17- [Requirements](#requirements)
18 - [Runtime](#runtime)
19 - [Development](#development)
20- [Installation](#installation)
21 - [Official distribution packages](#official-distribution-packages)
22 - [Flatpak](#flatpak)
23 - [Snappy](#snappy)
24 - [AppImage](#appimage)
25 - [Ubuntu](#ubuntu)
26 - [ElementaryOS](#elementaryos)
27 - [Debian](#debian)
28 - [Fedora](#fedora)
29 - [Solus](#solus)
30 - [Arch Linux](#arch-linux)
31 - [Other distributions](#other-distributions)
32 - [From source](#from-source)
33- [Frequently Asked Questions](#frequently-asked-questions)
34 - [How can I capture mouse clicks and/or keystrokes?](#how-can-i-capture-mouse-clicks-andor-keystrokes)
35 - [How can I improve the quality of recorded GIF files](#how-can-i-improve-the-quality-of-recorded-gif-files)
36 - [Why are the GIF files so big?](#why-are-the-gif-files-so-big)
37 - [If GIF is so bad why use it at all?](#if-gif-is-so-bad-why-use-it-at-all)
38 - [What about WebM or MP4? Those are well supported on the web.](#what-about-webm-or-mp4-those-are-well-supported-on-the-web)
39 - [What is the cause for "Could not start GNOME Shell recorder" errors?](#what-is-the-cause-for-could-not-start-gnome-shell-recorder-errors)
40 - [Why can't I interact with the UI elements inside the recording area?](#why-cant-i-interact-with-the-ui-elements-inside-the-recording-area)
41 - [My recorded GIFs flicker, what is wrong?](#my-recorded-gifs-flicker-what-is-wrong)
42 - [On i3 the recording area is all black, how can I record anything?](#on-i3-the-recording-area-is-all-black-how-can-i-record-anything)
43 - [Why no native Wayland support?](#why-no-native-wayland-support)
44- [Contribute](#contribute)
45 - [Development](#development-1)
46 - [Translations](#translations)
47- [License](#license)
48
49<!-- END doctoc generated TOC please keep comment here to allow auto update -->
50
51## About
52Peek makes it easy to create short screencasts of a screen area. It was built
53for the specific use case of recording screen areas, e.g. for easily showing UI
54features of your own apps or for showing a bug in bug reports. With Peek, you
55simply place the Peek window over the area you want to record and press
56"Record". Peek is optimized for generating animated GIFs, but you can also
57directly record to WebM or MP4 if you prefer.
58
59Peek is not a general purpose screencast app with extended features but
60rather focuses on the single task of creating small, silent screencasts of
61an area of the screen for creating GIF animations or silent WebM or MP4
62videos.
63
64Peek runs on X11 or inside a GNOME Shell Wayland session using XWayland.
65Support for more Wayland desktops might be added in the future (see FAQs below).
66
67
68## Requirements
69### Runtime
70
71- GTK+ >= 3.20
72- GLib >= 2.38
73- [libkeybinder3](https://github.com/kupferlauncher/keybinder)
74- FFmpeg >= 3
75- GStreamer 'Good' plugins (for recording on GNOME Shell)
76- GStreamer 'Ugly' plugins (for MP4 recording on GNOME Shell)
77- [gifski](https://gif.ski/) (optional but recommended for improved GIF quality)
78
79### Development
80
81- Vala compiler >= 0.22
82- Meson >= 0.37.0
83- Gettext (>= 0.19 for localized .desktop entry)
84- txt2man (optional for building man page)
85
86
87## Installation
88### Official distribution packages
89Peek is available in official package repositories for the following
90distributions:
91
92- [Arch Linux](https://www.archlinux.org/packages/community/x86_64/peek/)
93- [Fedora](https://koji.fedoraproject.org/koji/packageinfo?packageID=28880)
94- [Gentoo](https://packages.gentoo.org/packages/media-video/peek)
95- [NixOS](https://nixos.org/nixos/packages.html?channel=nixos-unstable&query=%5Epeek)
96- [OpenSUSE Tumbleweed](https://software.opensuse.org/package/peek)
97- [Parabola](https://www.parabola.nu/packages/?q=peek)
98- [Solus](https://dev.getsol.us/source/peek/)
99
100### Flatpak
101Peek can be installed on all distributions supporting [Flatpak](http://flatpak.org/) from [Flathub](https://flathub.org/apps/details/com.uploadedlobster.peek).
102To install, either download
103[com.uploadedlobster.peek.flatpakref](https://flathub.org/repo/appstream/com.uploadedlobster.peek.flatpakref)
104and open it with GNOME Software or install via command line (first time flatpak
105users need to follow the [flatpak/flathub setup instructions](https://flatpak.org/setup/) first):
106
107 flatpak install flathub com.uploadedlobster.peek
108
109For full functionality you should also install
110[xdg-desktop-portal-gtk](https://github.com/flatpak/xdg-desktop-portal-gtk).
111It is available for most current distributions. Once installed, you can run Peek
112via its application icon in your desktop environment or from the command line:
113
114 flatpak run com.uploadedlobster.peek
115
116To update to the latest version run:
117
118 flatpak update --user com.uploadedlobster.peek
119
120To test the latest development version you can install
121[peek-master.flatpakref](http://flatpak.uploadedlobster.com/peek-master.flatpakref)
122
123### Snappy
124Peek no longer has officially supported Snap packages, see
125[the announcement](https://www.reddit.com/r/Ubuntu/comments/870bcn/snap_support_for_peek_screen_recorder_discontinued/).
126Please consider using the Flatpak or AppImage versions or use the Ubuntu PPA
127if you are using Ubuntu.
128
129### AppImage
130Peek [AppImage](https://appimage.org/) packages are available on the
131[release page](https://github.com/phw/peek/releases). To run download the
132`.AppImage` file and set it executable, then just run it. You can name the file
133however you want, e.g. you can name it just `peek` and place it in `$HOME/bin`
134for easy access. See the [AppImage wiki](https://github.com/AppImage/AppImageKit/wiki)
135for more information on how to use AppImages and integrate them with your system.
136
137### Ubuntu
138You can install the latest versions of Peek from the
139[Ubuntu PPA](https://code.launchpad.net/~peek-developers/+archive/ubuntu/stable).
140
141 sudo add-apt-repository ppa:peek-developers/stable
142 sudo apt update
143 sudo apt install peek
144
145If you want to use the latest development version there is also a
146[PPA with daily builds](https://code.launchpad.net/~peek-developers/+archive/ubuntu/daily)
147available. Use the repository `ppa:peek-developers/daily` in the above commands.
148
149### ElementaryOS
150Adding PPA repositories requires the package `software-properties-common`
151
152 sudo apt install software-properties-common
153 sudo add-apt-repository ppa:peek-developers/stable
154 sudo apt update
155 sudo apt install peek
156
157If you want to use the latest development version there is also a
158[PPA with daily builds](https://code.launchpad.net/~peek-developers/+archive/ubuntu/daily)
159available. Use the repository `ppa:peek-developers/daily` in the above commands.
160
161### Debian
162There are official Debian packages for Debian 10 ("Buster") via main repository
163and packages for Debian 9 ("Stretch") via
164[`stretch-backports`](https://packages.debian.org/stretch-backports/peek)
165repository. Please refer to [Debian Backports Website](https://backports.debian.org/)
166for detailed usage of `stretch-backports` repository.
167
168After enabling `stretch-backports` for Debian 9 (Debian 10 or `Sid` doesn't need
169any tweaks at all), installation can be done by simply typing:
170
171 sudo apt install peek
172
173Besides, you can also create your own `.deb` package for Peek easily.
174First, install the build dependencies:
175
176 sudo apt install cmake valac libgtk-3-dev libkeybinder-3.0-dev libxml2-utils gettext txt2man
177
178Then build Peek and package it:
179
180 git clone https://github.com/phw/peek.git
181 mkdir peek/build
182 cd peek/build
183 cmake -DCMAKE_INSTALL_PREFIX=/usr -DGSETTINGS_COMPILE=OFF ..
184 make package
185
186This will create the package `peek-x.y.z-Linux.deb` (where `x.y.z` is the
187current version). You can install it with `apt`:
188
189 sudo apt install ./peek-*-Linux.deb
190
191### Fedora
192**Note: Fedora by default does not provide the required `ffmpeg` package in its
193repositories. For this reason it is recommended for Fedora users to install Peek
194with Flatpak, see above. If you prefer to install Peek from the repositories
195you should install `ffmpeg` separately as described below.**
196
197Peek is available in the default repositories (Fedora 29 and later):
198
199 sudo dnf install peek
200
201To install the required `ffmpeg` package you can use the RPM Fusion free
202repository, see the
203[setup instructions for RPM Fusion](https://rpmfusion.org/Configuration).
204Once the repository is enabled install FFmpeg with:
205
206 sudo dnf install ffmpeg
207
208For MP4 recording on GNOME Shell you also need the `gstreamer1-plugins-ugly`
209package also available from RPM Fusion free:
210
211 sudo dnf install gstreamer1-plugins-ugly
212
213### Solus
214Solus users can simply install with:
215
216 sudo eopkg it peek
217
218### Arch Linux
219Arch Linux users can simply install with:
220
221 sudo pacman -S peek
222
223For GNOME Shell recording there are some optional packages you can choose from:
224
225 gst-plugins-good: Recording under Gnome Shell
226 gst-plugins-ugly: MP4 output under Gnome Shell
227 gifski: High quality GIF animations with thousands of colors
228
229If you have a package manager for AUR (or fetch from AUR manually) the git
230version is available [here](https://aur.archlinux.org/packages/peek-git)
231
232
233### Other distributions
234See the [Repology package list](https://repology.org/metapackage/peek/packages)
235for a list of Peek packages for various distributions.
236
237### From source
238You can build and install Peek using Meson with Ninja:
239
240 git clone https://github.com/phw/peek.git
241 cd peek
242 meson --prefix=/usr/local builddir
243 cd builddir
244 ninja
245
246 # Run directly from source
247 ./peek
248
249 # Install system-wide
250 sudo ninja install
251
252*Note: `ninja` might be called `ninja-build` on some distributions.*
253
254## Frequently Asked Questions
255### How can I capture mouse clicks and/or keystrokes?
256Peek does not support this natively. But you could install an external tool
257like [key-mon](https://github.com/critiqjo/key-mon) which is usually included
258in most distributions, so you can easily install with your package manager.
259Then start key-mon with `key-mon --visible_click`. The `--visible_click` option
260is for drawing small circles around mouse clicks.
261
262### How can I improve the quality of recorded GIF files
263To get the best possible quality you should install the [gifski](https://gif.ski/)
264GIF encoder. If available Peek will automatically use gifski and will provide
265a quality slider in the preferences dialog. The default value will give a
266balanced result between quality and file size. Set the quality to maximum if you
267want to get the highest possible quality even with thousands of colors. The file
268size will increase significantly, though (see below).
269
270### Why are the GIF files so big?
271The GIF format is highly inefficient and not well suited for doing large
272animations with a lot of changes and colors. Peek tries its best to reduce the
273file size by using FFmpeg or [gifski](https://gif.ski/) to generate optimized
274GIF files. For best results:
275
276- Use a lower frame rate. 10fps is the default and works well, but in many
277 cases you can even get good results with lower framerates.
278- If you have [gifski](https://gif.ski/) installed you can adjust the GIF
279 quality in the preferences. A lower quality gives a smaller file size at the
280 expense of visual quality (see above).
281- Avoid too much change. If there is heavy animation the frames will differ
282 a lot.
283- Record small areas or use the downsample option to scale the image. The GIF
284 file format is not well suited for high resolution or full-screen recording.
285- Avoid too many colors, since GIF is limited to a 256 color palette per frame.
286 This one is not so much about file size but more about visual quality.
287- If the above suggestions are not suitable for your use case, consider using
288 WebM or MP4 format (see below).
289
290### If GIF is so bad why use it at all?
291While GIF is a very old format, it has seen some rise in usage again in recent
292years. One reason is its easy usage in the Web. GIF files are supported nearly
293everywhere, which means you can add animations easily to everywhere where you
294can upload images. With real video files you are still more limited. Typical use
295cases for Peek are recording small user interactions for showing UI features
296of an app you developed, for making short tutorials or for reporting bugs.
297
298### What about WebM or MP4? Those are well supported on the web.
299Peek allows you to record in both WebM and MP4 format, just choose your
300preferred output format in the preferences. Both are well supported by modern
301browsers, even though they are still not as universally supported by tools and
302online services as GIFs.
303
304### What is the cause for "Could not start GNOME Shell recorder" errors?
305
306This usually indicates an error while starting the built-in GNOME shell
307recorder. Unfortunately Peek does not receive any error details, to find out
308more about this issues look at the GNOME Shell log output in `journalctl`.
309
310A common cause for this is that the GNOME Shell recorder is already running,
311either because it was started via the GNOME Shell keyboard shortcut or by
312another application.
313
314If this error is shown when trying to record MP4 a common cause is that you are
315missing the [GStreamer ugly](https://gstreamer.freedesktop.org/modules/gst-plugins-ugly.html)
316plugins, which provide MP4 encoding. Please refer to the documentation of your
317distribution on how to install these.
318Do note that you have to logout and login for Peek to recognize the new
319installed libraries if you are running the Wayland display server.
320
321See also issue [#287](https://github.com/phw/peek/issues/287) for related discussion.
322
323### Why can't I interact with the UI elements inside the recording area?
324You absolutely should be able to click the UI elements inside the area you are
325recording. If you use i3 you should stack Peek with the window you intend to
326record or make sure all windows are floating and uncheck "Always on top" from
327the Peek settings. If you want to be able to control the area when recording
328in i3 you can move Peek to the Scratchpad it will keep recording the area once
329you hide the window. If this does not work for you on any other window manager
330please open an [issue on GitHub](https://github.com/phw/peek/issues).
331
332### My recorded GIFs flicker, what is wrong?
333Some users have experienced recorded windows flicker or other strange visual
334artifacts only visible in the recorded GIF. This is most likely a video driver
335issue. If you are using Intel video drivers switching between the SNA and UXA
336acceleration methods can help. For NVIDIA drivers changing the "Allow Flipping"
337setting in the NVIDIA control panel
338[was reported to help](https://github.com/phw/peek/issues/86).
339
340### On i3 the recording area is all black, how can I record anything?
341i3 does not support the X shape extension. In order to get a transparent
342recording area, you have to run a compositor such as Compton.
343
344### Why no native Wayland support?
345Wayland has two restrictions that make it hard for Peek to support Wayland
346natively:
347
3481. The Wayland protocol does not define a standard way for applications to
349 obtain a screenshot. That is intentional, as taking an arbitrary screenshot
350 essentially means any application can read the contents of the whole display,
351 and Wayland strives to offer improved security by isolating applications. It
352 is up to the compositors to provide screenshot capability, and most do. GNOME
353 Shell also provides a public interface for applications to use which Peek
354 does support.
355
3562. The Wayland protocol does not provide absolute screen coordinates to the
357 applications. There is not even a coordinate system for windows at all. Again
358 this is intentional, as they are not needed in many cases and you do not need
359 to follow restrictions imposed by the traditional assumption that the screen
360 is a rectangular area (e.g. you can have circular screens or [layout windows
361 in 3D space](https://www.youtube.com/watch?v=_FjuPn7MXMs)).
362
363Unfortunately, the whole concept of the Peek UI is that the window position
364itself is used to obtain the recording coordinates. That means, for now, there
365cannot be any fully native Wayland support without special support for this
366use case by the compositor.
367
368However, it is possible to use Peek in a GNOME Shell Wayland session using
369XWayland by launching Peek with the X11 backend:
370
371 GDK_BACKEND=x11 peek
372
373Support for compositors other than GNOME Shell can be added if a suitable
374screencasting interface is provided.
375
376
377## Contribute
378If you want to help make Peek better the easiest thing you can do is to
379[report issues and feature requests](https://github.com/phw/peek/issues).
380Or you can help in development and translation.
381
382### Development
383You are welcome to contribute code and provide pull requests for Peek. The
384easiest way to start is looking at the open issues tagged with
385[good first issue](https://github.com/phw/peek/labels/good%20first%20issue).
386Those are open issues which are not too difficult to solve and can be started
387without too much knowledge about the code.
388
389Another good starting point are issues tagged with
390[help wanted](https://github.com/phw/peek/labels/help%20wanted). Those issues are
391probably harder to solve, but for some reason I cannot work on it for now and
392would love to see somebody jump in.
393
394In any case, just leave a note on the issue itself that you are working on it,
395to avoid multiple people working on the same issue.
396
397
398### Translations
399You can help translate Peek into your language. Peek is using
400[Weblate](https://weblate.org/) for translation management.
401
402Go to the [Peek localization project](https://hosted.weblate.org/projects/peek/translations/)
403to start translating. If the language you want to translate into is not already
404available, you [can add it here](https://hosted.weblate.org/projects/peek/translations/#newlang).
405
406If you want to be credited for your translation, please add your name to the
407[translator-credits](https://hosted.weblate.org/search/peek/translations/?q=translator-credits&search=exact&source=on&type=all&ignored=False)
408for your language. The translator credits are shown in Peek's About dialog.
409
410
411## License
412Peek Copyright © 2015-2018 by Philipp Wolfer <ph.wolfer@gmail.com>
413
414Peek is free software: you can redistribute it and/or modify
415it under the terms of the GNU General Public License as published by
416the Free Software Foundation, either version 3 of the License, or
417(at your option) any later version.
418
419Peek is distributed in the hope that it will be useful,
420but WITHOUT ANY WARRANTY; without even the implied warranty of
421MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
422GNU General Public License for more details.
423
424You should have received a copy of the GNU General Public License
425along with Peek. If not, see <http://www.gnu.org/licenses/>.
426