Skip to content

High latency in USBVideo stream via SSH due to playbin3 buffering #1773

@hamztouiz

Description

@hamztouiz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions