# olivia-leggio/ggvastedgemuxer architecture

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

- Interactive diagram: https://gitdiagram.com/olivia-leggio/ggvastedgemuxer
- Repository: https://github.com/olivia-leggio/ggvastedgemuxer

## Overview

This is a C++ video-capture and MKV-archiving tool for Guilty Gear Vastedge XT. Its principal implemented workflow selects an FFmpeg input device, decodes video frames, and encodes/muxes them into an MKV file; it also has a separate path for turning PPM frames into MKV and utilities for exporting frames from video files. The README describes audio synchronization and real-time scene splitting as project goals, not demonstrated implemented features. Hardware capture details and those goals are therefore not shown as working software stages.

Main entry points: [`VastedgeOutputMuxer.cpp`](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp) (Capture workflow), [`MkvWriter.cpp`](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/MkvWriter.cpp) (MKV writer), [`ExportFrames.cpp`](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/ExportFrames.cpp) (Frame export), [`VideoUtils.cpp`](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VideoUtils.cpp) (Video utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and mux"]
  node_input_device["Capture input"]
  node_app["Capture workflow"]
  node_stream_decode["Stream decoding"]
  node_ppm_import["PPM import"]
end

subgraph group_media["Media processing"]
  node_mkv_writer["MKV writer<br/>[MkvWriter.cpp]"]
  node_video_utils["Video utilities<br/>[VideoUtils.cpp]"]
  node_decoder_state["Decoder state<br/>[VideoUtils.h]"]
  node_mkv_file["MKV archive"]
end

subgraph group_export["Frame export"]
  node_frame_export["Frame export<br/>[ExportFrames.cpp]"]
  node_frame_files["PNG / PPM files"]
end

node_operator(("Operator"))
node_lvds(("Vastedge LVDS"))
node_ffmpeg["FFmpeg libraries"]

node_operator -->|"selects input"| node_app
node_app -->|"lists devices"| node_input_device
node_lvds -.->|"captured as"| node_input_device
node_app -->|"starts capture"| node_stream_decode
node_stream_decode -->|"reads packets"| node_input_device
node_stream_decode -->|"writes frames"| node_mkv_writer
node_app -->|"imports frames"| node_ppm_import
node_ppm_import -->|"writes frames"| node_mkv_writer
node_mkv_writer -->|"writes archive"| node_mkv_file
node_stream_decode -->|"decodes video"| node_ffmpeg
node_mkv_writer -->|"encodes and muxes"| node_ffmpeg
node_video_utils -->|"opens video"| node_decoder_state
node_frame_export -->|"reads decoded frames"| node_decoder_state
node_frame_export -->|"converts and saves"| node_video_utils
node_frame_export -->|"writes images"| node_frame_files
node_video_utils -->|"decodes and converts"| node_ffmpeg

click node_app "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp"
click node_stream_decode "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp"
click node_ppm_import "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp"
click node_mkv_writer "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/MkvWriter.cpp"
click node_video_utils "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VideoUtils.cpp"
click node_decoder_state "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VideoUtils.h"
click node_frame_export "https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/ExportFrames.cpp"

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_input_device,node_app,node_stream_decode,node_ppm_import toneBlue
class node_mkv_writer,node_video_utils,node_decoder_state,node_mkv_file toneAmber
class node_frame_export,node_frame_files toneMint
class node_operator,node_lvds,node_ffmpeg toneIndigo
```

## Components

### Capture and mux

- **Capture input**
- [Capture workflow](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp): `VastedgeOutputMuxer.cpp`
- [Stream decoding](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp): `VastedgeOutputMuxer.cpp`
- [PPM import](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VastedgeOutputMuxer.cpp): `VastedgeOutputMuxer.cpp`

### Media processing

- [MKV writer](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/MkvWriter.cpp): `MkvWriter.cpp`
- [Video utilities](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VideoUtils.cpp): `VideoUtils.cpp`
- [Decoder state](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/VideoUtils.h): `VideoUtils.h`
- **MKV archive**

### Frame export

- [Frame export](https://github.com/olivia-leggio/ggvastedgemuxer/blob/main/ExportFrames.cpp): `ExportFrames.cpp`
- **PNG / PPM files**

### Other components

- **Operator**
- **Vastedge LVDS**
- **FFmpeg libraries**

## Connections

- Operator → Capture workflow: selects input (evidence: `VastedgeOutputMuxer.cpp`)
- Capture workflow → Capture input: lists devices (evidence: `VastedgeOutputMuxer.cpp`)
- Vastedge LVDS → Capture input: captured as (evidence: `README.md`)
- Capture workflow → Stream decoding: starts capture (evidence: `VastedgeOutputMuxer.cpp`)
- Stream decoding → Capture input: reads packets (evidence: `VastedgeOutputMuxer.cpp`)
- Stream decoding → MKV writer: writes frames (evidence: `VastedgeOutputMuxer.cpp`)
- Capture workflow → PPM import: imports frames (evidence: `VastedgeOutputMuxer.cpp`)
- PPM import → MKV writer: writes frames (evidence: `VastedgeOutputMuxer.cpp`)
- MKV writer → MKV archive: writes archive (evidence: `MkvWriter.cpp`)
- Stream decoding → FFmpeg libraries: decodes video (evidence: `VastedgeOutputMuxer.cpp`)
- MKV writer → FFmpeg libraries: encodes and muxes (evidence: `MkvWriter.cpp`)
- Video utilities → Decoder state: opens video (evidence: `VideoUtils.cpp`)
- Frame export → Decoder state: reads decoded frames (evidence: `ExportFrames.cpp`)
- Frame export → Video utilities: converts and saves (evidence: `ExportFrames.cpp`)
- Frame export → PNG / PPM files: writes images
- Video utilities → FFmpeg libraries: decodes and converts (evidence: `VideoUtils.cpp`)
