Skip to main content
skill CX Codex

muapi-ai-clipping — Claude Code skill: cut long video into clips

Turns one long video into short vertical clips through a single API call. Handy when a podcast or stream has to be cut for Shorts and Reels.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add SamurAIGPT/Generative-Media-Skills --skill muapi-ai-clipping -a claude-code
Open on GitHub

What muapi-ai-clipping does

The skill wraps muapi.ai's /ai-clipping endpoint. You hand over a video link, a clip count and an aspect ratio; transcription, highlight picking and face-tracked vertical cropping all happen on the server. Nothing runs on your machine — no Whisper, no GPU, no LLM keys.

Ranking follows a set of signals: a strong opening line, an emotional peak, a contrarian take, a revelation, conflict, a quotable phrase, a story climax, practical value. Overlapping candidates get deduped by score. Every clip comes back with a score from 0 to 100, a hook sentence, a one-line reason it should work, and a hosted mp4 link.

Before the first run you need muapi-cli installed and authed, plus MUAPI_API_KEY in your environment. Without the key the script stops at an auth error. If the backend cannot reach the source video, upload it first with muapi upload file and pass the returned URL. The --coords-only flag returns time ranges only, which suits you if you render clips yourself.

Invocation goes through bash library/edit/ai-clipping/scripts/run-ai-clipping.sh. It resolves --video to a hosted URL, calls muapi edit clipping, polls until the job finishes and prints a ranked summary. With --async it returns a request_id right away; fetch the result later with muapi predict wait.

What it helps with

  • cut a podcast into vertical clips for TikTok and Reels
  • pull the strongest moments out of a long stream recording
  • get face-tracked vertical crops without running ffmpeg
  • collect highlight timestamps for a custom renderer
  • batch through a list of videos in urls.txt

Example prompts for the agent

  • Cut 5 vertical clips from https://example.com/podcast.mp4 and show them in the player
  • Make 3 square clips from ./recording.mp4 for an Instagram feed
  • Return only the highlight time ranges for this video, no cropping

How to install muapi-ai-clipping

1Skills CLI (Vercel)

npx skills add SamurAIGPT/Generative-Media-Skills --skill muapi-ai-clipping -a claude-code

2Manually: put the files in place

~/.claude/skills/muapi-ai-clipping/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/muapi-ai-clipping/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about muapi-ai-clipping

How do I install muapi-ai-clipping in Claude Code?

Run npx skills add SamurAIGPT/Generative-Media-Skills --skill muapi-ai-clipping -a claude-code. The skill lands at ~/.claude/skills/muapi-ai-clipping/SKILL.md.

What does muapi-ai-clipping do?

It sends a video to the /ai-clipping endpoint and gets back short clips with a virality score, a hook line and an mp4 URL. Transcription, highlight ranking and cropping are handled server-side.

What do I need before running the skill?

An installed and authed muapi-cli, plus the MUAPI_API_KEY environment variable. Local ffmpeg, Python and Whisper are not needed.

Source text

SKILL.md · MIT
---
slug: muapi-ai-clipping
name: muapi-ai-clipping
version: "1.0.0"
description: Turn a long video into N viral-ready short clips with a single managed API call. Wraps muapi.ai's `/ai-clipping` endpoint, which handles transcription, highlight ranking through a virality framework (hook / emotional peak / opinion bomb / revelation / conflict / quotable / story peak / practical value), overlap dedupe, and vertical face-tracking auto-crop server-side. No local Whisper, no local LLM, no GPU.
acceptLicenseTerms: true
---

# AI Clipping

**One API call: long video in → ranked vertical short clips out.**

Each clip ships with a viral score (0–100), an opening hook line, a one-sentence "why it works" reason, and a hosted mp4 URL.

Underlying API: https://muapi.ai/playground/ai-clipping
Reference implementation (open source): https://github.com/SamurAIGPT/AI-Youtube-Shorts-Generator

---

