﻿# RTSP over TCP: separate ordered delivery from timely frames for inference

RTSP over TCP: separate ordered delivery from timely frames for inference. 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-rtsp-tcp-interleaving-late-frame-policy/
Language: en

A camera service switches to interleaved TCP transport to avoid missing datagrams. During network disruption it receives intact but late video, while the model continues answering questions about an older scene.

## The media mechanism

Reliable ordered byte delivery does not guarantee a frame deadline. Retransmission and shared transport ordering can delay later media, while a real-time application still needs an explicit stale-frame policy.

## Establish the pipeline boundary

Record whether media actually uses interleaved TCP or another negotiated transport. A requested client setting does not establish the resulting session, and reliable byte delivery is a different promise from bounded application latency.

Observe capture age after a controlled transport stall. Data arriving intact after the deadline may be useful for historical analysis while unsuitable for a current-scene decision. Keep those consumers' acceptance rules separate.

Test how the receiver resumes after delayed delivery: immediate backlog processing can briefly produce high throughput while every analyzed frame remains stale. Apply a documented freshness boundary using the appropriate source clock mapping. Do not discard arbitrary compressed bytes merely to catch up; use a supported decoder recovery path or discard suitable decoded observations. Report completeness and timeliness independently.

## A constructed failure case

Delay delivery of an early part of the media stream while later source frames continue to exist. The service must show whether it waits, drops or rejects stale analysis instead of equating intact delivery with real-time usefulness.

## A practical validation procedure

Negotiate and record the actual transport. Inject permitted delay or loss in a controlled fixture and compare capture age, delivery completeness and accepted results. Keep transport recovery separate from deciding whether a late frame is still usable.

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 transport selection, frame-age observations and explicit late-result decisions.

## Recovery and limits

A transport comparison needs the same source content and deadline; lower packet loss alone is insufficient.

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: [RTSP2 transport and session contract](https://www.rfc-editor.org/rfc/rfc7826.html); [GStreamer RTSP source behavior](https://gstreamer.freedesktop.org/documentation/rtsp/rtspsrc.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 [TinyML on Frame glasses: faster inference, slower complete pipeline](/journal/frame-tinyml-on-glasses-inference-pipeline-latency/); [RTP jitter-buffer deadlines: distinguish reordered packets from packets declared lost](/journal/sv-rtp-jitter-window-deadline-loss/). Their adjacent context does not replace the specific frame-flow acceptance check described here.
