Home首頁  /  Lessons課程  /  Lesson 7第七課

Cut Videos with AI Agents用 AI Agents 剪輯影片

Claude Code and other terminal-based AI agents can now open a folder of raw footage and cut it — trim the pauses, transcribe and burn in subtitles, drop in cutaway shots, mix in music — the same way they write and edit a webpage. This lesson covers what to install and exactly how to ask, for any kind of school video: a lesson recap, a student activity reel, a campus tour, even a class play.

Claude Code 這類終端機型 AI agent,現在可以打開一整個資料夾的原始素材,直接動手剪——剪掉冷場的停頓、轉出逐字稿並燒上字幕、插入補充畫面、混入背景音樂——手法跟它寫網頁、改網頁一模一樣。這堂課教你該裝什麼工具,以及每一步該怎麼開口問,適用各種校園影片:教學回顧、學生活動精華、校園簡介,甚至學生話劇。

What you'll be able to do你將學會

  • a Install ffmpeg and a terminal-based AI agent that can actually touch your video filesa 安裝 ffmpeg 與一個能真正動到你影片檔案的終端機型 AI agent
  • b Get a clean transcript and burned-in subtitles without typing a word yourselfb 不用自己打一個字,就拿到乾淨的逐字稿與燒錄字幕
  • c Find and legally download background music, and have your agent duck it under your voicec 找到並合法下載背景音樂,讓 agent 幫你在人聲出現時自動壓低音量
  • d Understand what "B-roll" is and how to ask your agent to place itd 搞懂什麼是「B-roll」,以及怎麼請 agent 幫你安插
  • e Follow a full prompt workflow for any video: lesson recap, activity reel, campus tour, or class playe 學會一套完整指令流程,適用任何影片:教學回顧、活動精華、校園簡介或班級話劇
Before we start.開始之前。 You'll need a Mac or PC with Terminal access, about an hour, and your raw footage (phone video is perfectly fine). This lesson assumes you're using Claude Code, or a similar agent that can open Terminal on your own computer — see Part B if you're starting from zero. About 30–40 minutes to read. 你需要一台能開終端機的 Mac 或 PC、大約一小時,以及你的原始素材(手機拍的完全沒問題)。這堂課假設你在用 Claude Code,或其他能在你自己電腦上開終端機的 agent——如果你是從零開始,請看 Part B。閱讀大約需要 30–40 分鐘。
Part A

Why this works now為什麼現在做得到

Video editors like Premiere or iMovie hide everything behind a timeline you drag with a mouse. But underneath, editing is really just a series of file operations: cut this clip from 0:03 to 0:11, lay this audio track under that video at a lower volume, burn these lines of text onto the frame at these timestamps. That's exactly the kind of precise, repeatable, file-based task an AI coding agent is built for.Premiere 或 iMovie 這類剪輯軟體,把一切都藏在你用滑鼠拖拉的時間軸背後。但實際上,剪輯說穿了就是一連串對檔案的操作:把這段畫面從 0:03 剪到 0:11、把這條音軌用較低的音量疊在畫面下方、在指定時間點把這幾行文字燒進畫面。這正是 AI 寫程式 agent 最擅長的那種精準、可重複、以檔案為本的任務。

The engine that actually does the work is a free, open-source program called ffmpeg — it has been the invisible backbone of nearly every video app for over 20 years. Your AI agent doesn't replace it; it writes and runs ffmpeg commands for you, the same way it writes and runs code when it builds you a webpage. You describe what you want in plain language; the agent translates that into exact commands, runs them, and shows you the result.真正動手做事的引擎,是一套免費、開源的程式,叫做 ffmpeg——它是幾乎所有影片軟體背後那個隱形的骨幹,已經默默運作超過 20 年了。你的 AI agent 不是取代它,而是幫你把話翻成 ffmpeg 指令、跑給你看,跟它幫你寫網頁程式碼、執行、給你看結果是同一套邏輯。你用白話描述想要什麼,agent 負責翻成精確的指令、執行,再把結果拿給你看。

