--- name: vtake-cut description: Turn a local video into metadata, transcript, and an AI-composed card-based video where the agent freely designs and writes HTML cards in conversation. Use when the user asks for VTake, vtake-cut, video takeaways, transcript cleanup, or AI-composed video repurposing. --- # VTake Local Workflow VTake converts a local input video into a card-based composition. The agent designs the cards (timing + content) and **writes each card's HTML directly in the conversation**, then assembles a single composition HTML and renders it to MP4 via `hyperframes`. There is no fixed archetype list and no prescribed card structure — the cards emerge from what the transcript actually says. Inspectable intermediate files in the work directory: - `metadata.json` — duration / width / height / fps - `audio.mp3` — extracted audio - `transcript.json` — segments + words with timestamps - `storyboard.json` — lightweight card outline (the agent's plan) - `public/cards/card-XX.html` — one HTML fragment per card - `public/index.html` — final assembled composition - `output.mp4` — rendered video ## CLI Resolution ```bash # vtake CLI — auto-downloaded from npm on first run npx -y @notedit/vtake@latest --help # hyperframes — for rendering the assembled HTML to MP4 npx hyperframes render --help ``` > Every `vtake …` command below is shorthand for `npx -y @notedit/vtake@latest …`. ## Workflow ### 1. Check Environment ```bash npx -y @notedit/vtake@latest doctor # confirm bundled assets: ls "/assets/fonts" "/assets/vendor/gsap.min.js" ``` Required: - `ffmpeg` / `ffprobe` (system) - `/assets/fonts/*.woff2`, `/assets/vendor/gsap.min.js` (bundled inside this skill, staged to work dir in Step 9) Optional: - `ELEVEN_API_KEY` — when set, `vtake transcribe` connects to ElevenLabs directly and bypasses the rate-limited proxy. When **not** set, it falls back to `https://vtake.app/api/transcribe`, which enforces **3 requests per minute per IP**. Override the proxy URL with `VTAKE_TRANSCRIBE_ENDPOINT` (e.g. for local Wrangler dev). Strongly recommended on macOS for `hyperframes render`: ```bash export PRODUCER_BROWSER_GPU_MODE=hardware ``` ### 2. Create a Work Directory ```bash VIDEO_PATH="/absolute/path/input.mp4" WORK_DIR=".vtake-work/$(basename "$VIDEO_PATH" | sed 's/\.[^.]*$//')" mkdir -p "$WORK_DIR" ``` ### 3. Extract Audio and Metadata ```bash npx -y @notedit/vtake@latest extract "$VIDEO_PATH" --out-dir "$WORK_DIR" ``` Outputs: `metadata.json` (duration, width, height, fps) + `audio.mp3`. ### 4. Transcribe ```bash npx -y @notedit/vtake@latest transcribe "$WORK_DIR/audio.mp3" --out-dir "$WORK_DIR" --asr elevenlabs ``` Output: `transcript.json` with `{ segments, words, raw }`. **Rate limiting (proxy mode only — no `ELEVEN_API_KEY`):** the server allows 3 requests per minute per IP. If you see an error starting with `rate_limited:` or `service_busy:`, do **not** auto-retry — stop and tell the user how many seconds to wait (the message includes the retry hint), then resume from this step when they ask again. ### 5. Correct Transcript Read `transcript.json` and fix obvious ASR errors: - Homophones, product names, technical terms, punctuation - Preserve all `start` / `end` timestamps - Prefer editing `segments[].text` only - Edit individual `words[].word` only for clear one-to-one replacements ### 6. Draft a Lightweight Storyboard (in chat) **No CLI involved.** Read `transcript.json` + `metadata.json` and design cards directly. `storyboard.json` is an agent-internal planning artifact — no vtake CLI command consumes it; it exists so you can think clearly about timing and content before writing each card's HTML. Keep the shape consistent with the example below so the same outline can drive the composition you author in Step 9: ```json { "schemaVersion": 3, "composition": { "fps": 30, "width": 1080, "height": 1920, "durationSeconds": 121.2, "layout": "portrait", "themeId": "noir", "seed": 42 }, "videoTrack": { "sourcePath": "input-video.mp4", "startSec": 0, "endSec": 121.2, "bounds": { "x": 0, "y": 0, "width": 1080, "height": 1920 } }, "subtitles": { "enabled": false }, "cards": [ { "id": "card-01", "intent": "Hook with the speaker's anxious midnight question", "startSec": 0.5, "endSec": 13.0, "accentIndex": 0, "zone": "fullscreen", "contentHints": { "kicker": "AN HONEST QUESTION", "title": "晚上 11 点的灵魂提问", "detail": "客户六十秒语音:「人民币会升值,我的美金保单是不是亏惨了?」" } } ] } ``` **Required Card fields:** | field | type | purpose | |---|---|---| | `id` | string | stable id used in card HTML & GSAP selectors | | `intent` | string | natural-language description; fed to card synthesis | | `startSec` / `endSec` | number | times in seconds (endSec > startSec) | | `accentIndex` | 0 \| 1 \| 2 \| 3 \| 4 | which of the 5 theme accent colors this card pulls | | `zone` | enum (see below) | where on the canvas the card lives | | `contentHints` | object | free-form bag; agent puts kicker/title/detail/data/quote here | | `archetype` (optional) | string | free-form label you may attach to remember a card's pattern; absent = free-form, which is the default | | `transition` (optional) | enum: `cut` \| `fade` \| `slide` \| `wipe` | declarative card-to-card transition | **Five `zone` values:** | zone | resolved bounds | when to use | |---|---|---| | `fullscreen` | covers whole canvas | hero moments, big numbers, mantras | | `whiteboard-area` | inset 40px margin (or 45% of portrait height) | dense data / annotated content | | `lower-third` | bottom 30% band | annotation over visible video | | `side-panel` | right 42% (landscape) or bottom 40% (portrait) | data side, video other side | | `video-overlay` | full canvas, expects mostly-transparent card | annotation overlays on full-bleed video | When you assemble the composition in Step 9, resolve each card's `zone` into pixel bounds on the card-host wrapper following the table above. Video bounds are set **once** at composition level (`videoTrack.bounds`); to make video appear to "move between cards", author GSAP tweens against `#video-wrap` in the composition's ` ``` #### GSAP Statement Cheat Sheet Compile each `data-anim` attribute into a GSAP statement. Times are **absolute seconds** = card.startSec + data-anim-at, quantized to 1/fps. Selector is `.card[data-card-id="X"] #elementId`. | data-anim | GSAP statement template | |---|---| | `fade-in` | `tl.fromTo(SEL, { opacity: 0 }, { opacity: 1, duration: D, ease: 'power2.out' }, T);` | | `fade-out` | `tl.to(SEL, { opacity: 0, duration: D, ease: 'power2.in' }, T);` | | `slide-in` (from=left, dist=80) | `tl.fromTo(SEL, { opacity: 0, x: -80 }, { opacity: 1, x: 0, duration: D, ease: 'power2.out' }, T);` | | `kinetic-chars` (pop) | `tl.from(SEL + ' .char', { opacity: 0, y: 8, scale: 0.8, duration: D, ease: 'power2.out', stagger: S }, T);` | | `count-up` | `(function(){const o={v:FROM};tl.to(o,{v:TO,duration:D,ease:'power2.out',onUpdate:function(){const el=document.querySelector(SEL);if(el)el.textContent=__fmt(o.v,'FMT');}},T);})();` | | `draw-path` | `(function(){const el=document.querySelector(SEL);if(!el)return;const L=el.getTotalLength();tl.set(SEL,{strokeDasharray:L,strokeDashoffset:L},T);tl.to(SEL,{strokeDashoffset:0,duration:D,ease:'power2.inOut'},T);})();` | | `grow-x` (target-w=W) | `tl.fromTo(SEL, { width: 0 }, { width: W, duration: D, ease: 'power2.out' }, T);` | | `grow-y` (target-h=H) | `tl.fromTo(SEL, { height: 0 }, { height: H, duration: D, ease: 'power2.out' }, T);` | | `scale-pop` | `tl.fromTo(SEL, { opacity: 0, scale: 0.6 }, { opacity: 1, scale: 1, duration: D, ease: 'back.out(1.6)' }, T);` | | `mask-reveal` (direction=left) | `tl.fromTo(SEL, { clipPath: 'inset(0 100% 0 0)' }, { clipPath: 'inset(0 0 0 0)', duration: D, ease: 'power2.inOut' }, T);` | Quantize: `T = Math.round(absSec * fps) / fps`. At 30fps the smallest step is `1/30 ≈ 0.0333s`; rounding to 4 decimals (`.toFixed(4)`) is fine inside the JS literal. #### Video Framing Reference (per `layout` value) The selector for the video container is `#video-wrap`. Animate its bounds between cards using `tl.to('#video-wrap', { ...bounds }, T)`. Initial bounds should be set inline on the element to match card-01's layout. Pick a transition duration of 0.5–0.7s with `ease: 'power2.inOut'`. **Decorative frames** (`clean` / `hairline` / `polaroid`) sit as a **sibling** of `#video-wrap` and follow it through layout transitions. See [`references/frames/`](references/frames/) for each frame's placement HTML, suggested CSS, and which layouts it pairs with. Quick rule: `overlay` layout suppresses decorative frames (the full-bleed video clashes with chrome); PiP layouts already have their own pill treatment (border-radius + white ring + shadow), so add a decorative frame only on top of `split` / `stack`. **GSAP target lookup table** for `#video-wrap` per composition layout (landscape 1920×1080 — for portrait & 4:5 see `references/layouts/*.html` which list all three ratios): | composition layout | typical card.zone | `#video-wrap` GSAP target | extra css class | |---|---|---|---| | `split` | `side-panel` | `{ left: 960, top: 0, width: 960, height: 1080 }` | — | | `stack` | `lower-third` | `{ left: 14, top: 14, width: 1892, height: 548 }` (top 52%) | — | | `pip` (bottom-right) | `fullscreen` | `{ left: 1480, top: 760, width: 400, height: 300 }` | `pip-pill` (border-radius + ring + shadow) | | `pip` (top-left) | `fullscreen` | `{ left: 40, top: 40, width: 400, height: 300 }` | `pip-pill` | | `overlay` (video full-bleed) | `video-overlay` | `{ left: 0, top: 0, width: 1920, height: 1080 }` (no change from default) | — | | **hide video** (pure-graphic moment) | `fullscreen` | `{ opacity: 0 }` (or move off-canvas) | — | To toggle the pip-pill chrome (border-radius + white ring + drop shadow) when entering or leaving a pip moment: ```js // Enter pip — add chrome tl.set('#video-wrap', { className: 'video-wrapper pip-pill' }, T); tl.to('#video-wrap', { left: 1480, top: 760, width: 400, height: 300, duration: 0.6, ease: 'power2.inOut' }, T); // Leave pip — back to clean full-bleed tl.set('#video-wrap', { className: 'video-wrapper' }, T_NEXT); tl.to('#video-wrap', { left: 0, top: 0, width: 1920, height: 1080, duration: 0.6, ease: 'power2.inOut' }, T_NEXT); ``` **Card-host bounds match the zone**. Resolve the card's `zone` into pixel bounds using the table at the top of Step 6, then write those into the card-host's inline `style="left:Xpx;top:Ypx;width:Wpx; height:Hpx;..."`. For `video-overlay` zone (overlay recipe), the card-host fills the full canvas — your CSS inside `.card .root` decides where the actual visible card sits. #### HyperFrames Layout / Animation QA Rules - Build each card's static hero frame first: the moment where the card is fully visible and readable. - Confirm video, cards, subtitles/captions, and diagrams do not unintentionally overlap. - Confirm hidden video areas are clipped by the frame and not visible outside intended bounds. - Register one paused master timeline as `window.__timelines["vtake"]`. - Build timelines synchronously at page load; no `async`, `setTimeout`, Promises, or media `play()` calls. - Do not use `Math.random()` or `Date.now()` in render paths. - Do not use `repeat: -1`; calculate finite repeats from the video duration. - Prefer GSAP transforms and opacity (`x`, `y`, `scale`, `rotation`, `opacity`) over layout properties (`top`, `left`, `width`, `height`) for motion. - Animate wrappers such as `#video-wrap`, not the video element dimensions directly. - Avoid animating the same property on the same element from multiple timelines at the same time. - Use `data-track-index`, not `data-layer`; use `data-duration`, not `data-end`. - Every timed element (`card-host`, sub-composition, etc.) MUST include `class="clip"` alongside its own classes — e.g. `class="card-host clip"`. The HyperFrames runtime uses `.clip` to gate visibility to the `data-start … data-start+data-duration` window. Without it the element is visible for the whole video (lint: `timed_element_missing_clip_class`). - For body / global `font-family`, list **concrete font names** (`'Inter', 'Caveat', …`) — not a CSS variable like `var(--font-family)`. The HyperFrames font resolver doesn't expand CSS vars during static analysis (lint: `font_family_without_font_face`). Cards may still use `var(--font-family)` internally since their `@font-face` declarations are loaded. #### card-cta-vtake: Fixed GSAP Animation Block At the end of the GSAP timeline block (just before the final `window.__timelines` registration), append this fixed code block. Replace `CTA_START` with `card-cta-vtake.startSec` and `CTA_END` with `card-cta-vtake.endSec`: ```js // ── card-cta-vtake: Editorial Cinema brand outro (2.0s total) ── // Sequence: 1.0s entrance · 0.7s hold (CSS ambient breathing) · 0.3s fade-out const PREFIX = '.card[data-card-id="card-cta-vtake"]'; // Fade source video out at the start of the CTA tl.to('#video-wrap', { opacity: 0, duration: 0.30, ease: 'power2.in' }, CTA_START); // Card host enter tl.set('.card-host[data-card-id="card-cta-vtake"]', { visibility: 'visible' }, CTA_START); tl.fromTo('.card-host[data-card-id="card-cta-vtake"]', { opacity: 0 }, { opacity: 1, duration: 0.30, ease: 'power2.out' }, CTA_START); // V-shape stroke draw (function(){ const sel = PREFIX + ' #cta-path-v'; const el = document.querySelector(sel); if(!el) return; const L = el.getTotalLength(); tl.set(sel, { strokeDasharray: L, strokeDashoffset: L }, CTA_START + 0.05); tl.to(sel, { strokeDashoffset: 0, duration: 0.40, ease: 'power2.inOut' }, CTA_START + 0.05); })(); // "Powered by" label tl.fromTo(PREFIX + ' #cta-powered-label', { opacity: 0 }, { opacity: 1, duration: 0.45, ease: 'power2.out' }, CTA_START + 0.15); // Flanking lines grow-x tl.fromTo(PREFIX + ' #cta-line-l', { width: 0 }, { width: 56, duration: 0.40, ease: 'power2.out' }, CTA_START + 0.18); tl.fromTo(PREFIX + ' #cta-line-r', { width: 0 }, { width: 56, duration: 0.40, ease: 'power2.out' }, CTA_START + 0.18); // Viewfinder corners ×4 fade-in ['tl','tr','bl','br'].forEach(pos => { tl.fromTo(PREFIX + ' #cta-corner-' + pos, { opacity: 0, scale: 0.7 }, { opacity: 1, scale: 1, duration: 0.50, ease: 'power2.out' }, CTA_START + 0.20); }); // Top/bottom film-credit meta strips tl.fromTo(PREFIX + ' #cta-top-meta', { opacity: 0, y: 6 }, { opacity: 1, y: 0, duration: 0.50, ease: 'power2.out' }, CTA_START + 0.25); tl.fromTo(PREFIX + ' #cta-bot-meta', { opacity: 0, y: -6 }, { opacity: 1, y: 0, duration: 0.50, ease: 'power2.out' }, CTA_START + 0.30); // T-bar stroke draw (function(){ const sel = PREFIX + ' #cta-path-tbar'; const el = document.querySelector(sel); if(!el) return; const L = el.getTotalLength(); tl.set(sel, { strokeDasharray: L, strokeDashoffset: L }, CTA_START + 0.30); tl.to(sel, { strokeDashoffset: 0, duration: 0.25, ease: 'power2.inOut' }, CTA_START + 0.30); })(); // "vTake" main name mask-reveal (left → right) tl.fromTo(PREFIX + ' #cta-vtake-name', { clipPath: 'inset(0 100% 0 0)' }, { clipPath: 'inset(0 0% 0 0)', duration: 0.45, ease: 'power2.inOut' }, CTA_START + 0.40); // T-stem stroke draw (function(){ const sel = PREFIX + ' #cta-path-tstem'; const el = document.querySelector(sel); if(!el) return; const L = el.getTotalLength(); tl.set(sel, { strokeDasharray: L, strokeDashoffset: L }, CTA_START + 0.50); tl.to(sel, { strokeDashoffset: 0, duration: 0.25, ease: 'power2.inOut' }, CTA_START + 0.50); })(); // Dual concentric rings fade-in (CSS @keyframes handles the slow spin) tl.fromTo(PREFIX + ' #cta-ring-outer', { opacity: 0 }, { opacity: 1, duration: 0.50, ease: 'power2.out' }, CTA_START + 0.55); tl.fromTo(PREFIX + ' #cta-ring-inner', { opacity: 0 }, { opacity: 1, duration: 0.50, ease: 'power2.out' }, CTA_START + 0.60); // Amber dot scale-pop (elastic) tl.fromTo(PREFIX + ' #cta-dot', { opacity: 0, scale: 0.4, transformOrigin: '48px 118px' }, { opacity: 1, scale: 1, duration: 0.25, ease: 'back.out(1.7)' }, CTA_START + 0.65); // Decorative divider segments grow-x tl.fromTo(PREFIX + ' #cta-seg-l', { width: 0 }, { width: 56, duration: 0.30, ease: 'power2.out' }, CTA_START + 0.75); tl.fromTo(PREFIX + ' #cta-seg-r', { width: 0 }, { width: 56, duration: 0.30, ease: 'power2.out' }, CTA_START + 0.75); // Divider diamond pop tl.fromTo(PREFIX + ' #cta-diamond', { rotate: 45, scale: 0 }, { rotate: 45, scale: 1, duration: 0.30, ease: 'back.out(1.7)' }, CTA_START + 0.85); // Tagline fade-in tl.fromTo(PREFIX + ' #cta-tagline', { opacity: 0, y: 4 }, { opacity: 1, y: 0, duration: 0.45, ease: 'power2.out' }, CTA_START + 0.90); // Card exit — fade-out in the last 0.30s of the 2.0s window tl.to('.card-host[data-card-id="card-cta-vtake"]', { opacity: 0, duration: 0.30, ease: 'power2.in' }, CTA_END - 0.30); tl.set('.card-host[data-card-id="card-cta-vtake"]', { visibility: 'hidden' }, CTA_END); ``` ### 10. Render to MP4 ```bash cd "$WORK_DIR" PRODUCER_BROWSER_GPU_MODE=hardware npx hyperframes render public \ -o output.mp4 \ --fps 30 ``` `hyperframes render ` reads `/index.html` and produces the MP4. The flag `PRODUCER_BROWSER_GPU_MODE=hardware` (or `--browser-gpu`) is strongly recommended on macOS — software-only Chrome rendering times out on most laptops. For a sanity check before the full render, capture a single frame at a specific timestamp: ```bash npx hyperframes snapshot public --at 5 --out snapshot-5s.png ``` ### 11. Report Results Tell the user: - Work directory path - `storyboard.json` (the card outline you designed) - `public/cards/*.html` (one HTML per card) - `public/index.html` (the assembled composition) - `output.mp4` (the final video) - ASR provider used - Card count + how you chose them (in 1 sentence) - Any missing keys or quality caveats Do not delete the work directory unless the user asks.