muapi-ai-clipping
Original:🇺🇸 English
Translated
1 scripts
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.
2installs
Added on
NPX Install
npx skill4agent add samuraigpt/generative-media-skills muapi-ai-clippingTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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 to skip cropping and just get the highlight ranges.
--coords-onlyAgent Execution Protocol
Step 1 — Collect Inputs
| Input | Required | Default | Notes |
|---|---|---|---|
| yes | — | Hosted mp4 URL, or local file path (auto-uploaded), or YouTube URL (if backend supports it) |
| no | | Number of highlights to extract |
| no | | |
| 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
- installed and authed (
muapi-cli)muapi auth configure - available (env var or
MUAPI_API_KEYpasses)muapi auth status
That's it. No , no Python, no Whisper install, no LLM keys. Everything runs server-side.
ffmpegStep 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 \
--viewThe script:
- Resolves to a hosted URL (uploads local files via
--videoif needed).muapi upload file - Calls with the supported parameters.
muapi edit clipping - Polls until the job is done (or returns the immediately under
request_id).--async - Prints a ranked summary and, if is set, writes the full result.
--output-json
What Happens Server-Side
The endpoint internally runs the full pipeline so the agent doesn't have to:
/ai-clipping- 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 --viewSquare clips for Instagram feed:
bash
bash run-ai-clipping.sh --video "<URL>" --aspect-ratio 1:1 --num-clips 3Just the timestamps (build your own renderer):
bash
bash run-ai-clipping.sh --video "<URL>" --coords-only --output-json result.jsonAsync 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 ./outputsLocal file:
bash
bash run-ai-clipping.sh --video ./recording.mp4 --num-clips 5 --viewBatch — with one URL per line:
urls.txtbash
xargs -a urls.txt -I{} bash run-ai-clipping.sh --video "{}"Aspect Ratio Picker
| Platform | Ratio | Sweet-spot duration |
|---|---|---|
| TikTok / Reels / YouTube Shorts | | 30–75s |
| Instagram Feed | | 15–45s |
| Pinterest / portrait | | 30–60s |
Default to unless the platform is specified.
9:16Output 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 is set, each entry has / but no — render locally with ffmpeg.
--coords-onlystart_timeend_timeclip_urlWhen reporting back to the user, surface for each clip: rank, score, time range, title, hook, and clip URL.
Common Mistakes to Avoid
- Wrong aspect ratio for the platform — Shorts / TikTok / Reels are . Default to that.
9:16 - Padding to hit — if the API returns fewer survivors than requested, return what you have. Don't pretend.
num_clips - Re-running on a 404'd clip URL — the same can be re-fetched with
request_idrather than re-clipping.muapi predict wait <id> - 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 () and retry.
--poll-timeout - Source URL not reachable from the backend — upload locally with first, then pass the returned URL.
muapi upload file <path> - 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:
- has up to
result.shortsentries, each with a workingnum_clips(orclip_url/start_timeunderend_time).--coords-only - The user has been shown the ranked list (score, time range, title, hook, URL).
- If was set, the file exists and parses.
--output-json