Skip to main content

cine-handler

Read, process, trim and write Vision Research Phantom .cine files from Python. A portable Rust backend handles I/O, decoding, encoding and pixel processing; NumPy supplies the array interface. Frames load on demand, with no GPU or special CPU instruction set required.

Package name: cine-handler · Python import: cine_reader

Installation

python -m pip install --only-binary=:all: cine-handler
# Include image-file and video conversion:
python -m pip install --only-binary=:all: "cine-handler[media]"

Wheels include the native library. No Rust, C compiler or MATLAB installation is needed. Version 0.2.0 supplies Apple Silicon macOS (ARM64, macOS 11+), Windows x64 and Linux x64/glibc 2.28+ backends. Use 64-bit Python 3.9 or newer; dependency wheels may require newer OS versions. Intel macOS, Windows ARM64, Linux ARM64 and musl/Alpine are not included targets.

A downloaded/cloned GitHub checkout or source archive also installs without compilers because it contains the same verified backends:

python -m pip install ".[media]"
# For working directly in an IDE checkout:
python -m pip install -e ".[media]"

images installs Pillow, video installs PyAV, and media installs both. PyAV wheels bundle FFmpeg libraries, so ordinary video conversion needs no separate ffmpeg or ffprobe executable. If you have the older cine-reader distribution, uninstall it first: it shares the cine_reader import name.

Read frames

from cine_reader import Cine

with Cine("capture.cine", canonical=True) as cine:
    print(cine.total_frames, cine.frame_rate)
    for number in range(cine.first_frame_number, cine.last_frame_number + 1):
        cine.load_frame(number)
        frame = cine.image
        # Analyze one frame at a time.

Opening reads bounded metadata. Pixels, offsets and raw payloads load when requested. Acquisition frame numbers can be negative. canonical=True gives top-down coordinates and RGB channel order; the default retains the previous reader's storage row order and BGR convention. Raw CFA/Bayer frames remain 2D unless debayer=True; remove_dead_pixels=True enables pixel repair.

Write arrays, images and video

import numpy as np
from cine_reader import write_cine, write_cine_from_images, write_cine_from_video

frames = [np.full((64, 96), value, dtype=np.uint16) for value in (0, 100, 200)]
write_cine("normal.cine", frames, frame_rate=1000)
write_cine("packed.cine", frames, encoding="packed10", frame_rate=1000)
write_cine_from_images("photos.cine", ["001.png", "002.png"], frame_rate=30)
write_cine_from_video("video.cine", "input.mp4")

write_cine accepts sequences, frame-first NumPy stacks or generators; CineWriter provides incremental writing. Normal encoding preserves uint8/uint16 mono and RGB samples. Packed10 quantizes linear12 values with Phantom's nonlinear lookup table: uint16 input must be in 0..4095, uint8 is scaled, and RGB is sampled into a Bayer mosaic. Use normal RGB to preserve every input color sample. Writers consume top-down RGB coordinates; read back with canonical=True.

Known counts write directly. Unknown counts spool to disk and make one final copy, keeping RAM bounded. Existing destinations are never overwritten.

Processing and formats

  • Reads CINE v0/v1, normal8/16/24/48, packed10 and packed12, mono and raw CFA.
  • Trims encoded frames without decoding, preserving relevant metadata.
  • Repairs dead pixels, demosaics Bayer frames, averages recordings and estimates robust backgrounds through Rust.
  • Mean uses one accumulator; top-k retains bounded samples. Explicit MAD and batch loading intentionally hold a stack.

Proprietary compressed CCI is unsupported. Generated files follow the CINE format reference and pass independent FFmpeg checks. Direct PCC opening/playback has not yet been verified.

Documentation and examples

The repository also supplies a MATLAB interface and standalone Rust library/CLI. Python wheels contain only the Python interface and its matching native library. MATLAB users install the checkout's prebuilt gateway with install_cine_backend; see the MATLAB guide.

Project code is MIT licensed. This package is an independent implementation and does not require Vision Research software for its supported formats.

Metadata

Release files for cine-handler 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cine-handler 0.2.0
File Size Uploaded Provenance Actions
cine_handler-0.2.0.tar.gz 1.4 MB With provenance Details for cine_handler-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cine-handler 0.2.0
File Interpreter ABI Platform Actions
cine_handler-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for cine_handler-0.2.0-py3-none-win_amd64.whl
cine_handler-0.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for cine_handler-0.2.0-py3-none-manylinux_2_28_x86_64.whl
cine_handler-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for cine_handler-0.2.0-py3-none-macosx_11_0_arm64.whl

Total release size: 2.2 MB

Release files / cine_handler-0.2.0.tar.gz

Download URL cine_handler-0.2.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
af055c6e8e155974f858a34f6dff1a8aa472f37adda06d7e42de5f3a758eaa45
BLAKE2b-256 checksum
How to use checksums
3a8a1cfa09d1add94e696e3d227bcb9a9b3c647b696199c4d43a70cdbeea077f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / cine_handler-0.2.0-py3-none-win_amd64.whl

Download URL cine_handler-0.2.0-py3-none-win_amd64.whl
Size 211.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b56ee7cf8d91611694cc4d11d3eeb5ecef8819712bc5bc5da8f66f11194a39d3
BLAKE2b-256 checksum
How to use checksums
63bdf30c8bdfc2c09be6cc12b1d0808fd1af9696f69338aa472fe9ef42cb48fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / cine_handler-0.2.0-py3-none-manylinux_2_28_x86_64.whl

Download URL cine_handler-0.2.0-py3-none-manylinux_2_28_x86_64.whl
Size 276.9 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e276d44e0fe9bf4106aa9b0fd6d6ac450ecd900fefa43d3f2dc33a5994dba70c
BLAKE2b-256 checksum
How to use checksums
49137fad9b464a73d1cadc9381664e3de4b35256e6fcdf7ffec0b7c3ac529953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / cine_handler-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL cine_handler-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 238.6 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
28aefb96b6b37bd90aeef289021090d2a1380990340a2d5c8ac56a46bc0c3d07
BLAKE2b-256 checksum
How to use checksums
31a1ea20711000f2ff645e453101f2572dc2bd45add82e10b000405abc9f23bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for cine-handler 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for cine_handler-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

4 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page