## When to Use

- Auto-clip a podcast, interview, lecture, vlog, or stream into TikTok / Reels / Shorts.
- Extract the best 30–75s moments from any hosted video URL.
- Get face-tracked vertical (9:16), square (1:1), or portrait (4:5) crops without running ffmpeg locally.

If you only need raw timestamps for your own renderer, set `--coords-only` to skip cropping and just get the highlight ranges.

---

## Agent Execution Protocol

### Step 1 — Collect Inputs

| Input | Required | Default | Notes |
|:---|:---|:---|:---|
| `--video` | yes | — | Hosted mp4 URL, or local file path (auto-uploaded), or YouTube URL (if backend supports it) |
| `--num-clips` | no | `3` | Number of highlights to extract |
| `--aspect-ratio` | no | `9:16` | `9:16` \| `1:1` \| `4:5` |
| `--coords-only` | no | off | Return just the highlight time ranges, skip cropping |

If the user gave only a video URL, run with defaults — don't block on questions.

---

### Step 2 — Verify Prerequisites

- `muapi-cli` installed and authed (`muapi auth configure`)
- `MUAPI_API_KEY` available (env var or `muapi auth status` passes)

That's it. No `ffmpeg`, no Python, no Whisper install, no LLM keys. Everything runs server-side.

---

### Step 3 — Run the Skill

```bash
bash library/edit/ai-clipping/scripts/run-ai-clipping.sh \
  --video "https://example.com/podcast.mp4" \
  --num-clips 5 \
  --aspect-ratio 9:16 \
  --view
```

The script:
1. Resolves `--video` to a hosted URL (uploads local files via `muapi upload file` if needed).
2. Calls `muapi edit clipping` with the supported parameters.
3. Polls until the job is done (or returns the `request_id` immediately under `--async`).
4. Prints a ranked summary and, if `--output-json` is set, writes the full result.

---

## What Happens Server-Side

The `/ai-clipping` endpoint internally runs the full pipeline so the agent doesn't have to:

- **Transcribe** with Whisper.
- **Classify content type** (podcast / interview / tutorial / vlog / lecture / monologue).
- **Rank highlights** through the virality framework:
  - **Hook moments** — strong opening line that stops the scroll
  - **Emotional peaks** — laughter, anger, vulnerability, awe
  - **Opinion bombs** — spicy, contrarian, debate-bait takes
  - **Revelation moments** — "wait, what?" reframes
  - **Conflict** — disagreement, tension, callouts
  - **Quotable lines** — tight, screenshot-worthy phrasing
  - **Story peaks** — climax of a narrative arc
  - **Practical value** — actionable insight a viewer will save
- **Dedupe** overlapping candidates by score.
- **Top-N select** and **face-track auto-crop** to the requested aspect ratio.

This is why the skill is small: the heavy lifting is on the API.

---

## Quick Invocation Patterns

**Defaults — three 9:16 clips:**
```bash
bash run-ai-clipping.sh --video "https://example.com/long.mp4"
```

**Podcast — more clips, view in player:**
```bash
bash run-ai-clipping.sh --video "<URL>" --num-clips 8 --view
```

**Square clips for Instagram feed:**
```bash
bash run-ai-clipping.sh --video "<URL>" --aspect-ratio 1:1 --num-clips 3
```

**Just the timestamps (build your own renderer):**
```bash
bash run-ai-clipping.sh --video "<URL>" --coords-only --output-json result.json
```

**Async submit (returns request_id, poll later):**
```bash
REQUEST_ID=$(bash run-ai-clipping.sh --video "<URL>" --async --output-json - | jq -r '.request_id')
muapi predict wait "$REQUEST_ID" --download ./outputs
```

**Local file:**
```bash
bash run-ai-clipping.sh --video ./recording.mp4 --num-clips 5 --view
```

**Batch — `urls.txt` with one URL per line:**
```bash
xargs -a urls.txt -I{} bash run-ai-clipping.sh --video "{}"
```

