# rendi-api/ffmpeg-cheatsheet architecture

> Architecture diagram of the GitHub repository rendi-api/ffmpeg-cheatsheet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rendi-api/ffmpeg-cheatsheet
- Repository: https://github.com/rendi-api/ffmpeg-cheatsheet

## Overview

1. **Repo type and boundary**
   - This is a **documentation-first FFmpeg knowledge base**, not an application or service.
   - The architectural boundary is a curated set of Markdown assets that teach and standardize media-processing command patterns for humans and LLMs.

2. **Top-level entry point**
   - `README.md` is the main landing page and acts like the product overview.
   - It contains the full cheat sheet: concepts, categorized examples, caveats, and links to upstream FFmpeg references.
   - For architecture purposes, treat this as the primary “index” into the knowledge system.

3. **Skill module layout**
   - `skills/ffmpeg/SKILL.md` is a domain-specific skill package.
   - The `skills/ffmpeg` folder indicates the repo is organized for agent consumption: a skill description plus supporting references.
   - This suggests a clear separation between the broad cheat sheet and reusable skill-oriented guidance.

4. **Reference layer**
   - `skills/ffmpeg/references/command-patterns.md` is a supporting reference artifact.
   - Its role is likely to hold reusable command templates or canonical patterns, complementing the narrative examples in the README.
   - This is the closest thing in the repo to a “shared library” of FFmpeg usage patterns.

5. **Functional content domains**
   - The README is organized into major media-processing subsystems:
     - simple editing and remuxing
     - resizing, padding, and aspect-ratio management
     - audio extraction, replacement, mixing, and fading
     - advanced time-based editing and jump cuts
     - overlays, subtitles, and compositing
     - asset generation like thumbnails, GIFs, storyboards, and slideshows
     - encoding settings and GPU acceleration
   - These are not code modules, but they are the architectural domains of the knowledge base.

6. **Core data flow model**
   - Most examples follow the same pipeline shape:
     - one or more **input media assets**
     - FFmpeg **filters / filter graphs**
     - optional **stream mapping**
     - **encoding or stream copy**
     - a generated output file in a target container/codec
   - Multi-input compositions use `filter_complex` and often split into parallel branches before recombining.

7. **External dependencies and execution environment**
   - The repo assumes a local or scripted environment with the **FFmpeg CLI** and sometimes **ffprobe**.
   - Sample commands reference remote assets on `storage.rendi.dev`, so the examples depend on network-accessible media.
   - Some commands also depend on local assets like fonts, subtitle files, and images when using `fontfile=`, `textfile=`, or burned subtitles.

8. **Key technical boundaries**
   - The README emphasizes the difference between **stream copy/remuxing** and **re-encoding**.
   - It also distinguishes **input seeking vs. output seeking**, and when `-c copy` is safe or unsafe.
   - These are important architectural boundaries because they determine whether a command is a low-cost container transform or a CPU-heavy transcoding pipeline.

9. **Output and delivery concerns**
   - The examples cover production-oriented media outputs: MP4, MKV, MOV, WEBM, GIF, PNG/JPG thumbnails, and subtitle-bearing files.
   - Encoding settings such as CRF, preset, `yuv420p`, `faststart`, and GPU encoders materially affect compatibility, startup behavior, and file size.
   - In diagram form, these are the “delivery/packaging” concerns at the end of the media pipeline.

10. **Audience and usage pattern**
    - The repo is designed for **copy/paste execution** and **LLM-assisted exploration**.
    - Users are expected to browse the Markdown, search for a pattern, adapt a command, and run it locally.
    - That makes the repo a knowledge repository with a strong “recipe” structure rather than a program with runtime control flow.

11. **Operational style**
    - There is no evidence of build tooling, tests, or deployment infrastructure in the tree.
    - The architecture is therefore intentionally lightweight: documentation, references, and executable command examples.
    - The primary integration points are external FFmpeg docs, community references, and downloadable sample media, not internal services.

