# benayaram/stream-studio architecture

> Architecture diagram of the GitHub repository benayaram/stream-studio, 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/benayaram/stream-studio
- Repository: https://github.com/benayaram/stream-studio

## Overview

This repository implements a small web-based live-streaming controller. A user loads the public interface, submits a source and stream layout, and the server downloads the media with yt-dlp, composites video and optional image overlays with FFmpeg, then sends the output to a configured streaming destination. The server also exposes status and image-upload endpoints. Only partial server.js excerpts are available and the README is empty, so the graph omits unverified frontend-to-endpoint details and finer configuration behavior.

Main entry points: [`server.js`](https://github.com/benayaram/stream-studio/blob/master/server.js) (HTTP Controller), [`ffmpeg.exe`](https://github.com/benayaram/stream-studio/blob/master/ffmpeg.exe) (Video Compositor), [`yt-dlp.exe`](https://github.com/benayaram/stream-studio/blob/master/yt-dlp.exe) (Media Downloader), [`public/uploads`](https://github.com/benayaram/stream-studio/tree/master/public/uploads) (Uploaded Assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Web Control"]
  node_web["Control Interface<br/>[index.html]"]
  node_server["HTTP Controller<br/>[server.js]"]
  node_status["Stream Status<br/>[server.js]"]
  node_streamcontrol["Stream Control<br/>[server.js]"]
end

subgraph group_media["Stream Processing"]
  node_lifecycle["Process Lifecycle<br/>[server.js]"]
  node_downloader["Media Downloader<br/>[yt-dlp.exe]"]
  node_compositor["Video Compositor<br/>[ffmpeg.exe]"]
end

subgraph group_assets["Overlay Assets"]
  node_uploads["Asset Uploads<br/>[server.js]"]
  node_assetstore[("Uploaded Assets")]
end

node_viewer(("Operator"))
node_destination["Streaming Destination"]

node_viewer -->|"opens"| node_web
node_server -->|"serves"| node_web
node_viewer -.->|"controls"| node_server
node_server -->|"routes status"| node_status
node_server -->|"routes uploads"| node_uploads
node_uploads -->|"writes files"| node_assetstore
node_server -->|"routes stream"| node_streamcontrol
node_streamcontrol -->|"starts or stops"| node_lifecycle
node_lifecycle -->|"spawns"| node_downloader
node_lifecycle -->|"spawns"| node_compositor
node_downloader -->|"pipes media"| node_compositor
node_compositor -->|"publishes stream"| node_destination
node_assetstore -.->|"overlays assets"| node_compositor

click node_web "https://github.com/benayaram/stream-studio/blob/master/public/index.html"
click node_server "https://github.com/benayaram/stream-studio/blob/master/server.js"
click node_status "https://github.com/benayaram/stream-studio/blob/master/server.js"
click node_uploads "https://github.com/benayaram/stream-studio/blob/master/server.js"
click node_assetstore "https://github.com/benayaram/stream-studio/tree/master/public/uploads"
click node_streamcontrol "https://github.com/benayaram/stream-studio/blob/master/server.js"
click node_lifecycle "https://github.com/benayaram/stream-studio/blob/master/server.js"
click node_downloader "https://github.com/benayaram/stream-studio/blob/master/yt-dlp.exe"
click node_compositor "https://github.com/benayaram/stream-studio/blob/master/ffmpeg.exe"

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_web,node_server,node_status,node_streamcontrol toneBlue
class node_lifecycle,node_downloader,node_compositor toneAmber
class node_uploads,node_assetstore toneMint
class node_viewer,node_destination toneIndigo
```

## Components

### Web Control

- [Control Interface](https://github.com/benayaram/stream-studio/blob/master/public/index.html): `public/index.html`
- [HTTP Controller](https://github.com/benayaram/stream-studio/blob/master/server.js): `server.js`
- [Stream Status](https://github.com/benayaram/stream-studio/blob/master/server.js): `server.js`
- [Stream Control](https://github.com/benayaram/stream-studio/blob/master/server.js): `server.js`

### Stream Processing

- [Process Lifecycle](https://github.com/benayaram/stream-studio/blob/master/server.js): `server.js`
- [Media Downloader](https://github.com/benayaram/stream-studio/blob/master/yt-dlp.exe): `yt-dlp.exe`
- [Video Compositor](https://github.com/benayaram/stream-studio/blob/master/ffmpeg.exe): `ffmpeg.exe`

### Overlay Assets

- [Asset Uploads](https://github.com/benayaram/stream-studio/blob/master/server.js): `server.js`
- [Uploaded Assets](https://github.com/benayaram/stream-studio/tree/master/public/uploads): `public/uploads`

### Other components

- **Operator**
- **Streaming Destination**

## Connections

- Operator → Control Interface: opens
- HTTP Controller → Control Interface: serves (evidence: `server.js`)
- Operator → HTTP Controller: controls
- HTTP Controller → Stream Status: routes status (evidence: `server.js`)
- HTTP Controller → Asset Uploads: routes uploads (evidence: `server.js`)
- Asset Uploads → Uploaded Assets: writes files (evidence: `server.js`)
- HTTP Controller → Stream Control: routes stream (evidence: `server.js`)
- Stream Control → Process Lifecycle: starts or stops (evidence: `server.js`)
- Process Lifecycle → Media Downloader: spawns (evidence: `server.js`)
- Process Lifecycle → Video Compositor: spawns (evidence: `server.js`)
- Media Downloader → Video Compositor: pipes media
- Video Compositor → Streaming Destination: publishes stream
- Uploaded Assets → Video Compositor: overlays assets
