You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-1Lines changed: 38 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,46 @@ Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
13
13
```bash
14
14
llm install llm-video-frames
15
15
```
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
+
16
21
## Usage
17
22
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×tamps=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×tamps=1''list notable events with timestamps'
0 commit comments