ffmpeg

The free engine that actually cuts, mixes and exports video. Your agent drives it for you.

真正在剪接、混音、輸出影片的免費引擎。你的 agent 負責幫你操作它。

WhisperWhisper

A free speech-to-text model that turns your audio into an accurate, timestamped transcript.

免費的語音辨識模型,把你的聲音轉成準確、附時間碼的逐字稿。

SRT subtitlesSRT 字幕

A plain-text file of timed caption lines — the standard format your agent generates and burns in.

一份附時間碼的純文字字幕檔——agent 產生並燒進畫面用的標準格式。

B-rollB-roll

Cutaway footage shown over narration instead of a static talking head — covers edits, adds life.

在旁白進行時插入的補充畫面,取代死板的人頭鏡頭——遮住剪接痕跡,畫面也更有生命力。

DuckingDucking

Automatically lowering the music volume whenever someone is talking, then raising it back after.

只要有人在講話,就自動把音樂音量壓低,講完再拉回來。

Agent workspaceAgent 工作區

The project folder on your own computer where your agent reads and writes your video files directly.

你自己電腦上的專案資料夾,agent 直接在裡面讀寫你的影片檔案。

Part B

Installing the tools安裝工具

Four things, installed once. After this, you'll never touch the Terminal directly — you'll just talk to your agent, and it will run these tools on your behalf.四個東西,裝一次就好。裝完之後你就不用再自己碰終端機了——你只要跟 agent 說話,它會替你操作以下工具。

  1. Homebrew (Mac only)Homebrew(僅限 Mac) A package installer for Mac. If you don't already have it, go to brew.sh and copy the one-line install command into Terminal. Windows users can skip this and ask their agent to use winget instead.Mac 上的軟體安裝工具。如果你還沒裝,到 brew.sh 複製那行安裝指令貼進終端機執行即可。Windows 使用者可以跳過這步,改請 agent 用 winget 安裝。
  2. ffmpeg The actual video engine. In Terminal, run brew install ffmpeg. This is the single most important install on this page — nothing below works without it.真正的影片引擎。在終端機打 brew install ffmpeg。這是整頁最重要的一步——沒有它,下面所有事情都做不了。
  3. Whisper (speech-to-text)Whisper(語音轉文字) Ask your agent to install it for you — for example pip install openai-whisper or brew install whisper-cpp. You don't need to memorize the command; just tell your agent "install a local speech-to-text tool" and let it choose.請你的 agent 幫你裝,例如 pip install openai-whisperbrew install whisper-cpp。你不需要背指令,直接跟 agent 說「幫我裝一個本機語音轉文字工具」讓它自己決定就好。
  4. A terminal-based AI agent終端機型 AI agent Claude Code is the one this lesson is built around — install with npm install -g @anthropic-ai/claude-code, then run claude inside your project folder. The ChatGPT desktop app's agent mode can also open Terminal and drive ffmpeg the same way — the prompts in this lesson work with either.這堂課主要以 Claude Code 為例——執行 npm install -g @anthropic-ai/claude-code 安裝,再到你的專案資料夾裡執行 claude 就能開始。ChatGPT 桌面版的 agent 模式同樣能開終端機、操作 ffmpeg,原理相通——這堂課的提示詞兩邊都適用。
Why a terminal-based agent, not a browser tab.為什麼要用終端機型 agent,而不是網頁版。 Browser-based AI chat has an upload size limit and often re-compresses your video. A terminal-based agent works directly on the files already sitting on your computer — no upload, no size limit, no quality loss until the very final export. 網頁版的 AI 聊天工具有上傳大小限制,還常常會重新壓縮你的影片。終端機型 agent 是直接在你電腦上既有的檔案上工作——不用上傳、沒有大小限制,畫質一直到最後輸出前都不會損失。

Set up the project folder建立專案資料夾

