﻿# After a video seek: distinguish pipeline running-time from the original stream position

After a video seek: distinguish pipeline running-time from the original stream position. A practical streaming-video guide with failure mechanisms, a controlled scenario, acceptance evidence and primary references.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/sv-segment-running-time-stream-time-seek/
Language: en

A service analyzes a clip beginning at a nonzero source position. It reports pipeline elapsed time as the original event time, shifting annotations toward the beginning of the source recording.

## The media mechanism

Segment state maps buffer positions into different time domains. Running-time supports pipeline scheduling, while stream-time or original source linkage can answer another application question; they are not universally interchangeable.

## Establish the pipeline boundary

Use the segment conversion APIs with the actual segment format and mapping state. Buffer position, stream-time and running-time answer different questions, especially after seeks or playback-rate changes.

Preserve original source linkage for model results that leave the playback session. An elapsed pipeline interval cannot locate a detection in the original recording without the relevant segment mapping.

Seek to a marked nonzero source position and compare the converted times against the known reference. Repeat under a supported rate change and handle an unavailable conversion explicitly. Do not replace a failed conversion with the raw timestamp simply because its numeric value looks plausible. Keep the mapping generation with asynchronous work so a completion after another seek cannot use the replacement segment's state to reinterpret an older result.

## A constructed failure case

Analyze a marked interval after a seek and compare elapsed pipeline time with its source position. Acceptance requires the declared mapping and must not infer original event time solely from how long the new pipeline has been running.

## A practical validation procedure

Pin the segment format, start, rate and relevant mapping state. Use documented segment conversion APIs on known-position fixtures and handle unsupported conversions explicitly. Preserve original-source linkage when the model output will be consumed outside the current playback session.

Keep an unchanged control and a deliberate failure case. Change the relevant setting or interruption independently, then compare observed frame identities and state transitions. Measure through recovery as well as the first error; a restarted worker can retain obsolete results or references.

## Evidence for acceptance

Keep segment identity, conversion inputs and the output timestamp domain named explicitly.

## Recovery and limits

A valid segment conversion cannot supply source capture metadata that was never retained.

Define whether recovery drains, discards or isolates pending frames before resuming ordinary service. Preserve compact diagnostic identities and the fixture configuration. Avoid treating a new connection or a live process as proof that previous in-flight work has finished safely.

## References and interpretation

Primary references: [GStreamer segment time conversion](https://gstreamer.freedesktop.org/documentation/gstreamer/gstsegment.html); [GStreamer clock synchronization design](https://gstreamer.freedesktop.org/documentation/additional/design/synchronisation.html).

This is a proposed operational validation, not an executed Retrivium benchmark. Documentation defines interfaces and supported behavior; the actual pipeline needs its own evidence. Repeat the check after relevant plugin, decoder, source or preprocessing changes.

## Related reading

Continue with [Video retrieval timestamps: use PTS rather than frame-number arithmetic](/journal/video-vfr-pts-frame-indexing/); [Video flush boundaries: reject in-flight inference results from the previous segment](/journal/sv-flush-segment-epoch-inflight-results/). Their adjacent context does not replace the specific frame-flow acceptance check described here.
