Repository navigation
fix(recording): heal Studio display fps that finalization replaced with the average rate - #2689
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…n runs, not the most common one
Member
Author
|
@greptileai review |
Member
Author
|
@greptileai review |
…s, so a late frame is not one
Member
Author
|
@greptileai review |
This branch was successfully deployed
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.
Problem
Every fragmented Studio recording is finalized through
RecoveryManager::remux_if_needed, which until #2687 stored the display track's average frame rate asdisplay.fps. Decoders place frames on that rate. A mostly static screen averages far below its capture rate, so the editor and exports dropped frames, worst on idle screens (a 60 fps capture stored as 9 fps). #2687 stops new recordings getting the average. This PR repairs the recordings already on disk.Fix
cap_enc_ffmpeg::remux::get_video_capture_fpsestimates the rate frames were captured at from the first 20,000 packet timestamps:avg_frame_rateis the bug.r_frame_rateis the finest grid every timestamp lies on, which can be the display refresh: a 30 fps window capture on a 120 Hz screen reads 120.track_heal::heal_average_display_fpsacts only on segments whose stored fps equals the file's rounded average and whose capture rate is higher. It rewrites onlyrecording-meta.json; the media is untouched. A healed fps no longer equals the average, so it runs once.heal_stretched_tracks, which the Tauri editor already calls on open. The GPUI editor never calledheal_stretched_tracks; itspreflightnow does, non-fatally, the same way the Tauri path does.Evidence
Scan of every Studio recording on a dev Mac (162 recordings, 177 display segments in 5 app data dirs), using a Python copy of the estimator:
r_frame_rate120 and 30 fps frames estimates 30, so it is left alone.Exports of APFS clones of four affected recordings (cursor hidden, zooms off, at most 60 s each),
cap exportbuilt from this branch, before and after the heal. "Distinct" counts output frames kept bympdecimate. "Ideal" is the source display track resampled to the export rate, thenmpdecimate.The window recording shows no measurable change at
mpdecimate's defaults. With stricter thresholds, encoder noise outweighs the signal (both exports count above the ideal), so that row is inconclusive, not a regression.Tests
capture_fps_*(enc-ffmpeg) cover:track_healtests:capture_fps_*tests and the heal test fail;cargo test -p cap-enc-ffmpeg --lib(166 passed),cargo test -p cap-recording --lib(668 passed), clippy clean for the touched crates andcap-desktop-gpui.

Confidence Score: 5/5
No new independent blocking finding was identified in the changes since the previous review.Summary
Repairs saved Studio display frame rates without changing the media.
All supplied previous threads are unnumbered, so they receive no numbered previous-finding entries.
Reviews (4) · Last reviewed commit: "fix(enc-ffmpeg): a hold beside a short f..." · Reviewed by Greptile