driver/usbvideodriver: reduce latency of GStreamer pipeline#1494
Merged
Emantor merged 1 commit intolabgrid-project:masterfrom Sep 12, 2024
Merged
Conversation
The playbin3 uses a urisourcebin to open and read the uri. The urisourcebin detects the fd as a stream uri and internally crates a multiqueue with a default buffer duration of 5 s and a high watermark of 0.60 to buffer the stream. This adds 3 s latency to the video stream. If the source signals that is it a live source, the urisourcebin would avoid buffering of the stream. Unfortunately, the fdsrc doesn't signal that the data is live, and doesn't have a property to change this. Use buffer-duration to set the size of the queue for buffering to 0 to avoid this additional latency. The queue could be completely removed by setting "buffering" in the flags property of playbin3 to 0, which would be equal to the behavior of a live source, but the changed flags are more difficult to understand than the buffer duration.
Member
|
CI errors are unrelated, see #1493. |
jluebbe
approved these changes
Sep 12, 2024
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 playbin3 uses a urisourcebin to open and read the uri. The urisourcebin detects the fd as a stream uri and internally crates a multiqueue with a default buffer duration of 5 s and a high watermark of 0.60 to buffer the stream. This adds 3 s latency to the video stream.
If the source signals that is it a live source, the urisourcebin would avoid buffering of the stream. Unfortunately, the fdsrc doesn't signal that the data is live, and doesn't have a property to change this.
Use buffer-duration to set the size of the queue for buffering to 0 to avoid this additional latency.
The queue could be completely removed by setting "buffering" in the flags property of playbin3 to 0, which would be equal to the behavior of a live source, but the changed flags are more difficult to understand than the buffer duration.
Tested by running
labgrid-client videoon a place with a USB camera as resource, moving in front of the camera, and looking the delay of the movement on the screen.