Video Matting logo

Video Matting

Community
Littlpinguin
video-matting

Détourage vidéo local pour {{COMPANY_NAME}} — isole une personne d'une vidéo et produit un calque alpha exploitable au montage (remplacement de décor, incrustation sur fond généré). S'appuie sur RobustVideoMatting en local (ONNX, gratuit, privé). À utiliser pour remplacer un décor, incruster un sujet sur un fond de marque, ou isoler un premier plan. L'incrustation et la lumière relèvent de `video-editing`.

Overview

PublisherLittlpinguin
Repositorymarketing-cockpit-template
Skill namevideo-matting
Stars
9
Forks
0
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Littlpinguin on GitHub. Read the source before you install it.

Installation

Install the Video Matting AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Littlpinguin/marketing-cockpit-template/tree/main/.claude/skills/video-matting
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Littlpinguin/marketing-cockpit-template.git /tmp/marketing-cockpit-template
mkdir -p .claude/skills
cp -r /tmp/marketing-cockpit-template/.claude/skills/video-matting .claude/skills/video-matting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Video Matting in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Video Matting on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Video Matting is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

video-matting — détourer une vidéo en local

Gratuit et privé : tout tourne en local (ONNX Runtime, pas de PyTorch requis, accélération CoreML sur Apple Silicon).

Le principe qui décide de tout

Un détourage « se voit » quand le masque est binaire (bord franc) ou instable (contour qui frémit d'une image à l'autre). RobustVideoMatting règle les deux : alpha continu (vraies demi-transparences dans les cheveux) et état récurrent propagé d'une image à l'autre — mesuré plusieurs fois plus stable que les segmentations image-par-image des frameworks systèmes.

Méthode

Poids publics : rvm_resnet50_fp32.onnx (~100 Mo) ou rvm_mobilenetv3_fp32.onnx (~14 Mo), dépôt officiel PeterL1n/RobustVideoMatting.

  1. Prendre resnet50 : meilleur détail capillaire, moins d'artefacts (et souvent plus rapide via CoreML, meilleure couverture d'opérateurs).
  2. downsample_ratio : viser ~512 px sur le petit côté réduit (0,5 pour une source verticale ~576×1024 ; 0,25 pour de la 4K).
  3. Composer fgr + pha (les deux sorties du modèle), pas source × alpha : le premier plan rendu est décontaminé du spill du décor.
  4. Les 4 états récurrents s'initialisent à zéro et se repassent tels quels d'une frame à l'autre.

⚠️ RVM ne segmente QUE les personnes

Ni le bureau, ni le micro, ni les objets tenus. Deux compléments, légitimes tant que la caméra est fixe :

  • Meuble/bureau : bande pleine en bas de cadre avec un dégradé vertical (~50 px) pour que la jonction ne se lise pas.
  • Objets tenus : seuillage de luminance dans une bande centrale (sur toute la largeur, le seuillage ramasse le décor).

Piège de lecture : sur le masque seul, une manche ressemble à un meuble. Toujours contrôler en compositant sur un fond uni, jamais sur le masque brut.

Contrôle qualité — systématique

Extraire l'alpha (alphaextract) et suivre sa moyenne par frame (signalstats) : chercher les décrochages (masque quasi vide → clignotement), les sauts brusques, le jitter. Normaliser selon la profondeur de pixel (12 bits = échelle 0-4095). Si un frémissement se voit : lissage temporel tmix sur 3 images.

Export

  • ProRes 4444 avec -alpha_bits 8 (≈ 1 Go/min en 1080×1920). -alpha_bits 16 décuple le débit pour rien.
  • ⚠️ Certains encodeurs matériels perdent silencieusement l'alpha (sortie en yuv420p malgré la demande) : vérifier le pix_fmt du fichier de sortie.
  • Garder la résolution native : tout upscale est de l'invention de détail — le faire une seule fois, au plus tard dans la chaîne.

⚠️ La leçon la plus chère : régénérer plutôt que rattraper une source molle

Quand la source est en basse définition et que le montage la recadre fortement (zooms ×2-3), le calque détouré restera mou face à des plans générés en HD — et aucun rattrapage (matte pleine résolution, débruitage, upscale IA) ne comblera l'écart de définition. Vérifier la définition effective de la source avant de bâtir une architecture sur son détourage. Le détourage garde son sens entre sources de définition équivalente ; sinon, régénérer le plan entier (→ video-generation) est la voie qui tient.

Autre échec documenté : un compositing sujet/fond sans light wrap « se voit » toujours. L'incrustation et la lumière (halo, vignette, grain commun) se règlent au montage (→ video-editing) : dans une composition HyperFrames, où le calque détouré se pose comme une vidéo à canal alpha au-dessus du fond et où vignette et grain vont sur un calque commun (skills hyperframes:hyperframes-core et hyperframes:hyperframes-media), ou par des filtres ffmpeg dans le plan de montage (voie B). Jamais une simple superposition du calque sur le fond. Pour une composition HyperFrames, le calque se livre en WebM VP9 avec alpha, le format que Chrome lit en transparence ; le ProRes 4444 sert aux échanges et à ffmpeg.

Ce que cette skill ne fait pas

  • ❌ Incruster le fond et régler la lumière (→ video-editing : glow, vignette, grain commun, étalonnage)
  • ❌ Générer le fond (→ image-generation)
  • ❌ Le chroma key sur fond vert : un fond uni se découpe au montage, par le filtre ffmpeg chromakey dans le plan de montage de video-editing (voie B), sans modèle de détourage. La documentation d'HyperFrames ne propose pas de keyer : sa commande remove-background (skill hyperframes:hyperframes-media) détoure une personne, comme cette skill

Frequently asked questions

What does the Video Matting AI skill do?

Détourage vidéo local pour {{COMPANY_NAME}} — isole une personne d'une vidéo et produit un calque alpha exploitable au montage (remplacement de décor, incrustation sur fond généré). S'appuie sur RobustVideoMatting en local (ONNX, gratuit, privé). À utiliser pour remplacer un décor, incruster un sujet sur un fond de marque, ou isoler un premier plan. L'incrustation et la lumière relèvent de `video-editing`.

Why use Video Matting on TypingMind?

Because you install it once and use it with any model. Video Matting is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Video Matting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Littlpinguin/marketing-cockpit-template/tree/main/.claude/skills/video-matting. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Video Matting?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Video Matting?

As many as you like. As long as a model supports skills, you can use Video Matting with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Video Matting AI skill free?

Yes. It is published on GitHub by Littlpinguin under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