# aifoundry-org/ffmpeg architecture

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

- Interactive diagram: https://gitdiagram.com/aifoundry-org/ffmpeg
- Repository: https://github.com/aifoundry-org/ffmpeg

## Overview

FFmpeg is a multimedia processing suite: command-line tools let users convert, stream, play, and inspect media, backed by libraries for containers, codecs, filtering, device I/O, and media transformations. The principal conversion workflow is represented at the tool and library boundaries; the README describes those capabilities, while the supplied source excerpts do not show ffmpeg’s runtime wiring. Accordingly, undocumented tool-to-library links are dashed and uncited. The graph also preserves ffplay, ffprobe, and the documented library capabilities.

Main entry points: [`fftools/ffmpeg.c`](https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffmpeg.c) (ffmpeg CLI), [`libavcodec/avcodec.h`](https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/avcodec.h) (Codec processing), [`libavformat/avformat.h`](https://github.com/aifoundry-org/ffmpeg/blob/master/libavformat/avformat.h) (Containers and I/O), [`fftools/ffplay.c`](https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffplay.c) (ffplay player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tools["User Tools"]
  node_ffmpeg["ffmpeg CLI<br/>[ffmpeg.c]"]
  node_ffplay["ffplay player<br/>[ffplay.c]"]
  node_ffprobe["ffprobe inspector<br/>[ffprobe.c]"]
  node_ismindex["ISM index tool<br/>[ismindex.c]"]
end

subgraph group_media["Media Processing"]
  node_format["Containers and I/O<br/>[avformat.h]"]
  node_codec["Codec processing<br/>[avcodec.h]"]
  node_filter["Filter graphs<br/>[graphparser.c]"]
  node_device["Device access<br/>[avdevice.h]"]
  node_aac["AAC decoder<br/>[aacdec.c]"]
  node_hevcparser["HEVC parser<br/>[parser.c]"]
  node_jxlparser["JPEG XL parser<br/>[jpegxl_parser.c]"]
end

subgraph group_transform["Media Transformations"]
  node_resample["Audio resampling"]
  node_scale["Image scaling<br/>[swscale.h]"]
end

subgraph group_support["Runtime Support"]
  node_util["Media utilities"]
  node_hwcontexts["Hardware contexts<br/>[hwcontext_vulkan.c]"]
end

node_user(("Media user"))

node_user -->|"runs conversion"| node_ffmpeg
node_user -->|"plays media"| node_ffplay
node_user -->|"inspects media"| node_ffprobe
node_ffmpeg -.->|"reads and writes"| node_format
node_ffmpeg -.->|"encodes and decodes"| node_codec
node_ffmpeg -.->|"alters streams"| node_filter
node_ffmpeg -.->|"resamples audio"| node_resample
node_ffmpeg -.->|"scales images"| node_scale
node_ffmpeg -.->|"accesses devices"| node_device
node_ffplay -.->|"reads media"| node_format
node_ffplay -.->|"decodes media"| node_codec
node_ffprobe -->|"inspects streams"| node_format
node_ffprobe -->|"reads codec data"| node_codec
node_filter -.->|"supports scaling"| node_scale
node_codec -->|"includes decoder"| node_aac
node_codec -->|"includes parser"| node_hevcparser
node_codec -->|"includes parser"| node_jxlparser
node_device -->|"integrates capture"| node_format
node_hwcontexts -.->|"enables hardware I/O"| node_device
node_ismindex -->|"uses format API"| node_format

click node_ffmpeg "https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffmpeg.c"
click node_ffplay "https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffplay.c"
click node_ffprobe "https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffprobe.c"
click node_format "https://github.com/aifoundry-org/ffmpeg/blob/master/libavformat/avformat.h"
click node_codec "https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/avcodec.h"
click node_filter "https://github.com/aifoundry-org/ffmpeg/blob/master/libavfilter/graphparser.c"
click node_device "https://github.com/aifoundry-org/ffmpeg/blob/master/libavdevice/avdevice.h"
click node_resample "https://github.com/aifoundry-org/ffmpeg/tree/master/libswresample"
click node_scale "https://github.com/aifoundry-org/ffmpeg/blob/master/libswscale/swscale.h"
click node_util "https://github.com/aifoundry-org/ffmpeg/tree/master/libavutil"
click node_hwcontexts "https://github.com/aifoundry-org/ffmpeg/blob/master/libavutil/hwcontext_vulkan.c"
click node_aac "https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/aac/aacdec.c"
click node_hevcparser "https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/hevc/parser.c"
click node_jxlparser "https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/jpegxl_parser.c"
click node_ismindex "https://github.com/aifoundry-org/ffmpeg/blob/master/tools/ismindex.c"

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_ffmpeg,node_ffplay,node_ffprobe,node_ismindex,node_user toneBlue
class node_format,node_codec,node_filter,node_device,node_aac,node_hevcparser,node_jxlparser toneAmber
class node_resample,node_scale toneMint
class node_util,node_hwcontexts toneRose
```

## Components

### User Tools

- [ffmpeg CLI](https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffmpeg.c): `fftools/ffmpeg.c`
- [ffplay player](https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffplay.c): `fftools/ffplay.c`
- [ffprobe inspector](https://github.com/aifoundry-org/ffmpeg/blob/master/fftools/ffprobe.c): `fftools/ffprobe.c`
- [ISM index tool](https://github.com/aifoundry-org/ffmpeg/blob/master/tools/ismindex.c): `tools/ismindex.c`

### Media Processing

- [Containers and I/O](https://github.com/aifoundry-org/ffmpeg/blob/master/libavformat/avformat.h): `libavformat/avformat.h`
- [Codec processing](https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/avcodec.h): `libavcodec/avcodec.h`
- [Filter graphs](https://github.com/aifoundry-org/ffmpeg/blob/master/libavfilter/graphparser.c): `libavfilter/graphparser.c`
- [Device access](https://github.com/aifoundry-org/ffmpeg/blob/master/libavdevice/avdevice.h): `libavdevice/avdevice.h`
- [AAC decoder](https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/aac/aacdec.c): `libavcodec/aac/aacdec.c`
- [HEVC parser](https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/hevc/parser.c): `libavcodec/hevc/parser.c`
- [JPEG XL parser](https://github.com/aifoundry-org/ffmpeg/blob/master/libavcodec/jpegxl_parser.c): `libavcodec/jpegxl_parser.c`

### Media Transformations

- [Audio resampling](https://github.com/aifoundry-org/ffmpeg/tree/master/libswresample): `libswresample`
- [Image scaling](https://github.com/aifoundry-org/ffmpeg/blob/master/libswscale/swscale.h): `libswscale/swscale.h`

### Runtime Support

- [Media utilities](https://github.com/aifoundry-org/ffmpeg/tree/master/libavutil): `libavutil`
- [Hardware contexts](https://github.com/aifoundry-org/ffmpeg/blob/master/libavutil/hwcontext_vulkan.c): `libavutil/hwcontext_vulkan.c`

### Other components

- **Media user**

## Connections

- Media user → ffmpeg CLI: runs conversion
- Media user → ffplay player: plays media
- Media user → ffprobe inspector: inspects media
- ffmpeg CLI → Containers and I/O: reads and writes
- ffmpeg CLI → Codec processing: encodes and decodes
- ffmpeg CLI → Filter graphs: alters streams
- ffmpeg CLI → Audio resampling: resamples audio
- ffmpeg CLI → Image scaling: scales images
- ffmpeg CLI → Device access: accesses devices
- ffplay player → Containers and I/O: reads media
- ffplay player → Codec processing: decodes media
- ffprobe inspector → Containers and I/O: inspects streams (evidence: `fftools/ffprobe.c`)
- ffprobe inspector → Codec processing: reads codec data (evidence: `fftools/ffprobe.c`)
- Filter graphs → Image scaling: supports scaling
- Codec processing → AAC decoder: includes decoder (evidence: `libavcodec/aac/aacdec.c`)
- Codec processing → HEVC parser: includes parser (evidence: `libavcodec/hevc/parser.c`)
- Codec processing → JPEG XL parser: includes parser (evidence: `libavcodec/jpegxl_parser.c`)
- Device access → Containers and I/O: integrates capture (evidence: `libavdevice/avdevice.h`)
- Hardware contexts → Device access: enables hardware I/O
- ISM index tool → Containers and I/O: uses format API (evidence: `tools/ismindex.c`)
