Skip to main content

Video Stream Data

Dependency-free data structures for video streaming.

Installation

Use pip to install. Its recommended to install in a virtual environment

python3 -m venv video-streaming-pipeline
# install using system-site-packages (like opencv and pyudev)
source video-streaming-pipeline/bin/activate --system-site-packages
pip3 install video_stream_data

Although not recommended a user installation with --break-system-packages would also be okay as it does not have any dependencies.

Usage

Simply import the data classes you want to have, you can use the parser to load the video stream settings from a file (see test/-folder).

You can use the data structure to manually create any kind of video stream.

classDiagram
    direction LR

    class StreamControlType {
        <<enumeration>>
        +INT: str = 'int'
        +BOOL: str = 'bool'
        +MENU: str = 'menu'
    }

    class Encoding {
        <<enumeration>>
        +PASSTHROUGH: str = 'passthrough'
        +BGR: str = 'bgr'
        +GREY: str = 'grey'
        +GREY16: str = 'grey16'
        +GRB: str = 'rbg'
        +BGRA: str = 'bgra'
        +RGBA: str = 'rgba'

    }

    class Codec {
        <<enumeration>>
        +MJPEG: str = 'MJPEG'  # Motion-JPEG
        +YUYV: str = 'YUYV'  # e.g. YUYV 4:2:2
        +XVID: str = 'XVID'  # e.g. mp4 files
        +H264: str = 'H264'
        +UNKNOWN: str = 'unknown'
    }

    class StreamControl {
        +type: StreamControlType
        +name: str
        +writable: bool = False
        +min: float = 0
        +max: float = 0
        +step: int = 1
        +value: float | bool | None = None
        +options: list = []
    }

    class StreamValue {
        # desired video resolution
        +resolution: list[int]
        +fps: float  # desired FPS by user
        # desired configuration
        +controls: dict[str, int | float | bool | None]
        +encoding: Encoding = Encoding.PASSTHROUGH
        +codec: Codec = Codec.UNKNOWN
    }

    class StreamInfo {
        +name: str
        +stream_path: str
        +driver: str
        +codec: list[str]
        +controls: list[StreamControl]
        +resolutions: list[int, int]
        +max_fps: float
        +values: StreamValue
        +backend: str = 'v4l2'
    }

    StreamControlType <|-- StreamControl
    Encoding <|-- StreamValue
    Codec <|-- StreamValue
    StreamControl --> StreamInfo : controls
    StreamValue --> StreamInfo : values

Fig. 1: Data Model for the StreamInfo generated from any device

Release files for video-stream-data 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for video-stream-data 0.1.5
File Size Uploaded
video_stream_data-0.1.5.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for video-stream-data 0.1.5
File Interpreter ABI Platform
video_stream_data-0.1.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 11.0 kB

Release files / video_stream_data-0.1.5.tar.gz

Download URL video_stream_data-0.1.5.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a4dec78d2a80bc4c66f9f1179ff0317957aea07578479d424908091db1bab9eb
BLAKE2b-256 checksum
How to use checksums
f53967c55e88815caa82f10499989c673b9f03fae8432a0e3635d1ea5f31ad10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / video_stream_data-0.1.5-py2.py3-none-any.whl

Download URL video_stream_data-0.1.5-py2.py3-none-any.whl
Size 5.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0eccbe41064f4551ce5ec30d5f88829384224bd522be764f3ca49dff21bd8ff5
BLAKE2b-256 checksum
How to use checksums
d62466a33fe7b3f6641e5964ebf03b860d67f0a04ef446aa97864d14a79f9c7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page