Skip to content

Commit bf62b8f

Browse files
authored
Merge pull request #103 from viruslox/docs-cleanup-7528171207452560487
Cleanup temp files and update architecture documentation
2 parents 69f9367 + cc9de9f commit bf62b8f

4 files changed

Lines changed: 5 additions & 40 deletions

File tree

ARCHITECTURE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ VLX VisionBridge is a headless, high-performance Linux service written in Go. It
1111
The project is structured according to common Go conventions, primarily using the `internal/` directory to encapsulate private logic:
1212

1313
- `internal/models`: Defines core structs such as `Layer`, `Config`, and `DatabaseConfig`.
14+
- `configs`: Contains the `configs/visionbridge.settings.template` embedded directly into the binary via `configs/assets.go` to facilitate self-contained installations.
1415
- `internal/config`: Handles parsing of the `visionbridge.settings` YAML file and implements configuration watching and diffing.
15-
- `internal/db`: Manages the SQLite database connection pool and logging queries.
16+
- `internal/db`: Manages the SQLite database connection pool (using `github.com/mattn/go-sqlite3`) and logging queries.
1617
- `internal/engine`: The core FFmpeg command generator and process manager. It is further decoupled into:
1718
- `source`: Prepares input arguments, path sanitization, and input file parsing.
1819
- `mixer`: Constructs complex filtergraphs and manages dynamic ZMQ updates.
@@ -57,7 +58,7 @@ To eliminate local SRT network overhead and reduce latency for deployments runni
5758
- **Audio Ingress (`ipc_audio`)**: Accepts raw PCM data (`s16le`, 48kHz, 2-channel) directly via a Unix Domain Socket (`/tmp/vlx_audio.sock`), injecting it seamlessly into the FFmpeg audio mixer.
5859
- **Control Ingress**: A listener on `/tmp/vlx_control.sock` accepts JSON command payloads, directly mutating the internal State Manager to toggle inputs and trigger actions without requiring Web browser overhead.
5960

60-
- **Dynamic Updates via ZMQ**: Live properties (like `overlay@layerID` coordinates and `volume@layerID`) are manipulated in real-time. The mixer binds a `zmq` filter to `tcp://127.0.0.1:5555` to receive string commands.
61+
- **Dynamic Updates via ZMQ**: Live properties (like `overlay@layerID` coordinates and `volume@layerID`) are manipulated in real-time. ZMQ messaging is a mandatory dependency (not optional) for the system to provide the essential real-time filter communication required for dynamic updates with FFmpeg. The mixer binds a `zmq` filter to `tcp://127.0.0.1:5555` to receive string commands.
6162
- **Performance Optimizations**: For performance-sensitive code paths in filter generation, `strings.Builder` and stack buffers are used over `fmt.Sprintf` to minimize memory allocations.
6263

6364
## Output Pipeline
@@ -70,6 +71,7 @@ The output layer encodes the composite frames into H.264/AAC and pushes to a rob
7071
## Resilience & Process Management
7172

7273
A robust `ProcessManager` governs the underlying FFmpeg subprocess:
74+
- **Health Monitor**: Monitors CPU/RAM usage and stream stability, logging metrics to SQLite.
7375
- **Error Diagnostics**: Maintains a `tailBuffer` of the last 4096 bytes of the process's standard error stream to pinpoint failures (identifying them as `[input]`, `[mixer]`, or `[output]` issues).
7476
- **RetryTracker**: Uses a backoff strategy (5 quick retries, 2 slow retries, then dynamic disablement) for isolating failures in sources like Chromium overlays.
7577
- Process reaps and signal listeners ensure no zombie processes remain after graceful or ungraceful shutdown.

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,11 @@ The service is designed for professional 24/7 broadcasting environments where co
2323

2424
- **Canvas Size vs. Output Size**: The fundamental drawing area for layers and overlays is controlled by `input.resolution` (`InputSettings`). The final resolution of the stream that is encoded and pushed to your destinations is controlled by `output.resolution` (`OutputSettings`).
2525

26-
## Architecture Components
27-
28-
1. **Config Watcher**: Monitors `visionbridge.settings` using `fsnotify`.
29-
2. **State Manager**: Orchestrates the current state between the Config File and SQLite.
30-
3. **FFmpeg Engine**: A Go wrapper that generates and manages a complex subprocess for video/audio composition.
31-
4. **Health Monitor**: Monitors CPU/RAM usage and stream stability, logging metrics to SQLite.
32-
3326
## Technology Stack
3427

3528
- **Language**: Go (Golang)
3629
- **Processing Engine**: FFmpeg (via os/exec)
3730
- **Database**: SQLite (State persistence, Logs, Metadata)
38-
- **Messaging**: ZMQ for real-time filter communication with FFmpeg.
31+
- **Messaging**: ZMQ is a mandatory dependency for real-time filter communication with FFmpeg.
3932

4033
See [Architecture](ARCHITECTURE.md) for High-Level Design details.

fix.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

test_xvfb.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)