Communitygithub.com

notasimrazzaq/AI-Video-Editor

在用户原始视频/人物讲话视频上添加动态图形(Damiano 的 'Motion Graphics with Claude Code' 工作流,PROMPT 11 + 12)。适用于:用户提供原始视频、Reel、剪辑或素材,希望进行编辑、动画处理、'制作成杰作'、添加卡片/计数器/检查清单,或修复特定时刻('当我说 X 时,显示 Y')。

AI-Video-Editor 是什么?

这是一个用于向用户原始视频(如人物讲话视频、Reel 等)叠加动态图形的 AI 技能。它建立在 HyperFrames 技能之上,使用了 `hyperframes-core`(合成契约)和 `hyperframes-animation`(GSAP 规则)等组件,并在冲突时优先使用创作者自己的规则。该技能提供了一条经过验证的快速路径,包括使用 Deepgram 进行转录、生成字幕、应用样式模板(如 Paper Cut 风格)、通过快照进行视觉检查,以及添加音效。它支持多语言转录(包括乌尔都语/印地语与英语的混合),生成罗马化 Hinglish 字幕。该技能的精髓在于保持原始视频完全不变,仅叠加动态图形,确保每个图形都精确地在特定词的开始处触发,并遵循严格的布局规则(如避开面部、底部三分一区域等)。它非常适合需要为现有视频添加数字计数、清单勾选、对比、关键词放大等动态效果的场景,并支持单一风格贯穿始终,以及针对特定时刻进行单点修改。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/notasimrazzaq/AI-Video-Editor/tree/HEAD/.agents/skills/mg-edit-video

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

预览

来自技能 README

文档

在用户自己的视频上添加动态图形

在已安装的 HyperFrames 技能之上作为工作区层使用。对于 HTML/时间线机制,加载 hyperframes-core(合成契约)和 hyperframes-animation(GSAP 规则);最近的 上游路径是 talking-head-recut。此技能添加了创建者的内部规则,冲突时以其为准。

快速路径(在 reel-sep30 上验证,3:20 乌尔都语/英语 Reel,Paper Cut 风格)

  1. powershell -NoProfile -ExecutionPolicy Bypass -File tools/new-project.ps1 -Name <n> -Video raw/<file> -Transcribe → 数秒内获得 Deepgram 转录。
  2. 导出 transcript-words.txt(index:text@start)→ 阅读、总结、选取时刻。
  3. 字幕:captions-src.json(根据单词索引的罗马化 Hinglish 片段)→ node tools/build-captions.mjs projects/<n>。
  4. 样式模板:复制 kit/templates/paper-cut-vertical.html → index.html;设置两个 data-duration;将 EXAMPLE 调用替换为此视频的时刻。
  5. lint → snapshot --at ...(2 批,每批约 12 帧)→ 查看联系表 → 修复。
  6. 音效:根据 mg-sound 中的偏移表编写 sfx.json → node tools/sfx.mjs projects/<n>(在渲染之前,以便一次渲染包含它们)。
  7. 预先告知用户渲染时间(参见 mg-export:在 4 核笔记本电脑上,每 1 分钟 1080x1920 视频约需 25–30 分钟),然后渲染一次,复制到 exports/。
  8. 后期调整:仅音频 → sfx.mjs --mix(秒级别,无需重新渲染)。视觉调整 → 先快照,然后重新渲染一次。

不要:安装本地语音模型、恢复停滞的下载、为“检查”任何内容而渲染(请使用快照)、或在 VS Code 的播放器中预览(无 AAC 音频——请使用 VLC)。

1. 设置项目

  1. 如果视频不在 raw/ 中,可以保留在原处。从文件名中选取一个简短的 kebab-case 项目名称。
  2. 运行(从工作区根目录):
    powershell -NoProfile -ExecutionPolicy Bypass -File tools/new-project.ps1 -Name "<name>" -Video "<path>" -Transcribe
    
    • 转录使用 Deepgram(nova-3,默认 language=multi:处理乌尔都语/印地语 + 英语代码切换;印地语/乌尔都语词汇可能以天城文返回——请罗马化为 Hinglish,保留时间戳)。需要用户环境变量 DEEPGRAM_API_KEY;如果缺失,请让用户自己运行 powershell -NoProfile -ExecutionPolicy Bypass -File tools/set-deepgram-key.ps1(绝不要在聊天中执行)。纯英语视频:-Language en。单独重新运行:powershell -NoProfile -ExecutionPolicy Bypass -File tools/transcribe-deepgram.ps1 -Project projects/<name>。
    • 不要使用 npx hyperframes transcribe 配合 whisper 或安装它(太吵/慢);请使用 Deepgram。
    • 生成 projects/<name>/ 目录,包含 clip.mp4(CFR H.264)、audio.mp3、metadata.json、transcript.json、fonts/、sfx/、renders/。
    • 如果用户为某个时刻提供了截图,添加参数 -Screenshots "<folder>"。
  3. 此后在 projects/<name>/ 内工作(在任何 npx hyperframes 命令之前先 cd 到那里)。

2. 仔细分析视频

  • 阅读 metadata.json(宽度、高度、fps = r_frame_rate、时长)和 transcript.json(扁平的 [{text,start,end}])。
  • 就地修复明显的 ASR 错误,保留时间戳。语音转文本可能偏差约 1 秒:当某个时刻很重要时,请通过 ffmpeg -ss <t-0.5> -t 2 -i clip.mp4 ... 或快照进行验证,不要完全信任数字。
  • 长视频或混合语言转录:导出索引化的单词列表(index:text@start,每行一个句子)到 transcript-words.txt 并阅读。

