Skip to main content

Unified data format for video streams (devices, server, ...)

Project description

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

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

video_stream_data-0.1.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

video_stream_data-0.1.5-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file video_stream_data-0.1.5.tar.gz.

File metadata

  • Download URL: video_stream_data-0.1.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for video_stream_data-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a4dec78d2a80bc4c66f9f1179ff0317957aea07578479d424908091db1bab9eb
MD5 3eb6b7e4a249e5e29571195ac3ef7b72
BLAKE2b-256 f53967c55e88815caa82f10499989c673b9f03fae8432a0e3635d1ea5f31ad10

See more details on using hashes here.

File details

Details for the file video_stream_data-0.1.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for video_stream_data-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0eccbe41064f4551ce5ec30d5f88829384224bd522be764f3ca49dff21bd8ff5
MD5 1774c53193aaa32faef86ab931820a98
BLAKE2b-256 d62466a33fe7b3f6641e5964ebf03b860d67f0a04ef446aa97864d14a79f9c7b

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