Skip to content

fix(inspector): timeline time uses footer time table, not avg fps - #45

Merged
virtexalejandro merged 6 commits into
mainfrom
fix/inspector-timeline-utc
Jul 27, 2026
Merged

fix(inspector): timeline time uses footer time table, not avg fps#45
virtexalejandro merged 6 commits into
mainfrom
fix/inspector-timeline-utc

Conversation

@onur-zenos

@onur-zenos onur-zenos commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

The inspector timeline computes frame time as frame_index / (total_frames / duration_seconds) -- a uniform average-fps mapping. On captures containing recording stalls, average fps is far below the live capture rate, so every displayed time is wrong by up to the total stalled duration.

Real case: a 16,556-frame capture with 643 s of stalls (avg 13.6 fps, live rate ~29 fps). A frame stamped 13:54 wall clock displays as ~6:47 on the timeline; scrubbing to 13:54 lands ~3.4 minutes of gameplay away. This breaks any workflow that aligns VTX frames with external video/audio by time.

Fix

TimelineViewService::FrameToElapsedSeconds maps frame -> elapsed seconds through the footer ReplayTimeData table:

  • created_utc (data-writer wall clock) preferred, game_time fallback
  • frames recorded without a stamp (value 0, e.g. warm-up frames) walk back to the nearest earlier stamped frame
  • files with no time table keep the previous linear mapping unchanged

Wired into both timeline consumers: the current-frame Time: readout and the frame-strip hover tooltip. The total duration and strip layout are untouched.

Testing

  • vtx_inspector builds clean (VS2022 Release) with -DBUILD_VTX_INSPECTOR=ON
  • Mapping cross-checked against the same footer table dumped via vtx_cli frame on the capture above: frame 5537 -> 834.3 s (13:54) matches the writer UTC stamp; old code displayed 406.8 s (6:47)
  • clang-format (v19, repo .clang-format) applied to changed files

The timeline window derived frame time as frame_index / (total_frames /
duration_seconds). On captures with recording stalls the average fps is
far below the live rate, so displayed times drift by the total stalled
time (observed: a frame stamped 13:54 wall clock displayed as ~6:47 on a
capture with 643s of stalls at ~29fps live rate).

Map frame -> elapsed seconds through the footer ReplayTimeData table
instead: created_utc preferred, game_time fallback, walking back to the
nearest stamped frame for frames recorded without a value. Files without
a time table keep the old linear mapping. Applies to the current-time
readout and the strip hover tooltip.
BuildDroppedFrameMap flags every frame whose wall-clock span from the
previous stamped frame (footer created_utc, game_time fallback) exceeds
1.5x the expected interval, and estimates the missing frame count per
gap. The timeline strip paints flagged frames red, the info panel shows
a gap/missing-frame summary plus an editable "Drop FPS" expected rate
(default 30), and the hover tooltip reports the gap duration and
estimated missing frames. Files without a time table flag nothing.
…tional

Each gap from the dropped-frame map is overlaid on the slider track as a
red band positioned and sized by wall clock (start_seconds / duration),
so band width reads as gap duration - unlike the frame strip, where a
two-minute stall spans only a few bars.
The slider axis is now elapsed seconds over the full capture duration:
the grab sits at the current frame's footer-table time, and dragging
resolves the frame via binary search for the last stamp at or before the
grabbed time (zero entries skipped; linear fallback without a table).
Equal slider distance now means equal wall-clock time, and the red gap
bands align with the grab. Inside a gap the grab resolves to the frame
at the gap's start, snapping to it on release.
Captures never sustain their nominal rate, so gap detection now runs at
entered_fps * 0.75 (30 -> 22.5 effective). The input label shows the
factor and the resulting effective rate.
@onur-zenos
onur-zenos force-pushed the fix/inspector-timeline-utc branch from 8483cab to c36c349 Compare July 24, 2026 20:46
@onur-zenos
onur-zenos force-pushed the fix/inspector-timeline-utc branch from c36c349 to a7e2cc2 Compare July 27, 2026 10:19
@virtexalejandro
virtexalejandro merged commit 3be33a2 into main Jul 27, 2026
9 checks passed
@virtexalejandro
virtexalejandro deleted the fix/inspector-timeline-utc branch July 27, 2026 10:34
@virtexalejandro
virtexalejandro restored the fix/inspector-timeline-utc branch July 27, 2026 10:35
@virtexalejandro
virtexalejandro deleted the fix/inspector-timeline-utc branch July 27, 2026 10:35
virtexalejandro pushed a commit that referenced this pull request Jul 27, 2026
* fix(inspector): timeline time uses footer time table, not avg fps
* chore: ignore build-inspector/
* feat(inspector): paint recording gaps red on the timeline strip
* feat(inspector): paint recording gaps on the main slider, time-proportional
* feat(inspector): main slider scrubs wall-clock time, not frame index
* feat(inspector): derate entered Drop FPS by 0.75 for real-world rates
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.

2 participants