Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: configurable framerate for smoother animations#296

Merged
sassman merged 3 commits into
mainfrom
feat/higher-fps-rates
Nov 30, 2025
Merged

feat: configurable framerate for smoother animations#296
sassman merged 3 commits into
mainfrom
feat/higher-fps-rates

Conversation

@sassman
Copy link
Copy Markdown
Owner

@sassman sassman commented Nov 30, 2025

Summary

Adds a new --fps option 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:

# Smooth typing (10 fps, 100ms intervals)
t-rec --fps 10

# Very smooth (15 fps, 66ms intervals)
t-rec --fps 15

# Or use the new preset profile
t-rec --profile smooth

Usage Examples

FPS Interval Best For
4 (default) 250ms Regular recordings, smaller files
10 100ms Demos, presentations
15 66ms Fast typing, smooth cursor movement

Config File Support

You can save your preferred framerate in the config file:

[default]
fps = 10

[profiles.smooth]
fps = 10
idle-pause = "2s"

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 build succeeds
  • cargo test passes
  • cargo clippy passes
  • Manual test: t-rec --fps 4 (default behavior)
  • Manual test: t-rec --fps 10 (visibly smoother)
  • Manual test: t-rec --fps 15 (very smooth)
  • Manual test: t-rec --fps 3 errors (below minimum)
  • Manual test: t-rec --fps 16 errors (above maximum)
  • Manual test: Config file with fps = 10 works

Completes #28

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
@sassman sassman force-pushed the feat/higher-fps-rates branch from 94c83ca to 013d3f4 Compare November 30, 2025 20:03
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.
@sassman sassman marked this pull request as ready for review November 30, 2025 20:24
@sassman sassman merged commit d586965 into main Nov 30, 2025
12 checks passed
@sassman sassman deleted the feat/higher-fps-rates branch November 30, 2025 20:27
@5422m4n-bot 5422m4n-bot Bot mentioned this pull request Nov 30, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant