DEV Community

Cover image for GiffyPy: A fast, lightweight video editor to crop and trim screen recordings for your README
EffessDev
EffessDev

Posted on Edited on

GiffyPy: A fast, lightweight video editor to crop and trim screen recordings for your README

Note: The latest version includes changes to the export UI as well as a few new features. Please check the README for the latest info.

If you've ever tried adding a GIF or animated WebP of a screen recording to your project's README, you know how annoying it can be. You just want to show people how your product works without spending 20 minutes editing a video, but a few friction points always pop up.

A good README is important. Seeing an app in action builds way more trust than a wall of text. So I built a lightweight video editor called GiffyPy specifically to fix this workflow.

giffypy-cropping

Here are the main issues it solves (or click here to skip directly to the GitHub repository):

1. Removing the taskbar and black borders

In OBS Studio, even if you use Window Capture, you often end up with black bars or the taskbar stuck in the recording:

obs-recording

This happens because OBS forces a specific output resolution instead of locking to the recorded window. Cropping it cleanly in a regular video editor like DaVinci Resolve requires trial and error with resolutions. GiffyPy lets you drag a box and crop your video like an image.

2. Opening instantly and fast seeking

I usually only need to trim the ends and cut out a few middle parts. Waiting for a heavy editor like Clipchamp to load takes longer than the edit itself.

GiffyPy opens in under a second. To keep scrubbing fast, it generates a low-res image sequence during opening the file. When you move the playhead, it switches to the image. When you let go of the mouse, it swaps back to the full-res frame. So unlike Clipchamp, no loading screens while seeking.

3. Optimization

You adjust frame rate, resolution, and quality sliders so your video stays lightweight.

4. Fast exports

Exporting doesn't show a File Explorer pop-up every time. You can either overwrite the original file directly or save a numbered copy.

I'm also planning to add a "Copy to Clipboard" button so you can paste WebP/GIF files directly into READMEs or DEV.to posts. You can check the repo README for the latest updates.

5. Multiple export formats

It currently supports animated WebP, GIF, MP4, WebM, MOV, and MKV.

6. Custom app icon

Not a big feature. But an icon in the taskbar is very important for me:

How it was made

It's built using Python and PySide6. You can check out the code on GitHub:

👉 effessdev/GiffyPy

Note: It requires FFmpeg to work. On Windows, you can install it via the command prompt:

winget install Gyan.FFmpeg
Enter fullscreen mode Exit fullscreen mode

A question on PyInstaller

While opening a video file, the app briefly freezes while loading. This doesn't happen when I run main.py directly, only in the packaged .exe version built with PyInstaller.

Has anyone run into this issue with PyInstaller and PySide6/Qt before? I have no idea why this happens.

What features should I add next?

It largely ticks all my personal boxes right now, but I'd love to know what features would make this more useful for everyone. What should I work on next?

Top comments (9)

Collapse
 
ssapable profile image
ssapable •

"Waiting for the editor to load takes longer than the edit itself" is exactly why I never add GIFs to READMEs, and the low-res-while-scrubbing / full-res-on-release trick is a nicer fix than most "fast" editors manage. I turned the post into a 69-second hand-drawn cartoon: the black bars and the taskbar, the crop box, the six formats, and your open PyInstaller question, left open. No strings, yours to use or ignore, on a plain page with no sign-up:

ssap-pa.github.io/scripttoon-samples/

If any detail is off, say which shot and I'll re-render it. On the freeze: is it a onefile build? With PySide6, a onefile exe unpacks the Qt plugins (platforms, multimedia, imageformats) into a temp folder on first use, and the first file-open often lands exactly on that unpack. A onedir build, or warming the plugins at startup, is the usual way to find out whether that's it.

Picked as gem
Collapse
 
effessdev profile image
EffessDev •

Wow! 😮 How did you do that???! It's a onedir build. But the freeze happens after the editor has been loaded and when we try to load a video file in that editor. It's really confusing why that happens only on the packaged version. But how did you make that video? Is it something that you built? Thanks a lot! Really appreciate your effort 🥹 The only off thing that I was able to catch was the pronunciation (in the video: giffy-P-Y, actual: giffy-pie). But it's already really good!

Collapse
 
ssapable profile image
ssapable •

Fixed: the narration now says "Giffy Pie". The file on the page is replaced (same link, give GitHub Pages a minute). Sorry for the P-Y, the voice reads unknown names letter by letter and I didn't catch it.

How it's made: it's a small tool I built called ScriptToon. The storyboard is a Markdown file (narration, action, camera per shot), each shot is a Python function that draws on a hand-drawn background with tags and two cut-out characters, the narration is synthetic, and the characters were generated once from a character sheet. Your post was the whole input; nothing in the video came from anywhere else.

On the freeze: onedir rules out the unpack, so scratch that. Since it happens exactly when a file is loaded, my next suspect would be the FFmpeg subprocess you spawn for the low-res sequence: in a windowed (no console) PyInstaller build, a child process started without stdin/stdout/stderr redirected can block until its pipes are consumed, and it looks like a short freeze in the UI. Passing stdin=DEVNULL, stdout/stderr=PIPE (and reading them) plus CREATE_NO_WINDOW on Windows is the usual fix. If it's not that, the plain-script vs packaged difference points at something resolved by path: ffmpeg found through PATH in one case and not the other.

Thread Thread
 
effessdev profile image
EffessDev •

This fast??? 😱😱😱

Thread Thread
 
effessdev profile image
EffessDev •

But when I checked ssap-pa.github.io/scripttoon-samples/, it still says "giffy-p-y". At 0:18. Am I looking in the right place?

Thread Thread
 
ssapable profile image
ssapable •

You were looking in the right place. You checked about four minutes after I pushed the fix, so the page was most likely still serving the cached file. It says "Giffy Pie" at 0:18 now; a hard reload should pick it up. Thanks for checking it that closely.

Thread Thread
 
effessdev profile image
EffessDev •

Wow! It now correctly says GiffyPy! Good luck with Scriptoon. It's really impressive! 😊

Collapse
 
shieldxbot profile image
shieldx •

Việc tối ưu dung lượng file GIF/WebP cho README thường là một cực hình vì nếu để file quá nặng sẽ làm chậm tốc độ load trang GitHub. Mình từng mất rất nhiều thời gian để cân bằng giữa chất lượng hình ảnh và dung lượng file sao cho vừa đủ rõ nét mà vẫn nhẹ nhàng. Nếu GiffyPy xử lý được việc cắt tỉa nhanh gọn mà không làm giảm quá nhiều bitrate thì thực sự rất hữu ích cho quy trình làm documentation. Một mẹo nhỏ là sau khi crop xong, mọi người nên kiểm tra thêm độ phân giải thực tế hiển thị trên trình duyệt để tránh việc file trông quá mờ trên màn hình Retina.

Collapse
 
effessdev profile image
EffessDev •

Thanks 😊 Glad it helped!