Shared utilities for processing videos for sign language.
Project description
Simple Video Utils
Lightweight utilities for extracting frames and metadata from videos. Built for sign language processing workflows.
Goal
Provide simple, efficient tools for video processing in sign language research and applications. Uses PyAV for fast frame extraction with support for multiple formats (MP4, WebM) and remote URLs.
Installation
pip install simple-video-utils
Usage
Extract Video Metadata
from simple_video_utils.metadata import video_metadata
meta = video_metadata("video.mp4")
print(f"{meta.width}x{meta.height} @ {meta.fps} fps")
# Output: VideoMetadata(width=1920, height=1080, fps=30.0, nb_frames=450, time_base='1/15360')
Read Frames from File
from simple_video_utils.frames import read_frames_exact
# Read specific frame range (inclusive)
frames = list(read_frames_exact("video.mp4", start_frame=0, end_frame=10))
# Returns 11 frames as numpy arrays (H, W, 3) in RGB format
# Read from frame to end of video
frames = list(read_frames_exact("video.mp4", start_frame=5, end_frame=None))
Read Frames from Stream
from simple_video_utils.frames import read_frames_from_stream
# Useful for uploaded files or in-memory video data
with open("video.mp4", "rb") as f:
meta, frames_gen = read_frames_from_stream(f)
for frame in frames_gen:
# Process each frame (numpy array)
pass
Remote Videos
from simple_video_utils.metadata import video_metadata
from simple_video_utils.frames import read_frames_exact
# Works with remote URLs
url = "https://example.com/video.mp4"
meta = video_metadata(url)
frames = list(read_frames_exact(url, 0, 5))
Development
pip install -e ".[dev]"
pytest tests/
ruff check .
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_video_utils-0.0.4.tar.gz.
File metadata
- Download URL: simple_video_utils-0.0.4.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f0402a376f224160572cbb7be483bfa5f00d6754f6053688301b69350b0515
|
|
| MD5 |
ef1199403af670e328e80640b950f594
|
|
| BLAKE2b-256 |
7994fae85e274e19a9b0834681e580593620d534b2628eddf0c1e634a47c58c9
|
Provenance
The following attestation bundles were made for simple_video_utils-0.0.4.tar.gz:
Publisher:
release.yaml on sign/simple-video-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_video_utils-0.0.4.tar.gz -
Subject digest:
77f0402a376f224160572cbb7be483bfa5f00d6754f6053688301b69350b0515 - Sigstore transparency entry: 902439625
- Sigstore integration time:
-
Permalink:
sign/simple-video-utils@83cc317f450ba7bdb765322f048a1a834e07ab8f -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/sign
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@83cc317f450ba7bdb765322f048a1a834e07ab8f -
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_video_utils-0.0.4-py3-none-any.whl.
File metadata
- Download URL: simple_video_utils-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55560a77c47b1326821335244b710e671cfd43d2fc3ef181cc14ef8e4cc4f01d
|
|
| MD5 |
7623b21d49218200228be5d16df2339d
|
|
| BLAKE2b-256 |
4e270adcd6dac521fbce6ca63294d4e0403c49e403e494df6036e84ab85a137e
|
Provenance
The following attestation bundles were made for simple_video_utils-0.0.4-py3-none-any.whl:
Publisher:
release.yaml on sign/simple-video-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_video_utils-0.0.4-py3-none-any.whl -
Subject digest:
55560a77c47b1326821335244b710e671cfd43d2fc3ef181cc14ef8e4cc4f01d - Sigstore transparency entry: 902439689
- Sigstore integration time:
-
Permalink:
sign/simple-video-utils@83cc317f450ba7bdb765322f048a1a834e07ab8f -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/sign
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@83cc317f450ba7bdb765322f048a1a834e07ab8f -
Trigger Event:
release
-
Statement type: