/ffmpeg
Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.
$ npx -y skills add calesthio/OpenMontage --skill ffmpeg --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ffmpeg
Context preview
The summary Claude sees to decide when to auto-load this skill.
Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.
SKILL.md
ffmpeg.SKILL.mdname: ffmpeg
description: Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.
FFmpeg for Video Production
FFmpeg is the essential tool for video/audio processing. This skill covers common operations for Remotion video projects.
Quick Reference
GIF to MP4 (Remotion-compatible)
ffmpeg -i input.gif -movflags faststart -pix_fmt yuv420p \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4
**Why these flags:**
- `-movflags faststart` - Moves metadata to start for web streaming
- `-pix_fmt yuv420p` - Ensures compatibility with most players
- `scale=trunc(...)` - Forces even dimensions (required by most codecs)
Resize Video
# To 1920x1080 (maintain aspect ratio, add black bars)
ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4
# To 1920x1080 (crop to fill)
ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" output.mp4
# Scale to width, auto height
ffmpeg -i input.mp4 -vf "scale=1280:-2" output.mp4
Compress Video
# Good quality, smaller file (CRF 23 is default, lower = better quality)
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4
# Aggressive compression for web preview
ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 96k output.mp4
# Target file size (e.g., ~10MB for 60s video = ~1.3Mbps)
ffmpeg -i input.mp4 -c:v libx264 -b:v 1300k -c:a aac -b:a 128k output.mp4
Extract Audio
# Extract to MP3
ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 output.mp3
# Extract to AAC
ffmpeg -i input.mp4 -vn -acodec aac -b:a 192k output.m4a
# Extract to WAV (uncompressed)
ffmpeg -i input.mp4 -vn output.wav
Convert Audio Formats
# M4A to MP3 (for ElevenLabs voice samples)
ffmpeg -i input.m4a -codec:a libmp3lame -qscale:a 2 output.mp3
# WAV to MP3
ffmpeg -i input.wav -codec:a libmp3lame -b:a 192k output.mp3
# Adjust volume
ffmpeg -i input.mp3 -filter:a "volume=1.5" output.mp3
Trim/Cut Video
# Cut from timestamp to duration (recommended - reliable)
ffmpeg -i input.mp4 -ss 00:00:30 -t 00:00:15 -c:v libx264 -c:a aac output.mp4
# Cut from timestamp to timestamp
ffmpeg -i input.mp4 -ss 00:00:30 -to 00:00:45 -c:v libx264 -c:a aac output.mp4
# Stream copy (faster but may lose frames at cut points)
# Only use when source has frequent keyframes
ffmpeg -i input.mp4 -ss 00:00:30 -t 00:00:15 -c copy output.mp4
**Note:** Re-encoding is recommended for trimming. Stream copy (`-c copy`) can silently drop video if the seek point doesn't align with a keyframe.
Speed Up / Slow Down
# 2x speed (video and audio)
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4
# 0.5x speed (slow motion)
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]" -map "[v]" -map "[a]" output.mp4
# Video only (no audio)
ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -an output.mp4
Concatenate Videos
# Create file list
echo "file 'clip1.mp4'" > list.txt
echo "file 'clip2.mp4'" >> list.txt
echo "file 'clip3.mp4'" >> list.txt
# Concatenate (same codec/resolution)
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4
# Concatenate with re-encoding (different sources)
ffmpeg -f concat -safe 0 -i list.txt -c:v libx264 -c:a aac output.mp4
Add Fade In/Out
# Fade in first 1 second, fade out last 1 second (30fps video)
ffmpeg -i input.mp4 -vf "fade=t=in:st=0:d=1,fade=t=out:st=9:d=1" -c:a copy output.mp4
# Audio fade
ffmpeg -i input.mp4 -af "afade=t=in:st=0:d=1,afade=t=out:st=9:d=1" -c:v copy output.mp4
Get Video Info
# Duration, resolution, codec info
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4
# Full info
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
Remotion-Specific Patterns
Video Speed Adjustment for Remotion
**When to use FFmpeg vs Remotion `playbackRate`:**
| Scenario | Use FFmpeg | Use Remotion | |----------|------------|--------------| | Constant speed (1.5x, 2x) | Either works | ✅ Simpler | | Extreme speeds (>4x or <0.25x) | ✅ More reliable | May have issues | | Variable speed (accelerate over time) | ✅ Pre-process | Complex workaround needed | | Need perfect audio sync | ✅ Guaranteed | Usually fine | | Demo needs to fit voiceover timing | ✅ Pre-calculate | Runtime adjustment |
**Remotion limitation:** `playbackRate` must be constant. Dynamic interpolation like `playbackRate={interpolate(frame, [0, 100], [1, 5])}` won't work correctly because Remotion evaluates frames independently.
# Speed up demo to fit a scene (e.g., 60s demo into 20s = 3x speed)
ffmpeg -i demo-raw.mp4 \
-filter_complex "[0:v]setpts=0.333*PTS[v];[0:a]atempo=3.0[a]" \
-map "[v]" -map "[a]" \
public/demos/demo-fast.mp4
# Slow motion for emphasis (0.5x speed)
ffmpeg -i action.mp4 \
-filter_complex "[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]" \
-map "[v]" -map "[a]" \
public/demos/action-slow.mp4
# Speed up without audio (common for screen recordings)
ffmpeg -i demo.mp4 -filter:v "setpts=0.5*PTS" -an public/demos/demo-2x.mp4
# Timelapse effect (10x speed, drop audio)
ffmpeg -i long-demo.mp4 -filter:v "setpts=0.1*PTS" -an public/demos/timelapse.mp4
**Calculate speed factor:**
- To fit X seconds of video into Y seconds of scene: `speed = X / Y`
- setpts multiplier = `1 / speed` (e.g., 3x speed = setpts=0.333*PTS)
- atempo value = `speed` (e.g., 3x speed = atempo=3.0)
**Extreme speed (>2x audio):** Chain atempo filters (each limited to 0.5-2.0 range):
# 4x speed audio
-filter_complex
Read more
name: ffmpeg description: Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.
FFmpeg for Video Production
FFmpeg is the essential tool for video/audio processing. This skill covers common operations for Remotion video projects.
Quick Reference
GIF to MP4 (Remotion-compatible)
ffmpeg -i input.gif -movflags faststart -pix_fmt yuv420p \ -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4
**Why these flags:**
- `-movflags faststart` - Moves metadata to start for web streaming
- `-pix_fmt yuv420p` - Ensures compatibility with most players
- `scale=trunc(...)` - Forces even dimensions (required by most codecs)
Resize Video
# To 1920x1080 (maintain aspect ratio, add black bars) ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4 # To 1920x1080 (crop to fill) ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" output.mp4 # Scale to width, auto height ffmpeg -i input.mp4 -vf "scale=1280:-2" output.mp4
Compress Video
# Good quality, smaller file (CRF 23 is default, lower = better quality) ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4 # Aggressive compression for web preview ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 96k output.mp4 # Target file size (e.g., ~10MB for 60s video = ~1.3Mbps) ffmpeg -i input.mp4 -c:v libx264 -b:v 1300k -c:a aac -b:a 128k output.mp4
Extract Audio
# Extract to MP3 ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 output.mp3 # Extract to AAC ffmpeg -i input.mp4 -vn -acodec aac -b:a 192k output.m4a # Extract to WAV (uncompressed) ffmpeg -i input.mp4 -vn output.wav
Convert Audio Formats
# M4A to MP3 (for ElevenLabs voice samples) ffmpeg -i input.m4a -codec:a libmp3lame -qscale:a 2 output.mp3 # WAV to MP3 ffmpeg -i input.wav -codec:a libmp3lame -b:a 192k output.mp3 # Adjust volume ffmpeg -i input.mp3 -filter:a "volume=1.5" output.mp3
Trim/Cut Video
# Cut from timestamp to duration (recommended - reliable) ffmpeg -i input.mp4 -ss 00:00:30 -t 00:00:15 -c:v libx264 -c:a aac output.mp4 # Cut from timestamp to timestamp ffmpeg -i input.mp4 -ss 00:00:30 -to 00:00:45 -c:v libx264 -c:a aac output.mp4 # Stream copy (faster but may lose frames at cut points) # Only use when source has frequent keyframes ffmpeg -i input.mp4 -ss 00:00:30 -t 00:00:15 -c copy output.mp4
**Note:** Re-encoding is recommended for trimming. Stream copy (`-c copy`) can silently drop video if the seek point doesn't align with a keyframe.
Speed Up / Slow Down
# 2x speed (video and audio) ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4 # 0.5x speed (slow motion) ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]" -map "[v]" -map "[a]" output.mp4 # Video only (no audio) ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -an output.mp4
Concatenate Videos
# Create file list echo "file 'clip1.mp4'" > list.txt echo "file 'clip2.mp4'" >> list.txt echo "file 'clip3.mp4'" >> list.txt # Concatenate (same codec/resolution) ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4 # Concatenate with re-encoding (different sources) ffmpeg -f concat -safe 0 -i list.txt -c:v libx264 -c:a aac output.mp4
Add Fade In/Out
# Fade in first 1 second, fade out last 1 second (30fps video) ffmpeg -i input.mp4 -vf "fade=t=in:st=0:d=1,fade=t=out:st=9:d=1" -c:a copy output.mp4 # Audio fade ffmpeg -i input.mp4 -af "afade=t=in:st=0:d=1,afade=t=out:st=9:d=1" -c:v copy output.mp4
Get Video Info
# Duration, resolution, codec info ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4 # Full info ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
Remotion-Specific Patterns
Video Speed Adjustment for Remotion
**When to use FFmpeg vs Remotion `playbackRate`:**
| Scenario | Use FFmpeg | Use Remotion | |----------|------------|--------------| | Constant speed (1.5x, 2x) | Either works | ✅ Simpler | | Extreme speeds (>4x or <0.25x) | ✅ More reliable | May have issues | | Variable speed (accelerate over time) | ✅ Pre-process | Complex workaround needed | | Need perfect audio sync | ✅ Guaranteed | Usually fine | | Demo needs to fit voiceover timing | ✅ Pre-calculate | Runtime adjustment |
**Remotion limitation:** `playbackRate` must be constant. Dynamic interpolation like `playbackRate={interpolate(frame, [0, 100], [1, 5])}` won't work correctly because Remotion evaluates frames independently.
# Speed up demo to fit a scene (e.g., 60s demo into 20s = 3x speed) ffmpeg -i demo-raw.mp4 \ -filter_complex "[0:v]setpts=0.333*PTS[v];[0:a]atempo=3.0[a]" \ -map "[v]" -map "[a]" \ public/demos/demo-fast.mp4 # Slow motion for emphasis (0.5x speed) ffmpeg -i action.mp4 \ -filter_complex "[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]" \ -map "[v]" -map "[a]" \ public/demos/action-slow.mp4 # Speed up without audio (common for screen recordings) ffmpeg -i demo.mp4 -filter:v "setpts=0.5*PTS" -an public/demos/demo-2x.mp4 # Timelapse effect (10x speed, drop audio) ffmpeg -i long-demo.mp4 -filter:v "setpts=0.1*PTS" -an public/demos/timelapse.mp4
**Calculate speed factor:**
- To fit X seconds of video into Y seconds of scene: `speed = X / Y`
- setpts multiplier = `1 / speed` (e.g., 3x speed = setpts=0.333*PTS)
- atempo value = `speed` (e.g., 3x speed = atempo=3.0)
**Extreme speed (>2x audio):** Chain atempo filters (each limited to 0.5-2.0 range):
# 4x speed audio -filter_complex
World's first open-source, agentic video production system. 12 production pipelines, 100+ tools, 700+ agent skill and production-knowledge files. Turn your AI coding assistant into a full video production studio.
Repo: calesthio/OpenMontage
Other skills on openmontage.
- /acestep
AI music generation with ACE-Step 1.5 — background music, vocal tracks, covers, stem extraction for video production. Use when generating music, soundtracks, jingles, or working with audio stems. Triggers include background music, soundtrack, jingle, music generation, stem
Open skill - /agents
Build voice AI agents with ElevenLabs. Use when creating voice assistants, customer service bots, interactive voice characters, or any real-time voice conversation experience.
Open skill - /ai-video-gen
Generate AI videos from text prompts using multiple provider gateways. Use when: (1) Generating videos from text descriptions, (2) Creating AI-generated video clips for content production, (3) Image-to-video generation with a reference image, (4) Choosing between video
Open skill - /avatar-video
Create AI avatar videos with precise control over avatars, voices, scripts, scenes, and backgrounds using HeyGen's v2 API. Use when: (1) Choosing a specific avatar and voice for a video, (2) Writing exact scripts for an avatar to speak, (3) Building multi-scene videos with
Open skill - /azure-speech-to-text
Transcribe audio to text using Azure AI Speech (Fast Transcription REST API). Use when converting audio/video to text, generating subtitles, or processing spoken content in OpenMontage. Optional cloud STT provider — preferred when AZURE_SPEECH_KEY is configured; the local
Open skill - /beautiful-mermaid
Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.
Open skill

