labgrid-project / labgrid-project/labgrid

High latency in USBVideo stream via SSH due to playbin3 buffering

Open
#1,773 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
528
Forks
278
Avg merge
2d 19h
Merged PRs (30d)
4

Description

Hello,

I’m currently using Labgrid’s USBVideoDriver to stream a remote USB camera.

The stream works, but the latency is extremely high (around 30 seconds).
The exporter and coordinator run on the same machine as the USB camera, and the client PC (running the viewer) is on the same LAN.
To rule out network issues, I tested the link with an scp transfer of a large file and achieved 112.6 MB/s, so the network bandwidth is not the bottleneck.

After investigating, I found that the latency completely disappears when I replace the default playbin3-based RX pipeline with a manual GStreamer pipeline:

rx_cmd = [
    "gst-launch-1.0",
    "fdsrc",
    "!",
    "jpegdec",
    "!",
    "queue", "max-size-buffers=1", "leaky=downstream",
    "!",
    "videoconvert",
    "!",
    "autovideosink",
    "sync=false",
]

With this RX pipeline, the latency becomes near zero.
This makes me think that playbin3 might be introducing buffering or synchronization that is not suitable for low-latency SSH transport.

Questions

  1. Is this behavior expected when using playbin3 in this context?
  2. Is there an existing way in Labgrid to override the RX pipeline?
  3. As a workaround I created my own driver, is this the recommended approach, or should this be handled inside USBVideoDriver?

Thanks in advance for the guidance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with USBVideoDriver's receive path and the playbin3-based RX pipeline described in the report; compare it with the manual gst-launch-1.0 pipeline and its queue and sync settings. Done requires determining whether Labgrid exposes a supported RX-pipeline override or whether USBVideoDriver needs a defined low-latency option.

Written by the indexing model from the issue text.

Assessment

Domain
audio-video-rtc, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.