# cryptamarok/vidqueue architecture

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

- Interactive diagram: https://gitdiagram.com/cryptamarok/vidqueue
- Repository: https://github.com/cryptamarok/vidqueue

## Overview

VidQueue is a Python CLI for discovering video files, converting them in a resumable queue with FFmpeg, listing candidate files, and comparing video quality. The principal workflow is CLI arguments → application dispatch → file discovery and conversion → FFmpeg progress reporting, with queue state saved so interrupted work can resume. Analysis is a separate path that runs FFmpeg quality filters and reports a score. The graph follows the sampled entry point and core modules; README-documented modes and scoring capabilities are included, but unsampled implementation details are not inferred.

Main entry points: [`main.py`](https://github.com/cryptamarok/vidqueue/blob/main/main.py) (Application entry), [`vidqueue/core/ffmpeg_runner.py`](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/core/ffmpeg_runner.py) (FFmpeg runner), [`vidqueue/utils.py`](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py) (Conversion workflow), [`vidqueue/video_analyzer.py`](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/video_analyzer.py) (Video analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and dispatch"]
  node_main["Application entry<br/>[main.py]"]
  node_arguments["Argument parsing<br/>[cli.py]"]
end

subgraph group_conversion["Batch conversion"]
  node_discovery["File discovery<br/>[utils.py]"]
  node_listing["List mode<br/>[utils.py]"]
  node_conversion_flow["Conversion workflow<br/>[utils.py]"]
  node_resume["Resume workflow<br/>[utils.py]"]
  node_ffmpeg_runner["FFmpeg runner<br/>[ffmpeg_runner.py]"]
end

subgraph group_analysis["Quality analysis"]
  node_analysis_flow["Analysis workflow<br/>[utils.py]"]
  node_analyzer["Video analyzer<br/>[video_analyzer.py]"]
end

subgraph group_state_config["State and configuration"]
  node_queue_manager["Queue manager<br/>[queue_manager.py]"]
  node_queue_state[("Queue state file")]
  node_configuration["Configuration loader<br/>[config_loader.py]"]
  node_config_file["TOML configuration<br/>[config.toml]"]
end

node_user(("CLI user"))
node_ffmpeg["FFmpeg"]
node_ffprobe["FFprobe"]

node_user -->|"invokes"| node_main
node_main -->|"parses arguments"| node_arguments
node_main -->|"discovers files"| node_discovery
node_main -->|"dispatches run"| node_conversion_flow
node_main -->|"dispatches list"| node_listing
node_main -->|"dispatches analyze"| node_analysis_flow
node_main -->|"dispatches resume"| node_resume
node_conversion_flow -->|"prepares and runs"| node_ffmpeg_runner
node_conversion_flow -->|"saves progress"| node_queue_manager
node_resume -->|"loads and saves"| node_queue_manager
node_resume -->|"prepares and runs"| node_ffmpeg_runner
node_ffmpeg_runner -->|"runs conversion"| node_ffmpeg
node_ffmpeg_runner -->|"probes media"| node_ffprobe
node_analysis_flow -->|"requests analysis"| node_analyzer
node_analyzer -->|"gets media details"| node_ffmpeg_runner
node_analyzer -->|"runs metric filters"| node_ffmpeg
node_queue_manager -->|"reads and writes"| node_queue_state
node_configuration -->|"loads TOML"| node_config_file

click node_main "https://github.com/cryptamarok/vidqueue/blob/main/main.py"
click node_arguments "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/cli.py"
click node_discovery "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py"
click node_listing "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py"
click node_conversion_flow "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py"
click node_resume "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py"
click node_ffmpeg_runner "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/core/ffmpeg_runner.py"
click node_analysis_flow "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py"
click node_analyzer "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/video_analyzer.py"
click node_queue_manager "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/core/queue_manager.py"
click node_configuration "https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/config/config_loader.py"
click node_config_file "https://github.com/cryptamarok/vidqueue/blob/main/config.toml"

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_main,node_arguments,node_user toneBlue
class node_discovery,node_listing,node_conversion_flow,node_resume,node_ffmpeg_runner toneAmber
class node_analysis_flow,node_analyzer toneMint
class node_queue_manager,node_queue_state,node_configuration,node_config_file toneRose
class node_ffmpeg,node_ffprobe toneIndigo
```

## Components

### CLI and dispatch

- [Application entry](https://github.com/cryptamarok/vidqueue/blob/main/main.py): `main.py`
- [Argument parsing](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/cli.py): `vidqueue/cli.py`

### Batch conversion

- [File discovery](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py): `vidqueue/utils.py`
- [List mode](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py): `vidqueue/utils.py`
- [Conversion workflow](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py): `vidqueue/utils.py`
- [Resume workflow](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py): `vidqueue/utils.py`
- [FFmpeg runner](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/core/ffmpeg_runner.py): `vidqueue/core/ffmpeg_runner.py`

### Quality analysis

- [Analysis workflow](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/utils.py): `vidqueue/utils.py`
- [Video analyzer](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/video_analyzer.py): `vidqueue/video_analyzer.py`

### State and configuration

- [Queue manager](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/core/queue_manager.py): `vidqueue/core/queue_manager.py`
- **Queue state file**
- [Configuration loader](https://github.com/cryptamarok/vidqueue/blob/main/vidqueue/config/config_loader.py): `vidqueue/config/config_loader.py`
- [TOML configuration](https://github.com/cryptamarok/vidqueue/blob/main/config.toml): `config.toml`

### Other components

- **CLI user**
- **FFmpeg**
- **FFprobe**

## Connections

- CLI user → Application entry: invokes (evidence: `README.md`)
- Application entry → Argument parsing: parses arguments (evidence: `main.py`)
- Application entry → File discovery: discovers files (evidence: `main.py`)
- Application entry → Conversion workflow: dispatches run (evidence: `main.py`)
- Application entry → List mode: dispatches list (evidence: `main.py`)
- Application entry → Analysis workflow: dispatches analyze (evidence: `main.py`)
- Application entry → Resume workflow: dispatches resume (evidence: `main.py`)
- Conversion workflow → FFmpeg runner: prepares and runs (evidence: `vidqueue/utils.py`)
- Conversion workflow → Queue manager: saves progress (evidence: `vidqueue/utils.py`)
- Resume workflow → Queue manager: loads and saves (evidence: `vidqueue/utils.py`)
- Resume workflow → FFmpeg runner: prepares and runs (evidence: `vidqueue/utils.py`)
- FFmpeg runner → FFmpeg: runs conversion (evidence: `vidqueue/core/ffmpeg_runner.py`)
- FFmpeg runner → FFprobe: probes media (evidence: `vidqueue/core/ffmpeg_runner.py`)
- Analysis workflow → Video analyzer: requests analysis (evidence: `vidqueue/utils.py`)
- Video analyzer → FFmpeg runner: gets media details (evidence: `vidqueue/video_analyzer.py`)
- Video analyzer → FFmpeg: runs metric filters (evidence: `vidqueue/video_analyzer.py`)
- Queue manager → Queue state file: reads and writes (evidence: `vidqueue/core/queue_manager.py`)
- Configuration loader → TOML configuration: loads TOML (evidence: `vidqueue/config/config_loader.py`)
