# denzel-robin/btp-vsr architecture

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

- Interactive diagram: https://gitdiagram.com/denzel-robin/btp-vsr
- Repository: https://github.com/denzel-robin/btp-vsr

## Overview

This is a video-streaming research project and evaluation toolkit. Its primary runtime workflow paces a source through FFmpeg H.264/MPEG-TS delivery over localhost, decodes it on the client, optionally reconstructs with NanoVSR or resizes, and presents frames on a timed schedule. Separate research workflows compare quality, bitrate, latency, and client cost on natural video and run offline x4 evaluations. Source excerpts establish the live transport and client path; unsampled analysis stages are included where README capabilities support them, without asserting unverified call chains.

Main entry points: [`client/streaming_client.py`](https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py) (Stream client), [`scripts/run_streaming_demo.py`](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/run_streaming_demo.py) (Demo launcher), [`server/streaming_server.py`](https://github.com/denzel-robin/btp-vsr/blob/main/server/streaming_server.py) (Paced stream server), [`scripts/natural_quality.py`](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/natural_quality.py) (Natural-video quality study)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["Live streaming"]
  node_launcher["Demo launcher"]
  node_server["Paced stream server"]
  node_encoder["FFmpeg encode / mux"]
  node_protocol["Framed TCP protocol"]
  node_client["Stream client"]
end

subgraph group_processing["Client processing"]
  node_decoder["FFmpeg decode"]
  node_reconstruction["NanoVSR reconstruction"]
  node_resize["Playback resizing"]
  node_playback["Timed playback"]
end

subgraph group_research["Video evaluation"]
  node_natural["Natural-video quality study<br/>[natural_quality.py]"]
  node_x4eval["Offline x4 evaluation"]
  node_native["Native-720 comparison"]
  node_selection["Natural-study selection"]
end

subgraph group_reporting["Presentation and results"]
  node_dashboard["Playback statistics<br/>[demo_stats.py]"]
  node_comparison["Synchronized comparison view<br/>[comparison_view.py]"]
  node_summary["Natural-study summary"]
end

node_operator(("Research operator"))
node_viewer(("Playback viewer"))

node_operator -->|"starts demo"| node_launcher
node_launcher -->|"launches"| node_server
node_launcher -->|"launches"| node_client
node_server -->|"encodes / muxes"| node_encoder
node_server -->|"frames and sends"| node_protocol
node_protocol -->|"transfers stream"| node_client
node_client -->|"decodes"| node_decoder
node_client -->|"optionally reconstructs"| node_reconstruction
node_client -->|"optionally resizes"| node_resize
node_client -->|"schedules frames"| node_playback
node_client -->|"renders statistics"| node_dashboard
node_client -->|"renders comparison"| node_comparison
node_playback -->|"presents frames"| node_viewer
node_operator -->|"runs study"| node_natural
node_natural -->|"loads model"| node_client
node_natural -->|"uses metrics"| node_x4eval
node_operator -->|"runs evaluation"| node_x4eval
node_operator -->|"runs comparison"| node_native
node_native -->|"loads model"| node_client
node_native -->|"uses metrics"| node_x4eval
node_operator -->|"selects study points"| node_selection
node_operator -->|"summarizes study"| node_summary

click node_launcher "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/run_streaming_demo.py"
click node_server "https://github.com/denzel-robin/btp-vsr/blob/main/server/streaming_server.py"
click node_protocol "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/streaming_common.py"
click node_client "https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py"
click node_reconstruction "https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py"
click node_resize "https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py"
click node_playback "https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py"
click node_dashboard "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/demo_stats.py"
click node_comparison "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/comparison_view.py"
click node_natural "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/natural_quality.py"
click node_x4eval "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/evaluate_x4_video.py"
click node_native "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/compare_native720.py"
click node_selection "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/select_natural_points.py"
click node_summary "https://github.com/denzel-robin/btp-vsr/blob/main/scripts/summarize_natural.py"

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_launcher,node_server,node_encoder,node_protocol,node_client,node_viewer toneBlue
class node_decoder,node_reconstruction,node_resize,node_playback toneAmber
class node_natural,node_x4eval,node_native,node_selection toneMint
class node_dashboard,node_comparison,node_summary toneRose
class node_operator toneIndigo
```

## Components

### Live streaming

- [Demo launcher](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/run_streaming_demo.py): `scripts/run_streaming_demo.py`
- [Paced stream server](https://github.com/denzel-robin/btp-vsr/blob/main/server/streaming_server.py): `server/streaming_server.py`
- **FFmpeg encode / mux**
- [Framed TCP protocol](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/streaming_common.py): `scripts/streaming_common.py`
- [Stream client](https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py): `client/streaming_client.py`

### Client processing

- **FFmpeg decode**
- [NanoVSR reconstruction](https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py): `client/streaming_client.py`
- [Playback resizing](https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py): `client/streaming_client.py`
- [Timed playback](https://github.com/denzel-robin/btp-vsr/blob/main/client/streaming_client.py): `client/streaming_client.py`

### Video evaluation

- [Natural-video quality study](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/natural_quality.py): `scripts/natural_quality.py`
- [Offline x4 evaluation](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/evaluate_x4_video.py): `scripts/evaluate_x4_video.py`
- [Native-720 comparison](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/compare_native720.py): `scripts/compare_native720.py`
- [Natural-study selection](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/select_natural_points.py): `scripts/select_natural_points.py`

### Presentation and results

- [Playback statistics](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/demo_stats.py): `scripts/demo_stats.py`
- [Synchronized comparison view](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/comparison_view.py): `scripts/comparison_view.py`
- [Natural-study summary](https://github.com/denzel-robin/btp-vsr/blob/main/scripts/summarize_natural.py): `scripts/summarize_natural.py`

### Other components

- **Research operator**
- **Playback viewer**

## Connections

- Research operator → Demo launcher: starts demo (evidence: `README.md`)
- Demo launcher → Paced stream server: launches
- Demo launcher → Stream client: launches
- Paced stream server → FFmpeg encode / mux: encodes / muxes (evidence: `server/streaming_server.py`)
- Paced stream server → Framed TCP protocol: frames and sends (evidence: `server/streaming_server.py`)
- Framed TCP protocol → Stream client: transfers stream (evidence: `README.md`)
- Stream client → FFmpeg decode: decodes (evidence: `client/streaming_client.py`)
- Stream client → NanoVSR reconstruction: optionally reconstructs (evidence: `README.md`)
- Stream client → Playback resizing: optionally resizes (evidence: `README.md`)
- Stream client → Timed playback: schedules frames (evidence: `README.md`)
- Stream client → Playback statistics: renders statistics (evidence: `client/streaming_client.py`)
- Stream client → Synchronized comparison view: renders comparison (evidence: `client/streaming_client.py`)
- Timed playback → Playback viewer: presents frames (evidence: `README.md`)
- Research operator → Natural-video quality study: runs study (evidence: `README.md`)
- Natural-video quality study → Stream client: loads model (evidence: `scripts/natural_quality.py`)
- Natural-video quality study → Offline x4 evaluation: uses metrics (evidence: `scripts/natural_quality.py`)
- Research operator → Offline x4 evaluation: runs evaluation (evidence: `scripts/evaluate_x4_video.py`)
- Research operator → Native-720 comparison: runs comparison (evidence: `scripts/compare_native720.py`)
- Native-720 comparison → Stream client: loads model (evidence: `scripts/compare_native720.py`)
- Native-720 comparison → Offline x4 evaluation: uses metrics (evidence: `scripts/compare_native720.py`)
- Research operator → Natural-study selection: selects study points (evidence: `README.md`)
- Research operator → Natural-study summary: summarizes study (evidence: `README.md`)