mkdir my-video-project
cd my-video-project
mkdir raw-footage b-roll music
# drop your clips into raw-footage/, cutaways into b-roll/, mp3s into music/
claude
Part C

Get a transcript first — everything else builds on it先拿到逐字稿——後面所有事都建立在這上面

Before cutting anything, ask your agent to transcribe your raw audio. This one step gives you two things at once: a searchable script the agent can use to find the best soundbites and cut the "ums" and dead air, and the exact timestamps needed to generate subtitles.在剪任何東西之前,先請 agent 把原始聲音轉成逐字稿。這一步一次拿到兩樣東西:一份可搜尋的腳本,讓 agent 能找出最好的片段、剪掉「呃」和冷場;以及做字幕所需的精確時間碼。

Ask your agent跟你的 agent 這樣說

"Transcribe every clip in raw-footage/ using Whisper.
Save each as an .srt subtitle file with the same name.
Then show me the full transcript so I can tell you what to cut."

If you'd rather not touch a terminal at all for this one step, there are GUI apps that do good auto-captioning on their own — worth knowing about even though this lesson's workflow uses Whisper:如果這一步你完全不想碰終端機,也有幾套圖形介面的 App 能自己做出不錯的自動字幕——雖然這堂課的流程用的是 Whisper,但這些工具還是值得認識:

Tool工具Best for適合用在
Whisper via your agent透過 agent 用 WhisperMost accurate, works offline, batch-processes many clips at once, feeds directly into the rest of this workflow.最準確、離線可用、能一次批次處理多支影片,還能直接接上這堂課後面的整套流程。
CapCut (剪映) auto-captions剪映自動字幕A quick, free, no-install option if you just need one short clip captioned in Traditional Chinese right now.如果你只是想馬上幫一支短片加上繁中字幕,這是免安裝、免費又快速的選擇。
iFlytek (訊飛聽見)訊飛聽見Strong Mandarin dictation if your footage is entirely in Chinese with heavy accents or classroom noise.如果整支影片全是中文、口音重或教室噪音大,這套的中文聽打表現很強。
Read the transcript before you cut.動剪之前先看過逐字稿。 Skim it and tell your agent in plain language what to remove — "cut the long pause around 2:10," "drop the second attempt at this sentence, keep the third." The agent maps your notes back to timestamps and cuts the actual footage. 掃過一遍,用白話告訴 agent 要剪掉什麼——「把 2:10 附近那段很長的停頓剪掉」、「這句話講了三次,留第三次就好」。Agent 會把你的說法對應回時間碼,直接剪動實際的影片。
Part D

Copyright-free background music不用版權的背景音樂

A video with copyrighted music can get muted, demonetized or taken down once it's on YouTube or your school's site — and it's an easy problem to avoid entirely. These sources are free to use, even in videos published publicly by a school:影片一旦放上 YouTube 或學校網站,用了有版權的音樂可能會被靜音、拿掉廣告分潤、甚至整支下架——但這其實是完全可以避免的問題。以下這幾個來源都能免費使用,就算是學校公開發佈的影片也沒問題:

  1. YouTube Audio LibraryYouTube Audio Library Free inside YouTube Studio (studio.youtube.com → Audio Library). Most tracks need no attribution at all — filter by mood or genre and download the mp3 directly.YouTube Studio 裡就有(studio.youtube.com → 音效資料庫),完全免費。大部分曲目連掛名致謝都不需要——依情緒或曲風篩選,直接下載 mp3。
  2. Pixabay MusicPixabay Music pixabay.com/music — free for commercial use, no attribution required. Good search filters by mood, genre and length.pixabay.com/music——可商用、免致謝。可依情緒、曲風、長度篩選,好找。
  3. Free Music Archive / IncompetechFree Music Archive / Incompetech Creative Commons libraries with a huge catalogue. Many tracks require attribution in your video description — check the specific license shown next to each track before you use it.曲庫龐大的創用 CC 授權平台。不少曲目要求在影片說明欄掛名致謝——下載前務必看清楚每首曲子旁標示的授權條款。
"Free" doesn't always mean "no strings attached."「免費」不等於「完全沒有條件」。 Always read the license on the specific track, not just the site's homepage. When in doubt, YouTube Audio Library's no-attribution tracks are the safest default for a school video. 一定要看那首曲子本身的授權說明,不要只看網站首頁的宣傳。拿不準的話,YouTube Audio Library 裡不用致謝的曲目,是校園影片最保險的預設選擇。

Ask your agent to mix and duck it請 agent 幫你混音並自動壓低

"Add music/campus-theme.mp3 as a background track under the whole video,
starting at 20% volume. Duck it down to 8% whenever someone is speaking,
and bring it back up to 20% during quiet or B-roll-only sections."
Part E

B-roll — what it is, and why it saves your editB-roll——是什麼,為什麼能救你的剪輯

"B-roll" is any cutaway footage you show over narration instead of a static shot of someone talking — a wide shot of the classroom, hands writing on a worksheet, students laughing. It does two jobs at once: it hides the visual jump when you cut out an awkward pause in the main footage, and it simply makes the video feel less like a static recording.「B-roll」指的是在旁白進行時疊在畫面上的補充鏡頭,取代死板的講話人頭鏡頭——教室的遠景、學生在學習單上寫字的手、學生大笑的畫面。它同時做兩件事:剪掉主鏡頭裡尷尬停頓時,用它蓋過畫面跳接的痕跡;同時也讓整支影片不再像一支呆板的錄影。

Once your agent has the transcript, it can flag long stretches where the visual doesn't change — "the same static shot from 1:40 to 2:35" — and suggest exactly where a cutaway would help. You just need to have shot some extra footage to give it.Agent 拿到逐字稿之後,就能標出畫面一直沒變的長段落——「1:40 到 2:35 都是同一個靜止鏡頭」——並建議在哪裡插入補充畫面最合適。你只需要事先多拍一些額外素材,供它使用。

Video type影片類型B-roll ideas to shoot可以拍的 B-roll
Lesson recap教學影片Close-ups of the worksheet, students writing, the whiteboard, a page turning.學習單特寫、學生寫字的手、白板、翻頁的畫面。
Student activity reel學生活動影片Candid shots of the activity in progress, high-fives, group reactions, laughter.活動進行中的自然抓拍、擊掌、群體反應、笑聲畫面。
Campus tour校園簡介Establishing shots of the gate, hallway walk-throughs, a classroom door opening.校門遠景、走廊行走鏡頭、教室門打開的畫面。
Class play學生演戲Rehearsal footage, backstage costume prep, audience reactions in the crowd.彩排畫面、後台換裝準備、台下觀眾的反應。

Ask your agent跟你的 agent 這樣說

"Look at the transcript and flag any stretch longer than 15 seconds
where the visual doesn't change. Suggest which clip in b-roll/
would fit each one, then cut it in over the narration."
Part F

Putting it all together全部串起來

Here's the order that works best — each step hands the next one exactly what it needs.照這個順序做效果最好——每一步都會準備好下一步需要的東西。

Gather footage收集素材 Main footage into raw-footage/, cutaways into b-roll/, music into music/.主要畫面放 raw-footage/、補充畫面放 b-roll/、音樂放 music/。
Transcribe轉逐字稿 Whisper produces a script and timestamps for every clip.Whisper 產出每支影片的腳本與時間碼。
Trim narration剪掉冷場 You mark up the transcript; the agent cuts pauses and filler from the real footage.你在逐字稿上做標記;agent 從實際影片裡剪掉停頓與贅詞。
Add B-roll + music加 B-roll 與音樂 Cutaways drop into static stretches; music plays under, ducked under speech.補充畫面插入呆板段落;音樂鋪底,講話時自動壓低。
Subtitle + export燒字幕、輸出 Captions burn in from the .srt file; ffmpeg renders the finished video.字幕從 .srt 檔燒進畫面;ffmpeg 輸出完成的影片。

