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.4.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.4-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.4.tar.gz.

File metadata

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

File hashes

Hashes for video_stream_data-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f4dee75bdc9c08221dd59341c676ee8fe2e1005fb34ba77fdbc8e065a7fddbd6
MD5 8d652ecf6a92b9c8ded97944316b99ac
BLAKE2b-256 3b269400d6b392b4435c2a94466762612299f202551dd0675d55f04ec7a1eab7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for video_stream_data-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f4b1a8a11a66fea026a1f91e91ea3754859fe0f20d641ab6230f10f20a7063fd
MD5 f655c22fcd0963a00ab902936491509b
BLAKE2b-256 95ff5e4520a70befee301143f43f4539deaa762265b369ba9188016da44c82bf

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