---

## Aspect Ratio Picker

| Platform | Ratio | Sweet-spot duration |
|:---|:---|:---|
| TikTok / Reels / YouTube Shorts | `9:16` | 30–75s |
| Instagram Feed | `1:1` | 15–45s |
| Pinterest / portrait | `4:5` | 30–60s |

Default to `9:16` unless the platform is specified.

---

## Output Schema

```json
{
  "source_video_url": "...",
  "shorts": [
    {
      "title": "The one mistake that cost me $50K",
      "start_time": 124.3,
      "end_time": 187.6,
      "score": 92,
      "hook_sentence": "Nobody talks about this, but it killed my first startup...",
      "virality_reason": "Opens with a number + regret, peaks on a contrarian lesson",
      "clip_url": "https://.../short_1.mp4"
    }
  ]
}
```

When `--coords-only` is set, each entry has `start_time`/`end_time` but no `clip_url` — render locally with ffmpeg.

When reporting back to the user, surface for each clip: rank, score, time range, title, hook, and clip URL.

---

## Common Mistakes to Avoid

1. **Wrong aspect ratio for the platform** — Shorts / TikTok / Reels are `9:16`. Default to that.
2. **Padding to hit `num_clips`** — if the API returns fewer survivors than requested, return what you have. Don't pretend.
3. **Re-running on a 404'd clip URL** — the same `request_id` can be re-fetched with `muapi predict wait <id>` rather than re-clipping.
4. **Trying to tune Whisper / chunk size / LLM prompts** — those knobs aren't exposed; the endpoint handles them.

---

## Failure Modes

- **API key missing or rejected** — surface the exact error; never fabricate a key.
- **Job timed out** — bump poll timeout (`--poll-timeout`) and retry.
- **Source URL not reachable from the backend** — upload locally with `muapi upload file <path>` first, then pass the returned URL.
- **Fewer clips returned than requested** — the source had fewer rankable highlights. Return what came back with a note.

---

## Done Criteria

The skill is done when:
1. `result.shorts` has up to `num_clips` entries, each with a working `clip_url` (or `start_time`/`end_time` under `--coords-only`).
2. The user has been shown the ranked list (score, time range, title, hook, URL).
3. If `--output-json` was set, the file exists and parses.

© SamurAIGPT · MIT · SamurAIGPT/Generative-Media-Skills

Similar skills

All skills for AI and ML →

From the same set39

muapi-social-media-video A skill that takes a social video from brand files to a finished clip: post copy, storyboard, reference frames and a Seedance 2.0 prompt. CX Codex +1 2,800installs muapi-ui-design Turns a product brief into a design spec for high-fidelity UI mockups and wireframes: atomic design, tokens, layout patterns. CX Codex +1 2,800installs muapi-nano-banana Formulates reasoning-driven image prompts in Gemini 3 style and sends them to muapi.ai. Useful when you need legible typography and physically accurate lighting. CX Codex +1 2,800installs muapi-youtube-shorts Turns a long video into ranked 9:16 clips with virality scores and face-tracked crops. Useful when you need Shorts, TikTok or Reels out of a podcast or stream. CX Codex +1 2,700installs muapi-product-video-ad-maker Turns a plain product photo into a polished commercial still, then animates it into a short cinematic ad. Useful when you need a promo clip without a shoot. CX Codex +1 2,500installs muapi-instagram-post Generates Instagram visuals along with matching captions and hashtags via the muapi CLI. Useful for feed posts and Reels covers. CX Codex +1 2,500installs muapi-youtube-thumbnail This skill plans a thumbnail composition, generates a 16:9 image through muapi, then suggests overlay text, placement and font. CX Codex +1 2,500installs muapi-ugc-video-factory Creates vertical 9:16 UGC video ads with synchronized spoken audio from a person image, product photo, and script. Built for direct execution in coding agents. CX Codex +1 2,400installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor