Skip to content

VideoReceiver: Cap rtspsrc jitterbuffer with drop-on-latency#62

Merged
julianoes merged 2 commits into
Stable_V5.0-Herelinkfrom
pr-drop-on-latency
Jun 15, 2026
Merged

VideoReceiver: Cap rtspsrc jitterbuffer with drop-on-latency#62
julianoes merged 2 commits into
Stable_V5.0-Herelinkfrom
pr-drop-on-latency

Conversation

@julianoes

Copy link
Copy Markdown
Collaborator

The internal rtpjitterbuffer latency is a floor that only ever grows under sender/receiver clock skew and never shrinks back, so video lag accumulates monotonically. This shows up on some newer air unit firmware revisions (different RTC behaviour) but not others, despite the same QGC pipeline.

The sink is already sync=FALSE, so the accumulation is not at the sink but inside rtspsrc's jitterbuffer. Set drop-on-latency=TRUE to cap it at latency (25ms) and drop rather than grow.

The internal rtpjitterbuffer latency is a floor that only ever grows
under sender/receiver clock skew and never shrinks back, so video lag
accumulates monotonically. This shows up on some newer air unit
firmware revisions (different RTC behaviour) but not others, despite
the same QGC pipeline.

The sink is already sync=FALSE, so the accumulation is not at the sink
but inside rtspsrc's jitterbuffer. Set drop-on-latency=TRUE to cap it
at latency (25ms) and drop rather than grow.
The decode-path queue (tee -> queue -> valve -> decoder) ran at GstQueue
defaults: non-leaky and up to 1s deep. If the decoder stalls it would
back-pressure upstream and become a second place latency can accumulate,
on top of the rtspsrc jitterbuffer.

Make it leak the oldest buffer on overflow (drop, don't block) and cap it
at 200ms so the newest frames always win and worst-case added latency
stays bounded. In steady state the queue sits near-empty, so this adds no
latency; it only kicks in to drop during a stall.
@julianoes
julianoes merged commit cfb7ccf into Stable_V5.0-Herelink Jun 15, 2026
1 check passed
@julianoes
julianoes deleted the pr-drop-on-latency branch June 15, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant