Kashi Keefe← All resources
Creative·Claude·10 min read

Edit Video Start to Finish in Claude Code

Cut, caption, and render real video edits straight from the terminal with Claude Code.

Most people think of Claude as a writing tool. But if you run Claude Code in your terminal, you have something much more useful for video work: a coding agent that can write and execute ffmpeg commands, generate SRT captions, build edit timelines, and render final output — all from a conversation. You describe the edit, Claude writes the shell commands, and your video gets cut. No timeline scrubbing, no GUI crashes, no subscription to another app.

This workflow works best when you have raw footage already on your machine and you want to move fast. It is not a replacement for color grading in DaVinci or motion graphics in After Effects. It is a replacement for the tedious middle layer: trimming, joining, adding captions, resizing for platforms, and exporting in the right codec. Those tasks take real time in traditional editors. In Claude Code, they take a prompt.

What You Need Before You Start

  • Claude Code installed and running (claude.ai/code or via the CLI)
  • ffmpeg installed on your machine — run `ffmpeg -version` in terminal to confirm
  • Your raw video files in a known directory (e.g. ~/Desktop/footage/)
  • A rough idea of what you want: which clips, in what order, with what captions

If ffmpeg is not installed, Claude Code can walk you through installing it via Homebrew on Mac or apt on Linux. Just ask. Everything below assumes ffmpeg is ready.

The Prompt

I have raw video clips in ~/Desktop/footage/. Here is what I want:

1. Trim clip01.mp4 from 0:00:08 to 0:01:42
2. Trim clip02.mp4 from 0:00:03 to 0:00:55
3. Trim clip03.mp4 from 0:00:12 to 0:02:10
4. Join them in that order with no transition (hard cut)
5. Add burned-in subtitles using this transcript:
   [00:00:00 --> 00:00:06] The hardest part of running a business is not the work.
   [00:00:07 --> 00:00:14] It is making decisions without enough information.
   [00:00:15 --> 00:00:22] AI does not remove the uncertainty. It just compresses it.
6. Export the final video as final_cut.mp4, H.264, 1080p, optimized for web

Write and run the ffmpeg commands to do all of this. Show me each command before you run it and tell me what it does.

That prompt gives Claude everything it needs. It knows the files, the trim points, the order, the caption text with timestamps, and the export settings. The instruction to show each command before running it keeps you in control — you can catch a typo in a timestamp before it bakes into the output.

What Claude Actually Does

Claude Code will break this into stages and execute them sequentially. First it trims each clip using ffmpeg's -ss and -to flags, outputting trimmed versions to a working directory. Then it writes a concat list file — a plain text file ffmpeg uses to join clips in order. Then it runs the concat command. Then it generates an SRT file from your caption text, and burns it into the video using a subtitle filter. Finally it encodes the output with your specified codec and resolution.

Each step produces an intermediate file. If something looks wrong mid-process — a trim is off by a second, a caption line is missing — you can stop, correct the prompt, and rerun just that step. You do not start from scratch.

Tips for Getting Clean Results

  • Use exact timestamps in HH:MM:SS format. Vague ranges like 'cut the beginning' will produce guesses. Be precise.
  • Tell Claude the output codec and resolution upfront. Default ffmpeg settings are not always web-optimized. Specify H.264 + AAC + 1080p explicitly.
  • Ask Claude to preserve audio from all clips unless you want music-only output. It will not assume.
  • If you want captions styled a specific way — font size, color, position — say so. Claude can pass those options to the ffmpeg subtitle filter.
  • For platform exports, give Claude the target: 'Instagram Reels (9:16, 1080x1920, max 90 seconds)' or 'YouTube (16:9, 1080p, stereo audio)'. It will handle the crop and resize.
  • Ask Claude to verify the output file exists and print its duration after each render. This catches silent failures before you move on.
  • If a command fails, paste the error back into Claude Code. It will read the ffmpeg error output and fix the command. This is faster than Googling ffmpeg syntax.

Generating Captions From a Transcript

If you already have a transcript but no timestamps, you can have Claude generate the SRT timing for you. Give it the word-for-word transcript and the total video duration, and ask it to estimate timestamps based on average speaking pace. It is not frame-accurate, but it gets you a working SRT file you can fine-tune in a text editor.

Here is a word-for-word transcript of my 3-minute video. The speaker talks at a normal pace with brief pauses between sentences. Generate a properly formatted SRT subtitle file with estimated timestamps. Write it to ~/Desktop/footage/captions.srt

