# in801fo/mass-video-compressor architecture

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

- Interactive diagram: https://gitdiagram.com/in801fo/mass-video-compressor
- Repository: https://github.com/in801fo/mass-video-compressor

## Overview

This Windows command-line utility takes a folder path, discovers MP4 files, skips names marked as already compressed, and invokes FFmpeg once per remaining file. It probes for CUDA support and selects a hardware or software encoder. The graph reflects the single sampled runtime file and README-documented usage; external tools and devices are modeled separately.

Main entry points: [`Program.cs`](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs) (CLI orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command workflow"]
  node_program["CLI orchestration<br/>[Program.cs]"]
end

subgraph group_processing["Video processing"]
  node_gpu["GPU detection<br/>[Program.cs]"]
  node_discovery["MP4 discovery<br/>[Program.cs]"]
  node_filter["Name filtering<br/>[Program.cs]"]
  node_compression["Video compression<br/>[Program.cs]"]
end

subgraph group_external["External runtime"]
  node_cmd["Windows command shell"]
  node_gpu_runtime["CUDA runtime"]
  node_ffmpeg["FFmpeg"]
end

node_user(("CLI user"))
node_folder[("Input/output folder")]

node_user -->|"provides folder"| node_program
node_program -->|"probes devices"| node_gpu
node_gpu -->|"checks CUDA"| node_gpu_runtime
node_program -->|"calls"| node_discovery
node_discovery -->|"runs listing"| node_cmd
node_discovery -->|"lists MP4 files"| node_folder
node_discovery -->|"returns paths"| node_program
node_program -->|"calls"| node_filter
node_filter -->|"returns names"| node_program
node_program -->|"calls"| node_compression
node_compression -->|"selects encoder"| node_gpu_runtime
node_compression -->|"starts process"| node_ffmpeg
node_ffmpeg -->|"writes output"| node_folder

click node_program "https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs"
click node_gpu "https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs"
click node_discovery "https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs"
click node_filter "https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs"
click node_compression "https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs"

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_program,node_user toneBlue
class node_gpu,node_discovery,node_filter,node_compression,node_folder toneAmber
class node_cmd,node_gpu_runtime,node_ffmpeg toneMint
```

## Components

### Command workflow

- [CLI orchestration](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs): `Program.cs`

### Video processing

- [GPU detection](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs): `Program.cs`
- [MP4 discovery](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs): `Program.cs`
- [Name filtering](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs): `Program.cs`
- [Video compression](https://github.com/in801fo/mass-video-compressor/blob/main/Program.cs): `Program.cs`

### External runtime

- **Windows command shell**
- **CUDA runtime**
- **FFmpeg**

### Other components

- **CLI user**
- **Input/output folder**

## Connections

- CLI user → CLI orchestration: provides folder (evidence: `README.md`)
- CLI orchestration → GPU detection: probes devices (evidence: `Program.cs`)
- GPU detection → CUDA runtime: checks CUDA (evidence: `Program.cs`)
- CLI orchestration → MP4 discovery: calls (evidence: `Program.cs`)
- MP4 discovery → Windows command shell: runs listing (evidence: `Program.cs`)
- MP4 discovery → Input/output folder: lists MP4 files (evidence: `Program.cs`)
- MP4 discovery → CLI orchestration: returns paths (evidence: `Program.cs`)
- CLI orchestration → Name filtering: calls (evidence: `Program.cs`)
- Name filtering → CLI orchestration: returns names (evidence: `Program.cs`)
- CLI orchestration → Video compression: calls (evidence: `Program.cs`)
- Video compression → CUDA runtime: selects encoder (evidence: `Program.cs`)
- Video compression → FFmpeg: starts process (evidence: `Program.cs`)
- FFmpeg → Input/output folder: writes output
