You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: configurable framerate for smoother animations (#296)
## 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:
```sh
# 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:
```toml
[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
- [x] `cargo build` succeeds
- [x] `cargo test` passes
- [x] `cargo clippy` passes
- [x] Manual test: `t-rec --fps 4` (default behavior)
- [x] Manual test: `t-rec --fps 10` (visibly smoother)
- [x] Manual test: `t-rec --fps 15` (very smooth)
- [x] Manual test: `t-rec --fps 3` errors (below minimum)
- [x] Manual test: `t-rec --fps 16` errors (above maximum)
- [x] Manual test: Config file with `fps = 10` works
Completes #28
---------
Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
0 commit comments