diff --git a/.github/README.md b/.github/README.md index 6722b0c68..3622fb9a3 100644 --- a/.github/README.md +++ b/.github/README.md @@ -182,6 +182,7 @@ | 🟢 | | SpeedTest-Tracker | https://docs.speedtest-tracker.dev/ | Speedtest Tracker 是一款自托管互联网性能跟踪应用程序,可针对 Ookla 的 Speedtest 服务运行速度测试检查 | | | 🟢 | | SPlayer | https://github.com/imsyy/SPlayer/ | 一个简约的音乐播放器 | | | 🟢 | | Stash | https://stashapp.cc/ | 组织和刮削你的色情内容 | | +| 🟢 | | Rust-Rec | https://github.com/hua0512/rust-rec/ | Rust-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec | https://github.com/hua0512/stream-rec/ | Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec Web版 | https://github.com/hua0512/stream-rec/ | 【前端版】Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec 服务版 | https://github.com/hua0512/stream-rec/ | 【服务版】Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | diff --git a/README.md b/README.md index 7ee4755d2..f0579eaf2 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ | 🟢 | | SpeedTest-Tracker | https://docs.speedtest-tracker.dev/ | Speedtest Tracker 是一款自托管互联网性能跟踪应用程序,可针对 Ookla 的 Speedtest 服务运行速度测试检查 | | | 🟢 | | SPlayer | https://github.com/imsyy/SPlayer/ | 一个简约的音乐播放器 | | | 🟢 | | Stash | https://stashapp.cc/ | 组织和刮削你的色情内容 | | +| 🟢 | | Rust-Rec | https://github.com/hua0512/rust-rec/ | Rust-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec | https://github.com/hua0512/stream-rec/ | Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec Web版 | https://github.com/hua0512/stream-rec/ | 【前端版】Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | | 🟢 | | Stream-Rec 服务版 | https://github.com/hua0512/stream-rec/ | 【服务版】Stream-rec是一个用于各种流媒体服务的自动流媒体录制工具 | | diff --git a/apps/rust-srec/README.md b/apps/rust-srec/README.md new file mode 100644 index 000000000..a1f1f7e8c --- /dev/null +++ b/apps/rust-srec/README.md @@ -0,0 +1,94 @@ +# Rust Srec + +自动化直播录制解决方案 (Stream Rec 迭代版) + +基于 Rust 构建的高性能多平台直播录制系统 + +![Rust-Rec](https://file.lifebus.top/imgs/rust_rec_cover.png) + +![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) + +## 安装说明 + +### JWT 签名密钥 生成 + +```shell +openssl rand -hex 32 +``` + +### 会话密钥 生成 + +```shell +openssl rand -hex 32 +``` + +### 持久化路径 + +目前使用 `应用持久化路径` 与 `数据持久化路径` 配置,分别用于存储应用数据和录制数据。 + ++ `数据持久化路径`: 是指录制数据存放的路径,占用空间较多,请自行配置。 ++ `应用持久化路径`: 存放应用配置文件,如:JWT 签名密钥、会话密钥、数据库配置、日志配置、DAG 配置等。 + +## 特性 + +### 🎬 多平台支持 + +支持 Bilibili、抖音、斗鱼、虎牙、Twitch、TikTok 等平台 + +### ⚡ 高性能 + +Rust 构建,高效且资源占用低 + +### 🔄 DAG 管道 + +强大的后处理工作流(有向无环图) + +### 🎯 灵活配置 + +4 层配置层级,精细化控制 + +### 💬 弹幕支持 + +同步录制弹幕 + +### 🐳 容器化部署 + +支持 Docker 和 docker-compose 快速部署 + +### 📅 自定义录制计划 + +定时录制,自动管理文件名,便于组织归档 + +### 🔧 FLV 修复 + +自动修复损坏的 FLV 流,包括时间戳校正和元数据修复 + +## 直播平台支持列表 + +| 平台 | URL 格式 | 协议 | 弹幕 | +|:----------------------------------------------------------------------------------------|:------------------------------------------------------|:--------|:---| +| [Bilibili](https://hua0512.github.io/rust-srec/zh/platforms/bilibili.html) | `live.bilibili.com/{room_id}` | FLV/HLS | ✅ | +| [抖音](https://hua0512.github.io/rust-srec/zh/platforms/douyin.html) | `live.douyin.com/{room_id}` | FLV/HLS | ✅ | +| [斗鱼](https://hua0512.github.io/rust-srec/zh/platforms/douyu.html) | `douyu.com/{room_id}` | FLV | ✅ | +| [虎牙](https://hua0512.github.io/rust-srec/zh/platforms/huya.html) | `huya.com/{room_id}` | FLV/HLS | ✅ | +| [AcFun](https://hua0512.github.io/rust-srec/zh/platforms/others.html#acfun) | `acfun.cn/live/{room_id}` | HLS | ❌ | +| [PandaTV](https://hua0512.github.io/rust-srec/zh/platforms/others.html#pandatv) | `pandalive.co.kr/play/{id}` | HLS | ❌ | +| [小红书](https://hua0512.github.io/rust-srec/zh/platforms/others.html#redbook-小红书) | `xiaohongshu.com/user/profile/{id} or xhs.link/{id}` | HLS | ❌ | +| [微博](https://hua0512.github.io/rust-srec/zh/platforms/others.html#weibo) | `weibo.com/u/{uid} or weibo.com/l/wblive/p/show/{id}` | HLS | ❌ | +| [Twitch](https://hua0512.github.io/rust-srec/zh/platforms/twitch.html) | `twitch.tv/{channel}` | HLS | ✅ | +| [TikTok](https://hua0512.github.io/rust-srec/zh/platforms/others.html#tiktok) | `tiktok.com/@{user}/live` | HLS | ❌ | +| [Twitcasting](https://hua0512.github.io/rust-srec/zh/platforms/others.html#twitcasting) | `twitcasting.tv/{user}` | HLS | ✅ | +| [Picarto](https://hua0512.github.io/rust-srec/zh/platforms/others.html#picarto) | `picarto.tv/{user}` | HLS/MP4 | ❌ | + +## 安装说明 + +> 默认账户 +> +> 用户名:admin +> +> 密码:admin123! 或 `登录密码 (初始化)` 配置 + +--- + +![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) +![Ms Studio](https://analytics.lifebus.top/p/wJix5nI1W) diff --git a/apps/rust-srec/data.yml b/apps/rust-srec/data.yml new file mode 100644 index 000000000..34b017c96 --- /dev/null +++ b/apps/rust-srec/data.yml @@ -0,0 +1,18 @@ +additionalProperties: + key: rust-srec + name: Rust Srec + tags: + - WebSite + - Tool + - Local + shortDescZh: 自动流媒体录制工具 + shortDescEn: Automatic streaming record tool + type: website + crossVersionUpdate: true + limit: 0 + website: https://hua0512.github.io/rust-srec/ + github: https://github.com/hua0512/rust-srec + document: https://hua0512.github.io/rust-srec/ + architectures: + - amd64 + - arm64 diff --git a/apps/rust-srec/dev/data.yml b/apps/rust-srec/dev/data.yml new file mode 100644 index 000000000..410c94d90 --- /dev/null +++ b/apps/rust-srec/dev/data.yml @@ -0,0 +1,60 @@ +additionalProperties: + formFields: + - default: "/home/rust-rec" + edit: true + envKey: RUST_REC_ROOT_PATH + labelZh: 应用持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: "/home/rust-rec" + edit: true + envKey: RUST_REC_DATA_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 8088 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: 8080 + edit: true + envKey: PANEL_APP_PORT_API + labelZh: API 端口 + labelEn: API port + required: true + rule: paramPort + type: number + - default: "" + edit: true + envKey: JWT_SECRET + labelZh: JWT 签名密钥 + labelEn: JWT Secret + required: true + type: text + - default: "" + edit: true + envKey: SESSION_SECRET + labelZh: 会话密钥 + labelEn: Session Secret + required: true + type: text + - default: "" + edit: true + envKey: HTTP_PROXY + labelZh: 网络代理 + labelEn: Network Proxy + required: false + type: text + - default: "localhost,127.0.0.1,rust-srec-backend" + edit: true + envKey: NO_PROXY + labelZh: 忽略代理 + labelEn: Ignore Proxy + required: true + type: text diff --git a/apps/rust-srec/dev/docker-compose.yml b/apps/rust-srec/dev/docker-compose.yml new file mode 100644 index 000000000..03a289e68 --- /dev/null +++ b/apps/rust-srec/dev/docker-compose.yml @@ -0,0 +1,70 @@ +networks: + 1panel-network: + external: true + +services: + rust-srec-backend: + image: ghcr.io/hua0512/rust-srec:dev + container_name: backend-${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_API}:8080 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${RUST_REC_DATA_ROOT_PATH}/data:/app/data + - ${RUST_REC_DATA_ROOT_PATH}/output:/app/output + - ${RUST_REC_ROOT_PATH}/config:/app/config + - ${RUST_REC_ROOT_PATH}/logs:/app/logs + - ${RUST_REC_ROOT_PATH}/tmp:/tmp + environment: + - TZ=Asia/Shanghai + - RUST_LOG=${RUST_LOG:-info} + - DATABASE_URL=${DATABASE_URL:-sqlite:///app/data/rust-srec.db} + - API_PORT=8080 + - API_BIND_ADDRESS=0.0.0.0 + - ACCESS_TOKEN_EXPIRATION_SECS=${ACCESS_TOKEN_EXPIRATION_SECS:-3600} + - REFRESH_TOKEN_EXPIRATION_SECS=${REFRESH_TOKEN_EXPIRATION_SECS:-604800} + - MIN_PASSWORD_LENGTH=${MIN_PASSWORD_LENGTH:-8} + - HTTP_PROXY=${HTTP_PROXY:-} + - HTTPS_PROXY=${HTTP_PROXY:-} + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/api/health/live" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "5" + + rust-rec-frontend: + depends_on: + rust-srec-backend: + condition: service_healthy + image: ghcr.io/hua0512/rust-srec-frontend:dev + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:80 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + environment: + - TZ=Asia/Shanghai + - BACKEND_URL=${BACKEND_URL:-http://rust-srec-backend:8080} + - COOKIE_SECURE=${COOKIE_SECURE:-} + logging: + driver: "json-file" + options: + max-size: "50m" + max-file: "3" diff --git a/apps/rust-srec/dev/envs/default.env b/apps/rust-srec/dev/envs/default.env new file mode 100644 index 000000000..405d4f599 --- /dev/null +++ b/apps/rust-srec/dev/envs/default.env @@ -0,0 +1,8 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env +DATA_DIR=/app/data +CONFIG_DIR=/app/config +OUTPUT_DIR=/app/output +LOG_DIR=/app/logs +JWT_ISSUER=rust-srec +JWT_AUDIENCE=rust-srec-api diff --git a/apps/rust-srec/dev/envs/global.env b/apps/rust-srec/dev/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/rust-srec/dev/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/rust-srec/dev/scripts/init.sh b/apps/rust-srec/dev/scripts/init.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/rust-srec/dev/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rust-srec/dev/scripts/uninstall.sh b/apps/rust-srec/dev/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/rust-srec/dev/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rust-srec/dev/scripts/upgrade.sh b/apps/rust-srec/dev/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/rust-srec/dev/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rust-srec/logo.png b/apps/rust-srec/logo.png new file mode 100644 index 000000000..9bc4578a1 Binary files /dev/null and b/apps/rust-srec/logo.png differ