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.

By calesthio · 725 installs

npx skills add calesthio/openmontage --skill ffmpeg

Source repository · Upstream listing

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) 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 Compress Video Extract Audio Convert Audio Formats Trim/Cut Video 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 Concatenate Videos Add Fade In/Out Get Video Info 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. 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): Prepare Demo Recording for Remotion Screen Recording to Remotion Asset Batch Convert GIFs Common Issues "Height not divisible by 2" Add scale filter: vf "scale=trunc(iw/2) 2:trunc(ih/2) 2" Video won't play in browser Use: movflags faststart pix fmt yuv420p c:v libx264 Audio out of sync after speed change Use filter complex with atempo: filter complex "[0:v]setpts=0.5 PTS[v];[0:a]atempo=2.0[a]" File too large Increase CRF (23→28) or reduce resolution Quality Guidelines Use Case CRF Preset Notes Archive/Master 18 slow Best quality, large files Production 20 22 medium Good balance Web/Preview 23 25 fast Smaller files Draft/Quick 28+ veryfast Fast encoding Platform Specific Output Optimization After Remotion renders your video (typically to out/video.mp4 ), use FFmpeg to optimize for each distribution platform. Workflow Integration YouTube (Recommended Settings) YouTube re encodes everything, so upload high quality: Twitter/X Twitter has strict limits: max 140s, 512MB, 1920x1200: LinkedIn LinkedIn prefers MP4 with AAC audio, max 10 minutes: Website/Embed (Optimized for Fast Loading) GIF (for Previews/Thumbnails) Platform Requirements Quick Reference Platform Max Resolution Max Size Max Duration Audio YouTube 8K 256GB 12 hours AAC 48kHz Twitter/X 1920x1200 512MB 140s AAC 44.1kHz LinkedIn 4096x2304 5GB 10 min AAC 48kHz Instagram Feed 1080x1350 4GB 60s AAC 48kHz Instagram Reels 1080x1920 4GB 90s AAC 48kHz TikTok 1080x1920 287MB 10 min AAC Batch Export for All Platforms Error Handling Common errors and fixes when processing video: Handling Common Failures Error Cause Fix "No such file" Input path wrong Check path, use quotes for spaces "Invalid data" Corrupted input Re download or re record source "height not divisible by 2" Odd dimensions Add scale filter with trunc "encoder not found" Missing codec Install FFmpeg with full codecs Output 0 bytes Silent failure Check full ffmpeg output for errors Feedback & Contributions If this skill is missing information or could be improved: Missing a command? Describe what you needed Found an error? Let me know what's wrong Want to contribute? I can help you: 1. Update this skill with improvements 2. Create a PR to github.com/digitalsamba/claude code video toolkit Just say "improve this skill" and I'll guide you through updating .claude/skills/ffmpeg/SKILL.md .