Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver/usbvideodriver: reduce latency of GStreamer pipeline #1494

Merged

Conversation

tretter
Copy link
Contributor

@tretter tretter commented Sep 11, 2024

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.

  • PR has been tested

Tested by running labgrid-client video on a place with a USB camera as resource, moving in front of the camera, and looking the delay of the movement on the screen.

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.
@Bastian-Krause
Copy link
Member

CI errors are unrelated, see #1493.

Copy link
Member

@Bastian-Krause Bastian-Krause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Emantor Emantor merged commit 6b54121 into labgrid-project:master Sep 12, 2024
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants