Skip to main content

Python API for ThorVision

Project description

pythorvision

pythorvision is a python package as client API for communicating with XDAQ video streaming subsystem -- ThorVision, designed to manage camera streams and recordings.

Features

pythorvision features High-level API with simple interface for managing camera streams and recordings.

  • Camera Discovery: List available cameras and their capabilities.
  • Flexible Stream Selection: Select stream capabilities:
    • media type (MJPEG)
    • format
    • resolution
    • framerate
  • GStreamer-based Recording: Record video streams into split .mkv files using GStreamer.

Requirements

  • Python: Python 3.6 or higher is required.
  • Dependencies:
    • GStreamer: Must be installed on the client machine, and gst-launch-1.0 must be available in the system's PATH.
      • You can download GStreamer from gstreamer.freedesktop.org/download.

      • Windows:

        1. Download and run the runtime installer.
        2. Add the bin directory of your GStreamer installation (e.g., C:\gstreamer\1.0\msvc_x86_64\bin) to your system's Path environment variable.
      • macOS:

        • The recommended way to install is using Homebrew:
          brew install gstreamer
          
        • Alternatively, you can download and run the runtime installer from the GStreamer website. If you use the installer, you may need to manually add GStreamer to your PATH:
          export PATH=/Library/Frameworks/GStreamer.framework/Versions/Current/bin:$PATH
          

Installation

To install pythorvision, you can use pip in project root directory:

pip install .

This will install the package and its required Python dependencies.

Tutorial

This tutorial demonstrates how to use ThorVisionClient to connect to the server, start and record streams from cameras, and then clean up the resources.

Run the Example Scripts

Record Video from Two Cameras

Run the following script to record from the first two available cameras for 10 seconds:

python ./examples/run_two_cams.py

The recorded .mkv video files will be saved in the recordings/ directory.

Extract Metadata from a Video File

If you have a pre-recorded video, you can extract its frame metadata using this script:

python ./examples/extract_video_metadata.py "path/to/your/video.mkv"

Record and Immediately Extract Metadata

This script provides a complete end-to-end example of recording a short video and then immediately parsing it to display its metadata.

python ./examples/record_and_extract.py

API Documentation

For complete API documentation, visit: https://kontex-neuro.github.io/pythorvision/

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

pythorvision-0.3.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

pythorvision-0.3.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file pythorvision-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for pythorvision-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d80936d0538169249e88a08bc67c86cf18fafec47a6c679fa51b7d7b61fb4473
MD5 91acec5128d30b6b86c31d6deaf3a603
BLAKE2b-256 cab99d21491f0d96b77189da7b2c4b8e8f1a6f8f68acfff81f56adc6249d47d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythorvision-0.3.0.tar.gz:

Publisher: publish.yml on kontex-neuro/pythorvision

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

File details

Details for the file pythorvision-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pythorvision-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pythorvision-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8eab07ca3118d6b6b76d58ff3a4c6e45141e7167e596ed447f244c31e188d86
MD5 2278299913d6a28242d6b20db05dc231
BLAKE2b-256 fd8347e829c067ed294ca264a7d1e05df0362d03cc7dfef2ff29edec9f64c1fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythorvision-0.3.0-py3-none-any.whl:

Publisher: publish.yml on kontex-neuro/pythorvision

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