# C203 Lesson 1: Clocks, Offset and Drift

> The first lesson of the C203 time sync course: the two meanings of in sync, how much timing error a capture rig can afford, why two clocks drift apart and how far, and which instant a frame's timestamp actually marks, with worked examples.

Page: https://egocam.ai/university/c203/lesson-1-clocks-offset-and-drift/

Every downstream step in a capture pipeline assumes it knows when each sample was taken. Stereo depth matches a left frame with a right frame, visual-inertial tracking integrates the IMU between frames, and hand triangulation combines views of a hand that is moving. This lesson sets out the vocabulary and the arithmetic of time sync, so that later lessons can say how good each method is. The full treatment is on [Why Synchronisation Matters](https://egocam.ai/sync/why-sync-matters/).

## Terms used in this lesson

All of these are also in the [glossary's synchronisation section](https://egocam.ai/reference/glossary/#synchronisation-and-timing).

| Term | Meaning |
|---|---|
| Clock | A counter driven by an oscillator, usually a quartz crystal. Every camera, IMU and computer has its own |
| Clock offset | The difference between two clocks' readings at the same instant |
| Clock drift (skew) | The difference between two clocks' rates; with drift, the offset changes over time |
| ppm | Parts per million. A rate error of 50 ppm means a clock gains or loses 50 µs every second |
| Timestamp | The time a system attaches to a sample; which instant it marks varies by device |
| Exposure midpoint | The middle of the interval during which the sensor collects light; the usual best single instant to represent a frame |
| Readout time | For a rolling-shutter sensor, the time taken to read every row of one frame |
| Latency | A delay between when something happened and when it was timestamped; a constant latency is an offset |
| Jitter | Random variation in that delay from sample to sample |

## Two meanings of "in sync"

People say *the cameras are in sync* and mean one of two different things ([Two meanings of "in sync"](https://egocam.ai/sync/why-sync-matters/#two-meanings-of-in-sync)):

- **Synchronised exposure:** the cameras capture at the same instant. This needs a shared trigger or frame-timing signal.
- **Synchronised timestamps:** every sample carries a time from the same clock, or from clocks whose relationship is known. The frames may be taken at different moments, but you know exactly when.

The two are independent, and the second does not give you the first. Meta's documentation for multi-device Aria Gen 2 recordings puts every pair of glasses on a common time base and then notes that "the host and client devices' RGB cameras are NOT trigger aligned by nature" ([Aria Gen 2 time alignment tutorial](https://github.com/facebookresearch/projectaria_tools/blob/main/examples/Gen2/python_notebooks/Tutorial_4_timestamp_alignment.ipynb)). The RocSync authors give the consequence for clock-based methods: "residual misalignment of up to half a frame can remain even when pairing the closest timecodes between two video streams" ([Meyer et al., 2025](https://arxiv.org/abs/2511.14948)).

> **Diagram:** Two cameras at 30 frames per second whose frames start at different moments. A hand hits the table at 72 ms; camera A first shows it in the frame starting at 66.7 ms and camera B in the frame starting at 81.7 ms. Matching each event to the nearest frame leaves an error of up to one frame, 33 ms at 30 fps, unless the exposures themselves are synchronised.

## The error budget

How much timing error a rig can tolerate depends on how fast things move in the image. Distance is speed times time, so the arithmetic is simple. The field guide's [worked examples](https://egocam.ai/sync/why-sync-matters/#the-error-budget-how-much-timing-error-is-too-much) use a hand at 1 m/s and a head turning at 100 °/s, both stated as example values, not measured typical ones:

| Timing error | Hand at 1 m/s moves | Head at 100 °/s, 1280 px wide, 90° view: image shift near the centre |
|---|---|---|
| 1 ms | 1 mm | about 1.1 px |
| 10 ms | 10 mm | about 11 px |
| 16.7 ms (half a frame at 30 fps) | 16.7 mm | about 19 px |
| 33.3 ms (one frame at 30 fps) | 33.3 mm | about 37 px |

Redo the table with your own task's speeds and your own lens. Published results show what errors of this size do downstream. Testing on the EuRoC benchmark with artificial offsets, [Ling et al. (2018)](https://arxiv.org/abs/1810.05456) report that "OKVIS fails to track in sequence 2 ∼ 5 when the time offset is set to be 60 ms." For multi-view hands, RocSync found that interpolating to a common instant "reduced the mean Euclidean distance between poses from 26.07 mm without interpolation to 7.52 mm with interpolation" ([Meyer et al., 2025](https://arxiv.org/abs/2511.14948)).

## Offset and drift

Every device keeps time with its own oscillator, and no two run at exactly the same rate. Over a recording, the relationship between two clocks is, to a good approximation, a straight line ([Clock offset and clock drift](https://egocam.ai/sync/why-sync-matters/#clock-offset-and-clock-drift)):

time on clock B = (1 + drift) × time on clock A + offset

Measuring the offset once removes the offset but not the drift. The drift is usually given in ppm, and it adds up quickly:

| Rate difference | Drift per hour | Frames at 30 fps |
|---|---|---|
| 1 ppm | 3.6 ms | 0.11 |
| 20 ppm | 72 ms | 2.2 |
| 50 ppm | 180 ms | 5.4 |
| 100 ppm | 360 ms | 10.8 |

The two clocks' errors add. Fora Soft's guide notes: "Consumer-grade crystals are typically rated at ±20 to ±50 ppm, so two ordinary devices can differ from each other by as much as 100 ppm in the worst case" ([Fora Soft](https://www.forasoft.com/learn/audio-for-video/articles-audio/drift-correction-resampling-frame-drop)). At 50 ppm, two 30 fps cameras drift half a frame apart in about 5.6 minutes. Sensors inside a device can be much worse than its main clock: GoPro's documentation says "Camera internal sensors or data via a connected Bluetooth device, will have timing errors in the range ±1%" ([gpmf-parser](https://github.com/gopro/gpmf-parser)). Measured drift on real devices, from phones to eye trackers to headsets, is tabled on [Measured drift on real devices](https://egocam.ai/sync/why-sync-matters/#measured-drift-on-real-devices).

### One sync point is not enough

A single sync at the start of a session decays. GoPro's own [precision time page](https://gopro.github.io/labs/control/precisiontime/) says: "As the camera’s internal clock will drift slowly over time, use this QR Code just before your multi-camera shoot for the best synchronization." The fix is two sync points, one at the start and one at the end, and a straight line between them. With two points you get both the offset and the drift.

> **Diagram:** Clock drift between two cameras over an hour. Sync readings at the start give an offset of about 1240 ms and readings at the end, sixty minutes later, about 1312 ms. A straight line through both gives the offset for every frame in between; 72 ms of drift in an hour means the clocks run 20 parts per million apart.

**Worked example** (from [the field guide](https://egocam.ai/sync/why-sync-matters/#worked-example-drift-from-two-sync-points)). Camera B reads 1240 ms ahead of camera A at the start of a recording and 1312 ms ahead 60 minutes later. The drift is (1312 − 1240) ms ÷ 3,600,000 ms = 20 ppm. At 30 minutes the offset is 1240 + 72 × 0.5 = 1276 ms. Using only the starting offset would leave frames near the end 72 ms out, more than two frames at 30 fps.

The straight line assumes the rate stays steady. It does not, exactly: the [chrony FAQ](https://chrony-project.org/faq.html) notes that a clock's stability "mainly depends on the temperature sensitivity of the crystal oscillator and the maximum rate of the temperature change". Rigs that warm up on someone's head benefit from more than two sync points, or from continuous sync.

## Which instant a timestamp marks

A frame is not captured in an instant: the sensor collects light for the exposure time, then the image is read out, processed and sent. A timestamp can mark any of these moments ([Which instant a timestamp marks](https://egocam.ai/sync/why-sync-matters/#which-instant-a-timestamp-marks)). The Linux video API names two of them: a buffer flag for "End Of Frame", and one for "Start Of Exposure. The buffer timestamp has been taken when the exposure of the frame has begun" ([V4L2 buffers](https://docs.kernel.org/userspace-api/media/v4l/buffer.html)).

For motion, the best single instant is the middle of the exposure. The Kalibr paper states that "The middle of the exposure time constitutes the ideal point to timestamp an image" ([Furgale, Rehder and Siegwart, 2013](https://furgalep.github.io/bib/furgale_iros13.pdf)). The reason: a pixel adds up light over the whole exposure, so a moving point leaves a streak whose centre, for steady motion, is where the point was halfway through ([Exposure midpoint](https://egocam.ai/sync/why-sync-matters/#exposure-midpoint)). Two cameras triggered at the same instant, one exposing for 1 ms and the other for 10 ms, have midpoints 4.5 ms apart even though the trigger was perfect.

> **Diagram:** Two cameras triggered at the same instant but exposing for 1 ms and 10 ms. Their exposure midpoints, the instants the frames best represent, are 4.5 ms apart (top). Starting the longer exposure half its length earlier, as exposure-compensated triggering does, puts both midpoints at the same instant (bottom).

On a rolling-shutter sensor each row also has its own time: the last row is captured one readout time after the first. A common approximation treats the frame as taken at its middle row ([Rolling-shutter line timing](https://egocam.ai/sync/why-sync-matters/#rolling-shutter-line-timing)).

## Latency and jitter

Between the moment a sample is taken and the moment it is stamped lies a delay ([Latency and jitter](https://egocam.ai/sync/why-sync-matters/#latency-and-jitter)):

- **Latency**, the constant part, looks exactly like a clock offset and is removed the same way, by measuring it once.
- **Jitter**, the random part, cannot be calibrated away; it is reduced by timestamping closer to the sensor, or smoothed by fitting a model to many samples.
- **Drift** is neither. Fora Soft's test: "A slow, monotonic slide is always a clock mismatch, never network jitter."

Jitter is worst when a computer stamps data on arrival. Faizullin et al. measured a sensor whose packets arrive every 1328 µs: stamped by ROS on arrival, the period varied with a standard deviation of 82.64 µs, against 1.35 µs when a microcontroller stamped them ([Faizullin et al., 2021](https://arxiv.org/abs/2107.02625)).

## Self-check

1. Your head rig and an external camera are both on a network time server, and their clocks agree to well under a millisecond. Are their frames exposed together?
2. Two 30 fps cameras run on consumer crystals that differ by 50 ppm. Roughly how long until they are half a frame apart?
3. You sync two cameras with a QR code at the start of a one-hour session only. What can you not measure, and what do you add?
4. A camera stamps frames at the start of exposure and runs auto-exposure. Why does this matter for pairing it with another camera?
5. Your offsets between two devices jump around by a few milliseconds from frame to frame, but show no slope. Is that drift?

### Answers

1. Not necessarily. Clock sync gives synchronised timestamps, not synchronised exposures; free-running cameras can still be up to half a frame apart.
2. About 5.6 minutes: half a frame at 30 fps is 16.7 ms, and 50 ppm is 50 µs per second.
3. The drift. Add a second sync event at the end, and fit a straight line through both.
4. The frame's representative instant is the exposure midpoint, half an exposure after the stamp, and with auto-exposure that gap changes from frame to frame.
5. No. That is jitter; drift is a slow, steady slide in one direction.

## Sources

- Field guide: [Why Synchronisation Matters](https://egocam.ai/sync/why-sync-matters/), [glossary](https://egocam.ai/reference/glossary/#synchronisation-and-timing).
- Meta Project Aria: [Gen 2 time alignment tutorial](https://github.com/facebookresearch/projectaria_tools/blob/main/examples/Gen2/python_notebooks/Tutorial_4_timestamp_alignment.ipynb).
- Meyer, J. et al. (2025). [RocSync: Millisecond-accurate temporal synchronization for heterogeneous camera systems](https://arxiv.org/abs/2511.14948). arXiv.
- Ling, Y. et al. (2018). [Modeling varying camera-IMU time offset in optimization-based visual-inertial odometry](https://arxiv.org/abs/1810.05456). *ECCV*.
- Fora Soft. [Drift correction: resampling, frame drop, frame insertion](https://www.forasoft.com/learn/audio-for-video/articles-audio/drift-correction-resampling-frame-drop).
- GoPro. [gpmf-parser](https://github.com/gopro/gpmf-parser); GoPro Labs, [precision date and time](https://gopro.github.io/labs/control/precisiontime/).
- chrony. [Frequently asked questions](https://chrony-project.org/faq.html).
- Linux kernel documentation. [V4L2 buffers](https://docs.kernel.org/userspace-api/media/v4l/buffer.html).
- Furgale, P., Rehder, J. and Siegwart, R. (2013). [Unified temporal and spatial calibration for multi-sensor systems](https://furgalep.github.io/bib/furgale_iros13.pdf). *IEEE/RSJ IROS*.
- Faizullin, M., Kornilova, A. and Ferrer, G. (2021). [Open-source LiDAR time synchronization system by mimicking GNSS-clock](https://arxiv.org/abs/2107.02625). arXiv.
