The gist
Editing video without a video editor sounds like science fiction. But Claude Code can drive FFmpeg (a tool for working with video and audio) through commands, work with DaVinci Resolve through MCP (Model Context Protocol), and generate programmatic videos with Remotion. For a YouTube channel, ad spots or training materials, this changes the whole production process.
Key concepts
- FFmpeg: a command-line tool for video/audio (free, powerful, everywhere)
- DaVinci Resolve MCP: controlling a professional editor through Claude
- Remotion: creating video in code with React/JavaScript
- Pipe-based editing: processing step by step through commands (a pipeline is a chain of steps)
- Batch processing: processing video files in bulk
Theory
FFmpeg + Claude: automated editing
FFmpeg is the most powerful free tool for video. The problem: thousands of flags that nobody can memorize. Claude Code knows them all.
Installing FFmpeg:
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Check
ffmpeg -versionBasic operations (ask Claude Code for these):
# Convert formats
ffmpeg -i input.mov -c:v libx264 -crf 23 output.mp4
# Trim by time
ffmpeg -i input.mp4 -ss 00:00:30 -to 00:02:00 -c copy clip.mp4
# Resize
ffmpeg -i input.mp4 -vf "scale=1920:1080" output.mp4
# Compress for YouTube
ffmpeg -i raw.mp4 -c:v libx264 -preset slow -crf 18 \
-c:a aac -b:a 320k youtube-ready.mp4
# Join several videos
cat > list.txt << EOF
file 'clip1.mp4'
file 'clip2.mp4'
file 'clip3.mp4'
EOF
ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4
# Add subtitles
ffmpeg -i video.mp4 -i subtitles.srt -c copy -c:s mov_text with-subs.mp4
# Extract the audio track
ffmpeg -i video.mp4 -vn -acodec copy audio.m4a
# Add background music (lower the volume of the original)
ffmpeg -i video.mp4 -i music.mp3 \
-filter_complex "[0:a]volume=1.0[orig];[1:a]volume=0.3[bg];[orig][bg]amix=inputs=2" \
-c:v copy output.mp4YouTube pipeline: from recording to publishing
#!/usr/bin/env bash
# youtube-pipeline.sh: the full pipeline from raw video to YouTube
set -euo pipefail
INPUT_FILE="$1"
VIDEO_TITLE="$2"
OUTPUT_DIR="./youtube-ready"
mkdir -p "$OUTPUT_DIR"
echo "🎬 Processing: $INPUT_FILE"
# Step 1: Transcribe the audio with Whisper
# The API accepts files up to 25 MB, so first extract a lightweight audio track
# (for very long recordings, split the audio into parts)
echo "📝 Transcribing..."
ffmpeg -i "$INPUT_FILE" -vn -ac 1 -ar 16000 -b:a 48k "$OUTPUT_DIR/audio.mp3" -y -loglevel error
# whisper-1 can return ready-made subtitles (srt); for plain text OpenAI recommends newer models
curl -s -X POST "https://api.openai.com/v1/audio/transcriptions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F file="@$OUTPUT_DIR/audio.mp3" \
-F model="whisper-1" \
-F language="en" \
-F response_format="srt" \
--output "$OUTPUT_DIR/subtitles.srt"
# Step 2: Optimize for YouTube with Claude
echo "🤖 Generating metadata..."
DESCRIPTION=$(cat "$OUTPUT_DIR/subtitles.srt" | claude -p "
Based on this transcript, write:
1. A YouTube description (300-500 words, with timestamps)
2. 15-20 hashtags for our niche
3. Comma-separated tags (20-30 tags)
Video topic: $VIDEO_TITLE
")
# Step 3: Convert to a YouTube-optimal format
echo "📹 Converting video..."
ffmpeg -i "$INPUT_FILE" \
-c:v libx264 -preset slow -crf 18 \
-c:a aac -b:a 320k \
-vf "scale=1920:1080" \
"$OUTPUT_DIR/${VIDEO_TITLE// /_}.mp4" \
-y
# Step 4: Grab thumbnails from an early frame + the middle
ffmpeg -i "$INPUT_FILE" -ss 00:00:05 -vframes 1 "$OUTPUT_DIR/thumbnail-start.jpg"
ffmpeg -i "$INPUT_FILE" -ss $(ffprobe -v error -show_entries format=duration -of csv=p=0 "$INPUT_FILE" | awk '{print int($1/2)}') \
-vframes 1 "$OUTPUT_DIR/thumbnail-middle.jpg"
# Step 5: Save the description
echo "$DESCRIPTION" > "$OUTPUT_DIR/description.txt"
echo "✅ Done! Files are in $OUTPUT_DIR/"
echo "Video: ${VIDEO_TITLE// /_}.mp4"
echo "Subtitles: subtitles.srt"
echo "Description: description.txt"
echo "Thumbnails: thumbnail-start.jpg, thumbnail-middle.jpg"DaVinci Resolve MCP: professional editing through Claude
DaVinci Resolve is a professional video editor (the free version is very capable). There's an MCP server for it that lets you control the editor through Claude Code.
Installing the MCP (as of October 2026):
# Quick start with the npm launcher
npx davinci-resolve-mcp setup
# Or from source (requires Python 3.10+)
git clone https://github.com/samuelgursky/davinci-resolve-mcp.git
cd davinci-resolve-mcp
python install.pyThe installer adds the necessary entries to your MCP client config on its own. It requires DaVinci Resolve 18.5 or newer. External control through the official Scripting API works fully in the Studio version; in the free version external scripts are limited, and access goes through the Workspace → Scripts menu inside Resolve (see the repository README for the details).
What DaVinci Resolve MCP can do:
- Create new projects and timelines
- Import clips from the media pool
- Add clips to the timeline
- Apply color correction (LUT, Primary)
- Adjust audio (volume, noise reduction)
- Render to the format you need
- Manage markers and cut points
# Example of working with DaVinci Resolve through Claude
# Once the MCP is connected, Claude can carry out:
"""
Create a new project called "YouTube_EP15"
Import all mp4 files from the ~/raw-footage/ folder
Add them to the timeline in alphabetical order
Apply the Rec.709 color space
Bring the loudness down to -12 LUFS
Render to H.264 1080p for YouTube
"""Important: DaVinci Resolve MCP works through Resolve's Lua/Python API (application programming interface). DaVinci Resolve has to be running on the same machine.
Remotion: creating video in code
Remotion is a library for making videos with React. Write a JSX component → get an MP4. Remotion has Agent Skills and plugins for working with coding agents. License as of October 2026: free for individuals and teams of up to 3 people; companies of 4 or more need a paid license (terms at remotion.dev).
Installation:
npx create-video@latest
cd my-video
npm start # Opens a preview in the browserA simple example: an animated title:
// src/Root.tsx
import { Composition } from 'remotion';
import { TitleCard } from './TitleCard';
export const RemotionRoot = () => {
return (
<Composition
id="TitleCard"
component={TitleCard}
durationInFrames={150} // 5 seconds at 30fps
fps={30}
width={1920}
height={1080}
defaultProps={{
title: "How AI agents work",
subtitle: "A Claude Code course",
}}
/>
);
};// src/TitleCard.tsx
import { AbsoluteFill, spring, useCurrentFrame, useVideoConfig, interpolate } from 'remotion';
interface Props {
title: string;
subtitle: string;
}
export const TitleCard = ({ title, subtitle }: Props) => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
// Fade-in animation (spring gives a physical bounce)
const titleOpacity = spring({
frame,
fps,
config: { damping: 200 },
});
// Slide up from below
const titleY = interpolate(frame, [0, 20], [50, 0], {
extrapolateRight: 'clamp',
});
const subtitleOpacity = spring({
frame: frame - 15, // Lags by 0.5 sec
fps,
config: { damping: 200 },
});
return (
<AbsoluteFill
style={{
background: 'linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%)',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
}}
>
<h1
style={{
color: 'white',
fontSize: 80,
fontWeight: 'bold',
opacity: titleOpacity,
transform: `translateY(${titleY}px)`,
textAlign: 'center',
}}
>
{title}
</h1>
<p
style={{
color: '#64b5f6',
fontSize: 40,
opacity: subtitleOpacity,
marginTop: 20,
}}
>
{subtitle}
</p>
</AbsoluteFill>
);
};Rendering to MP4:
# Render one video
npx remotion render TitleCard output.mp4
# Render with parameters (for dynamic content)
npx remotion render TitleCard output.mp4 \
--props='{"title":"Next topic","subtitle":"Final module"}'
# Parallel render (faster)
npx remotion render TitleCard output.mp4 --concurrency=4Batch processing: 100 videos at once
#!/usr/bin/env bash
# batch-process.sh: bulk processing of video files
INPUT_DIR="./raw"
OUTPUT_DIR="./processed"
mkdir -p "$OUTPUT_DIR"
# Counter
TOTAL=$(find "$INPUT_DIR" -name "*.mp4" | wc -l)
CURRENT=0
find "$INPUT_DIR" -name "*.mp4" | while read -r file; do
CURRENT=$((CURRENT + 1))
FILENAME=$(basename "$file" .mp4)
echo "[$CURRENT/$TOTAL] Processing: $FILENAME"
# Convert for social media (several formats)
# YouTube (16:9, 1080p)
ffmpeg -i "$file" \
-c:v libx264 -preset fast -crf 22 \
-c:a aac -b:a 192k \
-vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080" \
"$OUTPUT_DIR/${FILENAME}_youtube.mp4" \
-y -loglevel error
# Instagram Reels/TikTok (9:16, 1080x1920)
ffmpeg -i "$file" \
-c:v libx264 -preset fast -crf 22 \
-c:a aac -b:a 192k \
-vf "scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920" \
"$OUTPUT_DIR/${FILENAME}_vertical.mp4" \
-y -loglevel error
# Thumbnail (frame at the 5-second mark)
ffmpeg -i "$file" \
-ss 5 -vframes 1 \
-vf "scale=1280:720" \
"$OUTPUT_DIR/${FILENAME}_thumb.jpg" \
-y -loglevel error
echo " ✅ Done: YouTube + Vertical + Thumbnail"
done
echo "✅ Batch processing complete: $TOTAL videos"Claude Code for writing FFmpeg commands
The simplest workflow is to just ask Claude to write the command you need:
I need to: - Take video.mp4 (4 hours, 4K) - Cut out the section from 01:15:30 to 01:45:00 - Scale it down to 1080p - Add subtitles from subs.srt - Save it as clip.mp4 Write the FFmpeg command.
Claude Code will reply with an exact command and an explanation of every flag.
Practice
- Install FFmpeg:
brew install ffmpeg - Take any video → ask Claude Code to write a command that converts it to a 1080p YouTube format
- Create a script that cuts a video into one-minute clips
- Install Remotion:
npx create-video@latest→ create an animated title card - (advanced) Install DaVinci Resolve + DaVinci Resolve MCP, try controlling it through Claude
Tools and resources
- FFmpeg: the official site, documentation for every flag
- DaVinci Resolve MCP: the GitHub repository (installation instructions and the limits of the free version of Resolve)
- DaVinci Resolve: free download
- Remotion: creating video in code with React; license: remotion.dev/docs/license
Key takeaways
FFmpeg + Claude Code = command-line editing. You don't know the flags, but Claude does. Say what you need, get a ready-made command.
Remotion = programmatic video. Animated presentations, data in motion, branded content, with no motion design skills, through React.
DaVinci Resolve MCP is for people who already use Resolve. Claude drives a professional editor through MCP: color correction, editing and rendering through text commands.
Next lesson
→ Algorithmic trading with Claude Code: Alpaca MCP and risk management
The mark stays in this browser only and is never sent anywhere. My progress