plugin-video

Public

Converts attached videos into image frames with ffmpeg before they reach the model, so any vision-capable LLM can 'watch' them. Requires ffmpeg/ffprobe and a vision model. Version 1.1 Changelog: v1.1 - Persistent frame storage (default): frames are copied to LM Studio's user-files cache so follow-up questions about the same video keep working across turns/restarts; per-chat registry tracks files. New /video commands: list, on <name>, off [name], purge <name|all>. Max 'Frame count' and 'Max frames per video' raised from 100/400 to 1000. v1.0 - Initial release: ffmpeg frame extraction (fixed-FPS or fixed-count sampling, resolution cap) for vision models.

630 Downloads

2 stars

README

video-frames (v1.1)

Converts attached videos into a sequence of image frames with ffmpeg before they reach the model, so any vision-capable LLM can "watch" them.

Changelog

v1.1

  • Fixed follow-up questions about an already-sent video failing: added a persistent storage mode (default) that copies extracted frames into LM Studio's user-files cache with stable names, so frame references stay valid across turns and app restarts; a per-chat registry (video-registry.json) tracks which files belong to which video.
  • New /video chat commands: list, on <name> (re-attach a video's frames), off [name] (tell the model to ignore them), purge <name|all> (delete stored frame files).
  • Raised the maximums for "Frame count" and "Max frames per video" from 100/400 to 1000.

v1.0

  • Initial release: converts attached videos into a sequence of image frames with ffmpeg before they reach the model (fixed-FPS or fixed-frame-count sampling, resolution cap), so any vision-capable LLM can "watch" them. Frames were uploaded through the SDK's temporary upload API only.

How to use

Plugins cannot add UI menu items, so there is no dedicated "Attach Video" button:

  • In LM Studio chat, click Attach File and pick a video (mp4, mkv, webm, mov, avi, ...).
  • Send the message with a vision model loaded.
  • The plugin detects the video, extracts frames with ffmpeg, replaces the attachment with the frame images (in chronological order) plus a short English note describing the conversion, and lets the prediction proceed.

Progress is visible in the chat as status steps (analyzing → extracting → storing N/M frames).

By default (persistent storage), extracted frames are copied into LM Studio's user-files cache with stable names, so follow-up questions about the same video keep working — the SDK's normal upload API only keeps images until you disconnect. A small registry (video-registry.json) is kept in the chat's working directory to track which files belong to which video.

Configuration

Per-chat settings (gear icon on the plugin):

SettingDefaultDescription
Sampling modeFixed FPSFixed FPS or Fixed frame count (whole video)
FPS1Frames per second in fixed-FPS mode (0.1–30)
Frame count16Total frames across the whole video in fixed-count mode (1–1000)
Resolution~1 MpxMax pixels per frame: ~300k / ~600k / ~1 Mpx / ~2 Mpx / native. Downscale only, aspect ratio preserved
Max frames per video100Safety cap (1–1000); sampling is slowed down to stay under it
Frame storagePersistentPersistent keeps frames in LM Studio's user-files cache across turns (recommended). Temporary uses the SDK upload, which LM Studio deletes after a while — follow-ups on the same video will then fail.

Global settings (application-wide): ffmpeg path and ffprobe path — defaults to ffmpeg/ffprobe on PATH. Set full paths if your binaries are not on PATH.

Chat commands (/video)

Type these as a message in the chat:

CommandEffect
/video listList videos whose frames are stored by the plugin
/video on <name>Re-attach a video's frames to this message (e.g. after /video off)
/video off [name]Instruct the model to ignore previously attached video frames
/video purge <name|all>Delete stored frame files from disk (chats that reference them will need to be restarted)

Any text on lines below the command is still sent as the message.

Requirements

  • ffmpeg + ffprobe available on PATH, or configured in the global plugin settings.
  • A vision-capable model (e.g. Qwen2-VL, LLaVA, InternVL).

Development

npm install
npm run build   # tsc → dist/
lms dev         # start the plugin dev server (live reload) in this folder

To publish to LM Studio Hub: set your username as owner in manifest.json, then lms push.

Notes & limits

  • Only the visual content of a video is used: frames are images, and the audio track is never processed or sent to the model. If the sound carries information (speech, music), it will not be seen by the model — transcribe it separately if needed.
  • Frame count is approximate in fixed-count mode (±1 frame); the actual number is reported in the status and in the note injected into the prompt.
  • Each 1 Mpx JPEG costs roughly 1–2k tokens of context depending on the model — keep frame counts modest for long videos.
  • In persistent mode, frames live in LM Studio's user-files cache until you remove them with /video purge. They are plain files named plugin-video__<name>__frame_NNNN.jpg, so they can also be deleted manually (the registry entry then becomes stale).