feat(av): decode the recorded video

Reading the video back: AVFoundation on macOS, the Media Foundation source
reader on Windows, a clear error elsewhere. A request for the frames between two
times is answered with the frame that was on screen at the start, even when the
decoder had to seek to an earlier key frame. `selftest` records a rendered
on-screen clock and compares the clock the video shows with the time the session
predicts.
This commit is contained in:
LGUG2Z committed 2026-10-27 22:22:56 -07:00
1 parent 5291a24fd4
commit 3e30d81bc5
12 files changed
+2156 -4

No files matched your search

+6
View File
@@ -102,6 +102,12 @@ the locked file.
The wire protocol is the same on both. The recorder's own binary does not depend on either komorebi's crates.
### Decoding the recorded video
macOS decodes with AVFoundation's `AVAssetReader`, Windows with Media Foundation's Source Reader, and the `unsupported`
host with nothing: it says so when asked to open a file. Both real hosts are asked for BGRA frames at a chosen size, so
that a contact sheet never decodes more pixels than it shows.
### The program's own windows
The recorder window and the viewer must not be in the video they are recording, and komorebi must not tile them.
+5
View File
@@ -54,6 +54,8 @@ The recorder window keeps itself out of the video (Windows 10 version 2004 or la
- **komorebi's log level.** The recorder never changes komorebi's log level or lifecycle; it only warns. For a useful
repro, start komorebi with `komorebi --log-level trace` (or `RUST_LOG=komorebi=trace`) first. At the default `info`
level most of what the window manager _decided_ is not in the log.
- **`ffmpeg`** is only needed for `frames` and `selftest`. It is never used to capture. The `nix develop` shell provides
it; otherwise `brew install ffmpeg`.
The recorder window is borderless and untitled on purpose: komorebi does not manage windows without a title, so opening
it does not move your layout around while you are trying to reproduce a layout bug. It is also excluded from the video, as is any other `komorebi-recorder` process.
@@ -167,6 +169,9 @@ anchors sampled every 5 seconds during the recording and at every sleep, so cloc
the event, so the stamp is when the handler **finished**; the `processing event` line in `komorebi.log` is when it
began.
`komorebi-recorder selftest` checks this on your machine: it records a rendered on-screen clock and compares the clock
visible in the video with the time the session predicts. The result is stored in `session.json` under `calibration`.
## Things to know
- **What can still be missing.** Events from a `log stream` during the moment it was dead and being restarted; komorebi