2.1 KiB
2.1 KiB
ECP-0010: time-synchronized chunking
Status: Draft
Problem
To achieve byte-identical chunks across uncoordinated antennas, we need a shared timeline for chunk boundaries. If chunk boundaries are derived from local capture start time, identical broadcasts will diverge.
Decision
Define a time-synchronized chunking model based on broadcast clocks:
- Primary clock: PCR
- Use MPEG-TS PCR (27 MHz) as the canonical timeline for chunk boundaries.
- UTC anchor (when available)
- ATSC: use PSIP STT to compute UTC time.
- DVB: use TDT/TOT to compute UTC time.
- Chunk boundary rule
- Compute
chunk_index = floor((t_anchor) / D)wheret_anchoris UTC time when available, otherwise PCR time. Dis fixed chunk duration (e.g., 2000 ms).
- Compute
- Alignment policy
- On ingest, drop data until the next full boundary.
- Each chunk contains frames/packets whose PTS fall within
[chunk_start, chunk_end).
- Discontinuity handling
- If PCR/PTS discontinuity is detected, close the current group and start a new one at the next boundary.
- Sync status
- Streams with UTC anchor are marked
syncedand eligible for swarm convergence. - Streams without UTC anchor are
unsyncedand remain source-scoped.
- Streams with UTC anchor are marked
Consequences
- Identical broadcasts on different antennas converge to the same chunk boundaries and can produce byte-identical object streams.
- Early ingestion can begin unsynced and promote to synced when broadcast time appears.
- Chunk IDs become deterministic functions of (UTC or PCR timeline, duration).
Alternatives considered
- Local wall clock (NTP/PTP): rejected as primary anchor because it is not broadcast-authoritative and varies between hosts.
- Capture-start-based chunking: rejected because it prevents convergence without coordination.
Rollout / teardown
- Add a time model to the ingest pipeline (PCR + optional UTC anchor).
- Require chunkers to align to the computed boundary.
- Promote
StreamIdfrom source scope to broadcast scope only whensynced. - Supersede this ECP if MoQ introduces a standardized global timeline.