Analyze videos with multimodal AI, one frame at a time.
Project description
Videoframer for Python
Analyze video with multimodal AI, one frame at a time.
Videoframer extracts chronologically ordered JPEG frames from a local video, groups them into batches, and sends them to OpenAI, Anthropic, or Gemini.
Requirements
- Python 3.10 or newer
- FFmpeg available on your system
PATH - An API key for the selected model provider
Installation
Install support for one provider:
pip install "videoframer[openai]"
pip install "videoframer[anthropic]"
pip install "videoframer[gemini]"
Or install all provider integrations:
pip install "videoframer[all]"
FFmpeg is a system dependency and is not installed by pip. For example:
brew install ffmpeg # macOS
sudo apt install ffmpeg # Debian or Ubuntu
Quick start
import os
from videoframer import Videoframer, VideoframerOptions
videoframer = Videoframer(
VideoframerOptions(
video_path="./videos/demo.mp4",
frames_directory="./tmp/frames",
provider="openai",
api_key=os.environ["OPENAI_API_KEY"],
model="gpt-5.6",
prompt=(
"Analyze these frames as one continuous video. "
"Summarize important actions chronologically."
),
frame_rate=1,
batch_size=5,
max_frames=20,
)
)
videoframer.on("progress", print)
analysis = videoframer.analyze()
for batch in analysis.results:
print(batch.output_text)
frames_directory is a parent directory. Each analysis gets a private,
uniquely named videoframer-* subdirectory so concurrent instances cannot
overwrite one another's frames. Set keep_frames=True to retain that run
directory after analysis. Set max_frames="all", 0, or -1 to analyze every
extracted frame.
Lifecycle event payloads are JSON strings. The started, progress, and
completed events can be parsed with json.loads; the error event receives
the original exception.
Command line
Installing the package provides both videoframer and
python -m videoframer:
export OPENAI_API_KEY="..."
videoframer ./videos/demo.mp4 \
--provider openai \
--model gpt-5.6 \
--max-frames 20 \
--progress
Use ANTHROPIC_API_KEY for Anthropic and GEMINI_API_KEY for Gemini. Analysis
JSON is written to standard output; --progress writes lifecycle JSON to
standard error.
Video frames are sent to the selected third-party model provider. Review that provider's data handling and retention terms before analyzing sensitive video.
Development
uv sync --all-extras
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run python -m build
License
MIT
Project details
Release history Release notifications | RSS feed
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 videoframer-0.1.0.tar.gz.
File metadata
- Download URL: videoframer-0.1.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3bef343da89f0986b88f797be9fd8c44cc87744512cf12ab890508f1645979e
|
|
| MD5 |
aea54b485a7317b80e6ff461da67e99d
|
|
| BLAKE2b-256 |
6ccc4eac48832155d724920c95577a8dce8f3028f0be778b7714c2f72d6c2c79
|
Provenance
The following attestation bundles were made for videoframer-0.1.0.tar.gz:
Publisher:
publish.yml on cacheflow/pyvideoframer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
videoframer-0.1.0.tar.gz -
Subject digest:
e3bef343da89f0986b88f797be9fd8c44cc87744512cf12ab890508f1645979e - Sigstore transparency entry: 2293195291
- Sigstore integration time:
-
Permalink:
cacheflow/pyvideoframer@dc4683e728367faf436f690188885749b3dc40be -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/cacheflow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc4683e728367faf436f690188885749b3dc40be -
Trigger Event:
release
-
Statement type:
File details
Details for the file videoframer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: videoframer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb4ba3f9f926986f71b9ed919ae550dca822f1ad20bcf914dd64038d7c3345b0
|
|
| MD5 |
e4bb903e3ee665bda9e933159a2d274e
|
|
| BLAKE2b-256 |
4aee9f247c5130143c204b12fcbba2f57efbf592d2c3f560ae3d9529246140d3
|
Provenance
The following attestation bundles were made for videoframer-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on cacheflow/pyvideoframer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
videoframer-0.1.0-py3-none-any.whl -
Subject digest:
bb4ba3f9f926986f71b9ed919ae550dca822f1ad20bcf914dd64038d7c3345b0 - Sigstore transparency entry: 2293195444
- Sigstore integration time:
-
Permalink:
cacheflow/pyvideoframer@dc4683e728367faf436f690188885749b3dc40be -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/cacheflow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc4683e728367faf436f690188885749b3dc40be -
Trigger Event:
release
-
Statement type: