Communitygithub.com

clip-shorts:一支成片切出多支獨立 YouTube Shorts

把完成的長影片切成 YouTube Shorts 的 Agent 技能:沿用成片的逐字時間戳,通讀全文逐字稿,挑出可獨立成立的片段,加上文字鉤子與留言引導,以 Remotion 算出 1080x1920 直式片段,並附含 Instagram 文案的上傳清單。

clip-shorts:一支成片切出多支獨立 YouTube Shorts 是什麼?

YouTube 單集配方第 3 步(Shorts),來自 SrigadaAkshayKumar/ai-video-editor(2026-10-09 發布;AI-clipper 資料夾是整條流程的 Shorts 環節,README 表示一整集從配音、剪輯、Shorts 到上傳 Drive,在免費 4 核 GitHub runner 上花 1 小時 13 分)。它直接使用成片的乾淨畫面與 -14 LUFS 母帶,不必再跑一次 Whisper,也不會出現雙層字幕。Agent 必須先讀完整份逐字稿再挑片段。好的 Short 要零脈絡也看得懂,有鋪陳、張力與爆點,以有力的一句開場,爆點之後立刻收尾,長度自然、最長 70 秒。同一秒素材不會出現在兩支片段裡。每支都有不超過 8 個字詞的畫面鉤子、可選的倒敘開場、具體的留言提問、YouTube 標題、主題標籤與獨立的 Instagram 文案。畫面可選黑邊、模糊背景、置中裁切或人臉追蹤。輸出 1080x1920、30fps、H.264 MP4 與 UPLOAD_SHEET.md。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SrigadaAkshayKumar/ai-video-editor/tree/HEAD/AI-clipper/.claude/skills/clip-shorts

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

長片 → YouTube Shorts

流程:AI 編輯專案(../projects/<p>)→ 轉錄(重複使用編輯的逐字稿;純檔案才用 Whisper)→ Claude 閱讀完整逐字稿並撰寫 clips.json → 準備(剪輯、字幕、追蹤)→ 渲染(Remotion)→ output/<slug>/。

0. 收集任務設定

從使用者的訊息中取得(只詢問缺少的部分):

設定數值備註
source../projects/ 中的 AI 編輯專案名稱沒有輸入資料夾:影片來自編輯的專案。一部長片的多個部分 → 列出所有部分 + --slug。
languageen / te / hi設定 Whisper 語言、字幕字體、鉤子/CTA 語言
framingblack(16:9 放在 9:16,黑邊)· blur(模糊背景)· center(中心裁剪)· track(裁剪跟隨講者臉部)無臉頻道 → black/blur;有臉頻道 → center/track(或 black/blur)。可依片段不同。
model(可選)small, medium, large-v3Whisper 只在必要時執行(純檔案,--from final,--whisper):en→small,te/hi→medium

1. 轉錄

從 AI-clipper/ 執行(或從 repo 根目錄執行 npm run shorts:transcribe -- …):

npm run transcribe -- <project>                               # ../projects/<project>,乾淨來源
npm run transcribe -- <part1> <part2> <part3> --slug <name>    # 一部長片的多個部分,按順序合併
npm run transcribe -- <project> --from final                  # 使用交付的 final-16x9.mp4 替代
npm run transcribe -- <joined-name|file.mp4> --lang te        # ../output/<name>-16x9.mp4(npm run join)或任何檔案

來源:

  • clean(預設,使用此選項):專案的 work/visuals-16x9.mp4 + work/master.wav(完成的影像、圖形和 -14 LUFS 混音,但無內嵌字幕且無開頭/結尾)多路複用為 jobs/<slug>/source.mp4。逐字詞直接來自 work/cleancut.words.json,因此沒有 Whisper 執行(即時,且泰盧固語/印地語保留 ElevenLabs 轉錄)。需要最終確定編輯(npm run finalize -- <p>);如果影像/master 比 clean cut 舊,它會發出警告。
  • final(--from final):交付的 output/final-16x9.mp4,使用 Whisper 重新轉錄。其字幕已燒錄,因此從它產生的 Shorts 會顯示兩層字幕;僅在乾淨檔案消失時使用。合併的長片(../output/<name>-16x9.mp4)相同:偏好列出其部分專案。

