ffmpeg-patterns▌
mindmorass/reflex · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Best practices for video and audio processing with FFmpeg.
FFmpeg Patterns
Best practices for video and audio processing with FFmpeg.
Basic Operations
Transcode Video
# Convert to MP4 (H.264 + AAC)
ffmpeg -i input.mov -c:v libx264 -preset medium -crf 23 \
-c:a aac -b:a 128k output.mp4
# Convert to WebM (VP9 + Opus)
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 \
-c:a libopus -b:a 128k output.webm
# Convert to HLS for streaming
ffmpeg -i input.mp4 -codec: copy -start_number 0 \
-hls_time 10 -hls_list_size 0 -f hls output.m3u8
Extract Audio
# Extract audio to MP3
ffmpeg -i video.mp4 -vn -acodec mp3 -ab 192k audio.mp3
# Extract audio to WAV (uncompressed)
ffmpeg -i video.mp4 -vn -acodec pcm_s16le audio.wav
# Extract audio from specific time range
ffmpeg -i video.mp4 -ss 00:01:00 -t 00:00:30 -vn audio.mp3
Trim and Cut
# Cut from timestamp to duration
ffmpeg -i input.mp4 -ss 00:01:30 -t 00:02:00 -c copy output.mp4
# Cut from start to end timestamp
ffmpeg -i input.mp4 -ss 00:01:30 -to 00:03:30 -c copy output.mp4
# Fast seek (put -ss before -i for large files)
ffmpeg -ss 00:10:00 -i large_video.mp4 -t 00:05:00 -c copy clip.mp4
Video Filters
Resize and Scale
# Scale to specific dimensions
ffmpeg -i input.mp4 -vf "scale=1920:1080" output.mp4
# Scale preserving aspect ratio (fit within)
ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease" output.mp4
# Scale with padding (letterbox/pillarbox)
ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4
# Scale to 50%
ffmpeg -i input.mp4 -vf "scale=iw/2:ih/2" output.mp4
Speed Adjustment
# Speed up video 2x (with audio pitch correction)
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
# Slow down video 0.5x
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
# Extreme slow motion (0.25x) - chain atempo filters
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=4.0*PTS[v];[0:a]atempo=0.5,atempo=0.5[a]" \
-map "[v]" -map "[a]" output.mp4
Crop and Overlay
# Crop video (width:height:x:y)
ffmpeg -i input.mp4 -vf "crop=640:480:100:50" output.mp4
# Crop center to 16:9
ffmpeg -i input.mp4 -vf "crop=ih*16/9:ih" output.mp4
# Add watermark
ffmpeg -i video.mp4 -i watermark.png \
-filter_complex "overlay=W-w-10:H-h-10" output.mp4
# Add text overlay
ffmpeg -i input.mp4 -vf "drawtext=text='Hello World':fontsize=24:fontcolor=white:x=10:y=10" output.mp4
Color and Effects
# Adjust brightness, contrast, saturation
ffmpeg -i input.mp4 -vf "eq=brightness=0.1:contrast=1.2:saturation=1.3" output.mp4
# Convert to grayscale
ffmpeg -i input.mp4 -vf "colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3" output.mp4
# Add fade in/out
ffmpeg -i input.mp4 -vf "fade=t=in:st=0:d=2,fade=t=out:st=8:d=2" output.mp4
# Blur video
ffmpeg -i input.mp4 -vf "boxblur=5:1" output.mp4
Audio Processing
Volume and Normalization
# Adjust volume
ffmpeg -i input.mp4 -af "volume=1.5" output.mp4
# Normalize audio (loudnorm)
ffmpeg -i input.mp4 -af "loudnorm=I=-16:TP=-1.5:LRA=11" output.mp4
# Detect silence
ffmpeg -i input.mp4 -af "silencedetect=noise=-30dB:d=0.5" -f null -
Audio Filters
# Remove background noise
ffmpeg -i input.mp4 -af "afftdn=nf=-25" output.mp4
# Add echo
ffmpeg -i input.mp4 -af "aecho=0.8:0.88:60:0.4" output.mp4
# High-pass filter (remove low frequencies)
ffmpeg -i input.mp4 -af "highpass=f=200" output.mp4
# Low-pass filter (remove high frequencies)
ffmpeg -i input.mp4 -af "lowpass=f=3000" output.mp4
Combining Media
Concatenate Videos
# Create file list
cat > files.txt << EOF
file 'video1.mp4'
file 'video2.mp4'
file 'video3.mp4'
EOF
# Concatenate (same codec)
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4
# Concatenate (different codecs - re-encode)
ffmpeg -f concat -safe 0 -i files.txt -c:v libx264 -c:a aac output.mp4
Merge Audio and Video
# Replace audio track
ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4
# Mix audio tracks
ffmpeg -i video.mp4 -i background.mp3 \
-filter_complex "[0:a][1:a]amerge=inputs=2[a]" \
-map 0:v -map "[a]" -c:v copy -ac 2 output.mp4
# Add audio to silent video
ffmpeg -i silent_video.mp4 -i audio.mp3 -c:v copy -c:a aac -shortest output.mp4
Picture-in-Picture
# Overlay smaller video
ffmpeg -i main.mp4 -i overlay.mp4 \
-filter_complex "[1:v]scale=320:-1[pip];[0:v][pip]overlay=W-w-10:H-h-10" \
output.mp4
# Side by side
ffmpeg -i left.mp4 -i right.mp4 \
-filter_complex "[0:v]scale=640:-1[l];[1:v]scale=640:-1[r];[l][r]hstack" \
output.mp4
Thumbnails and Screenshots
# Single screenshot at timestamp
ffmpeg -i video.mp4 -ss 00:00:10 -vframes 1 thumbnail.jpg
# Generate thumbnails every N seconds
ffmpeg -i video.mp4 -vf "fps=1/10" thumbnails_%03d.jpg
# Generate thumbnail sheet/sprite
ffmpeg -i video.mp4 -vf "fps=1/5,scale=160:-1,tile=5x5" sprite.jpg
# Best quality thumbnail
ffmpeg -i video.mp4 -ss 00:00:10 -vframes 1 -q:v 2 thumbnail.jpg
Streaming Formats
HLS (HTTP Live Streaming)
# Basic HLS
ffmpeg -i input.mp4 -c:v libx264 -c:a aac \
-hls_time 10 -hls_playlist_type vod \
-hls_segment_filename "segment_%03d.ts" \
playlist.m3u8
# Multi-bitrate HLS
ffmpeg -i input.mp4 \
-filter_complex "[0:v]split=3[v1][v2][v3]; \
[v1]scale=1920:1080[v1out]; \
[v2]scale=1280:720[v2out]; \
[v3]scale=854:480[v3out]" \
-map "[v1out]" -map 0:a -c:v libx264 -b:v 5M -c:a aac -b:a 192k \
-hls_time 10 -hls_playlist_type vod 1080p.m3u8 \
-map "[v2out]" -map 0:a -c:v libx264 -b:v 2M -c:a aac -b:a 128k \
-hls_time 10 -hls_playlist_type vod 720p.m3u8 \
-map "[v3out]" <How to use ffmpeg-patterns on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add ffmpeg-patterns
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches ffmpeg-patterns from GitHub repository mindmorass/reflex and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate ffmpeg-patterns. Access the skill through slash commands (e.g., /ffmpeg-patterns) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★73 reviews- ★★★★★Dev Huang· Dec 28, 2024
Solid pick for teams standardizing on skills: ffmpeg-patterns is focused, and the summary matches what you get after install.
- ★★★★★Dhruvi Jain· Dec 24, 2024
Keeps context tight: ffmpeg-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Valentina Tandon· Dec 24, 2024
Solid pick for teams standardizing on skills: ffmpeg-patterns is focused, and the summary matches what you get after install.
- ★★★★★Daniel Martin· Dec 20, 2024
I recommend ffmpeg-patterns for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Naina Harris· Dec 16, 2024
ffmpeg-patterns has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Noah Ghosh· Dec 12, 2024
ffmpeg-patterns is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Ava Diallo· Nov 19, 2024
We added ffmpeg-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Chen Sanchez· Nov 19, 2024
Solid pick for teams standardizing on skills: ffmpeg-patterns is focused, and the summary matches what you get after install.
- ★★★★★Oshnikdeep· Nov 15, 2024
Registry listing for ffmpeg-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Kaira Menon· Nov 15, 2024
We added ffmpeg-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 73