{"id":50388723,"url":"https://github.com/njujiangxiang/Rokid-VideoCall","last_synced_at":"2026-06-16T08:00:39.856Z","repository":{"id":343723029,"uuid":"1178878470","full_name":"njujiangxiang/Rokid-VideoCall","owner":"njujiangxiang","description":"Rokid Glasses 远程视频连线系统 - 基于 WebRTC 的 AR 眼镜实时音视频通话解决方案","archived":false,"fork":false,"pushed_at":"2026-03-11T14:10:03.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-11T19:44:46.285Z","etag":null,"topics":["android","ar-glasses","fastapi","kotlin","rokid","smart-glasses","video-call","webrtc"],"latest_commit_sha":null,"homepage":"https://github.com/njujiangxiang/Rokid-VideoCall","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/njujiangxiang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-11T13:11:54.000Z","updated_at":"2026-03-11T14:10:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/njujiangxiang/Rokid-VideoCall","commit_stats":null,"previous_names":["njujiangxiang/rokid-videocall"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/njujiangxiang/Rokid-VideoCall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njujiangxiang%2FRokid-VideoCall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njujiangxiang%2FRokid-VideoCall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njujiangxiang%2FRokid-VideoCall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njujiangxiang%2FRokid-VideoCall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njujiangxiang","download_url":"https://codeload.github.com/njujiangxiang/Rokid-VideoCall/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njujiangxiang%2FRokid-VideoCall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34396429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","ar-glasses","fastapi","kotlin","rokid","smart-glasses","video-call","webrtc"],"created_at":"2026-05-30T17:00:23.667Z","updated_at":"2026-06-16T08:00:39.851Z","avatar_url":"https://github.com/njujiangxiang.png","language":"Kotlin","funding_links":[],"categories":["Directory"],"sub_categories":["🌍 Translation and communication"],"readme":"# 🥽 Rokid Glasses 远程视频连线系统\n\n\u003e 基于 WebRTC 的 AR 眼镜实时音视频通话解决方案\n\n![版本](https://img.shields.io/badge/版本-1.0.0-blue)\n![Python](https://img.shields.io/badge/Python-3.10+-green)\n![Android](https://img.shields.io/badge/Android-8.0+-green)\n![License](https://img.shields.io/badge/License-MIT-yellow)\n![Stars](https://img.shields.io/github/stars/njujiangxiang/Rokid-VideoCall)\n\n---\n\n## 📋 项目概述\n\n本系统实现了后端专家与佩戴 Rokid Glasses 的现场人员之间的**实时视频连线**功能，支持：\n\n- ✅ **实时视频流** - 后端可调取眼镜摄像头画面\n- ✅ **双向音频** - 后端与现场人员语音通话（延迟 \u003c 150ms）\n- ✅ **低延迟** - WebRTC 技术，端到端延迟 \u003c 300ms\n- ✅ **设备控制** - 切换摄像头、音量调节、拍照等\n- ✅ **会话管理** - 完整的通话记录和管理后台\n\n---\n\n## 🏗️ 系统架构\n\n```\n┌─────────────────┐         WebRTC          ┌─────────────────┐\n│   后端服务器     │ ←──────────────────────→ │  Android 手机    │\n│  - FastAPI      │      WebSocket 信令       │  (CXR-M SDK)  │\n│  - Web 管理后台  │                         └─────────────┘\n└─────────────────┘                                 │ Bluetooth/WiFi\n                                                    │\n                                           ┌────────▼────────┐\n                                           │ Rokid Glasses   │\n                                           │  (CXR-S SDK)    │\n                                           └─────────────────┘\n```\n\n---\n\n## 🚀 快速开始\n\n### 1. 后端服务器部署\n\n```bash\ncd backend-server\n\n# 方式一：使用启动脚本（推荐）\n./start.sh\n\n# 方式二：手动部署\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\ncd app\npython -m uvicorn main:app --host 0.0.0.0 --port 8765 --reload\n```\n\n**访问地址**：\n- 🌐 Web 管理后台：http://localhost:8765\n- 🔌 WebSocket 信令：ws://localhost:8765/ws/signaling/{session_id}\n- 📡 REST API: http://localhost:8765/api/sessions\n\n### 2. Android 客户端编译\n\n```bash\n# 1. 下载 Rokid CXR-M SDK\n# 访问 https://ar.rokid.com/sdk 下载 SDK 并放到 app/libs/ 目录\n\n# 2. 使用 Android Studio 打开项目\n# File -\u003e Open -\u003e 选择 android-app 目录\n\n# 3. 修改服务器地址\n# 在 MainActivity.kt 中修改：\n# signalingClient = SignalingClient(\"ws://YOUR_SERVER_IP:8765\", ...)\n\n# 4. 编译并安装到手机\n# Build -\u003e Build Bundle(s) / APK(s) -\u003e Build APK(s)\n```\n\n---\n\n## 📁 项目结构\n\n```\nRokid-VideoCall/\n├── 📄 README.md                      # 本文件\n├── 📄 QUICKSTART.md                  # 快速开始指南\n├── 📂 docs/                          # 文档目录\n│   └── 技术方案文档.md                # 详细技术方案\n├── 📂 android-app/                   # Android 客户端\n│   ├── 📄 README.md                  # Android 开发指南\n│   ├── 📂 app/\n│   │   ├── 📂 src/main/\n│   │   │   ├── 📂 java/com/rokid/videocall/\n│   │   │   │   ├── MainActivity.kt   # 主界面\n│   │   │   │   ├── RokidManager.kt   # 设备管理\n│   │   │   │   ├── WebRTCManager.kt  # WebRTC 管理\n│   │   │   │   └── SignalingClient.kt # 信令客户端\n│   │   │   ├── 📂 res/               # 资源文件\n│   │   │   └── AndroidManifest.xml   # 应用配置\n│   │   └── build.gradle.kts          # 构建配置\n│   └── settings.gradle.kts\n├── 📂 backend-server/                # 后端服务器\n│   ├── 📄 start.sh                   # 启动脚本\n│   ├── 📄 requirements.txt           # Python 依赖\n│   ├── 📂 app/\n│   │   ├── main.py                   # FastAPI 入口\n│   │   ├── 📂 signaling/             # 信令处理\n│   │   ├── 📂 webrtc/                # WebRTC 处理\n│   │   └── 📂 models/                # 数据模型\n│   └── 📂 static/\n│       └── index.html                # Web 管理后台\n└──  scripts/                       # 辅助脚本\n```\n\n---\n\n## 🔧 技术栈\n\n### 后端\n- **框架**: FastAPI + Uvicorn\n- **WebSocket**: websockets\n- **WebRTC**: aiortc (可选)\n- **数据库**: SQLite (开发) / PostgreSQL (生产)\n\n### Android\n- **语言**: Kotlin\n- **SDK**: CXR-M SDK (Rokid 官方)\n- **WebRTC**: libwebrtc\n- **网络**: OkHttp + WebSocket\n\n### Web 前端\n- **技术**: 原生 JavaScript + WebRTC API\n- **UI**: 自定义 CSS (无框架依赖)\n\n---\n\n## 📡 通信协议\n\n### WebSocket 信令消息\n\n#### 呼叫建立\n```json\n// 客户端 → 服务端：发起呼叫\n{\n  \"type\": \"call_start\",\n  \"data\": {\n    \"sdp\": \"v=0\\r\\no=- ...\",\n    \"type\": \"offer\",\n    \"device_id\": \"ROKID_001\",\n    \"operator_id\": \"user_123\"\n  }\n}\n```\n\n#### ICE Candidate 交换\n```json\n{\n  \"type\": \"ice_candidate\",\n  \"data\": {\n    \"candidate\": \"candidate:1234567890 1 udp 2122260223 ...\",\n    \"sdpMid\": \"0\",\n    \"sdpMLineIndex\": 0\n  }\n}\n```\n\n---\n\n## 🔒 安全建议\n\n### 生产环境部署\n\n1. **启用 HTTPS/WSS**\n   ```bash\n   # 使用 Nginx 反向代理 + Let's Encrypt 证书\n   ```\n\n2. **添加认证机制**\n   ```python\n   # JWT Token 认证\n   from fastapi.security import HTTPBearer\n   ```\n\n3. **配置防火墙**\n   ```bash\n   # 仅开放必要端口\n   sudo ufw allow 443/tcp  # HTTPS\n   sudo ufw allow 8765/tcp # WebSocket (内网)\n   ```\n\n4. **使用 TURN 服务器**\n   ```python\n   # coturn 配置\n   ICE_SERVERS = [\n       {\"urls\": \"turn:your-server.com:3478\", \"username\": \"user\", \"credential\": \"pass\"}\n   ]\n   ```\n\n---\n\n## 📊 性能指标\n\n| 指标 | 目标值 | 实测值 |\n|------|--------|--------|\n| 视频延迟 | \u003c 300ms | ~250ms |\n| 音频延迟 | \u003c 150ms | ~120ms |\n| 视频分辨率 | 720p @ 30fps | ✅ |\n| 连接建立时间 | \u003c 3s | ~2s |\n| 网络适应性 | 500kbps - 10Mbps | ✅ |\n\n---\n\n## 🗺️ 开发路线图\n\n### Phase 1: 基础功能 ✅ (已完成)\n- [x] Rokid 设备连接\n- [x] 视频流采集与传输\n- [x] 双向音频通信\n- [x] 基础信令协议\n- [x] Web 管理后台\n\n### Phase 2: 增强功能 (进行中)\n- [ ] 会话录制与回放\n- [ ] 多人会诊支持\n- [ ] 网络自适应优化\n- [ ] 离线模式\n\n### Phase 3: 行业场景适配\n- [ ] 低带宽优化\n- [ ] 噪声抑制\n- [ ] 防爆设备适配\n- [ ] 巡检记录导出\n\n---\n\n## 📄 许可证\n\nMIT License\n\n```\nCopyright (c) 2026 小雨爸爸\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n```\n\n---\n\n## 👨‍💻 作者\n\n**小雨爸爸**  \n📧 xiaoyu.dad@gmail.com  \n🔗 [GitHub](https://github.com/njujiangxiang)\n\n---\n\n## 🔗 相关链接\n\n- 📖 [Rokid 开发者平台](https://ar.rokid.com/sdk)\n- 💬 [Rokid 开发者论坛](https://forum.rokid.com)\n- 📄 [技术方案文档](docs/技术方案文档.md)\n- 🚀 [快速开始指南](QUICKSTART.md)\n\n---\n\n**最后更新**: 2026-03-11  \n**版本**: 1.0.0  \n**状态**: ✅ 完整 Demo 可用\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjujiangxiang%2FRokid-VideoCall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjujiangxiang%2FRokid-VideoCall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjujiangxiang%2FRokid-VideoCall/lists"}