語言預設為專案的語言(--lang 覆蓋)。--format 9x16 改為從 9:16 編輯版本裁剪。Whisper 執行在 CPU 上很慢(small 約 20 分鐘/小時影片,medium 約 45 分鐘):在背景執行。輸出:jobs/<slug/ 包含 source.mp4、transcript.txt(含時間戳)、transcript.json(單詞時間戳)、meta.json(記錄來源專案)。

2. 閱讀全部內容,然後規劃片段(這是 Claude 的工作)

在選擇任何內容之前,閱讀 整個 jobs/<slug>/transcript.txt(如果很長,則分段閱讀)。理解整個腳本:主題、故事、論點、笑話、回顧。不要只是將影片切成等份。

一個好的 Short 是一個自成一體的對話時刻:

  • 在零上下文中也有意義(沒有“如我之前所說”,沒有在第一句話中未解決的“他/那個”)。
  • 有一個弧線:鋪陳/問題 → 張力 → 回報(答案、笑點、揭露、強烈意見、數字/結果)。
  • 以強而有力的台詞開始,絕不是填充詞(“所以”、“嗯”、“okay so”、“అయితే”、“तो”)。
  • 在回報之後、在一個完整的句子上立即結束,而不是思緒中斷。
  • 自然長度,最長 70 秒。 在每個片段的時刻結束時剪下:一個 30 秒的時刻就是一個 30 秒的 Short,一個 40 秒的時刻就是一個 40 秒的 Short。大多數落在 30–40 秒。70 秒只是上限(prepare.py 拒絕任何更長的片段)。切勿為了讓片段更長而從別處拉伸、合併或拼接台詞;這是使用者在 2026-10-06 修正的錯誤。適用於每種影片類型。
  • 切勿重複使用鏡頭。 沒有來源秒數可以出現在兩個片段中,也沒有片段可以重複播放同一句台詞。每個片段都是影片的不同部分。沒有“完整版”片段重複使用其他片段。prepare.py 拒絕重疊的計劃。

鉤子(兩種,有幫助時兩者都用):

  1. 文字鉤子(hook):前 3 秒在畫面上顯示 ≤ 8 個單詞。好奇心、大膽的主張或“你”的問題。必須忠實於片段。將 1–2 個衝擊詞用 *星號* 括起來(例如 Recruiters notice *THIS* coding contest 👀):在黑邊構圖中,它們會得到一個黃色高亮框。用影片的語言和文字系統撰寫(泰盧固語 → తెలుగు、印地語 → हिन्दी),除非使用者要求英文/泰盧固英/印地英。
  2. 冷開場(可選):將第一個片段設為該片段最令人驚訝的 1–3 秒台詞(它的回報或震撼性陳述),然後播放鋪陳直到該台詞之前,然後在其後繼續,這樣該台詞就不會被聽到兩次。範例:[{"start": 754.2, "end": 756.1}, {"start": 731.0, "end": 754.2}, {"start": 756.1, "end": 770.0}]。當回報很強但自然開頭很慢時使用。

你也可以透過分割成多個片段來移除無聊的中間部分,只要語音仍然自然流暢。

評論提示(cta):在最後 3.5 秒顯示(黑邊構圖:在結束卡前約 7 秒的頂部欄位中)。一個與片段相關的具體問題,讓人們可以用一句話回答(“你會選哪一個,1 還是 2?👇”),而不是通用的“按讚和訂閱”。語言與鉤子相同。

多少個片段? 取決於內容,而不是公式。找出每一個通過上述規則的時刻,按 score(1–10:鉤子強度 × 獨立清晰度 × 回報 × 可分享性)排序,並保留所有 ≥ 6 的。粗略的合理性檢查:大約每 1–3 分鐘實質性對話產生 1 個片段(5 分鐘 → 3–5,10 分鐘 → 4–8,30 分鐘 → 10–18)。較短的片段意味著更多數量。當影片緩慢或重複時,較少也可以。告訴使用者誠實的數字和原因。

撰寫 jobs/<slug>/clips.json,按分數排序(最好的在前):

