Repository navigation
fix(recording): keep the recorded display fps when finalizing a Studio recording - #2687
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e of a variable-rate track
Member
Author
|
@greptileai review |
Member
Author
|
Removed the helper comment in 0813d91. @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.
Exports of Studio recordings dropped every picture shorter than 1/average-fps, and their audio/video sync wandered by tens of milliseconds. Also in cap-v0.6.0.
Cause
Every fragmented Studio recording is finalized after Stop by
RecoveryManager::remux_if_needed(apps/desktop-gpui/src/recording.rs,apps/cli/src/record.rs). That path rebuilds the recording's metadata inbuild_recovered_meta. It set the display track'sfpsfrom the finalized file's average frame rate (get_video_fps,avg_frame_rate), replacing the capture rate the recorder had written. A mostly static screen records few frames, so its average is far below the capture rate: 11 to 20 fps measured for 60 fps captures.The decoders number frames on that rate (
segment_video_timing→spawn_decoder(…, fps)). On an 11 fps grid, one step is 91 ms, so every picture on screen for less than that can be skipped. Moving content in a mostly static recording exports choppy, and editor playback does the same.Fix
build_recovered_metakeeps the display fps from the recording's own metadata. Only when there is none (crash recovery with no metadata) does it use the stream's base frame rate (r_frame_rate, newget_video_base_fps), not its average. The camera track already kept the recorded fps.Measured
Real devices on a MacBook Pro (built-in display and MacBook Pro Microphone). A stimulus shows a new marker picture 15 times a second and plays audio markers through the speakers; Cap's CLI records a 19 s Studio recording and exports it at 1920x1080, 30 fps.
screen minus miccompares when each picture and each audio marker reach the export against when the stimulus presented and played them.studio_finalization_keeps_the_recorded_display_fpswrites 120 fps into a recording's metadata, finalizes it and checks the 120 survives. It fails without the fix (30).

Confidence Score: 5/5
The PR appears safe to merge; the latest change fully addresses the previous finding.Summary
Studio finalization keeps the recorded display frame rate and uses the stream’s base rate when no positive stored rate exists.
Reviews (3) · Last reviewed commit: "test(recording): drop a fixture comment ..." · Reviewed by Greptile