feat: configurable framerate for smoother animations#296
Merged
Conversation
Adds a new --fps option to control the capture framerate between 4 and 15 fps. Higher framerates produce smoother typing animations, ideal for demos. - Add -f/--fps <4-15> CLI argument (default: 4) - Add fps field to config profiles - Introduce CaptureContext struct for cleaner capture_thread API - Fix GIF delay rounding for more accurate frame timing - Add [profiles.smooth] preset with fps=10 Usage: t-rec --fps 10 # Smooth typing animations t-rec --fps 15 # Very smooth animations t-rec --profile smooth # Use preset from config Relates to #28
94c83ca to
013d3f4
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
Shows a visual summary of the recording settings used: 📋 Recording summary ├─ fps: 10 ├─ idle-pause: 3s ├─ wallpaper: ventura (padding: 100px) ├─ frames: 127 └─ output: t-rec This helps users understand what settings were applied, especially when using profiles or config file defaults.
Merged
sassman
added a commit
that referenced
this pull request
Nov 30, 2025
## 🤖 New release * `t-rec`: 0.7.11 -> 0.8.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.7.12](v0.7.11...v0.7.12) - 2025-11-30 ### Added - add interactive prompt for video generation ([#298](#298)) - configurable framerate for smoother animations ([#296](#296)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Signed-off-by: Sven Kanoldt <[email protected]> Co-authored-by: 5422m4n-bot[bot] <203366424+5422m4n-bot[bot]@users.noreply.github.com> Co-authored-by: Sven Kanoldt <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
--fpsoption to make typing animations smoother. Perfect for demos and presentations where you want fluid, professional-looking recordings.The Problem
The default 4 fps capture rate can make fast typing appear choppy. Multiple keystrokes within a 250ms window get compressed into a single frame, making the animation feel "jumpy".
The Solution
You can now increase the capture framerate up to 15 fps for smoother animations:
Usage Examples
Config File Support
You can save your preferred framerate in the config file:
Trade-offs
Higher framerates produce larger files (roughly proportional to fps increase). The idle frame detection still works, so file sizes are optimized during pauses.
Test plan
cargo buildsucceedscargo testpassescargo clippypassest-rec --fps 4(default behavior)t-rec --fps 10(visibly smoother)t-rec --fps 15(very smooth)t-rec --fps 3errors (below minimum)t-rec --fps 16errors (above maximum)fps = 10worksCompletes #28