Clocks and timestamps
Packager has several distinct timing controls. Choose the one matching the problem instead of using buffering to compensate for every timing difference.
| Control | Purpose |
|---|---|
sources.realtime_pacing | Makes fast-reading inputs such as files run at media rate. Browser sources pace themselves. |
sources.interleave_buffer.max_buffer_size_ms | Buffers tracks so packets with corresponding timestamps can be emitted together; adds latency. |
sources.handle_timestamp_rollover | Handles timestamp wraparound; enabled by default. |
Subtitle timestamp_source_track_id | Selects another configured track as the subtitle timestamp source. |
Host clock
Packager uses the host's system time. We strongly recommend synchronizing the host clock with chrony on every Packager host. A synchronized clock does not by itself make unrelated media sources frame aligned.
Compositor timing
A compositor puts all its inputs on one output timeline, the clock of its anchor input. The anchor's timestamps are never rewritten, and the output starts on its first keyframe, or its first unit for audio. Inputs from the same source as the anchor keep their timestamps too, so they stay exactly in sync with it. Inputs on other clocks, such as a second camera or a browser page, are offset onto the anchor's timeline when their first unit arrives.
By default the anchor is a passthrough video input if the compositor has one,
otherwise its first decoded input in source id and track order. Set anchor on
the compositor to choose another input, for example the program feed when a
browser overlay is listed first:
[[compositors]]
id = "program-with-overlay"
anchor = "program-video"
Passthrough tracks bypass decoding and filtering; only their timestamps are aligned with the output timeline. Audio mixing uses its first input as timing master, and later inputs are resampled to follow it. Check synchronization at the output, for example by playing it and comparing lip sync.
Timed metadata
The metadata API takes an optional timestamp in milliseconds. The handler forwards that timestamp as media metadata; it is not a generic wall-clock scheduling service. Without a timestamp, downstream handling determines the timing. Verify metadata receipt and alignment in your consumer, especially when joining sources with different timelines.