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
        +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.3.tar.gz (5.3 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.3-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.3.tar.gz.

File metadata

  • Download URL: video_stream_data-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for video_stream_data-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3c22428cbb6bf20320bbd587284f0235444d35579133f890b82a5c79bc57242e
MD5 a6bf8f8bc7cd4b1e2722352d1fd1382b
BLAKE2b-256 33879c4ebbb544869f8ce6db7da4cdb4902e8c81a46a0a73535dd258310c18dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for video_stream_data-0.1.3.tar.gz:

Publisher: test-and-publish.yml on brean/video_stream_data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for video_stream_data-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 35d388d39a79168da3257277948631ca2c2d24ed216b865da098075163237eb4
MD5 916c3919874b2a45b16aa48bcc938060
BLAKE2b-256 3424145594f8f771aa908be7d312302853572ebef5c9077fea09320e4bc3a40e

See more details on using hashes here.

Provenance

The following attestation bundles were made for video_stream_data-0.1.3-py2.py3-none-any.whl:

Publisher: test-and-publish.yml on brean/video_stream_data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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