Skip to main content

Roboflex module that streams webcams via GStreamer

Project description

roboflex.webcam_gst

Support for USB and built-in webcams using GStreamer. This module is a drop-in alternative to roboflex_webcamuvc, but it avoids the libuvc dependency and instead drives cameras through the GStreamer stack. The message schema and Python/C++ APIs are kept as close as possible to the original UVC implementation.

System dependencies

GStreamer and its development headers are required at build time:

# Ubuntu / Debian
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good

# macOS (Homebrew)
brew install gstreamer gst-plugins-base gst-plugins-good

Install

The project can be built like other roboflex modules:

pip install roboflex.webcam_gst

or from source with CMake.

Python usage

import roboflex.webcam_gst as rcw

print(rcw.get_device_list_string())

sensor = rcw.WebcamSensor(
    width=640,
    height=480,
    fps=30,
    device_index=-1,  # use default camera
    format="",  # empty string lets GStreamer pick
    emit_rgb=True,
)

sensor.start()
try:
    # consume messages...
    pass
finally:
    sensor.stop()

The emitted messages (WebcamDataRGB / WebcamDataRaw) match the original module so downstream nodes can continue to operate without changes.

Device descriptors

get_device_list() returns DeviceDescriptor objects with the following fields:

  • display_name: Human-readable label reported by GStreamer.
  • gst_factory_name: The underlying factory name used by GStreamer.
  • device_class: The class of device (e.g. Video/Source).
  • device_path: OS-specific identifier when available.
  • caps_strings: A list of capability structures advertised by the device.

Notes

  • RGB output is enabled by default. Set emit_rgb=False to receive raw frames; use the format parameter to request a specific pixel format string (e.g. "NV12" or "YUY2"), subject to what the device supports.
  • The helper WebcamRawToRGBConverter currently expects RGB input; raise an exception otherwise. Most workflows should request RGB directly from the sensor.
  • Because we rely on GStreamer, the available devices and pixel formats depend on the plugins installed on your system.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roboflex_webcam_gst-0.1.3.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roboflex_webcam_gst-0.1.3-cp311-cp311-macosx_13_0_arm64.whl (3.8 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file roboflex_webcam_gst-0.1.3.tar.gz.

File metadata

  • Download URL: roboflex_webcam_gst-0.1.3.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for roboflex_webcam_gst-0.1.3.tar.gz
Algorithm Hash digest
SHA256 030899391bf74b44f105fdf2f35d1f149ca0143f2abc392149ad3be07cfd0890
MD5 463db85011424e485c493ae91b9a5a43
BLAKE2b-256 984ff7db31fa98a5ca8bfb7cec0b63a55e575135b410ebff827ff187f836744f

See more details on using hashes here.

File details

Details for the file roboflex_webcam_gst-0.1.3-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for roboflex_webcam_gst-0.1.3-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 89d5958b6ec059be28fb3f22e1f885cb47220e95c4f688be1f7aeadbb49a6a21
MD5 54d8c6b371c5ad76c6b9b51093ab32d7
BLAKE2b-256 e5eed67b76d0352fed63c4e2a26b7e3f12e5548b4a8a98afd1753ab8c9102dd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page