Four files and a manifest, not one video
Every other recorder burns the webcam into the screen while it captures. We write four files and a manifest instead, and it changes what the editor is allowed to do.
A screen recording usually arrives as one file. The webcam is already in the corner, already round, already the size it will always be. That is convenient right up to the first time you want it somewhere else.
Prequel writes a take as five files in one directory:
screen.mp4 the display, window or region
camera.mp4 the webcam, on its own clock
mic.m4a the microphone
system.m4a system audio
session.json how the four line up in time
Nothing is composited during capture. The bubble in the corner of the editor is
drawn at playback, from camera.mp4, on top of screen.mp4. That is the whole
trick, and everything good about the editor follows from it.
What it buys
Move the camera. Resize it. Change it from a circle to a squircle, mirror it, push it behind a zoom, or delete it from a single slice and leave it everywhere else. None of that is an effect applied to a baked pixel — it is a layout decision being made for the first time, at the moment you make it.
The audio is the same story. The microphone and the system output are separate tracks with separate gains, so the moment somebody's notification lands at full volume over your voice is a slider, not a re-record.
What it costs
Something has to record how the four files line up, because they do not all start at the same instant. Asking macOS for the webcam takes a few hundred milliseconds longer than asking it for the screen, and that gap is real: play both from zero and the camera runs ahead of the screen for the rest of the take.
That offset lives in session.json and nowhere else. It is the one piece of
state that cannot be recovered from the media, and it is worth being precise
about why.
The trap inside the manifest
Each file is written by an AVAssetWriter that opens its session at the first
sample it receives. Whatever that sample's presentation timestamp was, it
becomes zero. So every media file in the directory starts at zero, no matter
when the recording of it actually began.
The mistake — and it is a good one, because everything about it looks correct — is to probe a file for its start time and subtract that too. The probe returns zero, because the writer already normalised it. Subtracting the manifest offset and a probed start double-counts the gap, and the result is a camera that drifts against the screen by exactly the amount you were trying to fix.
Take the offset from the manifest. Seek the file from zero. That is the entire rule, and there is a test named after it.
Why not just composite and be done
Because the decision is permanent by the time you can see it. A recorder that bakes the layout is asking you to get the layout right before you know what the recording contains — before you know that the thing worth looking at in minute four is behind where the bubble sits.
Four files is more bookkeeping. It is also the only version where the answer to "can I move that?" is yes.