Skip to main content

LLM plugin to turn a video into individual frames

Project description

llm-video-frames

PyPI Changelog Tests License

LLM plugin to turn a video into individual frames

Installation

Install this plugin in the same environment as LLM.

llm install llm-video-frames

Requires ffmpeg installed and available on the system PATH. On macOS, you can install it using Homebrew:

brew install ffmpeg

Usage

The llm-video-frames plugin provides a fragment loader that extracts individual frames from a video file using ffmpeg.

You can use the video-frames: fragment prefix to turn a video into a series of image attachments.

Fragment syntax

video-frames:<path>?fps=N&timestamps=1
  • <path>: Path to the video file accessible to the environment where LLM runs.
  • fps=N: (optional) Number of frames per second to extract. Defaults to 1 if omitted.
  • timestamps=1: (optional) If set to 1, overlays the filename and timestamp on each extracted frame in the bottom-right corner.

Examples

Extract 1 frame per second (default) from video.mp4:

llm -f video-frames:video.mp4 'describe the key scenes in this video'

Extract 5 frames per second:

llm -f 'video-frames:video.mp4?fps=5' 'summarize the video'

Extract 2 frames per second with filename and timestamps overlayed on frames:

llm -f 'video-frames:video.mp4?fps=2&timestamps=1' 'list notable events with timestamps'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-video-frames
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_video_frames-0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

llm_video_frames-0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file llm_video_frames-0.1.tar.gz.

File metadata

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

File hashes

Hashes for llm_video_frames-0.1.tar.gz
Algorithm Hash digest
SHA256 40fea50e4b40ece04b9ebd077092f3f224543970226b639f17134df70a2f5d31
MD5 745d4eb26ff66a82d789cc1d118fd94a
BLAKE2b-256 a2891aa07f6c4d65e331600732af57cd0f4bbd1bbee70f1a002eaf751aad67d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_video_frames-0.1.tar.gz:

Publisher: publish.yml on simonw/llm-video-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 llm_video_frames-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_video_frames-0.1-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 llm_video_frames-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 635c0609ee27619f23f704adba07fe1ca2dd00e744c7e532138353792fb391ef
MD5 0347c9309fc5892403923469cac1611f
BLAKE2b-256 55a9beb469cb442e14f5e72549cbe90d0995f1f80a6413b46e2f76bf7344f7fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_video_frames-0.1-py3-none-any.whl:

Publisher: publish.yml on simonw/llm-video-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