Files
dp/README.md
T
2026-07-17 02:10:08 +08:00

104 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LED 大屏投放平台
面向 `14880 x 3510` LED 大屏的双 GPU 服务器投放平台。
当前架构:
```text
控制服务
-> WebSocket 同步协议
-> 左 GPU 服务器本地渲染 left tile
-> 右 GPU 服务器本地渲染 right tile
-> 每台服务器 4 路 4K 输出
-> 拼控 / LED 控制器物理拼接
```
WebSocket 只传场景、动作、时间轴、ACK 和性能指标,不传超大视频流。画面由两台 GPU 服务器各自在本地渲染。
## 启动
第一次启动:
```bash
python -m venv .venv
python -m pip install -r requirements.txt
python -m led_platform.cli serve
```
已有环境后:
```bash
python -m led_platform.cli serve
```
或者直接用 uvicorn
```bash
uvicorn led_platform.main:app --host 0.0.0.0 --port 8000
```
查看地址:
```bash
python -m led_platform.cli urls
```
常用地址:
- 控制台:http://127.0.0.1:8000/
- 左输出:http://127.0.0.1:8000/output/left
- 右输出:http://127.0.0.1:8000/output/right
- 健康检查:http://127.0.0.1:8000/healthz
- 同步状态:http://127.0.0.1:8000/api/sync/status
生产输出端直接用浏览器打开:
```text
左 GPU 服务器:http://控制服务IP:8000/output/left
右 GPU 服务器:http://控制服务IP:8000/output/right
```
## 操作
1. 启动控制服务。
2. 打开控制台 `http://127.0.0.1:8000/`
3. 左输出端打开 `/output/left`
4. 右输出端打开 `/output/right`
5. 在控制台点击场景切换或局部动作。
6. 观察控制台右侧的节点、FPS、frame time、RTT、clock offset、ACK 状态。
## 项目结构
```text
led_platform/
api/ HTTP 和 WebSocket 路由
core/ 配置、时钟
domain/ 协议和领域模型
services/ 场景、tile、同步协调、WebSocket hub
web/static/ 控制台和输出端前端
main.py FastAPI 应用入口
cli.py 跨平台命令行入口
runtime.py 应用依赖装配
config/
scenes.json 场景配置
tiles.json 左右 GPU 服务器和 4 路 4K 输出映射
tests/
test_api.py
test_sync.py
test_tiles.py
```
## 验证
```bash
python -m pytest -q
python -m compileall led_platform tests
node --check led_platform/web/static/output/main.js
node --check led_platform/web/static/admin/main.js
```
## 文档
- [使用文档](docs/usage.md)
- [生产架构说明](docs/production-architecture.md)