{
  "framing": "blur",
  "summary": "完整影片的一段落摘要,以及為何選擇這些時刻。",
  "clips": [
    {
      "id": 1,
      "title": "YouTube 標題,少於 70 個字元,使用影片的語言",
      "hook": "畫面上的鉤子文字",
      "cta": "具體的評論問題 👇",
      "segments": [{ "start": 731.0, "end": 768.4 }],
      "framing": "track",
      "description": "1–2 行 YouTube 描述",
      "hashtags": ["#shorts", "#topic", "#niche"],
      "score": 8.5,
      "why": "為什麼這個時刻可以作為一個獨立的 Short",
      "instagram": {
        "caption": "鉤子行\n\n2-4 行簡短有價值的內容(✅ 項目符號可)\n\n相同的評論問題 👇\n\n💾 儲存這個...\n📌 完整影片:個人簡介中的連結",
        "hashtags": ["#topic", "#niche", "...8-12 個標籤", "#reels"]
      }
    }
  ]
}

Instagram(總是): 使用者也會將每個片段發布為 Instagram Reel,因此每個片段都有一個 instagram 區塊。為 Instagram 撰寫,而不是 YouTube 描述的副本:首先是鉤子行,簡短可掃讀的行,評論問題,儲存提示,以及 "📌 完整影片:個人簡介中的連結"(Instagram 說明和留言中的連結不可點擊)。使用 8–12 個標籤,用 #reels 代替 #shorts。上傳表格會將其印在 Instagram 說明下。如果缺少,表格會從 YouTube 欄位建立備用。僅重新撰寫表格:npm run render -- <slug> --sheet-only。

可選的黑邊覆蓋(每個片段或頂層):"topTexts": ["📌 完整影片連結在置頂留言", "💬 在下方留言你的想法"] 和 "endCard": {"title": "觀看完整影片", "subtitle": "連結在置頂留言"}。省略它們以使用這些預設值。僅在使用者要求時才使用影片的語言撰寫它們。

時間戳來自 transcript.txt(秒,小數點可以)。它們會自動對齊到單詞邊界,因此選取句子的開始/結束,讓腳本處理填充。每個片段的 framing 是可選的,並覆盖頂層的設定。

黑邊構圖(僅限信箱式影片)

使用 framing: "black"(且邊欄至少 300 像素高),渲染器使用邊欄,而不是影像:

  • 開始: 白色閃光 + 影片放大進入,然後鉤子逐字彈入頂部欄位(高亮單詞以黃色框框住),伴隨著彈跳的 👇,3 秒後它縮小為一個停留在畫面中的標題。
  • 頂部欄位,中間: 動畫晶片在標題下方旋轉(topTexts),然後評論問題(cta)作為黃色晶片。
  • 底部欄位: 逐字字幕,在影片下方,永遠不會覆蓋在影片上。影片底部邊緣是一個黃色進度條。
  • 最後 2.5 秒: 動畫結束卡:“觀看完整影片 · 📌 連結在置頂留言”。音頻繼續播放,因此在片段的最後一個完整句子(回報後 2–3 秒)結束片段,而不是在回報中間。

其他構圖(blur、center、track)保留經典覆蓋層。程式碼:src/BlackBars.tsx。

每個 Shorts 都指向置頂留言,因此提醒使用者在每次上傳時在置頂留言中固定一個帶有完整影片連結的留言,並同時將連結放在描述中。

3. 顯示計劃,然後準備 + 渲染

向使用者顯示一個表格(id、分數、持續時間、鉤子、一行說明為什麼)和總數。然後執行:

npm run prepare-clips -- <slug> [--framing blur] [--only 1,3]
npm run render -- <slug> [--only 1,3]

渲染每個片段在 CPU 上需要約 1–2 分鐘,因此在背景執行。輸出:output/<slug>/NN-title.mp4(1080×1920,30 fps,H.264)和 output/<slug/UPLOAD_SHEET.md(標題、YouTube 描述 + 標籤、Instagram 說明、來源時間戳)。

抽查 1–2 個片段:使用 ffmpeg 提取約 1 秒(鉤子)、中間(字幕、頂部欄晶片)和最後 2 秒(結束卡 / 評論提示)的畫面並查看它們。使用 track 構圖時,確保講者的臉部在畫面內。

之後編輯單一片段

變更其在 clips.json 中的條目,然後 npm run prepare-clips -- <slug> --only N 和 npm run render -- <slug> --only N。對於視覺調整(字體、顏色、位置),編輯 src/BlackBars.tsx(黑邊構圖)、src/Captions.tsx、src/Overlays.tsx、src/Framing.tsx;使用 npm run studio 預覽。

