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 Script

Run the example script from your terminal:

python ./examples/run_two_cams.py

This example script demonstrates how to:

  • Connect to the XDAQ ThorVision server
  • List available cameras and their capabilities
  • Start recording streams from up to 2 cameras
  • Record for a short period
  • Properly clean up resources

You should see output detailing the camera capabilities, the selected streams, and recording status. The recorded .mkv video files will be saved in the recordings/ directory.

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.1.0.tar.gz (10.1 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.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pythorvision-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8754ffe6f3ce07fa0f34dd025f85df5fbed4d24dee9d49d267dabdfa38adceb7
MD5 b1d8abae6e4c5a21114f226c8c81f6ce
BLAKE2b-256 eba91ea70837e589d4f811a4f8c51c312ce71d47bf5abad19861d79381fa46bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythorvision-0.1.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.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pythorvision-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33b9bee971ee1ef6ce03cce1c33f269e50b19a1e201b8981a7a78cd33d8196e9
MD5 6be9df827564d8ab8ac3ec6f66b6641c
BLAKE2b-256 fc5175c3d506550bf88fcc0fd04ec726a3ce6c041594dbbbe920b4012f28020a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythorvision-0.1.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