FFmpeg Cookbook
Reverse-lookup FFmpeg commands by goal. Primary sources required, FFmpeg version noted, only tested commands published.
🇺🇸 English 🔗 Primary sources 📌 Version notedCategories
Latest Articles
-
Fixing Audio-Video Sync Issues — -itsoffset and adelay Filter
Learn how to fix audio-video sync issues with FFmpeg. Explains when to use -itsoffset, the adelay filter, and -async option with practical examples. Verified with ffmpeg 6.1.
-
Concatenating Video — When to Use concat demuxer vs. concat filter
Explains the two FFmpeg approaches for joining multiple video files (concat demuxer and concat filter), their differences, and when to use each. Covers fast concatenation of same-format files through to merging videos with different formats and resolutions. Includes primary source references.
-
Extracting Audio from Video — Lossless Copy vs. Re-Encoding
How to extract audio from a video file with FFmpeg. Covers the -vn option for removing video, lossless extraction with -c:a copy, re-encoding with libmp3lame and aac, and selecting specific streams with -map. Includes format-specific command examples.
-
Changing Frame Rate — When to Use the -r Option vs the fps Filter
How to change frame rates with FFmpeg. Covers the difference between the -r option and the -vf fps filter, how to check frame rate with ffprobe, behavior when increasing or decreasing frame rate, and applying these techniques to timelapse creation. Verified with ffmpeg 6.1.
-
Video Compression — Choosing Between CRF Mode and Bitrate Mode
A guide to the two main approaches for compressing video with FFmpeg. Covers the difference between CRF (constant quality) mode and bitrate mode, 2-pass encoding, the speed vs. quality trade-off with -preset, and when to use H.264 vs H.265.
-
Audio Format Conversion — WAV, MP3, AAC, and FLAC
How to convert between major audio formats using FFmpeg. Covers WAV, MP3, AAC, and FLAC characteristics, specifying encoders with -c:a, the difference between bitrate (-b:a) and VBR quality (-q:a) options, and sample rate conversion (-ar) with practical command examples.
-
Extracting Thumbnails from Video — -vframes and the thumbnail Filter
How to extract still images from video using FFmpeg. Covers single-frame extraction at a specific timestamp, automatic representative frame selection with the thumbnail filter, resolution specification, and the differences between PNG and JPG output.
-
FFmpeg Command Basic Syntax — Input, Filter, and Output Order
Explains the structure of FFmpeg commands based on the official documentation. Covers the ordering rules for global options, input options, and output options; the meaning of -i/-c:v/-c:a; automatic output format detection; and common ordering mistakes.
-
Common FFmpeg Errors and Solutions — From Unknown encoder to moov atom not found
Explains the meaning and solutions for frequently encountered FFmpeg error messages. A practical troubleshooting guide covering Unknown encoder, moov atom not found, Invalid data, height not divisible by 2, and more. Verified with ffmpeg 6.1.
-
The Difference and Role of ffmpeg / ffprobe / ffplay
Explains the roles and appropriate use of the three command-line tools included in FFmpeg (ffmpeg, ffprobe, ffplay), based on the official documentation. Provides guidance on when to use each: ffprobe for information retrieval, ffmpeg for conversion, and ffplay for playback and testing.
-
Inspecting Metadata and Stream Information with ffprobe
Learn how to use ffprobe to check metadata, codecs, resolution, frame rate, bitrate, and other stream information for video and audio files. Also covers JSON output and combining with jq. Verified with ffmpeg 6.1.
-
Creating Optimized GIFs from Video — palettegen + paletteuse Two-Pass Pipeline
How to create high-quality, optimized GIFs from video using FFmpeg's two-pass palettegen and paletteuse pipeline. Covers fps scaling, Lanczos resize, dithering options, and looping.
-
FFmpeg Installation Guide for Windows / macOS / Linux
How to install FFmpeg on Windows, macOS, and Linux, based on official sources. Covers gyan.dev (Windows), Homebrew (macOS), apt/dnf (Linux), PATH configuration, and version verification.
-
Loudness Normalization — EBU R128 with the loudnorm Filter
How to normalize audio loudness to the EBU R128 broadcast standard using FFmpeg's loudnorm filter. Covers single-pass normalization, two-pass measurement for accuracy, and key parameters like I, TP, and LRA.
-
HLS Segmenting — Generate Segments and Playlists for Web Streaming
How to generate HLS (HTTP Live Streaming) segments and m3u8 playlists with FFmpeg. Covers hls_time, hls_list_size, hls_segment_filename, and adaptive bitrate ladder basics.
-
Changing Resolution and Preserving Aspect Ratio — Complete Guide to the scale Filter
How to change video resolution with FFmpeg's scale filter. Covers automatic aspect ratio preservation (-1/-2 syntax), relative resizing, maximum resolution capping, and letterboxing with padding. Includes primary source references.
-
Creating Video from Sequential Images — How to Make Slideshows and Timelapses
Learn how to create video from sequential PNG/JPG images with FFmpeg, loop a single image, and create timelapses by dropping frames from existing video. Covers the importance of pix_fmt yuv420p.
-
Rotating and Flipping Video — transpose Filter vs. Metadata Rotation
Learn how to rotate and flip video with FFmpeg. Covers transpose filter values 0–3 and their effects, horizontal/vertical flipping with hflip/vflip, the difference between metadata-only rotation and re-encoding rotation, and how to fix smartphone video orientation.
-
Burning and Embedding Subtitles — SRT, ASS, Hard Subs and Soft Subs
A guide to two methods for handling subtitles with FFmpeg. Covers the differences, use cases, and command examples for hard subs (burning SRT/ASS into the video) and soft subs (embedding subtitle tracks into MKV and other containers).
-
Trimming Video — -ss/-to/-t and the Keyframe Problem
How to trim a video segment with FFmpeg. Covers -ss (start), -to (end), and -t (duration), the difference between input-side vs. output-side -ss (speed vs. accuracy), stream-copy trimming, and frame-accurate re-encode trimming.
-
Two-Pass Encoding — Precise Bitrate and File Size Control
How to use FFmpeg two-pass encoding to hit a precise target bitrate or file size. Covers pass 1 analysis, pass 2 encoding, passlogfile option, H.264 and H.265 examples, and when two-pass is worth the extra time.
-
Video Stabilization — vidstabdetect and vidstabtransform
How to stabilize shaky video using FFmpeg's vidstab filters (vidstabdetect and vidstabtransform). Covers two-pass pipeline, smoothing strength, crop modes, and installation notes for libvidstab.
-
Video Format Conversion Basics (MP4, MKV, WebM, MOV)
How to convert between major video formats — MP4, MKV, WebM, and MOV — using FFmpeg. Covers the difference between containers and codecs, when stream copy works (and when it fails), and how to inspect codecs with ffprobe. Includes primary source references.
-
Watermark and Logo Overlay — How to Use the overlay Filter
Learn how to composite logos and watermarks onto video using FFmpeg's overlay filter. Covers position variables, transparent PNGs with alpha channels, time-limited display, and other practical patterns. Verified with ffmpeg 6.1.
-
What Is FFmpeg — What It Can and Cannot Do
An overview of FFmpeg and its key components (ffmpeg/ffprobe/ffplay/libav*). Covers what it can do — from video conversion to streaming — and what it cannot do (e.g., DRM), based on the official documentation.
-
Complete Guide to Converting Video to MP4 (H.264/AAC) with FFmpeg
How to convert any video file to MP4 (H.264 video + AAC audio) using the ffmpeg command. Covers the basic command, CRF quality settings, stream copy, and preset selection — all verified on a real machine with primary sources.