# Synchronization

Luxonis devices expose several different synchronization paths, and each one solves a different timing problem. Some methods align
sensor capture directly, while others group messages later in software based on timestamps.

Use the section that matches the synchronization problem first, then choose the `RVC2` or `RVC4` implementation panel within that
page.

## Choose a synchronization path

| Synchronization type | Primary purpose | Typical fit |
| --- | --- | --- |
| [Time Based Synchronization](https://docs.luxonis.com/hardware/platform/deploy/data-sync/time-based-sync.md) | Group camera
frames, sensor data, and derived messages by timestamp | Same-device pipelines, mixed-rate streams, and visual-inertial workflows
|
| [PTP synchronization](https://docs.luxonis.com/hardware/platform/deploy/data-sync/ptp-sync.md) | Align device clocks over
Ethernet | Multi-device RVC4 deployments on supported networks |
| [Hardware synchronization (FSYNC)](https://docs.luxonis.com/hardware/platform/deploy/data-sync/hardware-sync.md) | Align capture
using an electrical trigger | Tight frame alignment across sensors or devices |

## Timing fundamentals

The timing behavior below applies to both RVC2 and RVC4 devices and provides the baseline for understanding both hardware and
software synchronization results.

### Frame capture graphs

Frame timestamp is assigned to the frame at the MIPI SoF (start of frame) event, when the sensor starts streaming the frame (MIPI
readout).

For global shutter sensors, this follows immediately after the exposure for the whole frame was finished, so we can say the
timestamp assigned is aligned with end of exposure-window (within a margin of few microseconds). Here's an example graph of the
global shutter sensor timings, which demonstrates when timestamp is assigned to the frame:

#### Global shutter sensor timings

For rolling shutter, the example graph looks a bit different. MIPI SoF follows after the first row of the image was fully exposed
and it's being streamed, but the following rows are still exposing or may have not started exposing yet (depending on exposure
time).

#### Rolling shutter sensor timings

Below there's an example graph of rolling shutter sensor (IMX378) at 1080p and 30fps (33.3ms frame time). MIPI readout time varies
between sensors/resolutions, but for IMX378 it's 16.54ms at 1080P, 23.58ms at 4K, and 33.04ms at 12MP.
