assemble-media

assemble-media is a skill for Claude Code, Codex from mudler/LocalAI. It costs 52 tokens per session (6,028 once invoked), scanned C, original, MIT.

A set of instructions for assembling generated images, video, sound, subtitles, and related files with command-line media tools. It also describes checking the input and output files during the process.

In plain words
What is it for?
Use it to make videos from pictures or text, combine or trim clips, mix audio, add subtitles, create frames and masks, and inspect media files.
Why use it?
It reduces mistakes when joining, trimming, converting, or inspecting generated media, such as using the wrong file or failing to check its duration or dimensions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is sh /tmp/vconcat.sh joined2.mp4 1280 720 24 a.mp4 b.mp4.

Good fit Use it to make videos from pictures or text, combine or trim clips, mix audio, add subtitles, create frames and masks, and inspect media files.

Compare 6 skills from other repositories ↓
About the project

LocalAI is an inference server that runs language, vision, voice, image, and video models through compatible APIs on local hardware. It is used to operate models privately across different hardware, including CPU-only systems, and supports applications, agents, and multi-user services. The catalogue contains instructions for using LocalAI.

mudler/LocalAI · 50,663 stars · on GitHub · localai.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mudler/LocalAI
agentmods
npx agentmods add skills/mudler/localai/assemble-media

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for assemble-media

README.md
[![agentmods](https://agentmods.dev/badge/skills/mudler/localai/assemble-media/github.svg)](https://agentmods.dev/skills/mudler/localai/assemble-media)
Your own site
<a href="https://agentmods.dev/skills/mudler/localai/assemble-media"><img src="https://agentmods.dev/badge/skills/mudler/localai/assemble-media/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for assemble-media

Your own site · 80×15
<a href="https://agentmods.dev/skills/mudler/localai/assemble-media"><img src="https://agentmods.dev/badge/skills/mudler/localai/assemble-media.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,028 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.06028
Opus 5.5 $0.00021 $0.02411
Sonnet 5.5 $0.00010 $0.01206
Haiku 4.5 $0.00005 $0.00603

Measured 22d ago against content hash bf1ea3cd6e29, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

assemble-media scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$dir"

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

p = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-f", "rawvideo", "-pix_fmt", "rgb24",
core/services/studio/builtinskills/tree/assemble-media/SKILL.md · 330 lines

How it starts

The opening of the file, as written. The whole thing — 330 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Assemble generated media

Generate the pieces with the LocalAI tools, then rework them with the shell tools of the media sandbox: ffmpeg, ffprobe, sox, magick and Python with Pillow. There is no network. Work in the folder where the pieces are.

Find the files

A generation tool returns a ref, a path such as /workspace/home/generated/clip-1a2b3c4d.mp4. Use that exact path; do not guess names. List what exists with ls -lt /workspace/home/generated | head. Write results next to the inputs, with new names (never overwrite a piece), then give the user the output path. A file in that folder can be passed to a tool as an argument (start_image, image, mask, audio).

Loop

  1. Generate one piece. Do not generate all pieces before checking the first.
  2. Inspect it: ffprobe for the facts, one frame grab for the picture (below). Look at the PNG.
  3. If it is wrong (size, length, no audio, bad frame), say so and fix the prompt or the command. Do not retry in a cycle.
  4. Assemble with the recipes below, then inspect the result the same way.

Inspect

cd /workspace/home/generated
ffprobe -v error -show_entries format=duration:stream=index,codec_type,codec_name,width,height,r_frame_rate,sample_rate,channels -of default=nw=1 a.mp4
ffmpeg -y -v error -ss 1 -i a.mp4 -frames:v 1 a-frame.png
ffmpeg -hide_banner -nostats -i voice.wav -af volumedetect -f null - 2>&1 | grep -E 'mean_volume|max_volume'

Look at a frame PNG with the file tools, or describe it with describe_image.

Join clips

Same codec, size and frame rate (clips of one model and settings), no re-encode:

printf "file '%s'\n" a.mp4 a.mp4 > list.txt
ffmpeg -y -v error -f concat -safe 0 -i list.txt -c copy joined.mp4

Different size, frame rate, codec, or some clips without audio: write this script once, then run sh /tmp/vconcat.sh out.mp4 1280 720 24 a.mp4 b.mp4. It scales each clip to fit with black bars, adds silence to clips with no audio, and joins them.

cat > /tmp/vconcat.sh <<'EOF2'
#!/bin/sh
# usage: vconcat.sh out.mp4 WIDTH HEIGHT FPS clip...
set -e
out=$1; w=$2; h=$3; fps=$4; shift 4
vf="scale=$w:$h:force_original_aspect_ratio=decrease,pad=$w:$h:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=$fps,format=yuv420p"
enc="-c:v libx264 -preset veryfast -crf 20 -c:a aac -ar 48000 -ac 2"
dir=$(mktemp -d); : > "$dir/list.txt"; i=0
for f in "$@"; do
  i=$((i+1)); n="$dir/$i.mp4"
  if [ -n "$(ffprobe -v error -select_streams a -show_entries stream=index -of csv=p=0 "$f")" ]; then
    ffmpeg -y -v error -i "$f" -vf "$vf" $enc "$n"
  else
    ffmpeg -y -v error -i "$f" -f lavfi -i anullsrc=r=48000:cl=stereo -map 0:v -map 1:a -shortest -vf "$vf" $enc "$n"
  fi
  echo "file '$n'" >> "$dir/list.txt"
done
ffmpeg -y -v error -f concat -safe 0 -i "$dir/list.txt" -c copy "$out"
rm -rf "$dir"
EOF2
sh /tmp/vconcat.sh joined2.mp4 1280 720 24 a.mp4 b.mp4

Read the full file on GitHub · 330 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago First seen · 330 lines · 52 tokens per session scan C bf1ea3cd6e29

Subscribe to this mod's changes

assemble-media is a skill published in the GitHub repository mudler/LocalAI (50,663 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 6,028 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-11.

Related

assemble-media compared with skills from other repositories

assemble-media next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
assemble-mediamudler/LocalAISkill51ktodayMITC52Claude Code, Codex
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
sglang-diffusion-performancesgl-project/sglangSkill39ktodayApache-2.0A29Claude Code, Codex
sglang-diffusion-cache-ditsgl-project/sglangSkill39ktodayApache-2.0A161Claude Code
sglang-diffusion-modelopt-quantsgl-project/sglangSkill39ktodayApache-2.0A49Claude Code, Codex
skill-creatorunslothai/unslothSkill81ktodayApache-2.0A26Claude Code
image-promptingunslothai/unslothSkill81ktodayApache-2.0A23Claude Code