ffmpeg

Convert, encode, extract, and stream audio and video with FFmpeg.

Updated Jul 23, 2025
One-click install
npx skills add https://github.com/levanminhduc/LuongHoaThoNew --skill ffmpeg-levanminhduc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ffmpeg
Source: https://github.com/levanminhduc/LuongHoaThoNew/tree/main/.claude/skills/ffmpeg
Command: npx skills add https://github.com/levanminhduc/LuongHoaThoNew --skill ffmpeg-levanminhduc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

FFmpeg is a comprehensive toolkit for encoding, decoding, converting, streaming, and filtering multimedia content. This Skill guides you through common tasks like format conversion, codec selection, audio extraction, streaming, and batch processing.

Core Features & Use Cases

  • Format Conversion & Copy: Convert formats and copy streams when possible.
  • Encoding & Bitrate: Use CRF/preset strategies for quality and performance.
  • Streaming & Filters: Activate RTMP streaming, HLS/DASH, and apply filters.
  • Scripting & Automation: Provide patterns for batch processing and automation.

Quick Start

Example: convert a video from MKV to MP4 using copy and then encode to H.264: ffmpeg -i input.mkv -c copy output.mkv

Frequently Asked Questions about ffmpeg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert video between different formats like MP4, MKV, and WebM?

Video format conversion with FFmpeg uses the -i input flag and output format specification. FFmpeg automatically selects codecs based on the container, or you can explicitly set them with -c:v for video and -c:a for audio. Stream copying with -c copy preserves quality when codec compatibility allows.

What's the best way to balance video quality and file size when encoding?

FFmpeg's Constant Rate Factor (CRF) method controls quality-to-size tradeoff without setting a fixed bitrate. Lower CRF values (0–28) produce higher quality; typical range is 18–28. Combine CRF with preset options (ultrafast to veryslow) to trade encoding speed for compression efficiency.

Can I extract audio from a video file?

Audio extraction isolates the audio stream from video using FFmpeg's stream selection and output flags. Specify -c:a to choose an audio codec and -vn to skip video, then set the output format (MP3, AAC, FLAC). Stream copy with -c:a copy preserves the original audio without re-encoding.

How do I set up live streaming or HLS/DASH adaptive streaming with FFmpeg?

FFmpeg supports RTMP streaming to push live content and HLS/DASH output for adaptive bitrate delivery. Use -f rtmp to stream to a server, or -f hls/-f dash to segment video into manifests and chunks. Configure segment duration, bitrate, and resolution for each quality tier.

Can I apply filters to resize, trim, or modify video during encoding?

FFmpeg's filter graph syntax chains transformations like scaling, cropping, and effects. Use -filter:v for video filters (e.g., scale=1280:720, trim=start=10:end=60) and -filter:a for audio. Complex filter graphs combine multiple operations in a single pass to reduce file I/O.

How do I automate batch processing of multiple video files?

Batch processing loops FFmpeg commands over file lists using shell scripts or automation tools. Iterate through input files, apply consistent encoding settings (codec, CRF, filters), and output to a target directory. Two-pass encoding improves efficiency for multiple files by analyzing bitrate distribution first.