From a9a16f2218c680eb9b68463e78c1770c5cf9941a Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Wed, 8 Jul 2026 08:19:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 27 ++++++++++++++++++++------- README.md | 27 +++++++++++++++++---------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/README.en.md b/README.en.md index 1d78fb05..f9161d82 100644 --- a/README.en.md +++ b/README.en.md @@ -22,6 +22,8 @@ Goals: an open, lightweight, easy-to-use IP-KVM stack. - **Lightweight**: shipped as a binary with minimal moving parts for deployment. - **Easy to use**: no hand-edited config files required; settings are done in the web UI. +For more information, see the [One-KVM Rust documentation](https://docs.one-kvm.cn/). + > **One-KVM (Python)** is no longer maintained. If you still need it, see .
@@ -32,7 +34,7 @@ Goals: an open, lightweight, easy-to-use IP-KVM stack. ## Features -### Core +**Core** | Area | Capabilities | |------|----------------| @@ -40,11 +42,9 @@ Goals: an open, lightweight, easy-to-use IP-KVM stack. | Video encoding | VAAPI / QSV / RKMPP / V4L2 M2M hardware paths, with software fallback | | Keyboard & mouse | USB OTG HID or CH340 + CH9329 HID; absolute / relative mouse | | Virtual media | USB mass storage; ISO/IMG mount and Ventoy-style virtual USB | -| ATX power | GPIO or USB relay; power and reset control | +| ATX power | GPIO or USB relay; power control | | Audio | ALSA capture + Opus (HTTP / WebRTC) | -The web UI supports visual configuration and Chinese/English locales. Built-ins include a web terminal (ttyd), intranet tunnel (gostc), P2P (EasyTier), RustDesk protocol (optional cross-platform remote access), and RTSP streaming. - ## Installation Release artifacts are on [GitHub Releases](https://github.com/mofeng-git/One-KVM/releases). Below are short paths for common setups. For **system requirements, hardware, Docker env vars, USB OTG**, and full troubleshooting, see the [One-KVM documentation](https://docs.one-kvm.cn/) (Chinese; use a translator if needed). @@ -216,15 +216,22 @@ One-KVM builds on many great open-source projects; a lot of time goes into testi - 爱发电用户_d3d9c +- 爱发电用户_97b41 + +- 偶然 + +- 爱发电用户_dba45 + +- 爱发电用户_d4f8b + +- 故人。 + - ...... ### Sponsors -**Mirror Download Services:** -- **[Chongqing University Open Source Software Mirror](https://mirrors.cqu.edu.cn/)** — provides mirror download services - **File hosting** - **[Huang1111 public-interest program](https://pan.huang1111.cn/s/mxkx3T1)** — login-free downloads @@ -236,3 +243,9 @@ One-KVM builds on many great open-source projects; a lot of time goes into testi ![林枫云](https://docs.one-kvm.cn/img/36076FEFF0898A80EBD5756D28F4076C.png) 林枫云 offers premium network routes, high-frequency game servers, and high-bandwidth servers in China and abroad. + +- **[Beta Network](https://my.beita.cc/?ref=github_onekvm)** — project server sponsorship + +![BTBT](https://github.com/user-attachments/assets/c442d5f5-d72f-4a07-b9f4-400a6a0c3f1e) + +Remote computers, consumer GPU servers, and dedicated physical machines with fully automated online delivery. diff --git a/README.md b/README.md index abcacdc7..2e677f5b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ --- -## 📖 项目概述 +## 项目概述 **One-KVM Rust** 是一个用 Rust 编写的轻量级 IP-KVM 解决方案,可通过网络远程管理服务器和工作站,实现 BIOS 级远程控制。 @@ -22,6 +22,8 @@ - **轻量**:以二进制文件形式分发,无繁杂的依赖项,部署过程简单。 - **易用**:无需手动编辑配置文件,参数设置均可通过网页界面完成。 +更多内容可访问 [One-KVM Rust 文档站点](https://docs.one-kvm.cn/)。 + > **One-KVM Python** 已停止开发,如有需要可访问
@@ -30,9 +32,9 @@
-## 📊 功能介绍 +## 功能介绍 -### 核心功能 +**核心功能** | 功能 | 能力说明 | |------|------| @@ -40,12 +42,10 @@ | 视频编码 | VAAPI/QSV/RKMPP/V4L2M2M 硬件编码支持,以及软件编码兜底 | | 键鼠控制 | USB OTG HID 或 CH340 + CH9329 HID,支持绝对/相对鼠标模式 | | 虚拟媒体 | USB Mass Storage,支持 ISO/IMG 镜像挂载和 Ventoy 虚拟U盘模式 | -| ATX 电源控制 | GPIO /USB 继电器,支持控制电源、重启按钮 | +| ATX 电源控制 | GPIO/USB 继电器,支持电源控制 | | 音频传输 | ALSA 采集 + Opus 编码(HTTP/WebRTC) | -此外提供基于 Web UI 的可视化配置与中英文界面;并集成 Web 终端(ttyd)、内网穿透(gostc)、P2P 组网(EasyTier)、RustDesk 协议(扩展跨平台远程访问)以及 RTSP 推流等能力。 - -## ⚡ 安装使用 +## 安装使用 构建产物见 [GitHub Releases](https://github.com/mofeng-git/One-KVM/releases)。以下为常见安装方式的简要步骤;**系统要求、硬件准备、Docker 环境变量与 USB OTG 等完整说明**请查阅 [One-KVM Rust 文档站点](https://docs.one-kvm.cn/)。 @@ -210,6 +210,16 @@ One-KVM 已上架飞牛 **应用市场**,在 NAS 上直接搜索安装即可 - 爱发电用户_d3d9c +- 爱发电用户_97b41 + +- 偶然 + +- 爱发电用户_dba45 + +- 爱发电用户_d4f8b + +- 故人。 + - ...... @@ -218,9 +228,6 @@ One-KVM 已上架飞牛 **应用市场**,在 NAS 上直接搜索安装即可 本项目得到以下赞助商的支持: -**镜像下载服务:** -- **[重庆大学开源软件镜像站](https://mirrors.cqu.edu.cn/)** - 提供镜像站下载服务 - **文件存储服务:** - **[Huang1111公益计划](https://pan.huang1111.cn/s/mxkx3T1)** - 提供免登录下载服务 From 809d0ca65c7089e2ddfd66c591ff53b00af9fca0 Mon Sep 17 00:00:00 2001 From: chengzongkai Date: Mon, 13 Jul 2026 15:32:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=B8=BA=20VAAPI=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20CQP=20=E7=A0=81=E7=8E=87=E6=8E=A7=E5=88=B6=E5=9B=9E?= =?UTF-8?q?=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/hwcodec/cpp/common/util.cpp | 20 ++++++++++ .../cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp | 40 ++++++++++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/libs/hwcodec/cpp/common/util.cpp b/libs/hwcodec/cpp/common/util.cpp index 08e4f87a..7eba59bd 100644 --- a/libs/hwcodec/cpp/common/util.cpp +++ b/libs/hwcodec/cpp/common/util.cpp @@ -368,6 +368,26 @@ struct CodecOptions { bool set_rate_control(AVCodecContext *c, const std::string &name, int rc, int q) { + if (name.find("vaapi") != std::string::npos && rc == RC_CQ) { + // Used only after the normal bitrate-based VAAPI initialization fails. + // Some drivers, including Intel iHD on Jasper Lake, expose CQP as their + // only compatible rate-control mode. + c->bit_rate = 0; + c->rc_min_rate = 0; + c->rc_max_rate = 0; + c->rc_buffer_size = 0; + c->rc_initial_buffer_occupancy = 0; + + const int qp = q > 0 ? q : 23; + const int ret = av_opt_set_int(c->priv_data, "qp", qp, 0); + if (ret < 0) { + LOG_ERROR(std::string("vaapi set qp failed, ret = ") + + av_err2str(ret)); + return false; + } + return true; + } + if (name.find("qsv") != std::string::npos) { // https://github.com/LizardByte/Sunshine/blob/3e47cd3cc8fd37a7a88be82444ff4f3c0022856b/src/video.cpp#L1635 c->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL; diff --git a/libs/hwcodec/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp b/libs/hwcodec/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp index c4507a54..7ccef090 100644 --- a/libs/hwcodec/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp +++ b/libs/hwcodec/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp @@ -273,7 +273,10 @@ public: LOG_ERROR(std::string("set_quality failed, name: ") + name_); return false; } - util_encode::set_rate_control(c_, name_, rc_, q_); + if (!util_encode::set_rate_control(c_, name_, rc_, q_)) { + LOG_ERROR(std::string("set_rate_control failed, name: ") + name_); + return false; + } util_encode::set_gpu(c_->priv_data, name_, gpu_); util_encode::force_hw(c_->priv_data, name_); util_encode::set_others(c_->priv_data, name_); @@ -694,11 +697,38 @@ ffmpeg_ram_new_encoder(const char *name, const char *mc_name, int width, RamEncodeCallback callback) { FFmpegRamEncoder *encoder = NULL; try { - encoder = new FFmpegRamEncoder(name, mc_name, width, height, pixfmt, align, - fps, gop, rc, quality, kbs, q, thread_count, - gpu, callback); + auto try_create = [&](int attempt_rc, int attempt_kbs) { + FFmpegRamEncoder *candidate = new FFmpegRamEncoder( + name, mc_name, width, height, pixfmt, align, fps, gop, attempt_rc, + quality, attempt_kbs, q, thread_count, gpu, callback); + if (candidate && candidate->init(linesize, offset, length)) { + return candidate; + } + + if (candidate) { + candidate->free_encoder(); + delete candidate; + } + return static_cast(NULL); + }; + + // Preserve the existing VAAPI path first. With a target bitrate and no + // explicit QP, FFmpeg negotiates a supported bitrate-based mode such as + // AVBR, VBR or CBR with the driver. + encoder = try_create(rc, kbs); if (encoder) { - if (encoder->init(linesize, offset, length)) { + return encoder; + } + + // Retry only VAAPI with a fresh context in explicit-QP mode. This avoids + // changing rate control on hardware which already supports CBR/VBR while + // allowing CQP-only drivers to pass probing and normal encoder creation. + if (name && std::string(name).find("vaapi") != std::string::npos && + rc != RC_CQ) { + LOG_WARN(std::string("VAAPI bitrate-based rate control failed for ") + + name + ", retrying with CQP"); + encoder = try_create(RC_CQ, 0); + if (encoder) { return encoder; } }