Skip to content

Commit 64d9499

Browse files
committed
README, refs #1
1 parent 7018e1a commit 64d9499

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,46 @@ Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
1313
```bash
1414
llm install llm-video-frames
1515
```
16+
Requires `ffmpeg` installed and available on the system `PATH`. On macOS, you can install it using Homebrew:
17+
```bash
18+
brew install ffmpeg
19+
```
20+
1621
## Usage
1722

18-
Usage instructions go here.
23+
The `llm-video-frames` plugin provides a [fragment loader](https://llm.datasette.io/en/stable/fragments.html#using-fragments-from-plugins) that extracts individual frames from a video file using `ffmpeg`.
24+
25+
You can use the `video-frames:` fragment prefix to turn a video into a series of image attachments.
26+
27+
### Fragment syntax
28+
29+
```
30+
video-frames:<path>?fps=N&timestamps=1
31+
```
32+
33+
- `<path>`: Path to the video file accessible to the environment where LLM runs.
34+
- `fps=N`: (optional) Number of frames per second to extract. Defaults to `1` if omitted.
35+
- `timestamps=1`: (optional) If set to `1`, overlays the filename and timestamp on each extracted frame in the bottom-right corner.
36+
37+
### Examples
38+
39+
Extract 1 frame per second (default) from `video.mp4`:
40+
41+
```bash
42+
llm -f video-frames:video.mp4 'describe the key scenes in this video'
43+
```
44+
45+
Extract 5 frames per second:
46+
47+
```bash
48+
llm -f 'video-frames:video.mp4?fps=5' 'summarize the video'
49+
```
50+
51+
Extract 2 frames per second with filename and timestamps overlayed on frames:
52+
53+
```bash
54+
llm -f 'video-frames:video.mp4?fps=2&timestamps=1' 'list notable events with timestamps'
55+
```
1956

2057
## Development
2158

0 commit comments

Comments
 (0)