12. **Best diagram framing**
    - Draw it as a **documentation/skill system** with:
      - a root cheat sheet entry point
      - a skill-specific FFmpeg module
      - a small reference appendix
      - external dependencies on FFmpeg, sample media hosts, and upstream documentation
    - The main flow is “reference content -> adapted FFmpeg command -> local execution -> media output.”

Main entry points: [`README.md`](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/README.md) (README), [`skills/ffmpeg/SKILL.md`](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/SKILL.md) (FFmpeg Skill), [`skills/ffmpeg/references/command-patterns.md`](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/references/command-patterns.md) (Command Patterns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Documentation"]
  node_readme["README<br/>cheat sheet index<br/>[README.md]"]
  node_simple_edit{{"Edit & Remux<br/>container transforms"}}
  node_resize_aspect{{"Resize & Pad<br/>video framing"}}
  node_audio_ops{{"Audio Ops<br/>audio pipeline"}}
  node_timeline_fx{{"Timeline FX<br/>filter graph"}}
  node_compositing{{"Overlays & Subs<br/>compositing"}}
  node_asset_gen{{"Assets<br/>derived media"}}
  node_encoding{{"Encoding & GPU<br/>delivery settings"}}
end

subgraph group_skill["Skill Module"]
  node_skill_md["FFmpeg Skill<br/>skill spec<br/>[SKILL.md]"]
end

subgraph group_refs["References"]
  node_cmd_patterns["Command Patterns<br/>pattern reference"]
end

subgraph group_external["External Dependencies"]
  node_ffmpeg_cli["FFmpeg CLI<br/>media engine"]
  node_ffprobe["ffprobe<br/>inspection tool"]
  node_sample_media[("Sample Media<br/>remote assets")]
  node_local_assets["Local Assets<br/>fonts/subtitles/images"]
  node_upstream_docs["Upstream Docs<br/>ffmpeg references"]
end

subgraph group_outputs["Media Outputs"]
  node_outputs[("Media Files<br/>deliverables")]
end

node_readme -->|"complements"| node_skill_md
node_skill_md -->|"uses"| node_cmd_patterns
node_readme -->|"covers"| node_simple_edit
node_readme -->|"covers"| node_resize_aspect
node_readme -->|"covers"| node_audio_ops
node_readme -->|"covers"| node_timeline_fx
node_readme -->|"covers"| node_compositing
node_readme -->|"covers"| node_asset_gen
node_readme -->|"covers"| node_encoding
node_cmd_patterns -->|"targets"| node_ffmpeg_cli
node_readme -->|"examples use"| node_ffmpeg_cli
node_readme -->|"inspects with"| node_ffprobe
node_readme -->|"references"| node_sample_media
node_readme -->|"depends on"| node_local_assets
node_readme -->|"links to"| node_upstream_docs
node_simple_edit -->|"executes via"| node_ffmpeg_cli
node_resize_aspect -->|"executes via"| node_ffmpeg_cli
node_audio_ops -->|"executes via"| node_ffmpeg_cli
node_timeline_fx -->|"executes via"| node_ffmpeg_cli
node_compositing -->|"executes via"| node_ffmpeg_cli
node_asset_gen -->|"executes via"| node_ffmpeg_cli
node_encoding -->|"controls"| node_ffmpeg_cli
node_simple_edit -->|"produces"| node_outputs
node_encoding -->|"delivers"| node_outputs

click node_readme "https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/README.md"
click node_skill_md "https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/SKILL.md"
click node_cmd_patterns "https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/references/command-patterns.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_simple_edit,node_resize_aspect,node_audio_ops,node_timeline_fx,node_compositing,node_asset_gen,node_encoding toneBlue
class node_skill_md toneAmber
class node_cmd_patterns toneMint
class node_ffmpeg_cli,node_ffprobe,node_sample_media,node_local_assets,node_upstream_docs toneRose
class node_outputs toneIndigo
```

## Components

### Documentation

Top-level cheat sheet and human-readable guidance

- [README](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/README.md): cheat sheet index · Primary landing page with concepts, categorized examples, and caveats. · `README.md`
- **Edit & Remux**: container transforms · Low-cost trimming, stream copy, and simple container edits.
- **Resize & Pad**: video framing · Sizing, padding, and aspect-ratio management.
- **Audio Ops**: audio pipeline · Extraction, replacement, mixing, fading, and audio-focused transforms.
- **Timeline FX**: filter graph · Advanced time-based editing, jump cuts, and multi-branch filter graphs.
- **Overlays & Subs**: compositing · Overlaying images, subtitles, and other layered compositing tasks.
- **Assets**: derived media · Thumbnails, GIFs, storyboards, slideshows, and other generated assets.
- **Encoding & GPU**: delivery settings · Codec settings, CRF, presets, faststart, pixel format, and hardware acceleration.

### Skill Module

Agent-oriented FFmpeg skill package

- [FFmpeg Skill](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/SKILL.md): skill spec · Domain-specific skill guidance for agent consumption. · `skills/ffmpeg/SKILL.md`

### References

Reusable command patterns and canonical examples

- [Command Patterns](https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/skills/ffmpeg/references/command-patterns.md): pattern reference · Reusable FFmpeg command templates and canonical usage patterns. · `skills/ffmpeg/references/command-patterns.md`

### External Dependencies

Tools, media sources, and upstream documentation used by the examples

- **FFmpeg CLI**: media engine · Core command-line tool used to transcode, remux, filter, and generate media.
- **ffprobe**: inspection tool · Auxiliary CLI used to inspect streams and media properties.
- **Sample Media**: remote assets · Remote example inputs referenced by the cheat sheet commands.
- **Local Assets**: fonts/subtitles/images · Fonts, subtitle files, and images required by some overlay and burn-in examples.
- **Upstream Docs**: ffmpeg references · Official FFmpeg documentation and related external references.

### Media Outputs

Common delivery artifacts produced by the commands

- **Media Files**: deliverables · Produced MP4, MKV, MOV, WEBM, GIF, and image outputs.

## Connections

- README → FFmpeg Skill: complements · The cheat sheet and the skill package reinforce each other.
- FFmpeg Skill → Command Patterns: uses · Skill guidance draws on reusable command templates.
- README → Edit & Remux: covers · Documentation section for trimming and remuxing.
- README → Resize & Pad: covers · Documentation section for sizing and aspect ratio handling.
- README → Audio Ops: covers · Documentation section for audio extraction, mixing, and replacement.
- README → Timeline FX: covers · Documentation section for time-based edits and multi-input filtering.
- README → Overlays & Subs: covers · Documentation section for overlays, subtitles, and compositing.
- README → Assets: covers · Documentation section for generated media assets.
- README → Encoding & GPU: covers · Documentation section for codec and compatibility settings.
- Command Patterns → FFmpeg CLI: targets · Patterns are meant to be executed with the FFmpeg CLI.
- README → FFmpeg CLI: examples use · Commands in the cheat sheet assume FFmpeg is installed locally.
- README → ffprobe: inspects with · Some workflows rely on media inspection before editing or encoding.
- README → Sample Media: references · Examples pull inputs from remote sample media hosts.
- README → Local Assets: depends on · Certain overlays and burn-ins require local fonts, subtitles, or images.
- README → Upstream Docs: links to · The cheat sheet points to official FFmpeg references.
- Edit & Remux → FFmpeg CLI: executes via · Simple remux/edit commands run through the CLI.
- Resize & Pad → FFmpeg CLI: executes via · Frame and aspect transforms are applied through FFmpeg filters.
- Audio Ops → FFmpeg CLI: executes via · Audio processing uses FFmpeg stream selection and filters.
- Timeline FX → FFmpeg CLI: executes via · Complex edits are implemented with filter graphs and mapping.
- Overlays & Subs → FFmpeg CLI: executes via · Compositing workflows are encoded as filter chains.
- Assets → FFmpeg CLI: executes via · Derived assets are produced by FFmpeg rendering and encoding.
- Encoding & GPU → FFmpeg CLI: controls · Encoding settings configure the final media pipeline.
- Edit & Remux → Media Files: produces · Remuxing and editing create packaged media files.
- Encoding & GPU → Media Files: delivers · Codec choices and container settings determine final deliverables.
