Skip to content

Audio Video Sync

Rique edited this page Oct 3, 2026 · 2 revisions

Audio and Video Sync

A clip where the sound lands a beat late is worse than no clip. Audio and video come from different clocks (the GPU's frame timing and each audio device's own sample clock), so keeping them together takes deliberate work at every stage. This page walks through how Flashback does it, and how to check a clip yourself.

The short version: sound starts on the real video timeline, captured audio is written back to back with gaps filled only where samples were truly missed, every segment's sound is joined sample for sample, and from 0.8.0 clips start on a keyframe so Windows players stay in sync too. A built-in Capture health check measures any clip on demand.

Where sync can go wrong

 display frames ---- GPU clock ----+
                                   +--> encoder --> segment --> join --> clip
 system audio ----- device clock --+
 microphone ------- device clock --+

Drift can creep in at five points: when recording starts, when an audio device drops or inserts samples, where a saved clip starts, when two segments are joined, and when separate tracks are mixed. Flashback handles each one.

1. Starting on the real video timeline

When you start the buffer there's a short delay between asking for capture and the first frame actually arriving. If the audio started counting at the request, it would run slightly ahead of the picture.

Flashback timestamps the first encoded frame at the moment it was captured, then starts the external audio tracks on that same timeline. Sound and picture begin together.

2. Handling gaps from audio devices

Audio devices deliver sound in small packets, each with a timestamp. Those timestamps jitter by a few milliseconds on USB interfaces and virtual cables even when every sample arrives in order, and devices sometimes report a discontinuity: a stretch where samples were genuinely missed.

  • Back to back (0.8.0). While the device says the stream is continuous, Flashback writes its packets back to back and uses timestamps only to anchor the stream, to size real gaps, and to follow slow clock drift one sample at a time. Versions 0.7.22 to 0.7.41 placed every packet by its timestamp, which cut clean voice into tiny gaps; that was the static some people heard.
  • Flashback inserts silence only for frames that were genuinely missing, sized from the device's own sample counter, at the point they were missed. An oversized block of silence pushed to the front of the queue would shift everything after it out of sync; this approach doesn't.
  • The audio timeline corrects for device-clock gaps that can happen with virtual cables, so a long session doesn't slowly drift.
  • Every capture counts its dropouts. The counts the device and Windows report feed the in-app microphone warning and each clip's Microphone continuity in Capture health.

3. Joining segments cleanly

Your buffer is a series of MP4 segments, and a saved clip joins several of them without re-encoding. A segment's audio and container often run a fraction longer than its video: a 60 FPS segment might hold 119.983 seconds of video inside a 120.000-second timeline.

  • Video joins. Flashback tells the join step each segment's actual video duration, including any fractional offset in the first segment. That took the largest video gap at a join from 33.316 ms to 16.667 ms, exactly one frame at 60 FPS, with no gap above 20 ms and audio timing that stays continuous. It's still stream copy, so there's no quality loss.
  • Mixed audio at joins. Since 0.7.41, replays assembled from several segments keep the mixed audio aligned with the video at every join, instead of drifting by a few hundredths of a second over a long clip.
  • Sample-exact joins (0.8.0). Audio used to be joined in whole packets, so each join kept a sliver of the previous segment's sound past the cut, or stopped just short of it. In 0.8.0 each editable track is written as one continuous stream, cut at exact samples, and each later segment starts on the sample that continues the previous one: during a rotation both segments record the same device, so the overlap shows exactly where the join belongs. Mixed sound is decoded segment by segment and padded or trimmed to exactly its share of the video timeline. Every segment's sound starts where its picture does, and the tracks don't drift apart.
  • Soft joins on the single mixed track. The recorder's single mixed track starts every new segment with about 10 ms of silence. Where that happens, Flashback fades the last 2 ms before the join out and the first 1 ms after the silence back in, so the join doesn't click. Joins that start with sound pass through untouched. Editable tracks, on by default, don't have this gap at all.

Where a saved clip starts (0.8.0)

A replay rarely starts exactly on a keyframe. Earlier versions kept the frames back to the previous keyframe hidden behind an MP4 "edit list". Many players honor that list, but Windows' own media stack ignores it, so Windows players and the Editor preview could show the picture late against the sound.

From 0.8.0 a save starts on the keyframe at or just before the moment you asked for and cuts every audio track at that same instant, and trims are encoded without B-frames, so neither needs an edit list. A clip can therefore start a moment earlier than the length you picked, and plays in sync everywhere. Clips saved by earlier versions still play in sync in the Editor: Flashback previews them through a lossless copy that shifts the sound to match, without touching the file.

4. Separate tracks stay together

With Add editable audio tracks on (the default from 0.8.0), Flashback records game and desktop audio, and the microphone when it's on, as separate streams that follow the same segment lifetime as the video. When you save, it writes the Flashback mix plus the named Game and desktop and Microphone tracks into the MP4, all on the same timeline. The Flashback mix adds the two at full level, with a limiter that only acts on moments that would clip.

If you switch or unplug the Windows default device while recording, the segment in progress ends within a couple of seconds and the next one records the new device, so the history before the switch stays usable.

If you leave Discord, Spotify or your browser out of the recording, Flashback uses Windows process-loopback capture to remove them. The first excluded app uses Windows' own exclusion mode; each additional one is captured on its own, then aligned and subtracted at the segment boundary. If that alignment can't be done reliably, for example because the app's processes changed, Flashback discards and refreshes that audio rather than saving something out of sync or something you asked to exclude.

Check a clip yourself: Capture health

Every clip in the Library has a Capture health check in its three-dot menu. It runs only when you ask, reads the clip's packet timestamps with FFprobe, and reports frame timing and audio sync, plus Microphone continuity for clips recorded with 0.8.0 or later: the dropouts the microphone reported while that clip was recording and how much audio was lost. It's read-only: it never changes the clip, and it caches only the report.

Use it when:

  • a clip feels out of sync and you want to know whether it's the file or the player,
  • you've changed audio devices, added a virtual cable, or switched to separate tracks,
  • you're reporting a sync problem and want something concrete to include.

How sync is tested before a release

Release qualification includes a controlled audio-sync check: known tone pulses are recorded alongside visible flashes, and the decoded clip is measured to confirm the two line up. An audio fidelity gate compares Flashback's recorded and joined audio sample for sample against an independent capture of the same sound. The long hardware soak also checks that audio is continuous across every segment boundary. See Release qualification and testing.

If your clips sound off

Symptom First thing to try
Sound slightly late or early across the whole clip Run Capture health on it. If it reports good sync, try a different player.
Drift that grows over long clips Update to 0.8.0. If you use a virtual cable, try your physical device for one session to compare.
Picture late against sound in Windows' Films & TV or Media Player, but fine elsewhere That's an older clip's edit list. Clips saved by 0.8.0 don't use one; older clips play in sync in Flashback's Editor.
Crackles, pops or dropouts See Troubleshooting audio.
Desktop sound in your microphone track A virtual mic, Stereo Mix-style input or speaker bleed can carry desktop audio; headphones and a physical mic separate cleanly.

Related pages: Audio · Replay buffer and segment rotation · Troubleshooting audio

Clone this wiki locally