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.3.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.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cv_frames-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 d30639836400c5671d6732f5a2633cd29e1e90254dec1e7afc4f7a87c95a36b8
MD5 b8a4a1403b275877cd8b7581caec0044
BLAKE2b-256 7bdafef957fec1fd711e761171391111d3b4de58465c68b90e18bd0c016139bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cv_frames-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: cv_frames-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8adbfaa100cbd0112dcd060e72a0bcd8261853fb879e99f50ba7f3de1399087f
MD5 3ee8a86e7e3959f51383d8ca09421077
BLAKE2b-256 9bdae5d790fb9b4193481082584f0366dde695fd17037d9d8466f43f9f2d7df0

See more details on using hashes here.

Provenance

The following attestation bundles were made for cv_frames-0.0.3-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