All postsEngineering

How we keep gameplay actions in step with the video

A model that learns from gameplay needs to know which frame a key press belongs to. This is how Runtime Recorder times video, sound and input on one clock, and how we check it.

Runtime · 20 November 2026 · 4 min read

A recording of someone playing a game is two things: what they saw and what they did. For training a world model or a game-playing agent, the second is only useful if it can be placed on the first. A key press that lands three frames late teaches the model that the world reacts before the player acts.

Screen recorders were not built for this. They capture video well and treat input, if they capture it at all, as a separate file with its own idea of time. We wrote Runtime Recorder so that everything in a recording shares one timeline from the start.

One clock

Every recording is cut into one-minute segments. Each segment has an origin: a single reading of the operating system's high-resolution counter, taken at the instant the segment starts. On Windows that counter is QueryPerformanceCounter.

Every frame, every block of audio and every input event is stamped as an offset from that origin. The offsets are whole microseconds. There are no floating-point times anywhere in a recording, so two tools reading the same file cannot disagree by rounding.

One row per frame

Next to the video, each segment has a file with one row for every frame given to the encoder:

{"frame": 0, "t_us": 0, "native_us": -412500}

t_us is where the frame sits on the segment's timeline. native_us is when its image was really captured. The two are equal for an ordinary frame. They differ when the screen did not change and the recorder repeated the last image to keep the video continuous. A reader can tell a new image from a held one.

The video is H.264 with no frame reordering, so the order frames are decoded in is the order they are shown in. Row 12 is frame 12.

Input as it happened

Input is a second file of rows on the same timeline:

  • Keys and mouse buttons are written as edges: one row when pressed, one when released.
  • Mouse movement is the raw device delta, before the operating system applies pointer acceleration. This is what a game reads for camera control.
  • Scroll is in wheel notches.
  • The cursor and gamepads are state, not events. The recorder samples them every 8 milliseconds and writes a row when something changed. A gamepad row holds the buttons, triggers and sticks as the controller reported them, with no dead zone applied.

The cursor is left out of the picture and written as rows instead, with its position and whether the game is showing it. A model that needs the cursor can draw it. A model that does not is not forced to learn around an arrow baked into every frame.

Only the game

When a contributor records one window, input is written only while that window's app is in front. If they switch to a chat app and type, the recording has a row saying another app took focus, and nothing they typed there. We record the name of the program, such as game.exe, and never the window title.

Nothing made up

The recorder does not resample, mix or fill gaps. Silence in the audio is silence that was observed. If a frame was dropped because the PC could not keep up, it is missing from both the video and the frame list, and the segment says how many were dropped.

Checking it

A recording is not trusted because the recorder says so. Before it is reviewed, our server decodes the whole video and matches every decoded frame to its row, checks that the times only move forward, and checks both audio tracks against the same timeline. A segment that fails is not approved.

Only then does a person review the footage.

Why it matters

Most of this is invisible when you watch a recording. It shows up when you train on one: actions can be placed on the frame they happened in. Our gameplay data is built on this format.