字幕(当用户需要时)

  • 编写 captions-src.json:[[firstWordIndex, lastWordIndex, "caption text", ["key","words"]], ...],每个块 3–7 个单词,覆盖所有单词。 乌尔都语/印地语/Hinglish 语音 → 将文本写成 罗马化 Hinglish(例如 "ke 9 maah guzar gaye hain"),保留英语单词原样,通过上下文修正误听("नौ मां" → 9 maah,"New York" → New Year)。
  • 构建:node tools/build-captions.mjs projects/<name> → captions.js(window.CAPTIONS = [{s,e,text,key}]),对未覆盖的单词发出警告。通过 <script src="captions.js"> 加载。
  • 找到脸部位置:在合成存在之前 npx hyperframes snapshot 不可用,因此提取帧: ffmpeg -nostdin -v error -ss <t> -i clip.mp4 -frames:v 1 renders/_probe_<t>.png 在 3–4 个点,并查看它们。
  • 编写一段摘要:视频内容是什么,以及 3–8 个重要的时刻(数字、列表、前后对比、关键声明、行动号召)。
  • 如果用户未指定风格,询问他们(参见 mg-styles)。默认:干净的白色磨砂卡片(Liquid Glass)。

3. 规划(如果视频长度 > 30 秒或需求模糊,请在构建前向用户展示)

对于每个时刻:触发词及其精确的 start、图形类型、内容、区域、退出时间。图形类型跟随所说内容:

  • 数字 → 计数递增 · 列表 → 清单勾选 · 前后对比 → 对比 · 关键行 → 放大 或大字
  • 截图/证明 → 顺序弹出(PROMPT 12)· 新话题 → 重构(视频缩入卡片) 动作词汇和样式存在于 mg-styles 技能中。

4. 内部规则(不可协商)

  1. 保持视频完全不变:相同尺寸、fps、音频、剪辑。合成 data-width/height = 视频尺寸,fps = 视频 fps, 根元素 data-duration = 视频时长(锁定到 metadata.json)。视频为 <video id="a-roll" class="clip" src="clip.mp4" data-has-audio="true" data-start="0" ...>,无 muted,无 crossorigin。
  2. 每个图形 在精确的单词上开始(转录中该单词的 start)。
  3. 整个视频使用一种风格。
  4. 前 3 秒内不添加任何内容——那是吸引观众的部分。
  5. 保持图形 远离面部、避开底部三分之一区域(字幕),并且 位于宽度中间 80% 范围内(左右各 10% 边距)。
  6. 仅使用项目 fonts/ 文件夹中的字体,通过 @font-face 定义(绝不使用 Google Fonts 网址);通过 <script src="vendor/gsap.min.js"> 使用 GSAP。
  7. 磨砂玻璃效果需要背后有内容;覆盖在视频上有效果,透明导出请使用实心卡片。

5. 构建、检查、审阅

  1. 编写 index.html(独立合成,一条暂停的 GSAP 时间线,注册为 window.__timelines["<id>"])。Paper Cut 风格:从 kit/templates/paper-cut-vertical.html 开始。 低分辨率手机视频(例如 480x864 WhatsApp):仍然在 1080x1920 画布上创作,以便图形/字幕保持清晰;视频在下方缩放。
  2. npx hyperframes lint 然后 npx hyperframes check — 修复所有错误。
  3. npx hyperframes snapshot --at <t1>,<t2>,... 在每个图形的中间点,然后 查看 PNG 文件 — 检查面部/字幕重叠和文本裁剪。
  4. 渲染草稿:npx hyperframes render . -o renders/with-cards.mp4(渲染在普通 PC 上较慢;使用快照进行迭代,仅当帧看起来正确时才渲染)。
  5. 将批准的最终版本复制到 exports/<name>.mp4。

6. 后续操作(同一会话内)

  • 单个位置(PROMPT 12):"当我说 <短语> 时,显示 <内容>"。在转录中找到该短语,仅修改那一刻,保持其他所有内容完全相同,重新渲染到同一文件。
  • 音效:使用 mg-sound 技能。导出变体/透明:mg-export 技能。
  • 用简单语言进行微调(表面、颜色、字体、运动、时间、布局)→ 仅编辑该项,保持其他所有内容不变,再次渲染。

基础优先,然后一次一个位置。不要试图一次完成所有内容。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

notasimrazzaq/AI-Video-Editor

Render and export HyperFrames videos: frame rate, 4K, ProRes MOV, PNG sequence, smaller files (--crf), transparent overlays for Premiere/After Effects (PROMPT 14), plus quick fixes when something looks wrong (fonts, cropping, captions overlap, timing, huge files). Use when: the user asks to render, export, change resolution/fps, make it transparent, reduce size, or says something looks off.

notasimrazzaq/AI-Video-Editor

Make a motion-graphics video with no footage: text-only / script video, product launch video, SaaS promo from screenshots, a first test render, or the 10-moves demo (kit PROMPTS 02, 03, 08, 09, 10). Use when: the user gives a script, a product description, app screenshots or a brief and wants an animated video made from nothing.

notasimrazzaq/AI-Video-Editor

Check or repair the video-editing toolchain on this Windows PC (Node 22+, FFmpeg, Deepgram key, Chrome, HyperFrames skills). Use when: transcription or rendering fails, a new PC needs setup, .setup-ok is missing, or the user asks to update HyperFrames.

notasimrazzaq/AI-Video-Editor

Add sound effects to a motion-graphics video: the kit's clicks (pop, tick, counter, chime, snap, star, switch, fill, success) and the paper / stop-motion set (paper-flip, paper-drop, paper-rustle, tape-rip, marker-tick, marker-scribble, stamp, paper-slide, thump). PROMPT 13. Use when: the user asks for sound effects, SFX, clicks, ticks, dings, crisp sounds, page turns, paper sounds, or 'make it sound better'.

相关技能