Transcript:
The hardest part of running a business is not the work. It is making decisions without enough information. AI does not remove the uncertainty. It just compresses it. When I started using Claude to process client research, my proposal turnaround went from four days to one. Not because I worked harder. Because I stopped doing the part that did not require my judgment.

Claude will produce a valid SRT file. Open it in any text editor to adjust timestamps if a line is off. Then use the main editing prompt to burn those captions into your video.

Resizing for Multiple Platforms in One Pass

One of the highest-leverage uses of this workflow is exporting the same base cut in multiple aspect ratios without touching a timeline. You describe the crops once and Claude runs them in parallel.

Take final_cut.mp4 and export three versions:
1. YouTube: 1920x1080 (16:9), keep original framing, H.264, stereo AAC 192k → youtube_version.mp4
2. Instagram Reels: 1080x1920 (9:16), center crop the 16:9 source, same codec → reels_version.mp4
3. LinkedIn: 1920x1080 (16:9), same as YouTube but with a 3-second black fade-in at the start → linkedin_version.mp4

Write and run all three ffmpeg commands. Confirm each output file exists and print its duration when done.

Center-crop from 16:9 to 9:16 works well for talking-head footage where the subject stays centered. For footage with side-to-side movement, tell Claude which side of the frame to bias the crop toward — it can adjust the crop offset in the ffmpeg filter.

Adding a Music Bed

Mix background music into final_cut.mp4:
- Music file: ~/Desktop/footage/background_music.mp3
- Lower the music volume to 15% of its original level
- Keep the original voice audio at 100%
- Fade the music out over the last 5 seconds of the video
- Export as final_with_music.mp4

Write and run the ffmpeg command.

Claude will use ffmpeg's amix and afade filters to handle this. The 15% volume reduction is a reliable starting point for voice-over content — enough presence without drowning the speaker. Adjust the percentage in the prompt if your first render feels off.

Troubleshooting Common Issues

  • If trim points produce a clip that starts mid-sentence, your source timestamps may be off. Ask Claude to re-examine the original file duration first: 'Run ffprobe on clip01.mp4 and tell me its exact duration and frame rate.'
  • If burned-in captions look pixelated or too small, ask Claude to increase the font size in the subtitle filter and re-render. Specify the pixel size you want, not just 'bigger.'
  • If the joined clips have a audio pop at the cut point, ask Claude to add a 2-frame audio crossfade at each join. ffmpeg can do this with the acrossfade filter.
  • If the 9:16 crop cuts off the subject's head, tell Claude to shift the crop window upward by a specific number of pixels. Start with 200px and adjust from there.
  • If Claude says it cannot run a command, check that Claude Code has file system access permissions enabled for your footage directory.

Where This Fits in a Real Content Workflow

The most practical use case is post-interview or post-recording cleanup. You record a 45-minute Zoom call, download the local recording, and want a 3-minute highlight cut with captions ready to post by end of day. Traditionally that is two to three hours of timeline work. With Claude Code, you write the prompt, review the commands, let it run, and spot-check the output. Total active time: under 20 minutes.

This also works well for batch jobs. If you have 12 raw clips from a workshop and need each one trimmed, captioned, and exported in two aspect ratios, write one prompt that loops over all 12. Claude will handle the repetition without complaining. That is the actual leverage — not one clever edit, but eliminating the manual repetition entirely.

Claude Code operates on your local files. Nothing is uploaded to a cloud editor. Your footage stays on your machine. That matters if you are working with client content under NDA or footage that has not been cleared for distribution yet.

Prompt Variations

  • Extract all audio from a video file as a clean MP3: 'Strip the audio track from interview.mp4 and save it as interview_audio.mp3 at 192k bitrate.'
  • Add a static lower-third title card: 'Add a white text lower-third reading "Kashi Keefe — AI Operator" at the bottom of the frame from 0:00:03 to 0:00:08 using ffmpeg's drawtext filter.'
  • Speed up a clip without changing pitch: 'Speed up broll_clip.mp4 by 1.5x and preserve the original audio pitch. Export as broll_fast.mp4.'
  • Compress a large file for email: 'Re-encode final_cut.mp4 to keep it under 25MB while maintaining 1080p. Use two-pass encoding if needed.'
  • Remove silence: 'Detect and cut all sections of interview.mp4 where the audio level drops below -40dB for more than 1.5 seconds. Export the result as interview_trimmed.mp4.'