LLM plugin to turn a video into individual frames
Project description
llm-video-frames
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×tamps=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 to1if omitted.timestamps=1: (optional) If set to1, 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×tamps=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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40fea50e4b40ece04b9ebd077092f3f224543970226b639f17134df70a2f5d31
|
|
| MD5 |
745d4eb26ff66a82d789cc1d118fd94a
|
|
| BLAKE2b-256 |
a2891aa07f6c4d65e331600732af57cd0f4bbd1bbee70f1a002eaf751aad67d0
|
Provenance
The following attestation bundles were made for llm_video_frames-0.1.tar.gz:
Publisher:
publish.yml on simonw/llm-video-frames
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_video_frames-0.1.tar.gz -
Subject digest:
40fea50e4b40ece04b9ebd077092f3f224543970226b639f17134df70a2f5d31 - Sigstore transparency entry: 206743621
- Sigstore integration time:
-
Permalink:
simonw/llm-video-frames@daea91779ad42dd9e5df3ac67649285b6677f82c -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@daea91779ad42dd9e5df3ac67649285b6677f82c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
635c0609ee27619f23f704adba07fe1ca2dd00e744c7e532138353792fb391ef
|
|
| MD5 |
0347c9309fc5892403923469cac1611f
|
|
| BLAKE2b-256 |
55a9beb469cb442e14f5e72549cbe90d0995f1f80a6413b46e2f76bf7344f7fb
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_video_frames-0.1-py3-none-any.whl -
Subject digest:
635c0609ee27619f23f704adba07fe1ca2dd00e744c7e532138353792fb391ef - Sigstore transparency entry: 206743622
- Sigstore integration time:
-
Permalink:
simonw/llm-video-frames@daea91779ad42dd9e5df3ac67649285b6677f82c -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@daea91779ad42dd9e5df3ac67649285b6677f82c -
Trigger Event:
release
-
Statement type: