# aaac15/asciimov architecture

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

- Interactive diagram: https://gitdiagram.com/aaac15/asciimov
- Repository: https://github.com/aaac15/asciimov

## Overview

asciimov is a C terminal video player: the user enters a local video path or URL, the program obtains video frames and plays audio through ffmpeg, maps grayscale pixels to ASCII characters, and redraws the terminal at roughly 30 fps. URL playback downloads a temporary video with yt-dlp (configured to use Node.js), then follows the same playback path. The tree also contains an older still-image-to-ASCII implementation using stb_image. The current video stages are sampled in asciimov.c; external-tool relationships are visible there, while legacy image loading is documented by its source include.

Main entry points: [`asciimov.c`](https://github.com/aaac15/asciimov/blob/main/asciimov.c) (Video Player), [`OLD/static0.01/asciimov.c`](https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/asciimov.c) (Still Image Converter), [`OLD/static0.01/stb_image.h`](https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/stb_image.h) (Image Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_video["Video Playback"]
  node_player["Video Player<br/>[asciimov.c]"]
  node_url_download["URL Download<br/>[asciimov.c]"]
  node_temp_video["Temporary Video"]
  node_audio["Audio Output"]
  node_frame_reader["Frame Reader<br/>[asciimov.c]"]
end

subgraph group_render["Terminal Rendering"]
  node_terminal_size["Terminal Sizing<br/>[asciimov.c]"]
  node_ascii_map["ASCII Mapping<br/>[asciimov.c]"]
  node_terminal_draw["Terminal Redraw<br/>[asciimov.c]"]
end

subgraph group_legacy["Legacy Image"]
  node_legacy_player["Still Image Converter<br/>[asciimov.c]"]
  node_stb_image["Image Loader<br/>[stb_image.h]"]
end

node_user(("User"))
node_ytdlp["yt-dlp"]
node_node["Node.js Runtime"]
node_ffmpeg["ffmpeg"]

node_user -->|"enters path"| node_player
node_player -->|"dispatches URLs"| node_url_download
node_url_download -->|"downloads with"| node_ytdlp
node_url_download -->|"configures runtime"| node_node
node_ytdlp -->|"writes video"| node_temp_video
node_player -->|"starts playback"| node_ffmpeg
node_ffmpeg -->|"plays audio"| node_audio
node_ffmpeg -->|"streams frames"| node_frame_reader
node_player -->|"queries dimensions"| node_terminal_size
node_frame_reader -->|"maps grayscale"| node_ascii_map
node_terminal_size -->|"sets drawing bounds"| node_ascii_map
node_ascii_map -->|"updates buffers"| node_terminal_draw
node_player -->|"renders frames"| node_terminal_draw
node_player -->|"removes temporary file"| node_temp_video
node_legacy_player -->|"loads image"| node_stb_image

click node_player "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_url_download "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_frame_reader "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_terminal_size "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_ascii_map "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_terminal_draw "https://github.com/aaac15/asciimov/blob/main/asciimov.c"
click node_legacy_player "https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/asciimov.c"
click node_stb_image "https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/stb_image.h"

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_player,node_url_download,node_temp_video,node_audio,node_frame_reader,node_user toneBlue
class node_terminal_size,node_ascii_map,node_terminal_draw toneAmber
class node_legacy_player,node_stb_image toneMint
class node_ytdlp,node_node,node_ffmpeg toneIndigo
```

## Components

### Video Playback

- [Video Player](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`
- [URL Download](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`
- **Temporary Video**
- **Audio Output**
- [Frame Reader](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`

### Terminal Rendering

- [Terminal Sizing](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`
- [ASCII Mapping](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`
- [Terminal Redraw](https://github.com/aaac15/asciimov/blob/main/asciimov.c): `asciimov.c`

### Legacy Image

- [Still Image Converter](https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/asciimov.c): `OLD/static0.01/asciimov.c`
- [Image Loader](https://github.com/aaac15/asciimov/blob/main/OLD/static0.01/stb_image.h): `OLD/static0.01/stb_image.h`

### Other components

- **User**
- **yt-dlp**
- **Node.js Runtime**
- **ffmpeg**

## Connections

- User → Video Player: enters path (evidence: `asciimov.c`)
- Video Player → URL Download: dispatches URLs (evidence: `asciimov.c`)
- URL Download → yt-dlp: downloads with (evidence: `asciimov.c`)
- URL Download → Node.js Runtime: configures runtime (evidence: `asciimov.c`)
- yt-dlp → Temporary Video: writes video
- Video Player → ffmpeg: starts playback (evidence: `asciimov.c`)
- ffmpeg → Audio Output: plays audio
- ffmpeg → Frame Reader: streams frames (evidence: `asciimov.c`)
- Video Player → Terminal Sizing: queries dimensions (evidence: `asciimov.c`)
- Frame Reader → ASCII Mapping: maps grayscale (evidence: `asciimov.c`)
- Terminal Sizing → ASCII Mapping: sets drawing bounds (evidence: `asciimov.c`)
- ASCII Mapping → Terminal Redraw: updates buffers (evidence: `asciimov.c`)
- Video Player → Terminal Redraw: renders frames (evidence: `asciimov.c`)
- Video Player → Temporary Video: removes temporary file (evidence: `asciimov.c`)
- Still Image Converter → Image Loader: loads image (evidence: `OLD/static0.01/asciimov.c`)
