You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,9 @@ VLX VisionBridge is a headless, high-performance Linux service written in Go. It
11
11
The project is structured according to common Go conventions, primarily using the `internal/` directory to encapsulate private logic:
12
12
13
13
-`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.
14
15
-`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.
16
17
-`internal/engine`: The core FFmpeg command generator and process manager. It is further decoupled into:
17
18
-`source`: Prepares input arguments, path sanitization, and input file parsing.
18
19
-`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
57
58
-**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.
58
59
-**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.
59
60
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.
61
62
-**Performance Optimizations**: For performance-sensitive code paths in filter generation, `strings.Builder` and stack buffers are used over `fmt.Sprintf` to minimize memory allocations.
62
63
63
64
## Output Pipeline
@@ -70,6 +71,7 @@ The output layer encodes the composite frames into H.264/AAC and pushes to a rob
70
71
## Resilience & Process Management
71
72
72
73
A robust `ProcessManager` governs the underlying FFmpeg subprocess:
74
+
-**Health Monitor**: Monitors CPU/RAM usage and stream stability, logging metrics to SQLite.
73
75
-**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).
74
76
-**RetryTracker**: Uses a backoff strategy (5 quick retries, 2 slow retries, then dynamic disablement) for isolating failures in sources like Chromium overlays.
75
77
- Process reaps and signal listeners ensure no zombie processes remain after graceful or ungraceful shutdown.
Copy file name to clipboardExpand all lines: README.md
+1-8Lines changed: 1 addition & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,18 +23,11 @@ The service is designed for professional 24/7 broadcasting environments where co
23
23
24
24
-**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`).
25
25
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.
0 commit comments