MpegFlowBlogBack to home
FFmpeg recipes · MpegFlow

FFmpeg recipes for real production.

Working FFmpeg invocations for the tasks engineers actually search for — with the production scale notes, gotchas, and operational lessons that don't fit into a Stack Overflow answer. 21 recipes today, growing as we ship more. See also the reference architectures for the deployment side, and the engineering blog for the thinking behind the choices.

01Codec conversion.

Re-encoding from one codec to another — H.264 ↔ HEVC, VP9, AV1. The migrations every video team eventually runs.

  • H.264 → HEVC
    Transcode H.264 to HEVC with FFmpeg: production guide
    Convert H.264 to HEVC for ~50% smaller files at equivalent visual quality. Working FFmpeg commands for software (libx265) and GPU (NVENC), plus the Apple-compatibility tag every team forgets.
02Format conversion.

Container changes — MOV ↔ MP4, MXF ingest, format normalization. Often stream-copy when codecs are compatible.

  • MOV → MP4
    Convert MOV to MP4 with FFmpeg (no re-encoding)
    Convert .mov to .mp4 for web delivery without re-encoding the video stream. Stream-copy approach, faststart for web playback, and the audio codec compatibility table.
03Audio operations.

Loudness normalization, audio extraction, channel manipulation. Broadcast standards (EBU R128, ATSC A/85) and transcription-ready audio.

  • Loudness normalize
    Loudness-normalize audio with FFmpeg (EBU R128, ATSC A/85)
    Normalize audio loudness to broadcast targets — EBU R128 (-23 LUFS) for European broadcast, ATSC A/85 (-24 LUFS) for North America. Single-pass and two-pass loudnorm filter usage.
  • Extract audio
    Extract audio from video with FFmpeg: AAC, MP3, WAV, transcription-ready
    Pull audio out of a video file with three real recipes — stream-copy AAC for podcasts, MP3 for compatibility, mono 16kHz WAV for transcription pipelines.
04Video operations.

Concatenation, watermarking, caption burn-in, cropping. The recipes that touch frames directly.

  • Fade effects
    Fade in and fade out video and audio with FFmpeg
    Add fade-in / fade-out effects to video and audio. The fade and afade filters, the timing parameters, and the chain that does both at once.
  • Rotate / flip
    Rotate and flip video with FFmpeg: phone footage, EXIF metadata, and the right approach
    Rotate phone-shot video to correct orientation, flip horizontally for mirror effect, or strip EXIF rotation metadata that confuses some players.
  • Video → GIF
    Create high-quality GIF from video with FFmpeg: palette generation matters
    Convert video clips to animated GIFs with proper palette generation. The two-pass technique that produces small, sharp GIFs vs the one-pass approach that produces blurry mess.
  • Extract frames / thumbnails
    Extract frames and thumbnails from video with FFmpeg
    Pull individual frames as images, generate thumbnails at intervals, or extract keyframes as posters. The fps filter, the select filter, and the right pattern for each use case.
  • Resize / scale
    Resize / scale video with FFmpeg: lanczos, bicubic, and the algorithm that matters
    Scale video to specific dimensions for ABR ladders, mobile delivery, or proxy generation. The scaler choice that decides whether output is sharp or smudged.
  • Crop video
    Crop video with FFmpeg: aspect ratio conversion, letterbox removal, ROI extraction
    Crop video to a specific region — change aspect ratios (16:9 → 9:16 for mobile), remove letterboxes from old broadcasts, extract regions of interest for analysis pipelines.
  • Deinterlace
    Deinterlace video with FFmpeg: yadif, bwdif, nnedi, and the right choice
    Convert interlaced video (1080i broadcast, legacy DV/HDV) to progressive for modern delivery. Three real deinterlacers with different speed/quality trade-offs.
  • Trim / cut video
    Trim and cut video with FFmpeg: precise timestamps without re-encoding
    Cut clips from longer videos via stream-copy when keyframe boundaries align, or with re-encoding when frame-accurate cuts matter. The seek-input trick that saves real time.
  • Watermark video
    Watermark video with FFmpeg: logo overlay, transparency, and broadcast-bug positioning
    Overlay a PNG logo or watermark onto video. Top-right corner with padding, semi-transparent, and the alpha-channel handling that prevents the most common rendering bugs.
  • Concatenate videos
    Concatenate video files with FFmpeg: concat demuxer, concat filter, and the right choice
    Join multiple video files into one. The concat demuxer for matched files (no re-encoding), the concat filter for mismatched ones, and the file-list discipline that prevents the most common bug.
  • Burn captions
    Burn captions / subtitles into video with FFmpeg
    Hard-code SRT or ASS subtitles into the video frames. When sidecar VTT isn't supported, when archival requires baked-in captions, or when the player can't handle subtitle tracks.
05Packaging.

ABR ladder generation, HLS / DASH segmentation, manifest creation. The output side of the pipeline.

  • HLS VOD packaging
    Package HLS VOD output with FFmpeg: segments, manifests, byte-range delivery
    Generate HLS-compliant VOD packages with proper segment timing, manifest generation, and the byte-range patterns for efficient CDN delivery.
  • ABR ladder generation
    Generate an HLS/DASH ABR ladder with FFmpeg: production recipe
    Build an adaptive bitrate ladder (5-rendition standard) from a single master file. Closed-GOP discipline, VBV compliance, and the partial-success patterns that survive production load.
06Tooling.

Multi-output encoding, keyframe discipline, FFmpeg flags that operate across recipes. The plumbing.

  • Progress monitoring
    Monitor FFmpeg progress for production: parsing -progress output
    Track FFmpeg encoding progress in production. The -progress flag emits structured key-value pairs vs the chaotic stderr output that breaks log aggregators.
  • RTMP push streaming
    Push live RTMP stream with FFmpeg to YouTube, Twitch, or custom origins
    Stream live video to RTMP destinations — YouTube Live, Twitch, custom origins. Encoder settings, reconnection patterns, and tuning that prevents buffer underruns.
  • Keyframe interval tuning
    Keyframe interval tuning for HLS: GOP discipline and segment alignment
    Configure keyframe interval (GOP) so HLS segment boundaries are clean and rendition switches are seamless. Closed GOPs, scene-cut handling, and the keyint math for any framerate.
  • Multi-output encoding
    Multi-output encoding with FFmpeg: tee muxer, split filter, and the right pattern
    Encode one input into multiple outputs in a single FFmpeg invocation. Split filter, tee muxer, and the throughput math that decides when this beats per-output encoding.
© 2026 MpegFlow, Inc. · Trust & complianceAll systems nominal·StatusPrivacy