Clock drift is the slow divergence between two independent sample clocks that are nominally the same rate but never exactly equal — a capture device running at 48,000.2 Hz against a playback device at 47,999.8 Hz, say. The tiny per-sample error accumulates: over a long call or stream, audio and video gradually slide out of sync, or an audio buffer slowly fills or empties until it overflows into a glitch. It is a defining problem of long-running, separately-clocked systems like WebRTC and IP audio. The fixes are continuous resampling to gently match the rates, or, more crudely, dropping or inserting an occasional frame to claw the timing back.

Book cover: Audio for Video, Volume 5 of the Fora Soft Video Engineering Handbook

The book · Volume 5 of 7

Audio for Video: A Complete Guide to Sound in Video Products: From Jitter Buffers and Lip Sync to Atmos, Quality Metrics, and Neural Codecs

Clock drift is invisible in short tests and shows up after an hour as lip sync errors or clicks in long recordings. Volume 5 covers clock drift in detail: timestamps and clock domains, drift correction by resampling or frame drop and insertion, jitter buffers and lip sync between audio and video. Written by Nikolay Sapunov, CEO at Fora Soft.

Read it on Amazon →Kindle & paperback · Fora Soft Video Engineering Handbook

Audio drifting out of sync with video in long streams or recordings?

Send us a long recording and your pipeline, and we will measure the clock drift, find its source and propose a correction method. 250+ video products shipped since 2005.

Book a 30-min call →WhatsApp →Email us →