[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71KC0FD1TDNM0EVN5B520MB":3,"skill-same:01M71KC0FD1TDNM0EVN5B520MB":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M71KC0FD1TDNM0EVN5B520MB","video-editing",null,"Edit video files with FFmpeg — trim, merge, add subtitles, effects, voiceovers, and reformat.","clawdsolana\u002FOpenClawd","clawdsolana","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F279036008?v=4","01M71JTVF9FNGKE2SVJRPTQM31","OpenClawd","01M71JTVGCKWBSS8ZYC1HYWVA5",2,"MIT","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36],"Video","video editing","editing","files","edit","trim","effects","edit video","merge","add","subtitles","with","ffmpeg","2026-11-10 10:12:30",false,"---\nname: video-editing\ndescription: Edit video files with FFmpeg — trim, merge, add subtitles, effects, voiceovers, and reformat.\n---\n\n# Video Editing\n\n## OpenClawd Operator Adaptation\n\nRun this skill as part of the OpenClawd operator deck. Preserve the skill-specific workflow below, but frame outputs for Solana-native agents when relevant: prefer OpenClawd language, note whether the work can support autonomous agent operations, and keep financial, legal, tax, hiring, medical, or other regulated outputs informational unless the skill already requires a stricter disclaimer. Use the Llobster Legend persona only as light operator framing; do not let branding override accuracy, safety, or the user's stated domain.\n\n\nEdit existing video files server-side using FFmpeg. This skill covers the full editing workflow: trimming, splicing, concatenating, transitions, text overlays, subtitles, audio mixing, effects, and format conversion.\n\n## When to Use\n\n### Trimming & Cutting\n\n- \"Trim this video to 0:30-1:15\" \u002F \"Cut out the first 10 seconds\"\n- \"Extract a clip from 2:00 to 3:30\"\n\n- \"Remove the intro\" \u002F \"Cut the ending\"\n\n#### Merging & Compositing\n\n- \"Merge these clips together\" \u002F \"Concatenate these videos\"\n- \"Put two videos side by side\" \u002F \"Split screen\"\n\n- \"Picture-in-picture\"\n\n##### Text, Titles & Subtitles\n\n- \"Add subtitles\" \u002F \"Add captions\"\n- \"Put a title card at the beginning\"\n\n- \"Add text overlay\"\n\n###### Audio\n\n- \"Add background music\" \u002F \"Mix in this audio track\"\n- \"Add a voiceover\" \u002F \"Narrate this video\" (uses ElevenLabs)\n\n- \"Mute this video\" \u002F \"Remove the audio\"\n- \"Replace the audio with this track\"\n\n###### Speed & Motion\n\n- \"Speed up this video 2x\" \u002F \"Slow motion\"\n- \"Make this part slow-mo\"\n\n- \"Reverse this clip\"\n- \"Loop this clip 3 times\"\n\n###### Visual Effects & Fixes\n\n- \"Rotate this video 90 degrees\" \u002F \"Flip horizontally\"\n- \"Stabilize this shaky footage\"\n\n- \"Crop out the watermark\" \u002F \"Remove the watermark\"\n- \"Add my logo to this video\" (image overlay \u002F branding)\n\n- \"Color correct\" \u002F \"Make it brighter\" \u002F \"Adjust contrast\"\n\n###### Format & Size\n\n- \"Convert this MP4 to WebM\" \u002F \"Change format\"\n- \"Compress this video\" \u002F \"Make this file smaller\"\n\n- \"Resize to 720p\" \u002F \"Downscale\" \u002F \"Change resolution\"\n- \"Extract the audio as MP3\"\n\n- \"Create a GIF from this clip\"\n- \"Make a thumbnail from this video\" (frame extraction as image)\n\n###### Social Media & Platform\n\n- \"Make TikTok clips from this\" \u002F \"Break this into Reels\"\n- \"Make this vertical for Shorts\"\n\n- \"Reframe for Instagram\" \u002F \"LinkedIn\" \u002F \"Pinterest\" \u002F \"Facebook\" \u002F \"Snapchat\"\n- \"Convert this to square for Instagram feed\"\n\n###### AI-Powered Analysis\n\n- \"Find the best moments\" \u002F \"Auto-trim for virality\"\n- \"Extract the highlights\" \u002F \"Score these clips\"\n\n- \"Which parts are most engaging?\"\n\n###### Cleanup & Optimization\n\n- \"Remove dead space\" \u002F \"Remove silence\"\n- \"Shorten this by cutting out boring parts\"\n\n- \"Tighten up this video\"\n\n###### Chunking & Splitting\n\n- \"Split this into short clips\" \u002F \"Chunk this for TikTok\"\n- \"Break this talk into Reels-length videos\"\n\n- \"Make 15-second clips from this\"\n\n###### No Direction (user just uploads a video)\n\n- Probe the file, report what it is, and ask what they want to do\n\n## When NOT to Use\n\n- User wants to create an animated video from scratch using code (use the `video-js` skill instead)\n- User wants a browser-based video editor UI (build as a `react-vite` artifact with this skill powering the backend)\n\n## User Interaction — ALWAYS Ask Before Acting\n\n**When a user uploads a video without specific instructions, you MUST ask what they want to do with it.** Do NOT assume a workflow or start processing automatically.\n\nProbe the video first (to report basic info), then ask the user what they'd like. Here's a good pattern:\n\n1. Probe the file and tell the user what they uploaded (duration, resolution, format)\n2. Ask what they want to do. Offer common options like:\n\n- Trim or cut specific sections\n- Find the best\u002Fmost viral moments\n\n- Break it into short clips for a specific platform (TikTok, Reels, Shorts, X)\n- Remove dead space \u002F silence\n\n- Add text, subtitles, or a voiceover\n- Reframe for a different aspect ratio\n\n- Convert to a different format\n- Something else\n\n**When the user specifies a platform, the full pipeline includes reframing to that platform's native format.** Do not just chunk the video and leave it in the original aspect ratio. Always deliver platform-ready output — correct aspect ratio, resolution, and duration range.\n\n### Platform Specifications\n\n| Platform | Aspect Ratio | Resolution | Duration Range | Ideal Length | Max File Size |\n\n|----------|-------------|------------|---------------|-------------|--------------|\n\n| **TikTok** | 9:16 vertical | 1080×1920 | 10–45s | 25s | 287 MB |\n\n| **Instagram Reels** | 9:16 vertical | 1080×1920 | 10–30s | 20s | 250 MB |\n\n| **Instagram Stories** | 9:16 vertical | 1080×1920 | 1–60s | 15s | 250 MB |\n\n| **Instagram Feed** | 1:1 square or 4:5 portrait | 1080×1080 or 1080×1350 | 3–60s | 30s | 250 MB |\n\n| **YouTube Shorts** | 9:16 vertical | 1080×1920 | 15–60s | 40s | 256 MB |\n\n| **YouTube (standard)** | 16:9 landscape | 1920×1080 | any | any | 256 GB |\n\n| **X \u002F Twitter** | 16:9 landscape | 1280×720 | 10–45s | 25s | 512 MB |\n\n| **X \u002F Twitter (square)** | 1:1 square | 720×720 | 10–45s | 25s | 512 MB |\n\n| **Facebook Reels** | 9:16 vertical | 1080×1920 | 10–30s | 20s | 250 MB |\n\n| **Facebook Feed** | 16:9 or 1:1 | 1920×1080 or 1080×1080 | any | 15–60s | 4 GB |\n\n| **LinkedIn** | 16:9 landscape or 1:1 | 1920×1080 or 1080×1080 | 10–60s | 30s | 5 GB |\n\n| **Pinterest** | 9:16 or 2:3 vertical | 1080×1920 or 1000×1500 | 6–60s | 15–30s | 2 GB |\n\n| **Snapchat Spotlight** | 9:16 vertical | 1080×1920 | 5–60s | 15–30s | 250 MB |\n\n**When the user says a platform name, apply both the correct duration targets AND the correct aspect ratio\u002Fresolution.** For example:\n\n- \"Make TikTok clips\" → chunk to 10-45s AND reframe to 9:16 (1080×1920)\n- \"Instagram feed posts\" → chunk to 3-60s AND reframe to 1:1 (1080×1080) or 4:5 (1080×1350)\n\n- \"YouTube Shorts\" → chunk to 15-60s AND reframe to 9:16 (1080×1920)\n- \"Clips for X\" → chunk to 10-45s, keep 16:9 (1280×720)\n\n**When the user asks for clips or chunking without specifying a platform, ask which platform they're targeting** so you can apply the right duration targets and reframing.\n\n**When you deliver results, always present the output files** so the user can download and preview them. Never just describe what was done — show the files.\n\n## Environment\n\nFFmpeg 6.1.2 is pre-installed in Replit with full codec support:\n\n- **Video codecs:** H.264 (libx264), H.265 (libx265), VP8\u002FVP9 (libvpx), AV1 (libaom, libsvtav1, librav1e), Theora\n- **Audio codecs:** AAC, MP3 (libmp3lame), Opus, Vorbis, FLAC, WAV\n\n- **Image formats:** PNG, JPEG, WebP, JPEG XL (libjxl)\n- **Subtitle rendering:** libass (for styled subtitles), libfreetype + libfontconfig (for drawtext)\n\n- **Filters:** All standard filters available — scale, crop, overlay, drawtext, concat, fade, crossfade, etc.\n- **Tools:** `ffmpeg`,`ffprobe` (both available on PATH)\n\nNo additional installation is needed for FFmpeg itself.\n\n## Architecture Decisions\n\n### Script-based editing (simple tasks)\n\nFor one-off or single-operation tasks (trim a clip, convert a format, extract audio), write a Node.js script in `scripts\u002Fsrc\u002F`using`fluent-ffmpeg`or direct`child_process.execFile` calls to FFmpeg.\n\n```bash\n\npnpm --filter @workspace\u002Fscripts add fluent-ffmpeg\n\npnpm --filter @workspace\u002Fscripts add -D @types\u002Ffluent-ffmpeg\n\n```\n\n### API-based editing (complex workflows or UI)\n\nFor multi-step editing workflows or when building a video editor UI, add routes to the API server (`artifacts\u002Fapi-server\u002F`) that accept video files, process them with FFmpeg, and return results.\n\n```bash\n\npnpm --filter @workspace\u002Fapi-server add fluent-ffmpeg multer\n\npnpm --filter @workspace\u002Fapi-server add -D @types\u002Ffluent-ffmpeg @types\u002Fmulter\n\n```\n\n### Choosing the right approach\n\n| Scenario | Approach |\n\n|----------|----------|\n\n| \"Trim this video to 0:30-1:15\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Convert this MP4 to WebM\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Build me a video editor app\" | React-vite artifact + API routes |\n\n| \"Add subtitles to all my videos\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Merge these 5 clips with transitions\" | Script in `scripts\u002Fsrc\u002F` (or API if repeated) |\n\n## Instructions\n\n### 1. Probe Before Processing\n\nAlways probe the input file first to understand its properties. This prevents errors from wrong assumptions about codecs, resolution, frame rate, or duration.\n\n```typescript\n\nimport { execFile } from 'child_process';\n\nimport { promisify } from 'util';\n\nconst execFileAsync = promisify(execFile);\n\nasync function probeVideo(filePath: string) {\n\nconst { stdout } = await execFileAsync('ffprobe', [\n\n'-v', 'quiet',\n\n'-print_format', 'json',\n\n'-show_format',\n\n'-show_streams',\n\nfilePath\n\n]);\n\nreturn JSON.parse(stdout);\n\n}\n\n```\n\n### 2. Use fluent-ffmpeg for Complex Operations\n\nfluent-ffmpeg provides a chainable API that is easier to maintain than raw command strings. Use it for multi-step operations.\n\n```typescript\n\nimport ffmpeg from 'fluent-ffmpeg';\n\nfunction trimVideo(input: string, output: string, start: string, duration: string): Promise\u003Cvoid> {\n\nreturn new Promise((resolve, reject) => {\n\nffmpeg(input)\n\n.setStartTime(start)\n\n.setDuration(duration)\n\n.output(output)\n\n.on('end', resolve)\n\n.on('error', reject)\n\n.run();\n\n});\n\n}\n\n```\n\n### 3. Use execFile for Simple One-Liners\n\nFor straightforward operations where the FFmpeg command is well-known, calling FFmpeg directly is cleaner.\n\n```typescript\n\nawait execFileAsync('ffmpeg', [\n\n'-i', inputPath,\n\n'-vf', 'scale=1280:720',\n\n'-c:a', 'copy',\n\noutputPath\n\n]);\n\n```\n\n### 4. File Management\n\n- Store uploaded\u002Finput files in a `tmp\u002F`or`uploads\u002F` directory\n- Store output files where the user can access them — either `public\u002F` for web serving or a known output directory\n\n- Clean up temporary files after processing\n- For large files, stream the output rather than buffering in memory\n\n### 5. Progress Reporting\n\nFFmpeg outputs progress to stderr. Parse it for progress reporting in longer operations:\n\n```typescript\n\nffmpeg(input)\n\n.output(output)\n\n.on('progress', (progress) => {\n\nconsole.log(`Processing: ${progress.percent?.toFixed(1)}% done`);\n\n})\n\n.on('end', () => console.log('Done'))\n\n.run();\n\n```\n\n### 6. Error Handling\n\nFFmpeg errors are often cryptic. Always:\n\n- Log the full stderr output on failure\n- Validate input files exist before processing\n\n- Check that output codecs are compatible with the output container\n- Use `-y` flag to overwrite output files without prompting\n\n## AI-Powered Virality Scoring\n\nUse AI vision to analyze video content and score it on viral potential. This feature has two modes depending on the workflow.\n\nThis feature requires an AI integration (OpenAI or Gemini) to be set up. Set up the AI integration following the `ai-integrations-openai`or`ai-integrations-gemini` skill before proceeding. OpenAI is preferred because gpt-5.2 handles image analysis well and is the default for most tasks. Gemini (gemini-2.5-flash) is a good alternative, especially for high-volume analysis since it supports video\u002Fimage input natively.\n\n### Two Scoring Modes\n\n**Mode 1: Segment scoring (find the best moments)** — For when the user says \"find the best clips\" or \"auto-trim for virality.\" Detects scenes, scores small segments, and exports the top moments. Good for finding highlights in raw footage.\n\n#### Mode 2: Clip scoring (rank ready-to-post clips)**— For when clips already exist (from chunking, manual trimming, etc.) and the user wants to know which ones to post first. Scores each complete clip with a richer evaluation including narrative arc and standalone quality.**This is the preferred mode when used with the chunking pipeline\n\n### Recommended Pipeline\n\nWhen the user has a long video and wants social-ready clips, use this order:\n\n```text\n\nLong Video → Dead Space Removal → Chunking (10-60s clips) → Clip-Level Scoring → Reframe for Platform → Output\n\n```\n\nThis way the AI scores complete, self-contained clips rather than tiny scene fragments. The scores are much more meaningful because each clip is what will actually be posted.\n\nFor \"find the best moment in this video\" requests (no chunking), use the original segment-level pipeline:\n\n```text\n\nVideo → Scene Detection → Frame Extraction → Segment Scoring → Rank → Trim\u002FExport\n\n```\n\n### When the user asks for auto-trim, ask which output they want\n\nPresent these three options and let the user choose each time. Do not assume a default:\n\n- **Best clip** — The single highest-scoring segment\u002Fclip, trimmed and exported\n- **Multiple clips** — Several top segments\u002Fclips exported as separate files, ranked by score\n\n- **Highlight reel** — Top moments stitched together with crossfade transitions into one video\n\n### Scoring Criteria\n\n**Segment scoring** evaluates: visual dynamism, emotional impact, hook potential, pacing\u002Fenergy, uniqueness, and shareability. Each factor gets a 1-10 score, weighted to produce a final virality score.\n\n**Clip scoring** adds three additional criteria for complete clips:\n\n- **Narrative completeness** (weight: 15%) — Does the clip tell a complete micro-story? Does it have a clear beginning, middle, and end? Would a viewer feel satisfied or intrigued, not confused?\n- **Hook-to-payoff flow** (weight: 10%) — Does the clip open with something that grabs attention and deliver on that promise? Or does it start slow and meander?\n\n- **Standalone quality** (weight: 10%) — Would this clip make sense to someone who hasn't seen the full video? Can it be posted without context?\n\nThese three criteria reduce the weights of the original six factors proportionally so the total still sums to 100%.\n\n### Frame Extraction\n\n- **Segments (2-10s):** Extract 3 frames evenly spread across the segment.\n- **Clips (10-60s):** Extract 5-8 frames to capture the full arc. Always include the first frame (hook evaluation) and last frame (payoff evaluation).\n\n### Workflow\n\nFor the complete step-by-step implementation with code examples, see:\n\n- `virality-scoring.md` — Full virality analysis pipeline, AI prompts, scoring criteria, and output assembly\n\n### Key Gotchas (learned from testing)\n\n- **Scene detection:** Use `ffmpeg`with`select`+`showinfo`filters and parse stderr — the`ffprobe -f lavfi` approach doesn't work reliably in Replit.\n- **Content safety:** OpenAI vision may reject frames from documentary\u002Fmedical\u002Fnews content. Always wrap AI calls in try\u002Fcatch and skip failed segments gracefully.\n\n- **Segment indexing:** Use `index: segments.length`when filtering short segments, not the loop counter`i`.\n- **Package setup:** For scripts, install `openai`directly (`pnpm add -w openai`) and create the client with`AI_INTEGRATIONS_OPENAI_BASE_URL`\u002F`AI_INTEGRATIONS_OPENAI_API_KEY` env vars. No need for the full workspace integration library.\n\n- **Timeouts:** A 90-second video with ~13 segments takes 1-2 minutes for AI analysis. Warn the user and set generous timeouts.\n- **Minimum segment duration:** Use 2.0s minimum — segments under 2 seconds waste API calls and don't produce useful scores.\n\n- **Prefer clip-level scoring:** When the video has already been chunked, always score the chunks rather than re-running segment detection. The clips are what will actually be posted.\n\n## Dead Space Removal\n\nAutomatically detect and remove silence, dead air, and filler from a video to produce a tighter, more engaging cut. This is especially useful for talks, interviews, podcasts, tutorials, and raw footage.\n\n### How It Works\n\n1. **Silence detection** — Use FFmpeg's `silencedetect` filter to find all silent intervals (configurable threshold and minimum duration)\n2. **Segment extraction** — Extract all non-silent segments as individual clips\n\n3. **Reassembly** — Concatenate the non-silent segments back together with optional brief crossfade transitions\n4. **Optional: AI-assisted filler removal** — For more aggressive editing (removing \"ums\", filler words, repetitive sections), combine silence detection with AI transcription analysis\n\n### When the user asks to remove dead space\n\nAsk these clarifying questions if not clear from context:\n\n- **How aggressive?** Light (remove only true silence, > 1s gaps) vs. aggressive (remove short pauses > 0.3s for a fast-paced edit)\n- **Transitions?** Hard cuts between segments (default) or brief crossfades (0.2-0.5s) for smoother flow\n\n### Configuration\n\n| Preset | Silence Threshold | Min Silence Duration | Use Case |\n\n|--------|------------------|---------------------|----------|\n\n| Light | -40dB | 1.0s | Talks, interviews — remove obvious dead air |\n\n| Medium | -35dB | 0.5s | Podcasts, tutorials — tighter pacing |\n\n| Aggressive | -30dB | 0.3s | Fast-paced edits, social media — maximum tightness |\n\n### Implementation\n\nFor the complete FFmpeg commands and Node.js pipeline, see:\n\n- `dead-space-and-chunking.md` — See the \"Dead Space Removal\" section\n\n### Quick Summary\n\n```text\n\nVideo → Silence Detection (FFmpeg silencedetect) → Identify Non-Silent Ranges → Extract Segments → Concatenate → Output\n\n```\n\n## Social Media Chunking\n\nBreak a longer video (ad, promo, talk, presentation, livestream) into self-contained clips suitable for TikTok, Reels, and Shorts. Each clip should be 10-60 seconds and feel complete on its own.\n\n### How It Works (2)\n\n1. **Scene detection + silence detection** — Find natural break points using both visual scene changes and audio silence gaps\n2. **Smart boundary selection** — Merge adjacent segments into clips targeting 10-60 seconds, preferring to break at silence or scene changes rather than mid-sentence\n\n3. **AI content analysis (optional)** — Score each potential clip with AI to identify which ones are worth posting, suggest captions, and recommend clip order\n4. **Export** — Output each clip as a separate file, numbered and ranked\n\n### Clip Length Guidelines\n\n| Platform | Ideal Length | Max Length | Notes |\n\n|----------|-------------|------------|-------|\n\n| TikTok | 15-45s | 10 min | 15-30s performs best for new accounts |\n\n| Instagram Reels | 15-30s | 90s | Under 30s gets more reach |\n\n| YouTube Shorts | 30-60s | 60s | Hard cap at 60 seconds |\n\n| X \u002F Twitter | 15-45s | 2m 20s | Shorter gets more engagement |\n\n### When the user asks to chunk a video\n\nAsk which platform they're targeting (or default to TikTok at 15-45s). The chunking algorithm should:\n\n- **Never cut mid-sentence** — Always break at silence gaps or natural pauses\n- **Prefer scene boundaries** — Break where the visual content changes\n\n- **Ensure each clip stands alone** — Each clip should have a clear beginning, not start mid-thought\n- **Target the platform's sweet spot** — Not just \"under 60s\" but actually the ideal range for that platform\n\n### Implementation (2)\n\nFor the complete pipeline with code examples, see:\n\n- `dead-space-and-chunking.md` — See the \"Social Media Chunking\" section\n\n### Quick Summary (2)\n\n```text\n\nVideo → Scene Detection + Silence Detection → Merge into 10-60s Clips at Natural Boundaries → (Optional) AI Scoring → Export Individual Clips\n\n```\n\n### Combining with Other Features\n\nThese features work well together in a pipeline:\n\n```text\n\nLong Video → Dead Space Removal → Chunking into Clips → Virality Scoring → Reframe for TikTok → Output\n\n```\n\nThis takes a raw long-form video and produces polished, platform-ready social clips end to end.\n\n## Voiceovers with ElevenLabs\n\nAdd AI-generated voiceovers to videos using ElevenLabs text-to-speech, then mix the audio into the video with FFmpeg.\n\n### Prerequisites\n\nElevenLabs is available as a Replit integration (connector). The user needs to connect their ElevenLabs account through Replit's integration system — no manual API keys needed. Search for the integration and propose it to the user:\n\n```javascript\n\nconst results = await searchIntegrations(\"elevenlabs\");\n\n\u002F\u002F Then propose the connector so the user can authorize\n\nawait proposeIntegration(\"connector:ccfg_elevenlabs_...\");\n\n```\n\nAfter authorization, use `addIntegration`to wire it to the project, then use`listConnections('elevenlabs')` in the code execution sandbox to get the credentials.\n\n### Workflow (2)\n\n1. **Generate voiceover audio** — Send text to ElevenLabs TTS API, receive audio file\n2. **Mix into video** — Use FFmpeg to add the voiceover as a new audio track, optionally ducking (lowering volume of) existing audio\n\n### Voiceover Modes\n\nWhen the user asks for a voiceover, they may want one of these:\n\n- **Replace audio** — Remove existing audio entirely, use only the voiceover\n- **Mix over** — Layer voiceover on top of existing audio (with existing audio volume reduced)\n\n- **Add as track** — Keep existing audio at full volume, add voiceover on top\n\nAsk which mode the user prefers if not clear from context.\n\n### Implementation (3)\n\nFor the complete step-by-step implementation with code examples, see:\n\n- `voiceover.md` — ElevenLabs TTS integration, voice selection, audio mixing with FFmpeg, and timed voiceover segments\n\n### Quick Summary (3)\n\n```text\n\nText Script → ElevenLabs TTS → Audio File → FFmpeg Mix with Video → Output\n\n```\n\nKey capabilities:\n\n- Choose from ElevenLabs' voice library or cloned voices\n- Control voice settings (stability, similarity boost, style)\n\n- Generate voiceover for the full video or specific time segments\n- Duck existing audio under voiceover sections\n\n- Support for multiple languages\n\n## Social Media Reframing\n\nAutomatically reframe videos for different social media platforms. Each platform has a preferred aspect ratio and resolution — this feature handles the conversion intelligently.\n\n### Platform Specs\n\n| Platform | Aspect Ratio | Resolution | Notes |\n\n|----------|-------------|------------|-------|\n\n| YouTube | 16:9 | 1920x1080 | Standard landscape, also supports 4K (3840x2160) |\n\n| TikTok \u002F Reels | 9:16 | 1080x1920 | Vertical video, max 60s for Reels, 10min for TikTok |\n\n| Instagram Feed | 1:1 | 1080x1080 | Square format |\n\n| X \u002F Twitter | 16:9 or 1:1 | 1280x720 or 720x720 | Supports both, 2min 20s max |\n\n### Reframing Strategies\n\nWhen converting between aspect ratios, there are three strategies:\n\n1. **Center crop** (default) — Crop from the center to fill the target ratio. Fast, works well for most content. May cut off edges.\n2. **Letterbox\u002Fpillarbox** — Add black bars (or blurred background) to fit without cropping. Preserves all content but adds empty space.\n\n3. **Blurred fill** — Use a blurred, scaled-up version of the video as the background behind the original. Looks much better than black bars, especially for vertical reframing. This is the recommended approach for going from 16:9 to 9:16.\n\nWhen the user asks to reframe, ask which platform they're targeting. Use **blurred fill**by default for aspect ratio changes that would lose significant content (e.g., landscape to portrait). Use**center crop**when the content is center-focused. Use**letterbox** only if the user explicitly asks for it.\n\n### Implementation (4)\n\nFor the complete FFmpeg commands for each reframing strategy, see:\n\n- `operations.md` — See the \"Social Media Reframing\" section\n\n### Multi-platform Export\n\nWhen the user wants to export for multiple platforms at once, generate all versions in a batch:\n\n```text\n\nInput (16:9) → YouTube (copy) + TikTok (9:16 blurred fill) + Instagram (1:1 center crop) + X (1280x720 copy)\n\n```\n\nThis is a common workflow — the user shoots in landscape and needs versions for every platform.\n\n## Common Operations Reference\n\nFor detailed FFmpeg commands and patterns for each operation type, see:\n\n- `operations.md` — Complete command reference for all supported editing operations\n- `virality-scoring.md` — AI-powered virality analysis and auto-trim pipeline\n\n- `voiceover.md` — ElevenLabs voiceover generation and audio mixing\n- `dead-space-and-chunking.md` — Dead space removal and social media chunking pipelines\n\n## Building a Video Editor UI\n\nIf the user wants a visual editor interface:\n\n1. Create a `react-vite` artifact for the frontend\n2. Add API routes to `artifacts\u002Fapi-server\u002F` for video processing\n\n3. Use `multer` for file uploads to the API\n4. Process videos with FFmpeg on the server\n\n5. Return processed files for download or preview\n6. Use the `object-storage` skill for persisting uploaded and processed files if needed\n\nKey frontend considerations:\n\n- Use `\u003Cvideo>` element for preview playback\n- Show a timeline UI for trim\u002Fcut operations\n\n- Display progress during processing (poll an API status endpoint or use Server-Sent Events)\n- Provide download links for processed output\n\n## Tested Bugs & Caveats (Do Not Regress)\n\nThese issues were discovered during real-world testing and are documented here to prevent regressions:\n\n- **Scene detection:** The `ffprobe -f lavfi`approach does NOT work in Replit. Use`ffmpeg`with`select='gt(scene,threshold)',showinfo`and parse`pts_time` from stderr.\n- **Segment indexing:** Use `index: segments.length`when building segments, NOT the loop counter`i` — filtered segments cause index mismatches.\n\n- **Content safety:** OpenAI vision may reject frames (medical\u002Fdocumentary content). Always wrap AI calls in try\u002Fcatch and skip gracefully.\n- **Frame extraction timestamp clamping:** Clamp the last frame timestamp to `segment.endTime - 0.1`. Without this, the last clip in a video fails because`startTime + 1.0 * duration` can exceed the actual file duration due to floating point arithmetic.\n\n- **`silenceremove` filter:** Only strips audio silence, NOT video frames. Must use segmented extract+concat approach for proper dead space removal.\n- **Dead space with many segments:** Videos with lots of short dialogue (50+ speaking segments) can be very slow to process with re-encoding. Use `-preset ultrafast` for testing, or skip dead space removal for dialogue-heavy content where there's little dead space anyway.\n\n- **OpenAI for scripts:** Install with `pnpm add -w openai`, create client with`AI_INTEGRATIONS_OPENAI_BASE_URL`and`AI_INTEGRATIONS_OPENAI_API_KEY` env vars.\n- **AI scoring duration:** A 90-second video with ~13 segments takes 1-2 minutes for AI analysis. A 3.5-minute video with 9 clips takes ~3 minutes. Always warn the user.\n\n## Limitations\n\n- **No GPU acceleration** — Replit containers do not have GPU access, so hardware encoding (NVENC, VAAPI) is unavailable. Use software encoding (libx264, libx265, libvpx-vp9).\n- **Memory and CPU** — Very large files or high-resolution encoding (4K+) may be slow or hit memory limits. For large files, prefer stream-copy (`-c copy`) where possible and avoid unnecessary re-encoding.\n\n- **Disk space** — Video files are large. Clean up temporary files after processing. Monitor disk usage for batch operations.\n- **No real-time preview** — FFmpeg processes offline. Users cannot preview effects in real-time during editing (unlike desktop NLEs). Generate short previews of segments instead.\n","# Video Editing\n\n## OpenClawd Operator Adaptation\n\nRun this skill as part of the OpenClawd operator deck. Preserve the skill-specific workflow below, but frame outputs for Solana-native agents when relevant: prefer OpenClawd language, note whether the work can support autonomous agent operations, and keep financial, legal, tax, hiring, medical, or other regulated outputs informational unless the skill already requires a stricter disclaimer. Use the Llobster Legend persona only as light operator framing; do not let branding override accuracy, safety, or the user's stated domain.\n\n\nEdit existing video files server-side using FFmpeg. This skill covers the full editing workflow: trimming, splicing, concatenating, transitions, text overlays, subtitles, audio mixing, effects, and format conversion.\n\n## When to Use\n\n### Trimming & Cutting\n\n- \"Trim this video to 0:30-1:15\" \u002F \"Cut out the first 10 seconds\"\n- \"Extract a clip from 2:00 to 3:30\"\n\n- \"Remove the intro\" \u002F \"Cut the ending\"\n\n#### Merging & Compositing\n\n- \"Merge these clips together\" \u002F \"Concatenate these videos\"\n- \"Put two videos side by side\" \u002F \"Split screen\"\n\n- \"Picture-in-picture\"\n\n##### Text, Titles & Subtitles\n\n- \"Add subtitles\" \u002F \"Add captions\"\n- \"Put a title card at the beginning\"\n\n- \"Add text overlay\"\n\n###### Audio\n\n- \"Add background music\" \u002F \"Mix in this audio track\"\n- \"Add a voiceover\" \u002F \"Narrate this video\" (uses ElevenLabs)\n\n- \"Mute this video\" \u002F \"Remove the audio\"\n- \"Replace the audio with this track\"\n\n###### Speed & Motion\n\n- \"Speed up this video 2x\" \u002F \"Slow motion\"\n- \"Make this part slow-mo\"\n\n- \"Reverse this clip\"\n- \"Loop this clip 3 times\"\n\n###### Visual Effects & Fixes\n\n- \"Rotate this video 90 degrees\" \u002F \"Flip horizontally\"\n- \"Stabilize this shaky footage\"\n\n- \"Crop out the watermark\" \u002F \"Remove the watermark\"\n- \"Add my logo to this video\" (image overlay \u002F branding)\n\n- \"Color correct\" \u002F \"Make it brighter\" \u002F \"Adjust contrast\"\n\n###### Format & Size\n\n- \"Convert this MP4 to WebM\" \u002F \"Change format\"\n- \"Compress this video\" \u002F \"Make this file smaller\"\n\n- \"Resize to 720p\" \u002F \"Downscale\" \u002F \"Change resolution\"\n- \"Extract the audio as MP3\"\n\n- \"Create a GIF from this clip\"\n- \"Make a thumbnail from this video\" (frame extraction as image)\n\n###### Social Media & Platform\n\n- \"Make TikTok clips from this\" \u002F \"Break this into Reels\"\n- \"Make this vertical for Shorts\"\n\n- \"Reframe for Instagram\" \u002F \"LinkedIn\" \u002F \"Pinterest\" \u002F \"Facebook\" \u002F \"Snapchat\"\n- \"Convert this to square for Instagram feed\"\n\n###### AI-Powered Analysis\n\n- \"Find the best moments\" \u002F \"Auto-trim for virality\"\n- \"Extract the highlights\" \u002F \"Score these clips\"\n\n- \"Which parts are most engaging?\"\n\n###### Cleanup & Optimization\n\n- \"Remove dead space\" \u002F \"Remove silence\"\n- \"Shorten this by cutting out boring parts\"\n\n- \"Tighten up this video\"\n\n###### Chunking & Splitting\n\n- \"Split this into short clips\" \u002F \"Chunk this for TikTok\"\n- \"Break this talk into Reels-length videos\"\n\n- \"Make 15-second clips from this\"\n\n###### No Direction (user just uploads a video)\n\n- Probe the file, report what it is, and ask what they want to do\n\n## When NOT to Use\n\n- User wants to create an animated video from scratch using code (use the `video-js` skill instead)\n- User wants a browser-based video editor UI (build as a `react-vite` artifact with this skill powering the backend)\n\n## User Interaction — ALWAYS Ask Before Acting\n\n**When a user uploads a video without specific instructions, you MUST ask what they want to do with it.** Do NOT assume a workflow or start processing automatically.\n\nProbe the video first (to report basic info), then ask the user what they'd like. Here's a good pattern:\n\n1. Probe the file and tell the user what they uploaded (duration, resolution, format)\n2. Ask what they want to do. Offer common options like:\n\n- Trim or cut specific sections\n- Find the best\u002Fmost viral moments\n\n- Break it into short clips for a specific platform (TikTok, Reels, Shorts, X)\n- Remove dead space \u002F silence\n\n- Add text, subtitles, or a voiceover\n- Reframe for a different aspect ratio\n\n- Convert to a different format\n- Something else\n\n**When the user specifies a platform, the full pipeline includes reframing to that platform's native format.** Do not just chunk the video and leave it in the original aspect ratio. Always deliver platform-ready output — correct aspect ratio, resolution, and duration range.\n\n### Platform Specifications\n\n| Platform | Aspect Ratio | Resolution | Duration Range | Ideal Length | Max File Size |\n\n|----------|-------------|------------|---------------|-------------|--------------|\n\n| **TikTok** | 9:16 vertical | 1080×1920 | 10–45s | 25s | 287 MB |\n\n| **Instagram Reels** | 9:16 vertical | 1080×1920 | 10–30s | 20s | 250 MB |\n\n| **Instagram Stories** | 9:16 vertical | 1080×1920 | 1–60s | 15s | 250 MB |\n\n| **Instagram Feed** | 1:1 square or 4:5 portrait | 1080×1080 or 1080×1350 | 3–60s | 30s | 250 MB |\n\n| **YouTube Shorts** | 9:16 vertical | 1080×1920 | 15–60s | 40s | 256 MB |\n\n| **YouTube (standard)** | 16:9 landscape | 1920×1080 | any | any | 256 GB |\n\n| **X \u002F Twitter** | 16:9 landscape | 1280×720 | 10–45s | 25s | 512 MB |\n\n| **X \u002F Twitter (square)** | 1:1 square | 720×720 | 10–45s | 25s | 512 MB |\n\n| **Facebook Reels** | 9:16 vertical | 1080×1920 | 10–30s | 20s | 250 MB |\n\n| **Facebook Feed** | 16:9 or 1:1 | 1920×1080 or 1080×1080 | any | 15–60s | 4 GB |\n\n| **LinkedIn** | 16:9 landscape or 1:1 | 1920×1080 or 1080×1080 | 10–60s | 30s | 5 GB |\n\n| **Pinterest** | 9:16 or 2:3 vertical | 1080×1920 or 1000×1500 | 6–60s | 15–30s | 2 GB |\n\n| **Snapchat Spotlight** | 9:16 vertical | 1080×1920 | 5–60s | 15–30s | 250 MB |\n\n**When the user says a platform name, apply both the correct duration targets AND the correct aspect ratio\u002Fresolution.** For example:\n\n- \"Make TikTok clips\" → chunk to 10-45s AND reframe to 9:16 (1080×1920)\n- \"Instagram feed posts\" → chunk to 3-60s AND reframe to 1:1 (1080×1080) or 4:5 (1080×1350)\n\n- \"YouTube Shorts\" → chunk to 15-60s AND reframe to 9:16 (1080×1920)\n- \"Clips for X\" → chunk to 10-45s, keep 16:9 (1280×720)\n\n**When the user asks for clips or chunking without specifying a platform, ask which platform they're targeting** so you can apply the right duration targets and reframing.\n\n**When you deliver results, always present the output files** so the user can download and preview them. Never just describe what was done — show the files.\n\n## Environment\n\nFFmpeg 6.1.2 is pre-installed in Replit with full codec support:\n\n- **Video codecs:** H.264 (libx264), H.265 (libx265), VP8\u002FVP9 (libvpx), AV1 (libaom, libsvtav1, librav1e), Theora\n- **Audio codecs:** AAC, MP3 (libmp3lame), Opus, Vorbis, FLAC, WAV\n\n- **Image formats:** PNG, JPEG, WebP, JPEG XL (libjxl)\n- **Subtitle rendering:** libass (for styled subtitles), libfreetype + libfontconfig (for drawtext)\n\n- **Filters:** All standard filters available — scale, crop, overlay, drawtext, concat, fade, crossfade, etc.\n- **Tools:** `ffmpeg`,`ffprobe` (both available on PATH)\n\nNo additional installation is needed for FFmpeg itself.\n\n## Architecture Decisions\n\n### Script-based editing (simple tasks)\n\nFor one-off or single-operation tasks (trim a clip, convert a format, extract audio), write a Node.js script in `scripts\u002Fsrc\u002F`using`fluent-ffmpeg`or direct`child_process.execFile` calls to FFmpeg.\n\n```bash\n\npnpm --filter @workspace\u002Fscripts add fluent-ffmpeg\n\npnpm --filter @workspace\u002Fscripts add -D @types\u002Ffluent-ffmpeg\n\n```\n\n### API-based editing (complex workflows or UI)\n\nFor multi-step editing workflows or when building a video editor UI, add routes to the API server (`artifacts\u002Fapi-server\u002F`) that accept video files, process them with FFmpeg, and return results.\n\n```bash\n\npnpm --filter @workspace\u002Fapi-server add fluent-ffmpeg multer\n\npnpm --filter @workspace\u002Fapi-server add -D @types\u002Ffluent-ffmpeg @types\u002Fmulter\n\n```\n\n### Choosing the right approach\n\n| Scenario | Approach |\n\n|----------|----------|\n\n| \"Trim this video to 0:30-1:15\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Convert this MP4 to WebM\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Build me a video editor app\" | React-vite artifact + API routes |\n\n| \"Add subtitles to all my videos\" | Script in `scripts\u002Fsrc\u002F` |\n\n| \"Merge these 5 clips with transitions\" | Script in `scripts\u002Fsrc\u002F` (or API if repeated) |\n\n## Instructions\n\n### 1. Probe Before Processing\n\nAlways probe the input file first to understand its properties. This prevents errors from wrong assumptions about codecs, resolution, frame rate, or duration.\n\n```typescript\n\nimport { execFile } from 'child_process';\n\nimport { promisify } from 'util';\n\nconst execFileAsync = promisify(execFile);\n\nasync function probeVideo(filePath: string) {\n\nconst { stdout } = await execFileAsync('ffprobe', [\n\n'-v', 'quiet',\n\n'-print_format', 'json',\n\n'-show_format',\n\n'-show_streams',\n\nfilePath\n\n]);\n\nreturn JSON.parse(stdout);\n\n}\n\n```\n\n### 2. Use fluent-ffmpeg for Complex Operations\n\nfluent-ffmpeg provides a chainable API that is easier to maintain than raw command strings. Use it for multi-step operations.\n\n```typescript\n\nimport ffmpeg from 'fluent-ffmpeg';\n\nfunction trimVideo(input: string, output: string, start: string, duration: string): Promise\u003Cvoid> {\n\nreturn new Promise((resolve, reject) => {\n\nffmpeg(input)\n\n.setStartTime(start)\n\n.setDuration(duration)\n\n.output(output)\n\n.on('end', resolve)\n\n.on('error', reject)\n\n.run();\n\n});\n\n}\n\n```\n\n### 3. Use execFile for Simple One-Liners\n\nFor straightforward operations where the FFmpeg command is well-known, calling FFmpeg directly is cleaner.\n\n```typescript\n\nawait execFileAsync('ffmpeg', [\n\n'-i', inputPath,\n\n'-vf', 'scale=1280:720',\n\n'-c:a', 'copy',\n\noutputPath\n\n]);\n\n```\n\n### 4. File Management\n\n- Store uploaded\u002Finput files in a `tmp\u002F`or`uploads\u002F` directory\n- Store output files where the user can access them — either `public\u002F` for web serving or a known output directory\n\n- Clean up temporary files after processing\n- For large files, stream the output rather than buffering in memory\n\n### 5. Progress Reporting\n\nFFmpeg outputs progress to stderr. Parse it for progress reporting in longer operations:\n\n```typescript\n\nffmpeg(input)\n\n.output(output)\n\n.on('progress', (progress) => {\n\nconsole.log(`Processing: ${progress.percent?.toFixed(1)}% done`);\n\n})\n\n.on('end', () => console.log('Done'))\n\n.run();\n\n```\n\n### 6. Error Handling\n\nFFmpeg errors are often cryptic. Always:\n\n- Log the full stderr output on failure\n- Validate input files exist before processing\n\n- Check that output codecs are compatible with the output container\n- Use `-y` flag to overwrite output files without prompting\n\n## AI-Powered Virality Scoring\n\nUse AI vision to analyze video content and score it on viral potential. This feature has two modes depending on the workflow.\n\nThis feature requires an AI integration (OpenAI or Gemini) to be set up. Set up the AI integration following the `ai-integrations-openai`or`ai-integrations-gemini` skill before proceeding. OpenAI is preferred because gpt-5.2 handles image analysis well and is the default for most tasks. Gemini (gemini-2.5-flash) is a good alternative, especially for high-volume analysis since it supports video\u002Fimage input natively.\n\n### Two Scoring Modes\n\n**Mode 1: Segment scoring (find the best moments)** — For when the user says \"find the best clips\" or \"auto-trim for virality.\" Detects scenes, scores small segments, and exports the top moments. Good for finding highlights in raw footage.\n\n#### Mode 2: Clip scoring (rank ready-to-post clips)**— For when clips already exist (from chunking, manual trimming, etc.) and the user wants to know which ones to post first. Scores each complete clip with a richer evaluation including narrative arc and standalone quality.**This is the preferred mode when used with the chunking pipeline\n\n### Recommended Pipeline\n\nWhen the user has a long video and wants social-ready clips, use this order:\n\n```text\n\nLong Video → Dead Space Removal → Chunking (10-60s clips) → Clip-Level Scoring → Reframe for Platform → Output\n\n```\n\nThis way the AI scores complete, self-contained clips rather than tiny scene fragments. The scores are much more meaningful because each clip is what will actually be posted.\n\nFor \"find the best moment in this video\" requests (no chunking), use the original segment-level pipeline:\n\n```text\n\nVideo → Scene Detection → Frame Extraction → Segment Scoring → Rank → Trim\u002FExport\n\n```\n\n### When the user asks for auto-trim, ask which output they want\n\nPresent these three options and let the user choose each time. Do not assume a default:\n\n- **Best clip** — The single highest-scoring segment\u002Fclip, trimmed and exported\n- **Multiple clips** — Several top segments\u002Fclips exported as separate files, ranked by score\n\n- **Highlight reel** — Top moments stitched together with crossfade transitions into one video\n\n### Scoring Criteria\n\n**Segment scoring** evaluates: visual dynamism, emotional impact, hook potential, pacing\u002Fenergy, uniqueness, and shareability. Each factor gets a 1-10 score, weighted to produce a final virality score.\n\n**Clip scoring** adds three additional criteria for complete clips:\n\n- **Narrative completeness** (weight: 15%) — Does the clip tell a complete micro-story? Does it have a clear beginning, middle, and end? Would a viewer feel satisfied or intrigued, not confused?\n- **Hook-to-payoff flow** (weight: 10%) — Does the clip open with something that grabs attention and deliver on that promise? Or does it start slow and meander?\n\n- **Standalone quality** (weight: 10%) — Would this clip make sense to someone who hasn't seen the full video? Can it be posted without context?\n\nThese three criteria reduce the weights of the original six factors proportionally so the total still sums to 100%.\n\n### Frame Extraction\n\n- **Segments (2-10s):** Extract 3 frames evenly spread across the segment.\n- **Clips (10-60s):** Extract 5-8 frames to capture the full arc. Always include the first frame (hook evaluation) and last frame (payoff evaluation).\n\n### Workflow\n\nFor the complete step-by-step implementation with code examples, see:\n\n- `virality-scoring.md` — Full virality analysis pipeline, AI prompts, scoring criteria, and output assembly\n\n### Key Gotchas (learned from testing)\n\n- **Scene detection:** Use `ffmpeg`with`select`+`showinfo`filters and parse stderr — the`ffprobe -f lavfi` approach doesn't work reliably in Replit.\n- **Content safety:** OpenAI vision may reject frames from documentary\u002Fmedical\u002Fnews content. Always wrap AI calls in try\u002Fcatch and skip failed segments gracefully.\n\n- **Segment indexing:** Use `index: segments.length`when filtering short segments, not the loop counter`i`.\n- **Package setup:** For scripts, install `openai`directly (`pnpm add -w openai`) and create the client with`AI_INTEGRATIONS_OPENAI_BASE_URL`\u002F`AI_INTEGRATIONS_OPENAI_API_KEY` env vars. No need for the full workspace integration library.\n\n- **Timeouts:** A 90-second video with ~13 segments takes 1-2 minutes for AI analysis. Warn the user and set generous timeouts.\n- **Minimum segment duration:** Use 2.0s minimum — segments under 2 seconds waste API calls and don't produce useful scores.\n\n- **Prefer clip-level scoring:** When the video has already been chunked, always score the chunks rather than re-running segment detection. The clips are what will actually be posted.\n\n## Dead Space Removal\n\nAutomatically detect and remove silence, dead air, and filler from a video to produce a tighter, more engaging cut. This is especially useful for talks, interviews, podcasts, tutorials, and raw footage.\n\n### How It Works\n\n1. **Silence detection** — Use FFmpeg's `silencedetect` filter to find all silent intervals (configurable threshold and minimum duration)\n2. **Segment extraction** — Extract all non-silent segments as individual clips\n\n3. **Reassembly** — Concatenate the non-silent segments back together with optional brief crossfade transitions\n4. **Optional: AI-assisted filler removal** — For more aggressive editing (removing \"ums\", filler words, repetitive sections), combine silence detection with AI transcription analysis\n\n### When the user asks to remove dead space\n\nAsk these clarifying questions if not clear from context:\n\n- **How aggressive?** Light (remove only true silence, > 1s gaps) vs. aggressive (remove short pauses > 0.3s for a fast-paced edit)\n- **Transitions?** Hard cuts between segments (default) or brief crossfades (0.2-0.5s) for smoother flow\n\n### Configuration\n\n| Preset | Silence Threshold | Min Silence Duration | Use Case |\n\n|--------|------------------|---------------------|----------|\n\n| Light | -40dB | 1.0s | Talks, interviews — remove obvious dead air |\n\n| Medium | -35dB | 0.5s | Podcasts, tutorials — tighter pacing |\n\n| Aggressive | -30dB | 0.3s | Fast-paced edits, social media — maximum tightness |\n\n### Implementation\n\nFor the complete FFmpeg commands and Node.js pipeline, see:\n\n- `dead-space-and-chunking.md` — See the \"Dead Space Removal\" section\n\n### Quick Summary\n\n```text\n\nVideo → Silence Detection (FFmpeg silencedetect) → Identify Non-Silent Ranges → Extract Segments → Concatenate → Output\n\n```\n\n## Social Media Chunking\n\nBreak a longer video (ad, promo, talk, presentation, livestream) into self-contained clips suitable for TikTok, Reels, and Shorts. Each clip should be 10-60 seconds and feel complete on its own.\n\n### How It Works (2)\n\n1. **Scene detection + silence detection** — Find natural break points using both visual scene changes and audio silence gaps\n2. **Smart boundary selection** — Merge adjacent segments into clips targeting 10-60 seconds, preferring to break at silence or scene changes rather than mid-sentence\n\n3. **AI content analysis (optional)** — Score each potential clip with AI to identify which ones are worth posting, suggest captions, and recommend clip order\n4. **Export** — Output each clip as a separate file, numbered and ranked\n\n### Clip Length Guidelines\n\n| Platform | Ideal Length | Max Length | Notes |\n\n|----------|-------------|------------|-------|\n\n| TikTok | 15-45s | 10 min | 15-30s performs best for new accounts |\n\n| Instagram Reels | 15-30s | 90s | Under 30s gets more reach |\n\n| YouTube Shorts | 30-60s | 60s | Hard cap at 60 seconds |\n\n| X \u002F Twitter | 15-45s | 2m 20s | Shorter gets more engagement |\n\n### When the user asks to chunk a video\n\nAsk which platform they're targeting (or default to TikTok at 15-45s). The chunking algorithm should:\n\n- **Never cut mid-sentence** — Always break at silence gaps or natural pauses\n- **Prefer scene boundaries** — Break where the visual content changes\n\n- **Ensure each clip stands alone** — Each clip should have a clear beginning, not start mid-thought\n- **Target the platform's sweet spot** — Not just \"under 60s\" but actually the ideal range for that platform\n\n### Implementation (2)\n\nFor the complete pipeline with code examples, see:\n\n- `dead-space-and-chunking.md` — See the \"Social Media Chunking\" section\n\n### Quick Summary (2)\n\n```text\n\nVideo → Scene Detection + Silence Detection → Merge into 10-60s Clips at Natural Boundaries → (Optional) AI Scoring → Export Individual Clips\n\n```\n\n### Combining with Other Features\n\nThese features work well together in a pipeline:\n\n```text\n\nLong Video → Dead Space Removal → Chunking into Clips → Virality Scoring → Reframe for TikTok → Output\n\n```\n\nThis takes a raw long-form video and produces polished, platform-ready social clips end to end.\n\n## Voiceovers with ElevenLabs\n\nAdd AI-generated voiceovers to videos using ElevenLabs text-to-speech, then mix the audio into the video with FFmpeg.\n\n### Prerequisites\n\nElevenLabs is available as a Replit integration (connector). The user needs to connect their ElevenLabs account through Replit's integration system — no manual API keys needed. Search for the integration and propose it to the user:\n\n```javascript\n\nconst results = await searchIntegrations(\"elevenlabs\");\n\n\u002F\u002F Then propose the connector so the user can authorize\n\nawait proposeIntegration(\"connector:ccfg_elevenlabs_...\");\n\n```\n\nAfter authorization, use `addIntegration`to wire it to the project, then use`listConnections('elevenlabs')` in the code execution sandbox to get the credentials.\n\n### Workflow (2)\n\n1. **Generate voiceover audio** — Send text to ElevenLabs TTS API, receive audio file\n2. **Mix into video** — Use FFmpeg to add the voiceover as a new audio track, optionally ducking (lowering volume of) existing audio\n\n### Voiceover Modes\n\nWhen the user asks for a voiceover, they may want one of these:\n\n- **Replace audio** — Remove existing audio entirely, use only the voiceover\n- **Mix over** — Layer voiceover on top of existing audio (with existing audio volume reduced)\n\n- **Add as track** — Keep existing audio at full volume, add voiceover on top\n\nAsk which mode the user prefers if not clear from context.\n\n### Implementation (3)\n\nFor the complete step-by-step implementation with code examples, see:\n\n- `voiceover.md` — ElevenLabs TTS integration, voice selection, audio mixing with FFmpeg, and timed voiceover segments\n\n### Quick Summary (3)\n\n```text\n\nText Script → ElevenLabs TTS → Audio File → FFmpeg Mix with Video → Output\n\n```\n\nKey capabilities:\n\n- Choose from ElevenLabs' voice library or cloned voices\n- Control voice settings (stability, similarity boost, style)\n\n- Generate voiceover for the full video or specific time segments\n- Duck existing audio under voiceover sections\n\n- Support for multiple languages\n\n## Social Media Reframing\n\nAutomatically reframe videos for different social media platforms. Each platform has a preferred aspect ratio and resolution — this feature handles the conversion intelligently.\n\n### Platform Specs\n\n| Platform | Aspect Ratio | Resolution | Notes |\n\n|----------|-------------|------------|-------|\n\n| YouTube | 16:9 | 1920x1080 | Standard landscape, also supports 4K (3840x2160) |\n\n| TikTok \u002F Reels | 9:16 | 1080x1920 | Vertical video, max 60s for Reels, 10min for TikTok |\n\n| Instagram Feed | 1:1 | 1080x1080 | Square format |\n\n| X \u002F Twitter | 16:9 or 1:1 | 1280x720 or 720x720 | Supports both, 2min 20s max |\n\n### Reframing Strategies\n\nWhen converting between aspect ratios, there are three strategies:\n\n1. **Center crop** (default) — Crop from the center to fill the target ratio. Fast, works well for most content. May cut off edges.\n2. **Letterbox\u002Fpillarbox** — Add black bars (or blurred background) to fit without cropping. Preserves all content but adds empty space.\n\n3. **Blurred fill** — Use a blurred, scaled-up version of the video as the background behind the original. Looks much better than black bars, especially for vertical reframing. This is the recommended approach for going from 16:9 to 9:16.\n\nWhen the user asks to reframe, ask which platform they're targeting. Use **blurred fill**by default for aspect ratio changes that would lose significant content (e.g., landscape to portrait). Use**center crop**when the content is center-focused. Use**letterbox** only if the user explicitly asks for it.\n\n### Implementation (4)\n\nFor the complete FFmpeg commands for each reframing strategy, see:\n\n- `operations.md` — See the \"Social Media Reframing\" section\n\n### Multi-platform Export\n\nWhen the user wants to export for multiple platforms at once, generate all versions in a batch:\n\n```text\n\nInput (16:9) → YouTube (copy) + TikTok (9:16 blurred fill) + Instagram (1:1 center crop) + X (1280x720 copy)\n\n```\n\nThis is a common workflow — the user shoots in landscape and needs versions for every platform.\n\n## Common Operations Reference\n\nFor detailed FFmpeg commands and patterns for each operation type, see:\n\n- `operations.md` — Complete command reference for all supported editing operations\n- `virality-scoring.md` — AI-powered virality analysis and auto-trim pipeline\n\n- `voiceover.md` — ElevenLabs voiceover generation and audio mixing\n- `dead-space-and-chunking.md` — Dead space removal and social media chunking pipelines\n\n## Building a Video Editor UI\n\nIf the user wants a visual editor interface:\n\n1. Create a `react-vite` artifact for the frontend\n2. Add API routes to `artifacts\u002Fapi-server\u002F` for video processing\n\n3. Use `multer` for file uploads to the API\n4. Process videos with FFmpeg on the server\n\n5. Return processed files for download or preview\n6. Use the `object-storage` skill for persisting uploaded and processed files if needed\n\nKey frontend considerations:\n\n- Use `\u003Cvideo>` element for preview playback\n- Show a timeline UI for trim\u002Fcut operations\n\n- Display progress during processing (poll an API status endpoint or use Server-Sent Events)\n- Provide download links for processed output\n\n## Tested Bugs & Caveats (Do Not Regress)\n\nThese issues were discovered during real-world testing and are documented here to prevent regressions:\n\n- **Scene detection:** The `ffprobe -f lavfi`approach does NOT work in Replit. Use`ffmpeg`with`select='gt(scene,threshold)',showinfo`and parse`pts_time` from stderr.\n- **Segment indexing:** Use `index: segments.length`when building segments, NOT the loop counter`i` — filtered segments cause index mismatches.\n\n- **Content safety:** OpenAI vision may reject frames (medical\u002Fdocumentary content). Always wrap AI calls in try\u002Fcatch and skip gracefully.\n- **Frame extraction timestamp clamping:** Clamp the last frame timestamp to `segment.endTime - 0.1`. Without this, the last clip in a video fails because`startTime + 1.0 * duration` can exceed the actual file duration due to floating point arithmetic.\n\n- **`silenceremove` filter:** Only strips audio silence, NOT video frames. Must use segmented extract+concat approach for proper dead space removal.\n- **Dead space with many segments:** Videos with lots of short dialogue (50+ speaking segments) can be very slow to process with re-encoding. Use `-preset ultrafast` for testing, or skip dead space removal for dialogue-heavy content where there's little dead space anyway.\n\n- **OpenAI for scripts:** Install with `pnpm add -w openai`, create client with`AI_INTEGRATIONS_OPENAI_BASE_URL`and`AI_INTEGRATIONS_OPENAI_API_KEY` env vars.\n- **AI scoring duration:** A 90-second video with ~13 segments takes 1-2 minutes for AI analysis. A 3.5-minute video with 9 clips takes ~3 minutes. Always warn the user.\n\n## Limitations\n\n- **No GPU acceleration** — Replit containers do not have GPU access, so hardware encoding (NVENC, VAAPI) is unavailable. Use software encoding (libx264, libx265, libvpx-vp9).\n- **Memory and CPU** — Very large files or high-resolution encoding (4K+) may be slow or hit memory limits. For large files, prefer stream-copy (`-c copy`) where possible and avoid unnecessary re-encoding.\n\n- **Disk space** — Video files are large. Clean up temporary files after processing. Monitor disk usage for batch operations.\n- **No real-time preview** — FFmpeg processes offline. Users cannot preview effects in real-time during editing (unlike desktop NLEs). Generate short previews of segments instead.\n",{"name":5,"description":7},"main","6b4a291df75c639681e93b4b5b812126443fd6ed","secondary_skills\u002Fvideo-editing",3,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd","https:\u002F\u002Fsolanaclawd.com\u002Fopenclawd","https:\u002F\u002Fgithub.com\u002Fclawdsolana","https:\u002F\u002Fmusebook.trade","Welcome to Open Clawd. The future of Ai on and off chain. Bringing webMCP to web 3 using X402, A2A, MPP and so much more!","2026-08-01 09:30:51",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add clawdsolana\u002FOpenClawd --skill video-editing",{"tool":58,"command":59},"bunx","bunx skills add clawdsolana\u002FOpenClawd --skill video-editing",{"tool":61,"command":62},"pnpm","pnpm dlx skills add clawdsolana\u002FOpenClawd --skill video-editing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002FSKILL.md",true,[66,72,78,82,86],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},".fingerprint","OTHER","其他",32,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002F.fingerprint",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"dead-space-and-chunking.md","REFERENCE","参考文档",23352,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002Fdead-space-and-chunking.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"operations.md",32873,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002Foperations.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"virality-scoring.md",27839,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002Fvirality-scoring.md",{"path":87,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":88,"sourceHtmlUrl":89},"voiceover.md",13202,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Fvideo-editing\u002Fvoiceover.md",[91,122,150,176,186,210],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":100,"publishedAt":121},"01M71KRBD0W01EAXJ8YM4M1SJ2","solana-dev","End-to-end Solana development playbook (Jan 2026). Prefer Solana Foundation framework-kit (@solana\u002Fclient + @solana\u002Freact-hooks) for React\u002FNext.js UI. Prefer @solana\u002Fkit for all new client\u002FRPC\u002Ftransaction code. When legacy dependencies require web3.js, isolate it behind @solana\u002Fweb3-compat (or @solana\u002Fweb3.js as a true legacy fallback). Covers wallet-standard-first connection (incl. ConnectorKit), Anchor\u002FPinocchio programs, Codama-based client generation, LiteSVM\u002FMollusk\u002FSurfpool testing, and security checklists.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsrc\u002Fskills\u002Fsolana-dev\u002FSKILL.md",[97],{"categoryNo":98,"categoryName":99,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"solana dev","dev","solana","Wallet","end","testing","hooks","kit","new","when","web3","code","react","next","2026","playbook","security","ui","fallback","framework","2026-11-10 10:56:23",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":131,"publishedAt":121},"01M71KR8QPESSY61SVE8ZTFNVT","xurl","A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fxurl\u002FSKILL.md",[128],{"categoryNo":129,"categoryName":130,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[124,132,133,134,135,136,137,110,138,139,140,141,142,143,144,145,146,147,148,149],"posts","Media","x api","search","send","tap","you","api","cli","read","install","cli tool","endpoint","brew","for","manage","tool","twitter",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":157,"publishedAt":121},"01M71KR6FSXV88YDKWP7NBY3SH","wurk-integration","WURK API integration for monetizing agents with x402 payments on Solana\u002FBase - create social jobs, custom challenges, and agent help tasks","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fwurk-integration\u002FSKILL.md",[156],{"categoryNo":129,"categoryName":130,"taxonomyType":21,"taxonomyTypeDesc":22},[158,159,160,161,162,163,164,165,139,166,167,168,169,170,171,172,146,173,174,175],"wurk","wurk integration","integration","x402","social","payments","tasks","team","create","social-jobs","command","agent-help","custom-jobs","clawd","safe","api integration","custom","true",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":121},"01M71KR4HCX41BPAK9GP7RPRRP","workflows","Manage application workflows including configuration, restart, and removal.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fworkflows\u002FSKILL.md",[],[178,147,183,184,185],"configuration","application","restart",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":192,"publishedAt":121},"01M71KR1VM0F5GPEQDNG5J7A0H","web-search","Search the web, fetch content, extract branding profiles, and capture screenshots from URLs. Use for real-time information, API documentation, current events, design matching, and visual reference.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[193,135,194,195,196,146,197,198,199,200,201,202,203,139,204,205,206,207,208,209],"web search","web","fetch","api documentation","real-time","time","profiles","design","use","information","visual","documentation","branding","matching","reference","capture","content",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":216,"publishedAt":121},"01M71KQZN5MR1JFQHG5GWXYAHS","weather","Get current weather and forecasts via wttr.in or Open-Meteo. Use when: user asks about weather, temperature, or forecasts for any location. NOT for: historical weather data, severe weather alerts, or detailed meteorological analysis. No API key needed.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fweather\u002FSKILL.md",[],[212,217,146,218,201,110,219,139,220,221,222,223,224,225,226,227,228,229],"get","open","analysis","alerts","temperature","curl","via","help","about","https","location","data","user"]