TECHNOLOGY

RTSP reconnection: start a new frame-identity epoch before accepting detections

In this article
THE QUICK TAKE

Retain connection transitions, media epochs and detection-to-source acceptance evidence.

A camera connection restarts and reuses local timestamps or frame counters. Cached detections and tracker state from the previous session are incorrectly attached to the newly connected stream.

The media mechanism

A network endpoint and an uninterrupted media session are different identities. Reconnection requires a deliberate stream epoch even when the URL, dimensions and apparent scene remain unchanged.

Establish the pipeline boundary

Assign a new application stream epoch when the accepted media session restarts. Keep the stable camera registration separate so a reconnect does not accidentally create a new business camera or preserve an invalid continuous timeline.

Clear or explicitly migrate state whose meaning depends on continuity: decoder assumptions, tracker history, queued frame associations and clock mappings. Some state may legitimately survive, but each retained item needs a reason tied to the source contract.

Delay an old result across the reconnect while the source reuses local counters. Reject it using the dispatch epoch, not arrival order alone. Verify that monitoring distinguishes an endpoint becoming reachable from fresh decodable frames becoming available. A successful RTSP handshake is useful connection evidence, but it does not establish that the first accepted image is current or that the physical camera remained unchanged.

A constructed failure case

Reuse the same test URL while resetting local frame counters. A valid detection key includes the new session epoch; equal endpoint text and counter value alone must not identify a continuous observation.

A practical validation procedure

Interrupt a permitted RTSP fixture and restart with repeated local markers. Separate old dispatches, decoder state and tracking state from the new epoch. Verify that delayed old detections cannot be accepted as current observations.

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

Retain connection transitions, media epochs and detection-to-source acceptance evidence.

Recovery and limits

Automatic reconnect does not guarantee continuity of calibration, camera pose or scene identity.

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 RTSP source behavior; RTP and RTCP protocol specification.

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.

Continue with SAM2 video segmentation: object identity belongs to the inference session; RTP SSRC changes: reconcile transport source identifiers with camera identity. Their adjacent context does not replace the specific frame-flow acceptance check described here.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles