fix(recording): encode segmented video with real capture timestamps to fix white editor preview and cursor desync#1976
Open
ManthanNimodiya wants to merge 1 commit into
Conversation
…o fix white editor preview and cursor desync
Comment on lines
342
to
343
| .await | ||
| .map(|decoder| decoder.with_max_fallback_distance(SCREEN_MAX_FALLBACK_DISTANCE)) | ||
| .map_err(|e| format!("Screen:{e}")) |
There was a problem hiding this comment.
Minor maintainability thought: this relies on the decoder’s default fallback distance (currently 90). If that default ever changes again, this regression could come back; consider making the screen value explicit here.
Suggested change
| .await | |
| .map(|decoder| decoder.with_max_fallback_distance(SCREEN_MAX_FALLBACK_DISTANCE)) | |
| .map_err(|e| format!("Screen:{e}")) | |
| .await | |
| .map(|decoder| decoder.with_max_fallback_distance(90)) | |
| .map_err(|e| format!("Screen:{e}")) |
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.
Fixes the 0.5.4 Windows regression: white editor preview, and exported videos with cursor position/timing way off (0.5.2 unaffected).
42b059978changed the segmented encoder to stamp frames as frame_index / fps instead of their capture timestamps. Windows Graphics Capture only delivers frames when the screen changes, so the video's time axis compresses vs wall clock, desyncing the cursor track and leaving editor seeks pointing past the last PTS. Combined with the screen decoder's fallback distance being tightened from 90 frames to 4 in the same release, seeks find no frame and the preview renders white. macOS is unaffected (AVAssetWriter path).Fix: restore real capture timestamps in queue_frame and the default screen fallback distance. The non-monotonic-timestamp corruption that motivated the frame-index change is already handled by
normalize_input_ptsin the encoder, thejittery_capture_timestamps_still_produce_decodable_segmentstest still passes (32/32 green).Greptile Summary
This PR restores screen recordings to wall-clock video timing. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(recording): encode segmented video w..." | Re-trigger Greptile
Context used: