About Clipr
A small Windows utility for the clip you want to paste into a chat: a bug, a gesture, a piece of interface, a few seconds long and a couple of megabytes heavy.
Why it exists
Showing someone what happened on your screen is a five-second problem that usually costs five minutes: record, find the file, open an editor, trim, convert, wonder why the result is 40 MB. Clipr keeps all of that in one window and ends with a file you can drop straight into a message.
The one decision everything follows from
Clipr records video and builds the GIF only at the very end. That sounds like a detail and it is the whole design.
Writing a GIF while recording means paying for every frame — including the ten seconds at the start where you were still reaching for the window, and the frames outside the crop you have not chosen yet. Building it last means the expensive pass happens once, over the final picture, and everything before it stays cheap enough to change your mind about.
The same reasoning explains pause. There is no pause in screen capture, and a capture left running would faithfully record frozen frames. So each pause closes a segment and continuing opens a new one; stopping joins them without re-encoding.
Two details worth a mention
The panel is not in its own recording. Windows can mark a window as excluded from capture, which hides it both from the plain screen grab and from the faster duplication path. The outline around the chosen area is four thin strips rather than one window with a hole in it, because that particular flag does not work on transparent windows.
The interface is built on springs. Motion is described by damping and response instead of duration, animations start from wherever the thing is right now so they can be caught mid-flight, and the speed of your mouse when you let go of the panel carries into the animation, so there is no seam between dragging and settling. At the edges of the screen the panel resists instead of stopping dead.
Built with
Python and PySide6 for the interface, FFmpeg for capture and encoding, gifsicle for the last squeeze. Packaged with PyInstaller and Inno Setup. The source is on GitHub under the MIT licence.
Getting in touch
Bugs and ideas belong in issues. The other things I make are on the projects page.
О программе
Небольшая утилита для Windows ради того самого ролика, который хочется вставить в чат: ошибка, жест, кусок интерфейса — пара секунд и пара мегабайт.
Зачем она
Показать человеку, что произошло на экране, — задача на пять секунд, которая обычно стоит пяти минут: записать, найти файл, открыть редактор, обрезать, конвертировать, удивиться, почему вышло 40 МБ. Clipr держит всё это в одном окне и заканчивает файлом, который можно сразу бросить в сообщение.
Одно решение, из которого следует всё остальное
Clipr пишет видео, а GIF собирает в самом конце. Звучит как деталь, а это и есть вся конструкция.
Писать GIF прямо во время записи — значит платить за каждый кадр, включая те десять секунд в начале, когда вы ещё тянулись к окну, и всё, что лежит за пределами кадрирования, которое вы пока не выбрали. Сборка в конце означает, что дорогой проход выполняется один раз, по финальной картинке, а всё до него остаётся достаточно дешёвым, чтобы можно было передумать.
Из той же логики растёт пауза. В захвате экрана паузы нет, а оставленный работать захват честно записал бы застывшие кадры. Поэтому каждая пауза закрывает сегмент, продолжение открывает новый, а стоп склеивает их без перекодирования.
Две детали, которые стоит упомянуть
Панель не попадает в собственную запись. Windows умеет помечать окно как исключённое из захвата, и это прячет его и от обычного снимка экрана, и от более быстрого способа дублирования. Рамка вокруг выбранной области собрана из четырёх тонких полосок, а не из одного окна с дыркой, потому что тот самый флаг не работает на прозрачных окнах.
Интерфейс построен на пружинах. Движение описывается затуханием и откликом, а не длительностью; анимация стартует от текущего положения вещи, поэтому её можно перехватить на лету; скорость мыши в момент, когда вы отпускаете панель, передаётся в анимацию, так что между перетаскиванием и остановкой нет шва. У краёв экрана панель сопротивляется, а не упирается.
На чём сделано
Python и PySide6 для интерфейса, FFmpeg для захвата и кодирования, gifsicle для финального сжатия. Сборка — PyInstaller и Inno Setup. Исходники на GitHub под лицензией MIT.
Связь
Ошибки и идеи — в issues. Остальное, что я делаю, — на странице проектов.