SuperAPI AI Directory

video-pipeline

General & other

View repository

Updated 10-16 09:11

About this skill

Video Pipeline — Full-chain video content

In a nutshell

Throw in a video, get out a complete set of content products: transcript + insight summary + short video clips + publishable article.

Pipeline overview

输入: 视频文件 (直播回放/播客/会议录像)
  │
  ▼
┌─────────────────────────────────────────────┐
│ Stage 1: video-to-text                       │
│ 转写 → 带时间戳的文字稿 + JSON               │
│ (去口吃的基础数据也在这里产生)                │
└──────────────────┬──────────────────────────┘
                   │
        ┌──────────┴──────────┐
        ▼                     ▼
┌───────────────┐   ┌─────────────────────┐
│ Stage 2:       │   │ Stage 3:             │
│ insight-       │   │ video-clipper        │
│ extractor      │   │ 按观点切片 →         │
│ 提炼观点/金句  │   │ 去静音/去口吃 →      │
│ /争议点        │   │ 短视频成品           │
└───────┬───────┘   └─────────────────────┘
        │
        ▼
┌───────────────────────────────────────────┐
│ Stage 4: article-forge                     │
│ 观点摘要 + 原始文稿 → 可发布文章            │
│ (博客/知乎/公众号)                          │
└───────────────────────────────────────────┘

输出目录: workspace/pipeline/<project-name>/
  ├── transcript.txt          # 完整文字稿
  ├── transcript.json         # 带时间戳 JSON
  ├── insights.md             # 观点摘要
  ├── clips/                  # 短视频切片
  │   ├── 01-xxx.mp4
  │   ├── 02-xxx.mp4
  │   └── ...
  └── articles/               # 生成的文章
      ├── blog-xxx.md
      └── zhihu-xxx.md

Execution flow

Input parameters

The user provides:

  1. Video file path(required)
  2. Project name(optional, defaults to generated from the filename)
  3. Target outputs(optional, defaults to all):
    • transcript — transcript only
    • insights — transcript + insights
    • clips — transcript + clips
    • articles — transcript + insights + article
    • all — all (default)
  4. Article platform(optional): blog / zhihu / wechat
  5. Number of clips(optional, defaults to 5-8 clips)

Stage 1: Transcription (video-to-text)

  1. Read video-to-text SKILL.md
  2. Create the project directory:workspace/pipeline/<project-name>/
  3. Run the transcription script in the background with nohup:
    nohup python3 {video-to-text-skillDir}/scripts/transcribe.py \
      /path/to/video.mp4 \
      --output-dir workspace/pipeline/<project-name>/ \
      --output-name transcript \
      --diarize \
      > /tmp/pipeline-transcribe.log 2>&1 &
    
  4. Wait for completion (use process poll or check the output files)
  5. Output:transcript.txt + transcript.json

⚠️ This is the most time-consuming stage, a 30-minute video takes about 10-20 minutes to transcribe. Subsequent stages are all fast.

Stage 2: Insight extraction (insight-extractor)

  1. Read insight-extractor SKILL.md
  2. Input transcript.txt
  3. Extract following the insight-extractor process:
    • Topic boundary identification
    • Core argument extraction
    • Key quote annotation (preserve timestamps)
    • Controversial point annotation
  4. Output:insights.md

Key: The timestamps of key quotes and insights must be precise; Stage 3 clipping needs them.

Stage 3: Video clipping (video-clipper)

Can run in parallel with Stage 2 (both depend only on Stage 1's output).

  1. Read video-clipper SKILL.md
  2. Based on insights.md insights + transcript.json timestamps to locate clip boundaries
  3. Execute the four-stage clipping process:
    • Use batch-clip-v4.sh for batch clipping (remove silence + remove stutters + crossfade)
    • Use batch-postcheck.sh for secondary quality check
    • If necessary, use iterate-until-clean.py for iterative fixes
  4. Output:clips/01-xxx.mp4, clips/02-xxx.mp4, ...

Optimization: Prioritize clipping the segments marked as "key quotes" and "controversial points" in insights—these have the most viral potential as short videos.

Stage 4: Article generation (article-forge)

  1. Read article-forge SKILL.md
  2. Input insights.md + transcript.txt
  3. Select the genre and style according to the target platform
  4. Generate the article, strictly removing the AI flavor
  5. Output:articles/blog-xxx.md or articles/zhihu-xxx.md

Optional: If the user requests publishing, call ZhiForge's publishing process.

Parallel strategy

时间线:
─────────────────────────────────────────────────>
  Stage 1 (转写)     Stage 2 (观点)     Stage 4 (文章)
  ████████████████    ████████           ████████
                      Stage 3 (切片)
                      ████████████████
  • Stage 2 and Stage 3 canrun in parallel(run separately with sessions_spawn)
  • Stage 4 depends on Stage 2's output, serial
  • Stage 1 is the slowest, accounting for 60-70% of total time

Sub-agent orchestration

Recommended to use sessions_spawn parallelization:

主 agent:
  1. 启动 Stage 1(转写,等待完成)
  2. spawn 子 agent A → Stage 2(观点提炼)
  3. spawn 子 agent B → Stage 3(视频切片)
  4. 等 A 完成 → 启动 Stage 4(文章生成)
  5. 等 B 完成 → 汇总输出

Output summary template

After everything is complete, report to the user:

🎬 视频内容处理完成

📹 源文件:xxx.mp4 (时长 XX:XX)
📁 项目目录:workspace/pipeline/<name>/

📝 文字稿:transcript.txt (XXXX 字)
💡 观点提炼:insights.md
   - X 个核心观点
   - X 条金句
   - X 个争议点

🎞️ 短视频切片:X 条
   - 01-xxx.mp4 (XX:XX) — 主题
   - 02-xxx.mp4 (XX:XX) — 主题
   - ...

📄 文章:X 篇
   - blog-xxx.md (XXXX 字) — 标题
   - zhihu-xxx.md (XXXX 字) — 标题

Quick trigger

If the user says any of the following, trigger this skill:

  • "Process this video"
  • "Full video pipeline"
  • "Livestream replay processing"
  • "Turn this video into content"
  • "video pipeline"

Execute by default all(all outputs), unless the user specifies only a certain stage.

Notes

  • Stage 1 transcriptionMust use nohup in the background, otherwise it will time out
  • If the filename contains Chinese, create an English symlink
  • Slicing depends on word_segments in transcript.json, not transcript.txt
  • Article generation depends on insights.md; you cannot skip Stage 2 and go directly to Stage 4
  • Store all outputs in workspace/pipeline/<project-name>/, not /tmp/
  • After using the browser, you must browser stop