[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77XTGB6X2EZ20K2T41E6Q3X":3,"skill-same:01M77XTGB6X2EZ20K2T41E6Q3X":56},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M77XTGB6X2EZ20K2T41E6Q3X","vlog-auto-edit",null,"AI Agent自动剪辑旅行Vlog的完整工作流。从原始素材到成品视频，系统级只需ffmpeg，其余在Python venv内完成。","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fv\u002Fvlog-auto-edit\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vlog-auto-edit\ndescription: AI Agent自动剪辑旅行Vlog的完整工作流。从原始素材到成品视频，系统级只需ffmpeg，其余在Python venv内完成。\nversion: 1.0.1\ntags: [video-editing, vlog, ffmpeg, whisper, automation]\nauthor: nyx研究所 (https:\u002F\u002Fgithub.com\u002Fznyupup)\nstatus: stable\n---\n\n# AI Agent 自动剪辑旅行 Vlog\n\n> 把一堆手机拍的旅行素材，用AI自动剪成一个完整vlog。\n> 最小依赖：ffmpeg + Python(whisper+Pillow) + 视觉API。系统级只装ffmpeg，其余pip在venv装。\n\n## 触发条件\n\n- 用户有一批旅行\u002F日常视频素材，想自动剪成vlog\n- 用户说\"帮我剪个视频\"、\"自动剪辑\"、\"vlog剪辑\"\n\n## 前置要求\n\n### 1. 系统工具\n\n| 工具 | 用途 | 安装 |\n|------|------|------|\n| ffmpeg | 视频裁剪\u002F编码\u002F拼接\u002F抽帧\u002F音量检测 | `brew install ffmpeg` (macOS) \u002F `apt install ffmpeg` (Linux) |\n| Python 3.9+ | 脚本胶水 | macOS\u002FLinux 系统自带 |\n\n### 2. Python依赖（先检测，已有则跳过）\n\n**先检测系统是否已安装所需包，不要无脑创建 venv：**\n\n```bash\n# 检测 whisper\npython3 -c \"import whisper; print('✅ whisper已安装:', whisper.__file__)\"\n\n# 检测 Pillow\npython3 -c \"from PIL import Image; print('✅ Pillow已安装')\"\n```\n\n**⚠ 重要：不要用 `2>\u002Fdev\u002Fnull` 吃掉错误！要看到实际报错才能判断是真没装还是PATH问题。**\n\n**仅在检测不通过时才安装：**\n\n```bash\n# 方案A: 直接装到用户环境（推荐）\npip install openai-whisper Pillow\n\n# 方案B: 如果用户环境有冲突，再用 venv\npython3 -m venv .venv && source .venv\u002Fbin\u002Factivate\npip install openai-whisper Pillow\n```\n\n**⚠ 不要每个项目都新建 venv 重装一遍！whisper模型文件1.4GB，pip install也要几分钟。**\n\n**标题卡方案自动选择：**\n```bash\nffmpeg -filters 2>&1 | grep drawtext\n# 有drawtext → 直接用ffmpeg，不需要Pillow\n# 没有 → 用Pillow生成透明PNG再overlay（macOS brew ffmpeg通常没编freetype）\n```\n\n**可选（参考分析阶段用）：**\n```bash\nwhich yt-dlp && echo \"✅ yt-dlp已安装\" || pip install yt-dlp\npython3 -c \"import scenedetect\" 2>\u002Fdev\u002Fnull && echo \"✅ scenedetect已安装\" || pip install scenedetect\n```\n\n### 3. 视觉理解模型（API）\n\n需要一个能理解图像内容的视觉模型API，用于分析素材画面。\n\n**要求：**\n- 支持 OpenAI Chat Completions 格式（messages + image_url）\n- 支持 base64 图片输入（本地素材抽帧后编码上传）\n- 中文理解能力（需要描述画面内容、标注镜头类型等）\n\n**推荐模型：**\n\n| 模型 | 费用 | 说明 |\n|------|------|------|\n| 智谱 GLM-4.6V-Flash | 免费 | 注册 https:\u002F\u002Fopen.bigmodel.cn 即用，中文理解好 |\n| GPT-4o | 付费 | 效果最好 |\n| Qwen-VL | 付费 | 阿里云，中文好 |\n\n**调用示例：**\n\n```python\nimport base64, json, urllib.request\n\nAPI_URL = 'YOUR_VISION_API_ENDPOINT'   # 替换为你的视觉模型端点\nAPI_KEY = 'YOUR_API_KEY'               # 替换为你的API Key\nMODEL = 'YOUR_MODEL_NAME'             # 替换为你的模型名\n\nwith open('frame.jpg', 'rb') as f:\n    img_b64 = base64.b64encode(f.read()).decode()\n\npayload = {\n    'model': MODEL,\n    'messages': [{'role': 'user', 'content': [\n        {'type': 'image_url', 'image_url': {'url': f'data:image\u002Fjpeg;base64,{img_b64}'}},\n        {'type': 'text', 'text': '简洁描述画面内容，标注：镜头类型(远\u002F全\u002F中\u002F近\u002F特写)、拍摄手法(固定\u002F手持\u002F移动)、画面氛围。格式：内容|类型|手法|氛围'}\n    ]}],\n    'max_tokens': 200\n}\n\nreq = urllib.request.Request(API_URL, json.dumps(payload).encode(),\n    {'Content-Type': 'application\u002Fjson', 'Authorization': f'Bearer {API_KEY}'})\nwith urllib.request.urlopen(req, timeout=30) as resp:\n    result = json.loads(resp.read())\n    print(result['choices'][0]['message']['content'])\n```\n\n**⚠ 视觉API调用注意事项：**\n- 抽帧尺寸：缩到 720p 即可（节省上传带宽和token）\n- 端点区分：有些平台视觉模型和文本模型端点不同，确认用对\n- 限流：高峰时段容易被限流，加 retry + sleep\n\n### 不需要的（踩过的坑）\n\n- ❌ 剪映\u002FCapCut — v10.4+ 项目文件加密，无法程序化操作\n- ❌ moviepy — ffmpeg命令行已够用，多一层抽象反而不灵活\n- ❌ capcut-cli (GitHub) — 基于明文JSON，对加密后的新版无效\n- ❌ ImageMagick — Pillow已够用，不需要再装一个图像工具\n\n## 工作流（7个阶段）\n\n### 阶段1: 素材盘点\n\n目标：了解你有什么素材。\n\n```bash\n# 批量获取素材信息\nfor f in footage\u002F*.{MOV,mp4,MP4}; do\n  echo \"=== $f ===\"\n  ffprobe -v quiet -print_format json -show_format -show_streams \"$f\" \\\n    | python3 -c \"import json,sys; d=json.load(sys.stdin); \\\n      s=d['streams'][0]; f=d['format']; \\\n      print(f\\\"  时长: {float(f['duration']):.1f}s\\\"); \\\n      print(f\\\"  分辨率: {s['width']}x{s['height']}\\\"); \\\n      print(f\\\"  编码: {s['codec_name']}\\\")\"\ndone\n```\n\n输出一份素材清单：数量、总时长、分辨率分布、拍摄时间范围。\n\n### 阶段2: 参考研究（可选但强烈建议）\n\n目标：建立\"好vlog长什么样\"的认知。不做这步直接剪，效果会很差。\n\n**步骤：**\n1. 找2-3个同类型优质vlog（B站\u002FYouTube）\n2. `yt-dlp` 下载720p视频 + 音频\n3. `whisper` 转录旁白（提取叙事结构）\n4. `scenedetect` 检测镜头切换（统计节奏）\n5. `ffmpeg` 抽关键帧 + 视觉API分析（理解画面构成）\n\n**已验证的规律：**\n\n- 镜头节奏: 平均3-4秒\u002F镜头是黄金节奏\n- 内容配比: 美食40-45% + 风景30% + 人物15% + 日常15%\n- 镜头类型: 近景\u002F中景为主(60-65%)，全景\u002F远景穿插(35-40%)\n- 叙事结构: 精彩片头 → 出发\u002F到达 → 按地点串联 → 情感升华收尾\n- 长短交替: 短镜头(\u003C2s)做蒙太奇，长镜头(>8s)做叙事\n\n**剪辑教程要点：**\n1. 找侧重点，不要流水账\n2. 三幕式结构: 25%悬念 + 50%发展 + 25%收尾\n3. 精彩放片头\n4. 情感占51%（Walter Murch六法则）\n\n### 阶段3: 素材三维分析\n\n目标：让AI理解每条素材的内容。每条素材做三维分析：\n\n**a) 音频分析 — Whisper转录**\n```bash\n# 提取音频（16kHz单声道WAV，whisper最佳输入）\nffmpeg -i footage\u002FINPUT.MOV -vn -acodec pcm_s16le -ar 16000 -ac 1 \u002Ftmp\u002Faudio.wav\n\n# Whisper转录（medium模型，中文最佳性价比）\npython3 -c \"\nimport whisper, json\nmodel = whisper.load_model('medium')\nresult = model.transcribe('\u002Ftmp\u002Faudio.wav', language='zh')\nfor seg in result['segments']:\n    print(f\\\"[{seg['start']:.1f}-{seg['end']:.1f}] {seg['text']}\\\")\n\"\n```\n\n**b) 音量检测 — ffmpeg**\n```bash\nffmpeg -i footage\u002FINPUT.MOV -af volumedetect -f null \u002Fdev\u002Fnull 2>&1 | grep volume\n# mean_volume: 平均音量(dB)  max_volume: 峰值音量(dB)\n# mean \u003C -40dB 基本无声  mean > -20dB 有明显声音\u002F语音\n```\n\n**c) 视觉分析 — ffmpeg抽帧 + 视觉理解模型**\n```bash\n# 抽帧策略（按时长分段）\n# ≤20s → 3帧(首\u002F中\u002F尾)\n# 20-60s → 5帧\n# >60s → 每15s一帧\n\n# 抽首\u002F中\u002F尾三帧示例（缩到720p节省带宽）\nffmpeg -i footage\u002FINPUT.MOV -vf \"select=eq(n\\,0),scale=1280:-1\" -frames:v 1 -q:v 2 frame_start.jpg\nffmpeg -i footage\u002FINPUT.MOV -vf \"select=eq(n\\,MIDDLE),scale=1280:-1\" -frames:v 1 -q:v 2 frame_mid.jpg\nffmpeg -i footage\u002FINPUT.MOV -vf \"reverse,scale=1280:-1\" -frames:v 1 -q:v 2 frame_end.jpg\n```\n\n**d) 输出格式**（每条素材一个JSON）\n```json\n{\n  \"filename\": \"clip_001.MOV\",\n  \"duration\": 15.3,\n  \"resolution\": \"1920x1080\",\n  \"visual\": [\n    {\"time\": \"0:00\", \"description\": \"...\", \"shot_type\": \"近景\", \"camera\": \"手持\", \"mood\": \"温馨\"}\n  ],\n  \"audio\": {\n    \"has_speech\": true,\n    \"mean_volume_db\": -20.5,\n    \"max_volume_db\": -3.2,\n    \"transcript\": [{\"start\": 0.5, \"end\": 2.3, \"text\": \"...\"}]\n  }\n}\n```\n\n### 阶段3.5: 素材精修预处理\n\n目标：在给LLM之前，自动标注每条素材的\"推荐有效区间\"，让LLM专注叙事编排。\n\n**为什么需要这步：**\n原始手机素材普遍存在：开头录制口令、同一句话重复多遍、前1-2s举手机晃动、说完话后拖很长的无意义画面。如果把这些原始数据直接给LLM，LLM输出的plan还需要逐条修补。\n\n**预处理做四件事：**\n\n#### a) 录制口令检测\n\n```python\nRECORDING_CUES = [\n    \"开始了\", \"好了开始\", \"开始录了\", \"好了 开始\",\n    \"走了\", \"好了\", \"来了\",  # 仅在前3s内出现时算口令\n]\n\ndef detect_cues(transcript_segments, duration):\n    \"\"\"检测录制口令，返回skip zones\"\"\"\n    skip_zones = []\n    for seg in transcript_segments:\n        text = seg['text'].strip()\n        if seg['start'] \u003C 3.0 and any(text.startswith(c) or text == c for c in RECORDING_CUES):\n            skip_zones.append({\n                'type': 'recording_cue',\n                'range': [seg['start'], seg['end']],\n                'text': text,\n                'action': 'skip'\n            })\n        if seg['end'] > duration - 3.0 and text in [\"好了\", \"走了\", \"好了 走\"]:\n            skip_zones.append({\n                'type': 'recording_cue',\n                'range': [seg['start'], seg['end']],\n                'text': text,\n                'action': 'skip'\n            })\n    return skip_zones\n```\n\n#### b) 重复语音检测\n\n```python\nfrom difflib import SequenceMatcher\n\ndef detect_repeats(segments, threshold=0.6):\n    \"\"\"检测重复语音，标记建议跳过的重复段\"\"\"\n    repeats = []\n    for i, a in enumerate(segments):\n        for j, b in enumerate(segments):\n            if j \u003C= i: continue\n            ratio = SequenceMatcher(None, a['text'], b['text']).ratio()\n            if ratio >= threshold and len(a['text']) > 4:\n                skip = a if len(a['text']) \u003C= len(b['text']) else b\n                repeats.append({\n                    'type': 'repeat',\n                    'range': [skip['start'], skip['end']],\n                    'text': skip['text'],\n                    'kept': b['text'] if skip == a else a['text'],\n                    'action': 'suggest_skip'\n                })\n    return repeats\n```\n\n#### c) 起手晃动 \u002F 结尾拖拽检测\n\n```python\ndef detect_trim_points(segments, duration, mean_volume_db):\n    \"\"\"基于语音+音量推荐起止点\"\"\"\n    suggested_start = 0.0\n    suggested_end = duration\n\n    if segments:\n        first_speech = segments[0]['start']\n        last_speech_end = segments[-1]['end']\n        if first_speech > 2.0:\n            suggested_start = max(0, first_speech - 0.5)\n        if duration - last_speech_end > 3.0:\n            suggested_end = last_speech_end + 1.5\n    else:\n        if duration > 5.0:\n            suggested_start = 1.0\n\n    return suggested_start, suggested_end\n```\n\n#### d) 纯画面时长限制\n\n| 模式     | 纯画面上限 | 口令处理 | 重复处理       | 起手晃动 |\n|----------|-----------|---------|---------------|---------| \n| strict   | 8-10s     | 全部去除 | 只留1遍        | 去1.5s  |\n| normal   | 12-15s    | 去除明确口令 | 去明显重复   | 去1.0s  |\n| loose    | 20-25s    | 仅去\"开始了\" | 保留大部分    | 去0.5s  |\n\n#### e) 输出格式\n\n预处理结果追加到素材分析数据里：\n\n```\n━━━ clip_012.mp4 | 时长25.8s | 1920x1080 ━━━\n  【画面】...\n  【语音】...\n  【精修建议】模式: normal\n    原始区间: [0.0 - 25.8]\n    推荐区间: [2.4 - 25.8]\n    ⊘ [0.0-2.4] 跳过: 录制口令 \"开始了\"\n    有效语音: [2.62-25.8]\n```\n\n**⚠ 重要原则：预处理只做标注和建议，不做硬裁剪。LLM保留最终决定权。**\n\n### 阶段4: LLM叙事编排\n\n目标：把预处理后的素材数据交给LLM，生成剪辑方案。\n\n输入：素材分析 + 精修建议(推荐区间) + 参考研究结论\n输出：剪辑方案JSON（结构见下方schema）\n\n#### edit_plan JSON Schema\n\n```json\n{\n  \"title\": \"视频标题\",\n  \"structure\": [\n    {\n      \"section\": \"段落名 — 副标题\",\n      \"description\": \"本段落内容概述\",\n      \"clips\": [\n        {\n          \"file\": \"素材文件名.mp4\",\n          \"start\": 0.0,\n          \"end\": 12.0,\n          \"note\": \"画面内容简述\",\n          \"subtitle\": \"保留的语音文字\"\n        }\n      ]\n    }\n  ],\n  \"bgm_suggestion\": \"BGM风格建议（含genre\u002Fmood\u002Finstruments\u002Ftempo\u002Fbpm）\",\n  \"editing_notes\": \"整体剪辑说明\"\n}\n```\n\n**约束：**\n- 同一素材可出现在多个clip中（不同时间区间）\n- start\u002Fend 不能截断语音中间（阶段4.5会校验）\n- 第一个section建议是\"开篇\"类引入段落\n- 最后一个section建议是\"收尾\"类段落\n\n详细prompt模板见 `templates\u002Fedit_plan_prompt.md`。\n\n### 阶段4+ : 分镜可视化 + Dashboard（浏览器预览）\n\n目标：把LLM输出的剪辑方案做成图文并茂的网页，方便用户直观Review。\n\n**Dashboard 包含两个面板：**\n\n1. **📋 素材总览** — 素材缩略图网格 + 时长\u002F语音\u002F音量标注 + 筛选(全部\u002F已用\u002F未用\u002F含语音) + 点击查看详情\n2. **✅ 成品质量检查** — 成品视频定时抽帧(每30秒) + 段落定位 + 点击放大\n\n**使用 `gen_dashboard.py` 脚本：**\n\n```bash\n# 最小用法（只生成素材面板）\npython3 scripts\u002Fgen_dashboard.py \\\n  --analysis clip_analysis.json \\\n  --plan edit_plan.json \\\n  --footage footage\u002F \\\n  --out output\u002F\n\n# 完整两面板（含成品QC帧）\npython3 scripts\u002Fgen_dashboard.py \\\n  --analysis clip_analysis.json \\\n  --plan edit_plan.json \\\n  --footage footage\u002F \\\n  --video output\u002Ffinal.mp4 \\\n  --out output\u002F\n```\n\n**支持两种分析数据格式（自动检测）：**\n- 标准格式 `clip_analysis.json`: `{filename, duration, visual: [...], audio: {...}}`\n- 紧凑格式 `clips_compact.json`: `{file, dur, visual: \"string\", speech: [...]}`\n\n用户确认分镜方案后，再进入渲染阶段。\n\n### 阶段4.5: 语音截断校验\n\n目标：自动校验LLM输出的plan，确保没有把任何语音从中间截断。\n\n```python\ndef validate_speech(plan_clips, speech_data):\n    \"\"\"检查每个clip的start\u002Fend是否截断了语音\"\"\"\n    issues = []\n    for clip in plan_clips:\n        f = clip['file']\n        cs, ce = clip['start'], clip['end']\n        if f not in speech_data: continue\n        for ss, se, txt in speech_data[f]:\n            if ss \u003C ce and se > cs:  # 语音与clip有交集\n                if ss \u003C cs - 0.3:    # 语音开始在clip之前\n                    issues.append(f\"截断开头: {f} clip从{cs}开始，但语音\\\"{txt}\\\"从{ss}开始\")\n                if se > ce + 0.5:    # 语音结束在clip之后\n                    issues.append(f\"截断结尾: {f} clip在{ce}结束，但语音\\\"{txt}\\\"到{se}结束\")\n    return issues\n```\n\n**校验不通过时：自动修复start\u002Fend，不需要回LLM重新编排。**\n\n#### 自动修复逻辑\n\n```python\ndef fix_speech_cuts(plan, speech_data, margin=0.3):\n    \"\"\"\n    自动修复语音截断问题。直接修改plan中的start\u002Fend。\n    \n    参数:\n        plan: edit_plan dict (会被原地修改)\n        speech_data: dict, {filename: [(start, end, text), ...]}\n        margin: float, 语音边界容差(秒)\n    \n    返回:\n        fixes: list of str, 修复日志\n    \"\"\"\n    fixes = []\n    \n    for sec in plan[\"structure\"]:\n        for clip in sec[\"clips\"]:\n            f = clip[\"file\"]\n            cs = float(clip[\"start\"])\n            ce = float(clip[\"end\"])\n            \n            if f not in speech_data:\n                continue\n            \n            for ss, se, txt in speech_data[f]:\n                if ss >= ce or se \u003C= cs:\n                    continue\n                \n                # 开头截断：clip.start > speech.start + margin\n                if ss \u003C cs - margin and se > cs:\n                    old_start = cs\n                    new_start = max(0, ss - 0.1)\n                    clip[\"start\"] = round(new_start, 1)\n                    fixes.append(\n                        f\"  修复开头: {f} [{old_start}→{new_start}] \"\n                        f\"语音\\\"{txt[:20]}\\\"从{ss}s开始\"\n                    )\n                    cs = new_start\n                \n                # 结尾截断：clip.end \u003C speech.end - margin\n                if se > ce + margin and ss \u003C ce:\n                    old_end = ce\n                    new_end = se + 0.2\n                    clip[\"end\"] = round(new_end, 1)\n                    fixes.append(\n                        f\"  修复结尾: {f} [{old_end}→{new_end}] \"\n                        f\"语音\\\"{txt[:20]}\\\"到{se}s结束\"\n                    )\n                    ce = new_end\n    \n    return fixes\n```\n\n**修复策略：**\n\n| 截断类型 | 检测条件 | 修复方式 |\n|----------|---------|---------| \n| 开头截断 | clip.start > speech.start + margin | clip.start → speech.start - 0.1s |\n| 结尾截断 | clip.end \u003C speech.end - margin | clip.end → speech.end + 0.2s |\n\n**边界容差 (margin=0.3s)：** Whisper时间戳有±0.2-0.3s误差。修复后必须跑二次校验。\n\n### 阶段5: ffmpeg自动执行\n\n目标：把剪辑方案转成ffmpeg命令并执行。\n\n#### 渲染策略：逐片段裁剪 → 拼接\n\n```bash\n# 单个片段裁剪+编码\nffmpeg -y -ss 00:00:02.400 -i footage\u002FINPUT.mp4 -t 00:00:23.400 \\\n  -vf \"scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)\u002F2:(oh-ih)\u002F2,setsar=1\" \\\n  -r 30 -c:v libx264 -preset medium -crf 18 -pix_fmt yuv420p \\\n  -c:a aac -b:a 128k -ar 44100 -ac 2 \\\n  -movflags +faststart segments\u002Fseg_001.mp4\n\n# 拼接成品\nffmpeg -y -f concat -safe 0 -i concat.txt -c copy -movflags +faststart output.mp4\n```\n\n#### 片头高光蒙太奇\n\n从各段落选最有视觉冲击力的镜头，快切拼接放在视频最前面。\n\n**选片原则：**\n- 每个主要段落选1个精彩画面\n- 每个镜头0.5-1秒，快切节奏\n- 总共6-10个镜头，总时长5-8秒\n- 排除竖屏素材\n- 不加音频（-an），最终由BGM覆盖\n\n```python\nimport subprocess, os\n\nhighlights = [\n    ('footage\u002Fclip_a.mp4',   1.5, 2.2),\n    ('footage\u002Fclip_b.mp4',   2.0, 2.7),\n    # ... 每个0.7秒左右\n]\n\nfor i, (f, start, end) in enumerate(highlights, 1):\n    dur = end - start\n    cmd = f'ffmpeg -y -ss {start} -i \"{f}\" -t {dur} ' \\\n          f'-vf \"scale=1920:1080:force_original_aspect_ratio=decrease,' \\\n          f'pad=1920:1080:(ow-iw)\u002F2:(oh-ih)\u002F2\" ' \\\n          f'-c:v libx264 -preset ultrafast -crf 23 -pix_fmt yuv420p ' \\\n          f'-an highlights\u002Fhl_{i}.mp4'\n    subprocess.run(cmd, shell=True)\n\n# concat\nwith open('highlights\u002Fconcat.txt', 'w') as f:\n    for i in range(1, len(highlights)+1):\n        f.write(f\"file 'hl_{i}.mp4'\\n\")\n\nsubprocess.run('ffmpeg -y -f concat -safe 0 -i highlights\u002Fconcat.txt '\n               '-c copy highlights\u002Fmontage.mp4', shell=True)\n```\n\n#### 段落标题叠加\n\n用 Pillow 生成透明RGBA的PNG，ffmpeg overlay到视频画面上。**不要用黑底标题卡**。\n\n```python\nfrom PIL import Image, ImageDraw, ImageFont, ImageFilter\n\nW, H = 1920, 1080\ntitle = \"段落标题\"\n\nimg = Image.new(\"RGBA\", (W, H), (0, 0, 0, 0))\ndraw = ImageDraw.Draw(img)\n\n# 字体：macOS用冬青黑体，Linux用Noto Sans CJK\n# font = ImageFont.truetype(\"\u002FSystem\u002FLibrary\u002FFonts\u002FHiragino Sans GB.ttc\", 60)  # macOS\n# font = ImageFont.truetype(\"\u002Fusr\u002Fshare\u002Ffonts\u002Fopentype\u002Fnoto\u002FNotoSansCJK-Regular.ttc\", 60)  # Linux\nfont = ImageFont.truetype(\"YOUR_FONT_PATH\", 60)\n\nbbox = draw.textbbox((0, 0), title, font=font)\ntw, th = bbox[2] - bbox[0], bbox[3] - bbox[1]\nx, y = (W - tw) \u002F\u002F 2, (H - th) \u002F\u002F 2\n\n# 柔和阴影\nshadow = Image.new(\"RGBA\", (W, H), (0, 0, 0, 0))\nsd = ImageDraw.Draw(shadow)\nsd.text((x+2, y+2), title, fill=(0, 0, 0, 180), font=font)\nshadow = shadow.filter(ImageFilter.GaussianBlur(radius=6))\n\nimg = Image.alpha_composite(img, shadow)\ndraw = ImageDraw.Draw(img)\ndraw.text((x, y), title, fill=(255, 255, 255, 240), font=font)\nimg.save(\"title_overlay.png\")\n```\n\n**overlay到视频上：**\n\n```bash\n# 标题显示前3秒\nffmpeg -y -i section.mp4 -i title.png \\\n  -filter_complex \"overlay=0:0:enable='between(t,0,3)'\" \\\n  -c:v libx264 -preset medium -crf 18 -pix_fmt yuv420p \\\n  -c:a aac -b:a 128k -movflags +faststart \\\n  section_titled.mp4\n```\n\n**⚠ overlay关键Pitfall：**\n- ❌ 不要加 `shortest=1` — PNG只有1帧，会导致视频流立刻截断\n- ✅ 直接用 `overlay=0:0:enable='between(t,0,3)'` 最简单可靠\n- ✅ 先用短片段(5-8s)验证overlay效果\n\n#### 段落拼接（推荐方案）\n\n**✅ 正确方案：逐段编码 → concat copy**\n\n```bash\necho \"file 'final_sec_01.mp4'\" > concat.txt\necho \"file 'final_sec_02.mp4'\" >> concat.txt\nffmpeg -y -f concat -safe 0 -i concat.txt -c copy -movflags +faststart output.mp4\n```\n\n**❌ 不要用xfade链式合并：** 链式xfade会导致帧数累积丢失，后半段全黑。\n\n**段落间过渡**：段落内硬切即可。如需渐变，每段首尾加fade比xfade更可靠。\n\n#### BGM生成与混音（可选）\n\nBGM 可以手动添加，也可以用 AI 音乐生成工具（如 MiniMax music、Suno 等）。\n\n##### a) AI 生成 BGM\n\n**风格映射参考（vlog常用）：**\n\n| Vlog 风格 | genre | mood | instruments | tempo |\n|-----------|-------|------|-------------|-------|\n| 轻松日常 | indie pop | cheerful, carefree | ukulele, acoustic guitar | moderate |\n| 文艺治愈 | folk, acoustic | warm, gentle | acoustic guitar, piano, strings | slow |\n| 美食探店 | jazz, bossa nova | cozy, playful | piano, upright bass | moderate |\n| 冰雪\u002F冬季 | cinematic, ambient | serene, majestic | piano, celesta, strings | slow |\n| 热带\u002F海岛 | tropical house | sunny, relaxed | steel drums, marimba | upbeat |\n| 城市探索 | lo-fi hip hop | chill, urban | keys, vinyl crackle | moderate |\n\n##### b) 混合到视频\n\n```bash\n# BGM 音量 10-15%（有语音的vlog要压低BGM）\nffmpeg -y -i video_no_bgm.mp4 -i bgm.m4a \\\n  -filter_complex \"[0:a]volume=1.0[orig];[1:a]volume=0.12[bgm];[orig][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]\" \\\n  -map 0:v -map \"[aout]\" -c:v copy -c:a aac -b:a 192k \\\n  -movflags +faststart output\u002Ffinal.mp4\n```\n\n**BGM 音量建议：**\n- 有大量语音\u002F旁白 → 8-12%\n- 语音较少，空镜为主 → 15-25%\n- 纯空镜蒙太奇段落 → 30-40%\n\n## Pitfalls\n\n1. **剪映不可用** — v10.4+ 对 draft_info.json 加密，不要浪费时间\n2. **视觉API端点要区分** — 有些平台视觉模型和文本模型端点不同，确认用对\n3. **Whisper模型选择** — base中文太差，large太慢，medium是性价比最优\n4. **不要跳过参考研究** — 没有\"好vlog标准\"的AI会剪出流水账\n5. **ffmpeg编码兼容** — 拼接时注意素材编码一致性，先逐片段统一编码再concat\n6. **视觉API限流** — 高峰时段容易限流，加retry和sleep\n7. **预处理在LLM之前做** — 口令\u002F重复\u002F晃动检测在阶段3.5处理\n8. **预处理是建议不是硬裁剪** — LLM保留覆盖权，某些口令可能有叙事价值\n9. **语音截断必须自动校验** — LLM输出的plan可能在语音中间切断\n10. **Whisper幻觉** — 纯音乐\u002F环境音段落whisper会编造文字，需用音量阈值(-40dB)过滤\n11. **竖屏混横屏** — 素材分析阶段就要检测，竖屏(9:16)混在横屏里很突兀，建议去掉\n12. **overlay不要加shortest=1** — PNG只有1帧，shortest=1会让视频流截断\n13. **标题卡风格** — 白字+柔和阴影叠在视频画面上，**不要黑底标题卡**\n14. **ffmpeg drawtext不可用** — macOS Homebrew ffmpeg默认没编译freetype，用Pillow生成PNG overlay代替\n15. **HEVC警告可忽略** — \"Error constructing the frame RPS\" 是HEVC解码警告，不影响输出\n16. **Non-monotonic DTS** — concat拼接时常见的时间戳警告，播放不受影响\n17. **空镜不宜过长** — 无语音的纯画面>6s偏长，建议压缩到5-8s\n18. **xfade链式合并不可靠** — 链式xfade会导致帧数累积丢失，后半段全黑，用concat代替\n19. **先用短片段验证** — 每次改渲染方案都先用5-8秒短片段验证效果\n20. **渲染完必须验证帧数** — `ffmpeg -i output.mp4 -f null -` 检查实际frame数\n21. **BGM别太大声** — 有语音段BGM控制在8-12%，先试听再定\n22. **多段BGM衔接** — 保持相近的key和tempo(bpm差值\u003C20)\n23. **混音后必须试听** — 不同素材原始音量差异大\n24. **不要重复安装依赖** — whisper\u002FPillow等先检测再装，不要每次都新建venv\n\n## 端到端示例\n\n### 项目文件结构\n\n```\nmy-vlog-project\u002F\n├── footage\u002F                    # 原始素材（用户提供）\n│   ├── clip_001.MOV\n│   └── ...\n│\n├── analysis\u002F                   # 阶段3输出\n│   └── clip_analysis.json\n│\n├── edit_plan.json              # 阶段4输出\n├── edit_plan_fixed.json        # 阶段4.5输出\n│\n├── output\u002F\n│   ├── dashboard.html          # Dashboard网页\n│   ├── thumbnails\u002F             # 素材缩略图\n│   ├── qc_frames\u002F              # 成品QC帧\n│   ├── segments\u002F               # 裁剪后的片段\n│   ├── highlights\u002F             # 片头高光蒙太奇\n│   ├── titles\u002F                 # 段落标题PNG\n│   ├── sections\u002F               # 带标题的段落视频\n│   ├── bgm\u002F                    # BGM文件\n│   ├── video_no_bgm.mp4        # 无BGM的完整视频\n│   └── final.mp4               # 🎬 成品视频\n│\n└── reference\u002F                  # 阶段2输出（可选）\n```\n\n### 中间产物示例\n\n见 `examples\u002F` 目录下的示例文件。\n\n### 执行流程速查\n\n```\n素材文件夹 footage\u002F\n     │\n     ▼\n 阶段1: 素材盘点 → ffprobe批量扫描 → 清单\n     │\n     ▼\n 阶段2: 参考研究 → 下载优质vlog → 分析节奏（可选）\n     │\n     ▼\n 阶段3: 素材三维分析 → whisper+音量+视觉 → clip_analysis.json\n     │\n     ▼\n 阶段3.5: 精修预处理 → 口令\u002F重复\u002F晃动\u002F纯画面标注\n     │\n     ▼\n 阶段4: LLM叙事编排 → edit_plan.json\n     │\n     ▼\n 阶段4+: Dashboard可视化 → 浏览器预览确认\n     │\n     ▼\n 阶段4.5: 语音截断校验 → 自动修复\n     │\n     ▼\n 阶段5: ffmpeg渲染 → 裁剪→标题→拼接→BGM → final.mp4 🎬\n```\n\n## 验证\n\n- [ ] 素材盘点完成，生成清单\n- [ ] 参考研究完成，提取规律\n- [ ] 素材三维分析完成（视觉+音频+音量）\n- [ ] 素材精修预处理完成\n- [ ] LLM剪辑方案生成\n- [ ] 语音截断校验通过\n- [ ] ffmpeg执行成功，输出成品视频\n- [ ] 成品视频质量人工确认\n\n---\n\n**Author:** nyx研究所 · [GitHub](https:\u002F\u002Fgithub.com\u002Fznyupup) · [B站](https:\u002F\u002Fspace.bilibili.com\u002F4330525) · 小红书 @nyx研究所\n**License:** MIT\n","# AI Agent 自动剪辑旅行 Vlog\n\n> 把一堆手机拍的旅行素材，用AI自动剪成一个完整vlog。\n> 最小依赖：ffmpeg + Python(whisper+Pillow) + 视觉API。系统级只装ffmpeg，其余pip在venv装。\n\n## 触发条件\n\n- 用户有一批旅行\u002F日常视频素材，想自动剪成vlog\n- 用户说\"帮我剪个视频\"、\"自动剪辑\"、\"vlog剪辑\"\n\n## 前置要求\n\n### 1. 系统工具\n\n| 工具 | 用途 | 安装 |\n|------|------|------|\n| ffmpeg | 视频裁剪\u002F编码\u002F拼接\u002F抽帧\u002F音量检测 | `brew install ffmpeg` (macOS) \u002F `apt install ffmpeg` (Linux) |\n| Python 3.9+ | 脚本胶水 | macOS\u002FLinux 系统自带 |\n\n### 2. Python依赖（先检测，已有则跳过）\n\n**先检测系统是否已安装所需包，不要无脑创建 venv：**\n\n```bash\n# 检测 whisper\npython3 -c \"import whisper; print('✅ whisper已安装:', whisper.__file__)\"\n\n# 检测 Pillow\npython3 -c \"from PIL import Image; print('✅ Pillow已安装')\"\n```\n\n**⚠ 重要：不要用 `2>\u002Fdev\u002Fnull` 吃掉错误！要看到实际报错才能判断是真没装还是PATH问题。**\n\n**仅在检测不通过时才安装：**\n\n```bash\n# 方案A: 直接装到用户环境（推荐）\npip install openai-whisper Pillow\n\n# 方案B: 如果用户环境有冲突，再用 venv\npython3 -m venv .venv && source .venv\u002Fbin\u002Factivate\npip install openai-whisper Pillow\n```\n\n**⚠ 不要每个项目都新建 venv 重装一遍！whisper模型文件1.4GB，pip install也要几分钟。**\n\n**标题卡方案自动选择：**\n```bash\nffmpeg -filters 2>&1 | grep drawtext\n# 有drawtext → 直接用ffmpeg，不需要Pillow\n# 没有 → 用Pillow生成透明PNG再overlay（macOS brew ffmpeg通常没编freetype）\n```\n\n**可选（参考分析阶段用）：**\n```bash\nwhich yt-dlp && echo \"✅ yt-dlp已安装\" || pip install yt-dlp\npython3 -c \"import scenedetect\" 2>\u002Fdev\u002Fnull && echo \"✅ scenedetect已安装\" || pip install scenedetect\n```\n\n### 3. 视觉理解模型（API）\n\n需要一个能理解图像内容的视觉模型API，用于分析素材画面。\n\n**要求：**\n- 支持 OpenAI Chat Completions 格式（messages + image_url）\n- 支持 base64 图片输入（本地素材抽帧后编码上传）\n- 中文理解能力（需要描述画面内容、标注镜头类型等）\n\n**推荐模型：**\n\n| 模型 | 费用 | 说明 |\n|------|------|------|\n| 智谱 GLM-4.6V-Flash | 免费 | 注册 https:\u002F\u002Fopen.bigmodel.cn 即用，中文理解好 |\n| GPT-4o | 付费 | 效果最好 |\n| Qwen-VL | 付费 | 阿里云，中文好 |\n\n**调用示例：**\n\n```python\nimport base64, json, urllib.request\n\nAPI_URL = 'YOUR_VISION_API_ENDPOINT'   # 替换为你的视觉模型端点\nAPI_KEY = 'YOUR_API_KEY'               # 替换为你的API Key\nMODEL = 'YOUR_MODEL_NAME'             # 替换为你的模型名\n\nwith open('frame.jpg', 'rb') as f:\n    img_b64 = base64.b64encode(f.read()).decode()\n\npayload = {\n    'model': MODEL,\n    'messages': [{'role': 'user', 'content': [\n        {'type': 'image_url', 'image_url': {'url': f'data:image\u002Fjpeg;base64,{img_b64}'}},\n        {'type': 'text', 'text': '简洁描述画面内容，标注：镜头类型(远\u002F全\u002F中\u002F近\u002F特写)、拍摄手法(固定\u002F手持\u002F移动)、画面氛围。格式：内容|类型|手法|氛围'}\n    ]}],\n    'max_tokens': 200\n}\n\nreq = urllib.request.Request(API_URL, json.dumps(payload).encode(),\n    {'Content-Type': 'application\u002Fjson', 'Authorization': f'Bearer {API_KEY}'})\nwith urllib.request.urlopen(req, timeout=30) as resp:\n    result = json.loads(resp.read())\n    print(result['choices'][0]['message']['content'])\n```\n\n**⚠ 视觉API调用注意事项：**\n- 抽帧尺寸：缩到 720p 即可（节省上传带宽和token）\n- 端点区分：有些平台视觉模型和文本模型端点不同，确认用对\n- 限流：高峰时段容易被限流，加 retry + sleep\n\n### 不需要的（踩过的坑）\n\n- ❌ 剪映\u002FCapCut — v10.4+ 项目文件加密，无法程序化操作\n- ❌ moviepy — ffmpeg命令行已够用，多一层抽象反而不灵活\n- ❌ capcut-cli (GitHub) — 基于明文JSON，对加密后的新版无效\n- ❌ ImageMagick — Pillow已够用，不需要再装一个图像工具\n\n## 工作流（7个阶段）\n\n### 阶段1: 素材盘点\n\n目标：了解你有什么素材。\n\n```bash\n# 批量获取素材信息\nfor f in footage\u002F*.{MOV,mp4,MP4}; do\n  echo \"=== $f ===\"\n  ffprobe -v quiet -print_format json -show_format -show_streams \"$f\" \\\n    | python3 -c \"import json,sys; d=json.load(sys.stdin); \\\n      s=d['streams'][0]; f=d['format']; \\\n      print(f\\\"  时长: {float(f['duration']):.1f}s\\\"); \\\n      print(f\\\"  分辨率: {s['width']}x{s['height']}\\\"); \\\n      print(f\\\"  编码: {s['codec_name']}\\\")\"\ndone\n```\n\n输出一份素材清单：数量、总时长、分辨率分布、拍摄时间范围。\n\n### 阶段2: 参考研究（可选但强烈建议）\n\n目标：建立\"好vlog长什么样\"的认知。不做这步直接剪，效果会很差。\n\n**步骤：**\n1. 找2-3个同类型优质vlog（B站\u002FYouTube）\n2. `yt-dlp` 下载720p视频 + 音频\n3. `whisper` 转录旁白（提取叙事结构）\n4. `scenedetect` 检测镜头切换（统计节奏）\n5. `ffmpeg` 抽关键帧 + 视觉API分析（理解画面构成）\n\n**已验证的规律：**\n\n- 镜头节奏: 平均3-4秒\u002F镜头是黄金节奏\n- 内容配比: 美食40-45% + 风景30% + 人物15% + 日常15%\n- 镜头类型: 近景\u002F中景为主(60-65%)，全景\u002F远景穿插(35-40%)\n- 叙事结构: 精彩片头 → 出发\u002F到达 → 按地点串联 → 情感升华收尾\n- 长短交替: 短镜头(\u003C2s)做蒙太奇，长镜头(>8s)做叙事\n\n**剪辑教程要点：**\n1. 找侧重点，不要流水账\n2. 三幕式结构: 25%悬念 + 50%发展 + 25%收尾\n3. 精彩放片头\n4. 情感占51%（Walter Murch六法则）\n\n### 阶段3: 素材三维分析\n\n目标：让AI理解每条素材的内容。每条素材做三维分析：\n\n**a) 音频分析 — Whisper转录**\n```bash\n# 提取音频（16kHz单声道WAV，whisper最佳输入）\nffmpeg -i footage\u002FINPUT.MOV -vn -acodec pcm_s16le -ar 16000 -ac 1 \u002Ftmp\u002Faudio.wav\n\n# Whisper转录（medium模型，中文最佳性价比）\npython3 -c \"\nimport whisper, json\nmodel = whisper.load_model('medium')\nresult = model.transcribe('\u002Ftmp\u002Faudio.wav', language='zh')\nfor seg in result['segments']:\n    print(f\\\"[{seg['start']:.1f}-{seg['end']:.1f}] {seg['text']}\\\")\n\"\n```\n\n**b) 音量检测 — ffmpeg**\n```bash\nffmpeg -i footage\u002FINPUT.MOV -af volumedetect -f null \u002Fdev\u002Fnull 2>&1 | grep volume\n# mean_volume: 平均音量(dB)  max_volume: 峰值音量(dB)\n# mean \u003C -40dB 基本无声  mean > -20dB 有明显声音\u002F语音\n```\n\n**c) 视觉分析 — ffmpeg抽帧 + 视觉理解模型**\n```bash\n# 抽帧策略（按时长分段）\n# ≤20s → 3帧(首\u002F中\u002F尾)\n# 20-60s → 5帧\n# >60s → 每15s一帧\n\n# 抽首\u002F中\u002F尾三帧示例（缩到720p节省带宽）\nffmpeg -i footage\u002FINPUT.MOV -vf \"select=eq(n\\,0),scale=1280:-1\" -frames:v 1 -q:v 2 frame_start.jpg\nffmpeg -i footage\u002FINPUT.MOV -vf \"select=eq(n\\,MIDDLE),scale=1280:-1\" -frames:v 1 -q:v 2 frame_mid.jpg\nffmpeg -i footage\u002FINPUT.MOV -vf \"reverse,scale=1280:-1\" -frames:v 1 -q:v 2 frame_end.jpg\n```\n\n**d) 输出格式**（每条素材一个JSON）\n```json\n{\n  \"filename\": \"clip_001.MOV\",\n  \"duration\": 15.3,\n  \"resolution\": \"1920x1080\",\n  \"visual\": [\n    {\"time\": \"0:00\", \"description\": \"...\", \"shot_type\": \"近景\", \"camera\": \"手持\", \"mood\": \"温馨\"}\n  ],\n  \"audio\": {\n    \"has_speech\": true,\n    \"mean_volume_db\": -20.5,\n    \"max_volume_db\": -3.2,\n    \"transcript\": [{\"start\": 0.5, \"end\": 2.3, \"text\": \"...\"}]\n  }\n}\n```\n\n### 阶段3.5: 素材精修预处理\n\n目标：在给LLM之前，自动标注每条素材的\"推荐有效区间\"，让LLM专注叙事编排。\n\n**为什么需要这步：**\n原始手机素材普遍存在：开头录制口令、同一句话重复多遍、前1-2s举手机晃动、说完话后拖很长的无意义画面。如果把这些原始数据直接给LLM，LLM输出的plan还需要逐条修补。\n\n**预处理做四件事：**\n\n#### a) 录制口令检测\n\n```python\nRECORDING_CUES = [\n    \"开始了\", \"好了开始\", \"开始录了\", \"好了 开始\",\n    \"走了\", \"好了\", \"来了\",  # 仅在前3s内出现时算口令\n]\n\ndef detect_cues(transcript_segments, duration):\n    \"\"\"检测录制口令，返回skip zones\"\"\"\n    skip_zones = []\n    for seg in transcript_segments:\n        text = seg['text'].strip()\n        if seg['start'] \u003C 3.0 and any(text.startswith(c) or text == c for c in RECORDING_CUES):\n            skip_zones.append({\n                'type': 'recording_cue',\n                'range': [seg['start'], seg['end']],\n                'text': text,\n                'action': 'skip'\n            })\n        if seg['end'] > duration - 3.0 and text in [\"好了\", \"走了\", \"好了 走\"]:\n            skip_zones.append({\n                'type': 'recording_cue',\n                'range': [seg['start'], seg['end']],\n                'text': text,\n                'action': 'skip'\n            })\n    return skip_zones\n```\n\n#### b) 重复语音检测\n\n```python\nfrom difflib import SequenceMatcher\n\ndef detect_repeats(segments, threshold=0.6):\n    \"\"\"检测重复语音，标记建议跳过的重复段\"\"\"\n    repeats = []\n    for i, a in enumerate(segments):\n        for j, b in enumerate(segments):\n            if j \u003C= i: continue\n            ratio = SequenceMatcher(None, a['text'], b['text']).ratio()\n            if ratio >= threshold and len(a['text']) > 4:\n                skip = a if len(a['text']) \u003C= len(b['text']) else b\n                repeats.append({\n                    'type': 'repeat',\n                    'range': [skip['start'], skip['end']],\n                    'text': skip['text'],\n                    'kept': b['text'] if skip == a else a['text'],\n                    'action': 'suggest_skip'\n                })\n    return repeats\n```\n\n#### c) 起手晃动 \u002F 结尾拖拽检测\n\n```python\ndef detect_trim_points(segments, duration, mean_volume_db):\n    \"\"\"基于语音+音量推荐起止点\"\"\"\n    suggested_start = 0.0\n    suggested_end = duration\n\n    if segments:\n        first_speech = segments[0]['start']\n        last_speech_end = segments[-1]['end']\n        if first_speech > 2.0:\n            suggested_start = max(0, first_speech - 0.5)\n        if duration - last_speech_end > 3.0:\n            suggested_end = last_speech_end + 1.5\n    else:\n        if duration > 5.0:\n            suggested_start = 1.0\n\n    return suggested_start, suggested_end\n```\n\n#### d) 纯画面时长限制\n\n| 模式     | 纯画面上限 | 口令处理 | 重复处理       | 起手晃动 |\n|----------|-----------|---------|---------------|---------| \n| strict   | 8-10s     | 全部去除 | 只留1遍        | 去1.5s  |\n| normal   | 12-15s    | 去除明确口令 | 去明显重复   | 去1.0s  |\n| loose    | 20-25s    | 仅去\"开始了\" | 保留大部分    | 去0.5s  |\n\n#### e) 输出格式\n\n预处理结果追加到素材分析数据里：\n\n```\n━━━ clip_012.mp4 | 时长25.8s | 1920x1080 ━━━\n  【画面】...\n  【语音】...\n  【精修建议】模式: normal\n    原始区间: [0.0 - 25.8]\n    推荐区间: [2.4 - 25.8]\n    ⊘ [0.0-2.4] 跳过: 录制口令 \"开始了\"\n    有效语音: [2.62-25.8]\n```\n\n**⚠ 重要原则：预处理只做标注和建议，不做硬裁剪。LLM保留最终决定权。**\n\n### 阶段4: LLM叙事编排\n\n目标：把预处理后的素材数据交给LLM，生成剪辑方案。\n\n输入：素材分析 + 精修建议(推荐区间) + 参考研究结论\n输出：剪辑方案JSON（结构见下方schema）\n\n#### edit_plan JSON Schema\n\n```json\n{\n  \"title\": \"视频标题\",\n  \"structure\": [\n    {\n      \"section\": \"段落名 — 副标题\",\n      \"description\": \"本段落内容概述\",\n      \"clips\": [\n        {\n          \"file\": \"素材文件名.mp4\",\n          \"start\": 0.0,\n          \"end\": 12.0,\n          \"note\": \"画面内容简述\",\n          \"subtitle\": \"保留的语音文字\"\n        }\n      ]\n    }\n  ],\n  \"bgm_suggestion\": \"BGM风格建议（含genre\u002Fmood\u002Finstruments\u002Ftempo\u002Fbpm）\",\n  \"editing_notes\": \"整体剪辑说明\"\n}\n```\n\n**约束：**\n- 同一素材可出现在多个clip中（不同时间区间）\n- start\u002Fend 不能截断语音中间（阶段4.5会校验）\n- 第一个section建议是\"开篇\"类引入段落\n- 最后一个section建议是\"收尾\"类段落\n\n详细prompt模板见 `templates\u002Fedit_plan_prompt.md`。\n\n### 阶段4+ : 分镜可视化 + Dashboard（浏览器预览）\n\n目标：把LLM输出的剪辑方案做成图文并茂的网页，方便用户直观Review。\n\n**Dashboard 包含两个面板：**\n\n1. **📋 素材总览** — 素材缩略图网格 + 时长\u002F语音\u002F音量标注 + 筛选(全部\u002F已用\u002F未用\u002F含语音) + 点击查看详情\n2. **✅ 成品质量检查** — 成品视频定时抽帧(每30秒) + 段落定位 + 点击放大\n\n**使用 `gen_dashboard.py` 脚本：**\n\n```bash\n# 最小用法（只生成素材面板）\npython3 scripts\u002Fgen_dashboard.py \\\n  --analysis clip_analysis.json \\\n  --plan edit_plan.json \\\n  --footage footage\u002F \\\n  --out output\u002F\n\n# 完整两面板（含成品QC帧）\npython3 scripts\u002Fgen_dashboard.py \\\n  --analysis clip_analysis.json \\\n  --plan edit_plan.json \\\n  --footage footage\u002F \\\n  --video output\u002Ffinal.mp4 \\\n  --out output\u002F\n```\n\n**支持两种分析数据格式（自动检测）：**\n- 标准格式 `clip_analysis.json`: `{filename, duration, visual: [...], audio: {...}}`\n- 紧凑格式 `clips_compact.json`: `{file, dur, visual: \"string\", speech: [...]}`\n\n用户确认分镜方案后，再进入渲染阶段。\n\n### 阶段4.5: 语音截断校验\n\n目标：自动校验LLM输出的plan，确保没有把任何语音从中间截断。\n\n```python\ndef validate_speech(plan_clips, speech_data):\n    \"\"\"检查每个clip的start\u002Fend是否截断了语音\"\"\"\n    issues = []\n    for clip in plan_clips:\n        f = clip['file']\n        cs, ce = clip['start'], clip['end']\n        if f not in speech_data: continue\n        for ss, se, txt in speech_data[f]:\n            if ss \u003C ce and se > cs:  # 语音与clip有交集\n                if ss \u003C cs - 0.3:    # 语音开始在clip之前\n                    issues.append(f\"截断开头: {f} clip从{cs}开始，但语音\\\"{txt}\\\"从{ss}开始\")\n                if se > ce + 0.5:    # 语音结束在clip之后\n                    issues.append(f\"截断结尾: {f} clip在{ce}结束，但语音\\\"{txt}\\\"到{se}结束\")\n    return issues\n```\n\n**校验不通过时：自动修复start\u002Fend，不需要回LLM重新编排。**\n\n#### 自动修复逻辑\n\n```python\ndef fix_speech_cuts(plan, speech_data, margin=0.3):\n    \"\"\"\n    自动修复语音截断问题。直接修改plan中的start\u002Fend。\n    \n    参数:\n        plan: edit_plan dict (会被原地修改)\n        speech_data: dict, {filename: [(start, end, text), ...]}\n        margin: float, 语音边界容差(秒)\n    \n    返回:\n        fixes: list of str, 修复日志\n    \"\"\"\n    fixes = []\n    \n    for sec in plan[\"structure\"]:\n        for clip in sec[\"clips\"]:\n            f = clip[\"file\"]\n            cs = float(clip[\"start\"])\n            ce = float(clip[\"end\"])\n            \n            if f not in speech_data:\n                continue\n            \n            for ss, se, txt in speech_data[f]:\n                if ss >= ce or se \u003C= cs:\n                    continue\n                \n                # 开头截断：clip.start > speech.start + margin\n                if ss \u003C cs - margin and se > cs:\n                    old_start = cs\n                    new_start = max(0, ss - 0.1)\n                    clip[\"start\"] = round(new_start, 1)\n                    fixes.append(\n                        f\"  修复开头: {f} [{old_start}→{new_start}] \"\n                        f\"语音\\\"{txt[:20]}\\\"从{ss}s开始\"\n                    )\n                    cs = new_start\n                \n                # 结尾截断：clip.end \u003C speech.end - margin\n                if se > ce + margin and ss \u003C ce:\n                    old_end = ce\n                    new_end = se + 0.2\n                    clip[\"end\"] = round(new_end, 1)\n                    fixes.append(\n                        f\"  修复结尾: {f} [{old_end}→{new_end}] \"\n                        f\"语音\\\"{txt[:20]}\\\"到{se}s结束\"\n                    )\n                    ce = new_end\n    \n    return fixes\n```\n\n**修复策略：**\n\n| 截断类型 | 检测条件 | 修复方式 |\n|----------|---------|---------| \n| 开头截断 | clip.start > speech.start + margin | clip.start → speech.start - 0.1s |\n| 结尾截断 | clip.end \u003C speech.end - margin | clip.end → speech.end + 0.2s |\n\n**边界容差 (margin=0.3s)：** Whisper时间戳有±0.2-0.3s误差。修复后必须跑二次校验。\n\n### 阶段5: ffmpeg自动执行\n\n目标：把剪辑方案转成ffmpeg命令并执行。\n\n#### 渲染策略：逐片段裁剪 → 拼接\n\n```bash\n# 单个片段裁剪+编码\nffmpeg -y -ss 00:00:02.400 -i footage\u002FINPUT.mp4 -t 00:00:23.400 \\\n  -vf \"scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)\u002F2:(oh-ih)\u002F2,setsar=1\" \\\n  -r 30 -c:v libx264 -preset medium -crf 18 -pix_fmt yuv420p \\\n  -c:a aac -b:a 128k -ar 44100 -ac 2 \\\n  -movflags +faststart segments\u002Fseg_001.mp4\n\n# 拼接成品\nffmpeg -y -f concat -safe 0 -i concat.txt -c copy -movflags +faststart output.mp4\n```\n\n#### 片头高光蒙太奇\n\n从各段落选最有视觉冲击力的镜头，快切拼接放在视频最前面。\n\n**选片原则：**\n- 每个主要段落选1个精彩画面\n- 每个镜头0.5-1秒，快切节奏\n- 总共6-10个镜头，总时长5-8秒\n- 排除竖屏素材\n- 不加音频（-an），最终由BGM覆盖\n\n```python\nimport subprocess, os\n\nhighlights = [\n    ('footage\u002Fclip_a.mp4',   1.5, 2.2),\n    ('footage\u002Fclip_b.mp4',   2.0, 2.7),\n    # ... 每个0.7秒左右\n]\n\nfor i, (f, start, end) in enumerate(highlights, 1):\n    dur = end - start\n    cmd = f'ffmpeg -y -ss {start} -i \"{f}\" -t {dur} ' \\\n          f'-vf \"scale=1920:1080:force_original_aspect_ratio=decrease,' \\\n          f'pad=1920:1080:(ow-iw)\u002F2:(oh-ih)\u002F2\" ' \\\n          f'-c:v libx264 -preset ultrafast -crf 23 -pix_fmt yuv420p ' \\\n          f'-an highlights\u002Fhl_{i}.mp4'\n    subprocess.run(cmd, shell=True)\n\n# concat\nwith open('highlights\u002Fconcat.txt', 'w') as f:\n    for i in range(1, len(highlights)+1):\n        f.write(f\"file 'hl_{i}.mp4'\\n\")\n\nsubprocess.run('ffmpeg -y -f concat -safe 0 -i highlights\u002Fconcat.txt '\n               '-c copy highlights\u002Fmontage.mp4', shell=True)\n```\n\n#### 段落标题叠加\n\n用 Pillow 生成透明RGBA的PNG，ffmpeg overlay到视频画面上。**不要用黑底标题卡**。\n\n```python\nfrom PIL import Image, ImageDraw, ImageFont, ImageFilter\n\nW, H = 1920, 1080\ntitle = \"段落标题\"\n\nimg = Image.new(\"RGBA\", (W, H), (0, 0, 0, 0))\ndraw = ImageDraw.Draw(img)\n\n# 字体：macOS用冬青黑体，Linux用Noto Sans CJK\n# font = ImageFont.truetype(\"\u002FSystem\u002FLibrary\u002FFonts\u002FHiragino Sans GB.ttc\", 60)  # macOS\n# font = ImageFont.truetype(\"\u002Fusr\u002Fshare\u002Ffonts\u002Fopentype\u002Fnoto\u002FNotoSansCJK-Regular.ttc\", 60)  # Linux\nfont = ImageFont.truetype(\"YOUR_FONT_PATH\", 60)\n\nbbox = draw.textbbox((0, 0), title, font=font)\ntw, th = bbox[2] - bbox[0], bbox[3] - bbox[1]\nx, y = (W - tw) \u002F\u002F 2, (H - th) \u002F\u002F 2\n\n# 柔和阴影\nshadow = Image.new(\"RGBA\", (W, H), (0, 0, 0, 0))\nsd = ImageDraw.Draw(shadow)\nsd.text((x+2, y+2), title, fill=(0, 0, 0, 180), font=font)\nshadow = shadow.filter(ImageFilter.GaussianBlur(radius=6))\n\nimg = Image.alpha_composite(img, shadow)\ndraw = ImageDraw.Draw(img)\ndraw.text((x, y), title, fill=(255, 255, 255, 240), font=font)\nimg.save(\"title_overlay.png\")\n```\n\n**overlay到视频上：**\n\n```bash\n# 标题显示前3秒\nffmpeg -y -i section.mp4 -i title.png \\\n  -filter_complex \"overlay=0:0:enable='between(t,0,3)'\" \\\n  -c:v libx264 -preset medium -crf 18 -pix_fmt yuv420p \\\n  -c:a aac -b:a 128k -movflags +faststart \\\n  section_titled.mp4\n```\n\n**⚠ overlay关键Pitfall：**\n- ❌ 不要加 `shortest=1` — PNG只有1帧，会导致视频流立刻截断\n- ✅ 直接用 `overlay=0:0:enable='between(t,0,3)'` 最简单可靠\n- ✅ 先用短片段(5-8s)验证overlay效果\n\n#### 段落拼接（推荐方案）\n\n**✅ 正确方案：逐段编码 → concat copy**\n\n```bash\necho \"file 'final_sec_01.mp4'\" > concat.txt\necho \"file 'final_sec_02.mp4'\" >> concat.txt\nffmpeg -y -f concat -safe 0 -i concat.txt -c copy -movflags +faststart output.mp4\n```\n\n**❌ 不要用xfade链式合并：** 链式xfade会导致帧数累积丢失，后半段全黑。\n\n**段落间过渡**：段落内硬切即可。如需渐变，每段首尾加fade比xfade更可靠。\n\n#### BGM生成与混音（可选）\n\nBGM 可以手动添加，也可以用 AI 音乐生成工具（如 MiniMax music、Suno 等）。\n\n##### a) AI 生成 BGM\n\n**风格映射参考（vlog常用）：**\n\n| Vlog 风格 | genre | mood | instruments | tempo |\n|-----------|-------|------|-------------|-------|\n| 轻松日常 | indie pop | cheerful, carefree | ukulele, acoustic guitar | moderate |\n| 文艺治愈 | folk, acoustic | warm, gentle | acoustic guitar, piano, strings | slow |\n| 美食探店 | jazz, bossa nova | cozy, playful | piano, upright bass | moderate |\n| 冰雪\u002F冬季 | cinematic, ambient | serene, majestic | piano, celesta, strings | slow |\n| 热带\u002F海岛 | tropical house | sunny, relaxed | steel drums, marimba | upbeat |\n| 城市探索 | lo-fi hip hop | chill, urban | keys, vinyl crackle | moderate |\n\n##### b) 混合到视频\n\n```bash\n# BGM 音量 10-15%（有语音的vlog要压低BGM）\nffmpeg -y -i video_no_bgm.mp4 -i bgm.m4a \\\n  -filter_complex \"[0:a]volume=1.0[orig];[1:a]volume=0.12[bgm];[orig][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]\" \\\n  -map 0:v -map \"[aout]\" -c:v copy -c:a aac -b:a 192k \\\n  -movflags +faststart output\u002Ffinal.mp4\n```\n\n**BGM 音量建议：**\n- 有大量语音\u002F旁白 → 8-12%\n- 语音较少，空镜为主 → 15-25%\n- 纯空镜蒙太奇段落 → 30-40%\n\n## Pitfalls\n\n1. **剪映不可用** — v10.4+ 对 draft_info.json 加密，不要浪费时间\n2. **视觉API端点要区分** — 有些平台视觉模型和文本模型端点不同，确认用对\n3. **Whisper模型选择** — base中文太差，large太慢，medium是性价比最优\n4. **不要跳过参考研究** — 没有\"好vlog标准\"的AI会剪出流水账\n5. **ffmpeg编码兼容** — 拼接时注意素材编码一致性，先逐片段统一编码再concat\n6. **视觉API限流** — 高峰时段容易限流，加retry和sleep\n7. **预处理在LLM之前做** — 口令\u002F重复\u002F晃动检测在阶段3.5处理\n8. **预处理是建议不是硬裁剪** — LLM保留覆盖权，某些口令可能有叙事价值\n9. **语音截断必须自动校验** — LLM输出的plan可能在语音中间切断\n10. **Whisper幻觉** — 纯音乐\u002F环境音段落whisper会编造文字，需用音量阈值(-40dB)过滤\n11. **竖屏混横屏** — 素材分析阶段就要检测，竖屏(9:16)混在横屏里很突兀，建议去掉\n12. **overlay不要加shortest=1** — PNG只有1帧，shortest=1会让视频流截断\n13. **标题卡风格** — 白字+柔和阴影叠在视频画面上，**不要黑底标题卡**\n14. **ffmpeg drawtext不可用** — macOS Homebrew ffmpeg默认没编译freetype，用Pillow生成PNG overlay代替\n15. **HEVC警告可忽略** — \"Error constructing the frame RPS\" 是HEVC解码警告，不影响输出\n16. **Non-monotonic DTS** — concat拼接时常见的时间戳警告，播放不受影响\n17. **空镜不宜过长** — 无语音的纯画面>6s偏长，建议压缩到5-8s\n18. **xfade链式合并不可靠** — 链式xfade会导致帧数累积丢失，后半段全黑，用concat代替\n19. **先用短片段验证** — 每次改渲染方案都先用5-8秒短片段验证效果\n20. **渲染完必须验证帧数** — `ffmpeg -i output.mp4 -f null -` 检查实际frame数\n21. **BGM别太大声** — 有语音段BGM控制在8-12%，先试听再定\n22. **多段BGM衔接** — 保持相近的key和tempo(bpm差值\u003C20)\n23. **混音后必须试听** — 不同素材原始音量差异大\n24. **不要重复安装依赖** — whisper\u002FPillow等先检测再装，不要每次都新建venv\n\n## 端到端示例\n\n### 项目文件结构\n\n```\nmy-vlog-project\u002F\n├── footage\u002F                    # 原始素材（用户提供）\n│   ├── clip_001.MOV\n│   └── ...\n│\n├── analysis\u002F                   # 阶段3输出\n│   └── clip_analysis.json\n│\n├── edit_plan.json              # 阶段4输出\n├── edit_plan_fixed.json        # 阶段4.5输出\n│\n├── output\u002F\n│   ├── dashboard.html          # Dashboard网页\n│   ├── thumbnails\u002F             # 素材缩略图\n│   ├── qc_frames\u002F              # 成品QC帧\n│   ├── segments\u002F               # 裁剪后的片段\n│   ├── highlights\u002F             # 片头高光蒙太奇\n│   ├── titles\u002F                 # 段落标题PNG\n│   ├── sections\u002F               # 带标题的段落视频\n│   ├── bgm\u002F                    # BGM文件\n│   ├── video_no_bgm.mp4        # 无BGM的完整视频\n│   └── final.mp4               # 🎬 成品视频\n│\n└── reference\u002F                  # 阶段2输出（可选）\n```\n\n### 中间产物示例\n\n见 `examples\u002F` 目录下的示例文件。\n\n### 执行流程速查\n\n```\n素材文件夹 footage\u002F\n     │\n     ▼\n 阶段1: 素材盘点 → ffprobe批量扫描 → 清单\n     │\n     ▼\n 阶段2: 参考研究 → 下载优质vlog → 分析节奏（可选）\n     │\n     ▼\n 阶段3: 素材三维分析 → whisper+音量+视觉 → clip_analysis.json\n     │\n     ▼\n 阶段3.5: 精修预处理 → 口令\u002F重复\u002F晃动\u002F纯画面标注\n     │\n     ▼\n 阶段4: LLM叙事编排 → edit_plan.json\n     │\n     ▼\n 阶段4+: Dashboard可视化 → 浏览器预览确认\n     │\n     ▼\n 阶段4.5: 语音截断校验 → 自动修复\n     │\n     ▼\n 阶段5: ffmpeg渲染 → 裁剪→标题→拼接→BGM → final.mp4 🎬\n```\n\n## 验证\n\n- [ ] 素材盘点完成，生成清单\n- [ ] 参考研究完成，提取规律\n- [ ] 素材三维分析完成（视觉+音频+音量）\n- [ ] 素材精修预处理完成\n- [ ] LLM剪辑方案生成\n- [ ] 语音截断校验通过\n- [ ] ffmpeg执行成功，输出成品视频\n- [ ] 成品视频质量人工确认\n\n---\n\n**Author:** nyx研究所 · [GitHub](https:\u002F\u002Fgithub.com\u002Fznyupup) · [B站](https:\u002F\u002Fspace.bilibili.com\u002F4330525) · 小红书 @nyx研究所\n**License:** MIT\n",{"name":5,"tags":24,"author":30,"status":31,"version":32,"description":7},[25,26,27,28,29],"video-editing","vlog","ffmpeg","whisper","automation","nyx研究所 (https:\u002F\u002Fgithub.com\u002Fznyupup)","stable","1.0.1","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fv\u002Fvlog-auto-edit",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill vlog-auto-edit",{"tool":48,"command":49},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill vlog-auto-edit",{"tool":51,"command":52},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill vlog-auto-edit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fv\u002Fvlog-auto-edit\u002FSKILL.md",true,[],[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]