Skip to main content

Read frames from OpenCV like humans

Project description

Tests PyPI Downloads

cv-frames is a lightweight utility that simplifies working with video files frame-by-frame using OpenCV. It includes both a Python API and a command-line interface (CLI) for interacting with video frames in an intuitive way.


Installation

Install via pip:

pip install cv-frames

Command Line Usage

After installation, you can use the CLI:

cv-frames show path/to/video.mp4

Navigate through frames with any key. Press q to quit.


Python Usage

Example: Read and show frames programmatically

from pathlib import Path
from cvframes import iterate

for i, (_, frame) in enumerate(iterate(Path("video.mp4"))):
    print(f"Frame {i} shape:", frame.shape)

Example: Split side-by-side video into left/right frames

from cvframes import iterate_sbs

# Write the processed frames to disc
for capture, (left, right) in iterate_sbs("sbs_video.mp4", oname="processed.mp4"):
    processed = do_something(left)
    capture.write(processed)

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

cv_frames-0.0.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

cv_frames-0.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file cv_frames-0.0.2.tar.gz.

File metadata

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

File hashes

Hashes for cv_frames-0.0.2.tar.gz
Algorithm Hash digest
SHA256 511dc2ccb20c39d1dcad43bebbf17cf96a19763f14a3ce7ce93fe746a89e5ada
MD5 b6c79b1c099eb1282bf99deb36ecc8b6
BLAKE2b-256 4a2d36d83fadcb5bc5bd02c83bc7b5b536e4eb4e4608f2cc4a08941d6753701e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cv_frames-0.0.2.tar.gz:

Publisher: publish.yml on kqf/cv-frames

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

File details

Details for the file cv_frames-0.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cv_frames-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68a07b050e6d5a9f3053a147dae162c6cc495c5efcb8ae1e51fb081a80d0c1e4
MD5 9c319a51026c77d6de505242a691865f
BLAKE2b-256 2564e477f251eff4a4b3612037b7e95c912d024a72387fb352a50e21a0f2abe6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cv_frames-0.0.2-py3-none-any.whl:

Publisher: publish.yml on kqf/cv-frames

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