A full prompt you can copy and adapt一份可直接複製套用的完整指令

"This is a [lesson recap / activity reel / campus tour / class play] video.

1. Transcribe everything in raw-footage/ with Whisper.
2. Show me the transcript so I can mark what to cut.
3. Cut the marked pauses and filler from the real clips, and stitch
   the remaining footage together in order.
4. Wherever a single shot runs longer than 15 seconds, suggest a
   b-roll/ clip to cut in over the narration.
5. Add music/[track].mp3 under the whole video at 20% volume,
   ducked to 8% whenever someone is speaking.
6. Burn in the subtitles from the .srt files, centered near the
   bottom, readable on a phone screen.
7. Export as a single MP4, 1080p, ready to upload."
Cheat sheet速查表

Every word, one line each每個詞,各一句話

Term術語Plain English白話說法
ffmpegThe free engine that actually cuts, mixes and exports video files.真正在剪接、混音、輸出影片檔案的免費引擎。
WhisperA free tool that turns speech into a timestamped, written transcript.把語音轉成附時間碼書面逐字稿的免費工具。
SRTThe standard subtitle file format — timed lines of text your agent burns onto the video.標準的字幕檔格式——附時間碼的文字行,agent 用它燒字幕到畫面上。
B-rollCutaway footage shown over narration instead of a static talking-head shot.旁白時疊在畫面上的補充鏡頭,取代死板的講話人頭畫面。
DuckingDuckingAutomatically lowering music volume while someone is speaking.有人講話時自動把音樂音量壓低。
Talking headTalking headA static shot of one person speaking to camera — what B-roll is used to break up.一個人對著鏡頭講話的靜止鏡頭——B-roll 就是用來打斷這種畫面的。
Render / exportRender / exportThe final step where all the edits are combined into one finished video file.把所有剪輯合併成一支完成影片檔案的最後一步。
Quick check小考

Eight questions, one page八題小考,一頁搞定

Answer every question, then check your score. This grades itself right here in your browser — nothing is saved or sent anywhere.每一題都作答完,再檢查你的分數。這個測驗就在你的瀏覽器裡自動算分——什麼都不會被存起來或傳出去。

Question 1第 1 題

What does ffmpeg actually do?ffmpeg 到底在做什麼?

Question 2第 2 題

Why get a transcript before cutting anything?為什麼要在剪之前先拿到逐字稿?

Question 3第 3 題

Why prefer a terminal-based agent over a browser AI chat for editing video?為什麼剪片偏好用終端機型 agent,而不是網頁版 AI 聊天?

Question 4第 4 題

Which music source is described as the safest default for a school video?哪個音樂來源被說是校園影片最保險的預設選擇?

Question 5第 5 題

What does "ducking" mean?「ducking」是什麼意思?

Question 6第 6 題

What is B-roll for?B-roll 的用途是什麼?

Question 7第 7 題

In the recommended workflow, what comes right after transcribing?在建議的流程裡,轉完逐字稿之後緊接著是哪一步?

Question 8第 8 題

What format does your agent generate for subtitles?Agent 產生字幕用的是什麼格式?

You did it — quick recap你做到了——快速回顧

  • Install ffmpeg and a terminal-based AI agent that can touch your video files安裝 ffmpeg 與能真正動到影片檔案的終端機型 AI agent
  • Get a clean transcript and burned-in subtitles automatically自動拿到乾淨的逐字稿與燒錄字幕
  • Find legal background music and have it ducked under your voice找到合法背景音樂,並讓它在人聲出現時自動壓低
  • Understand B-roll and ask your agent to place it搞懂 B-roll,並請 agent 幫你安插
  • Follow the full workflow for any school video type套用完整流程剪出任何類型的校園影片