VideoReceiver: Cap rtspsrc jitterbuffer with drop-on-latency#62
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.