Skip to main content

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

Metadata

Release files for videoframer 1.0.1

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

Source distribution (sdist)

Source distribution for videoframer 1.0.1
File Size Uploaded Provenance Actions
videoframer-1.0.1.tar.gz 18.7 kB With provenance Details for videoframer-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for videoframer 1.0.1
File Interpreter ABI Platform Actions
videoframer-1.0.1-py3-none-any.whl Python 3 none any Details for videoframer-1.0.1-py3-none-any.whl

Total release size: 33.7 kB

Release files / videoframer-1.0.1.tar.gz

Download URL videoframer-1.0.1.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
15f11a0ba599b9b74b016c811b97ad9650524f5291312e99a265a433d5c97db2
BLAKE2b-256 checksum
How to use checksums
c1ca37c1023b0fc01b1093c72a287cbc34f51166e2d5bfceae2234abac18a4b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 30, 2026.

Transparency log

Release files / videoframer-1.0.1-py3-none-any.whl

Download URL videoframer-1.0.1-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e013c852b956d4589f4eb2c6e601a4d675a1cb08193b4fbc386a21709ddbd87
BLAKE2b-256 checksum
How to use checksums
9f717f89c6165fffbddd439590791e51939d791da9ea56ce3d4a8ef687c639ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 30, 2026.

Transparency log

Security for videoframer 1.0.1

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for videoframer-1.0.1.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 Jul 30, 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

1.0.1 This release

2 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