檔案

  • pipeline/transcribe.py:來源來自 ../projects/<p>(乾淨影像 + master + 編輯的逐字詞),純檔案使用 Whisper
  • pipeline/prepare.py:單詞對齊、ffmpeg 剪輯/合併、字幕、YuNet 臉部追蹤(模型自動下載到 models/)
  • scripts/render.mjs:Remotion 打包 + 渲染 + 上傳表格
  • src/:Remotion Short 合成(1080×1920):Framing、Captions、Hook/CallToAction

Individual skills in this repo

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

SrigadaAkshayKumar/ai-video-editor

Choose, fetch and place background music for an edit — Openverse search (commercial-use CC, or CC0-only), music_cues in work/audio-plan.json with fades, offsets and a deliberate silence gap; tools/mix.mjs conditions every bed, sets it to one measured house level under the voice and sidechain-ducks it. Use when adding, swapping or re-levelling music.

SrigadaAkshayKumar/ai-video-editor

Generate and style word-synced captions (Telugu, Hindi, English, code-mixed) as the HyperFrames captions pass over each format's Remotion picture, fix caption text, black captions out under on-screen text, and check caption content at every cut join. Use when creating, restyling, correcting or repositioning captions in any edit.

SrigadaAkshayKumar/ai-video-editor

Editorial rules for turning a raw talking video or voiceover into a clean cut — removing retakes, repetitions, false starts, stutters, fillers, mispronounced words, contradictions/inconsistencies, off-script chatter and dead air — by writing work/edl.json for tools/cut.mjs. Telugu, Hindi, English and code-mixed speech. Use for stage 2 of edit-video or whenever the user asks to tighten/re-cut a video.

SrigadaAkshayKumar/ai-video-editor

Turns a bare voiceover (no presenter on camera) into a finished faceless documentary/explainer for YouTube 16:9 and Instagram 9:16 — clean-cuts the narration, DIRECTS it (story spine, tension curve, hooks, involvement beats), researches the claims and screenshots the real sources, plans a scene track (stock b-roll, stills, news screenshots, pure-graphic beats) with motion graphics, designs music + SFX, renders, captions and credits it. Use when the user gives a voiceover/narration file (or says "faceless video", "make a video from this VO", "documentary").

SrigadaAkshayKumar/ai-video-editor

End-to-end editor for TALKING-HEAD videos (a person on camera) in this repo. Use when the user hands over a raw video with a speaker and wants a finished edit, or asks to continue/resume/redo any stage of an existing talking-head project — clean cut, motion graphics, b-roll, SFX, music, captions, final render, thumbnail. Delivers YouTube 16:9 and Instagram 9:16. Telugu, Hindi, English and code-mixed speech. For a voiceover with no presenter use edit-video-faceless.

SrigadaAkshayKumar/ai-video-editor

Plan the picture of an edit in work/visual-plan.json — motion graphics (28 component types across six stage layouts that dock/shrink/dim the video), b-roll cutaways from Pexels/Pixabay, camera moves, a-roll framing for 9:16 — validate it, QA it with stills in both formats, and render it with Remotion. Use for any titles, charts, stats, lower thirds, diagrams, b-roll or zooms in a talking-head or faceless edit.

SrigadaAkshayKumar/ai-video-editor

Design the sound effects of an edit in work/audio-plan.json sfx_events — which effect, where, how often — using the measured SFX library (repo assets/sfx, HyperFrames' bundled set, CC0 fetches from Openverse) and the spectral rule that sub-band cues carry structure while vocal-band cues are rationed. Mixed and levelled by tools/mix.mjs. Use when adding or adjusting SFX in any edit.

SrigadaAkshayKumar/ai-video-editor

Write the upload package for a video this repo edited — YouTube title options, description with chapters, tags, pinned comment, thumbnail text, and the Instagram Reels caption + hashtags for the 9:16 cut — optimised for whichever channel/client the user says it is for (config/brands/ profiles, only when named). Use when the user asks what to title a video, for a description, tags, chapters, "the YouTube metadata", an Instagram caption, or SEO/CTR advice on a finished render.

SrigadaAkshayKumar/ai-video-editor

Design and build a high-CTR thumbnail for a video this repo edited — hook selection, the real face frame pulled from the footage, background cut-out, type set with real fonts (Telugu/Devanagari included), the YouTube 1280x720 thumbnail and the Instagram 1080x1920 cover, an optional image-generation prompt for the background layer, and a feed-size legibility check. Use when the user asks for a thumbnail, thumbnail ideas, a cover image, or how to make the thumbnail more clickable.

相關技能