Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

test(recording): drive the real recorder and record the result

Veyra Goal Agentaa2773280ed1
diff --git a/docs/SCREEN_RECORDING_EXECUTION_2026-10-20.md b/docs/SCREEN_RECORDING_EXECUTION_2026-10-20.md
new file mode 100644
index 00000000..d0419245
--- /dev/null
+++ b/docs/SCREEN_RECORDING_EXECUTION_2026-10-20.md
@@ -0,0 +1,101 @@
+# 实时录制功能执行记录 — 2026-10-20
+
+## 一、范围
+
+用户要求:录制**处理后的画面**、设置页可设**位置与码率**、专业模式**截图按钮旁**加录制按钮
+(**动画 + 3 秒倒计时**),并给出**新的测试版本**实测。
+
+方案与取舍见 [SCREEN_RECORDING_PLAN_2026-10-20.md](SCREEN_RECORDING_PLAN_2026-10-20.md)。
+
+## 二、分支与存档
+
+- 分支 `codex/screen-recording-20261020`,起点 `nrvideo/main` `4ae285b`;
+- 工作树 `E:\项目\Veyra\worktrees\screen-recording-20261020`;
+- 存档标签 `checkpoint/pre-screen-recording-20261020`;
+- 提交:`2c80233`(功能)、`99bfc43`(首轮编译错误修正)、`65fe7ef`(界面布局修正);
+- 未合并 main、未推送、未发布、未修改 GitHub 上任何 Release 或标签。
+
+## 三、构建
+
+构建沿用 2.1.0 正式包的同一套固定依赖与 CMake 选项
+(`logs/pr64-avermedia-20261019/build-20261019-094942/receipt.json` 的 `dependencies`),
+脚本 `E:\项目\Veyra\tmp\screen-recording-20261020\build.py`,构建目录
+`E:\项目\Veyra\build\screen-recording-20261020`,并行 -j2。
+
+**首轮全量构建(548 步)在 431/548 处失败**,三次编译错误与修正:
+
+| 错误 | 原因 | 修正 |
+| --- | --- | --- |
+| `NvencD3D12Encoder.cpp(36): C2065 “p” 未声明` | 排空超时写成了 `p.drainTimeoutMs`,但 `drain()` 在 `Impl` 内部,成员直接访问 | 改为 `drainTimeoutMs` |
+| `EngineController.cpp(1565): C2065 “RecordingOptions” 未声明` | 引擎用了 `RecordingOptions/RecordingSnapshot`,而 `LiveRecorder.h` 里是 `RecordingSettings/RecordingStatus` | 统一为 `RecordingSettings/RecordingStatus`(含 `QmlPlayerBridge.cpp`) |
+| `EngineController.cpp(1206): C2059 语法错误` | 会话退出钩子 `OnExit{...}` 多加了一个语句后少一个右花括号 | 补 `}}}` |
+
+修正后增量重建 **44.8 秒**通过,5 个目标全部产出:
+
+| 目标 | SHA256 |
+| --- | --- |
+| `veyra_qml_ui.exe` | `016366feec4c22b4c20971404e9934f8dd9fdce867a4ed49d77fdd9049355bb3` |
+| `veyra_qml_quick_tests.exe` | `c2abd79e275f81d488deb161a3baec4d39a211873a53568ab343412444d3aaa1` |
+| `veyra_ui_i18n_tests.exe` | `ea0cf211488cd179b6562c7eb2062d67a57bc37a62398dccabc236e6900ead69` |
+| `veyra_ui_contract_tests.exe` | `3cf42aca6bcd419a6879c4c5505a48f906168ad57e889282f6d3d99c878c0897` |
+| `veyra_qml_data_tests.exe` | `bb9b6693f34d3a4c66578ec61f08040fc93dab41ce4df2820e70d0f1b864b40d` |
+
+## 四、回归
+
+`E:\项目\Veyra\tmp\screen-recording-20261020\run_tests.py`,日志在
+`E:\项目\Veyra\logs\screen-recording-20261020\`:
+
+| 组 | 结果 |
+| --- | --- |
+| `veyra_qml_quick_tests`(会真实实例化改过的 ProPage) | 105 passed / 0 failed |
+| `veyra_qml_data_tests` | PASS |
+| `veyra_ui_i18n_tests` | 0 failures(2637 条,四语无缺) |
+| `veyra_ui_contract_tests` | PASS |
+
+`scripts/i18n/extract.py --check`:2637 条,缺译 0,占位符问题 0。
+
+**冷启动抓到两个真实 QML 错误**(`logs/screen-recording-20261020/cold-console.log`),
+已修正并重建:
+
+1. 录制控件在头部 `RowLayout` 里用了 `anchors` → 改为 `Layout.alignment` / `Layout.preferredWidth`;
+2. `easing.type: Theme.spring` 把线性缓动当成枚举 → 改为 `easing: Theme.spring`。
+
+修正后重新打包并冷启动,日志中不再有这两条错误。
+
+## 五、测试包
+
+供体是已交付的 2.1.0-test NVIDIA 包(运行组件字节原样不动),只替换程序本体、QML 与文档,
+manifest 按包内实际文件重新审计(1734 个文件)。
+
+- 包目录 `E:\项目\Veyra\test-packages\screen-recording-20261020\Veyra-2.1.0-rec-NVIDIA-win64-portable`
+- 压缩包 `Veyra-2.1.0-rec-NVIDIA-win64-portable.zip`
+- 冷启动:从压缩包解压到 `E:\项目\Veyra\verify\screen-recording-20261020\NVIDIA`,逐文件核对 manifest
+ 哈希后启动,退出码 0
+
+## 六、功能验证(真实录制)
+
+`scripts/acceptance/screen-recording-control.py` + `scripts/acceptance/screen-recording-ui.qml`:
+把本任务打包好的测试版复制到独立目录,在**正式 Main.qml**里注入控制 QML,用**生产 bridge**
+打开一段合成测试片(`testsrc2` 1280x720 30fps,20 秒),`veyra.startRecording()` 开始录制,
+录约 5 秒后 `veyra.stopRecording()` 停止,随后检查引擎写出的文件。
+
+结果(`logs/screen-recording-20261020/recording-console.log` 与 `recording-files.json`):
+
+| 项 | 实测 |
+| --- | --- |
+| 界面通知 | 录制已结束:…/recordings/Veyra-2026-10-20-201734.mp4 |
+| 编码器帧数 | 160 帧,丢帧 0 |
+| 录制时长 | 5.216 秒 |
+| 产出文件 | 9,966,597 字节 |
+| ffprobe | h264 / 1280x720 / 160 帧 / 时长 5.249 秒 |
+
+即:**处理后画面确实被录成了可播放的 MP4**,录制-停止-落盘这条链路在生产代码上跑通。
+
+## 七、未验证与边界
+
+- 录制链路已在本机跑通(见第六节),但**画质观感、长时间录制稳定性、补帧帧是否进入文件、
+ 真实采集卡与串流场景**仍由用户实测确认。
+- 本机走 NVIDIA NVENC 路径;AMD/Intel 走系统 Media Foundation 编码器,本轮无实卡验证。
+- 录制**不含音频**;暂停时不继续写新帧;改增强设置会结束录制(增强图重建会换掉纹理)。
+- XeSS 自行持有交换链,其补帧生成帧不在增强图里,录制只取真实帧(与导出限制一致)。
+- 未合并 main、未推送、未发布;`docs/CURRENT_STATUS.md` 与对外 README 本轮未改。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index a2f87b55..e2622d08 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,22 @@
# WORKLOG
+## 2026-10-20 实时录制(处理后画面)功能
+
+用户要求录制处理后的画面、设置页可设位置与码率、专业模式截图按钮旁加带动画与 3 秒倒计时的录制按钮,并给出新测试版实测。
+
+分支 `codex/screen-recording-20261020`(起点 nrvideo/main `4ae285b`,E 盘 worktree `E:/项目/Veyra/worktrees/screen-recording-20261020`,存档标签 `checkpoint/pre-screen-recording-20261020`),提交 `2c80233` 功能、`99bfc43` 编译错误修正、`65fe7ef` 界面布局修正。方案 `docs/SCREEN_RECORDING_PLAN_2026-10-20.md`,执行记录 `docs/SCREEN_RECORDING_EXECUTION_2026-10-20.md`。
+
+实现:新增 `LiveRecorder`(`include/veyra/engine/LiveRecorder.h`、`src/engine/LiveRecorder.cpp`),复用产品导出编码器(N 卡 NVENC / 其它 Media Foundation MFT)对**实时增强图**编码,容器写入在独立线程并用有界队列(240 包、高水位 160),磁盘慢只丢帧计数不卡播放;`EncoderConfig` 增加可配置排空超时(录制 2 秒,导出保持 10 秒)。`EngineController` 负责请求/快照并在呈现点编码呈现的那一帧;增强设置变更重建图时先收尾文件。`QmlPlayerBridge` 提供录制属性与方法与偏好项(位置、码率 8/16/20/40/80、帧率、H.264/HEVC)。QML:专业模式截图按钮旁的录制按钮(红点呼吸 + 3 秒倒计时 + 数字弹跳)、设置页录制分区;i18n 新增 30 条四语文案(2637 条,缺译 0)。
+
+构建:沿用 2.1.0 正式包的固定依赖与 CMake 选项,`build/screen-recording-20261020`,-j2。首轮全量 548 步在 431/548 失败,三处编译错误(`Impl` 内成员误用 `p.` 前缀、引擎与 LiveRecorder 的类型名不一致、`OnExit` 初始化器少一个右花括号)均已修正,增量重建 44.8 秒通过 5 个目标。
+
+回归:QML 冒烟 105 passed / 0 failed(真实实例化改过的 ProPage)、QML 数据迁移 PASS、UI i18n 0 failures、UI 契约 PASS;`i18n/extract.py --check` 无缺译无占位符问题。**冷启动抓到两处真实 QML 错误**:录制控件在头部 RowLayout 里用了 anchors(改为 Layout.alignment),`easing.type: Theme.spring` 把线性缓动当枚举(改为 `easing: Theme.spring`);修正后重新打包,冷启动日志无 QML 错误。
+
+功能验证:`scripts/acceptance/screen-recording-control.py` 用生产 bridge 打开合成测试片并真实录制 5.2 秒,得到 160 帧、丢帧 0 的 h264 1280x720 MP4(9,966,597 字节,ffprobe 时长 5.249 秒),界面通知“录制已结束:…”。
+
+测试包:`E:/项目/Veyra/test-packages/screen-recording-20261020/Veyra-2.1.0-rec-NVIDIA-win64-portable.zip`(697,851,293 字节,SHA256 `5809345641c5df2dd07e1a1427992c4e0f23d6c3fd0baad8523587cd767f8fbf`),运行组件与 2.1.0-test 原样相同,只换程序本体与 QML,manifest 按 1734 个文件重新审计,从压缩包解压冷启动退出码 0。
+
+未改运行库/模型/驱动与用户真实配置,未合并 main、未推送、未发布、未改 GitHub 已发布 Release 正文或标签;未关机。画质观感、长时录制、补帧帧是否进文件、采集卡与串流场景待用户实测。
## 2026-10-19 2.1.0 整合与测试包(Claude)
按用户要求在 `claude/release-2.1.0-20261019` 合并 Codex 全屏输入(含 AMD NR 0.44)、Claude #48、美颜(含 E0/AA)与赞助页,版本 2.1.0。冲突只在 AGENTS/WORKLOG/翻译目录;补上 #48 40 秒超时提示的三语翻译。只读审查 Codex 三项修复,无阻塞问题(AMD 默认改用 Small 需写进发布说明)。43 目标构建 153 秒通过;58 组回归除 image-dimension 既有 NR 分块环境问题外全部通过(两组脚本问题修正后重跑通过)。详见 docs/RELEASE_2.1.0_TEST_2026-10-19.md、docs/BUILD_2.1.0_TEST.md。
diff --git a/scripts/acceptance/screen-recording-control.py b/scripts/acceptance/screen-recording-control.py
new file mode 100644
index 00000000..0c5b6160
--- /dev/null
+++ b/scripts/acceptance/screen-recording-control.py
@@ -0,0 +1,105 @@
+"""Real recording regression: the production bridge records the presented picture.
+
+Copies the built app and this task's QML into a private directory, opens a
+media file, starts the recorder through the real bridge, lets it record a few
+seconds, stops it and inspects the file the engine wrote.
+
+usage: screen-recording-control.py
+"""
+import json
+import os
+import shutil
+import subprocess
+import sys
+import time
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra')
+TASK = 'screen-recording-20261020'
+BUILD = BASE / 'build' / TASK
+OUT = BASE / 'tests' / TASK / 'recording'
+TMP = BASE / 'tmp' / TASK / 'recording'
+LOGS = BASE / 'logs' / TASK
+for path in (OUT, TMP, LOGS):
+ path.mkdir(parents=True, exist_ok=True)
+# The packaged test build carries the Qt runtime and the runtime components;
+# this test only drives it.
+DONOR = BASE / 'test-packages/screen-recording-20261020/Veyra-2.1.0-rec-NVIDIA-win64-portable'
+app = OUT / 'app'
+if app.exists():
+ shutil.rmtree(app)
+shutil.copytree(DONOR, app)
+assert (app / 'veyra_qml_ui.exe').exists()
+
+media = OUT / 'clip.mkv'
+recordings = OUT / 'recordings'
+recordings.mkdir(exist_ok=True)
+
+env = {k: v for k, v in os.environ.items() if not k.upper().startswith(('VEYRA_', 'QT_', 'QSG_'))}
+env.update(TEMP=str(TMP), TMP=str(TMP), VEYRA_LOG_FILE=str(LOGS / 'recording-engine.log'),
+ QT_FORCE_STDERR_LOGGING='1', QML_DISABLE_DISK_CACHE='1')
+
+# A short synthetic clip: no user media is copied or touched.
+with (LOGS / 'fixture.log').open('wb') as log:
+ ffmpeg = os.environ.get('FFMPEG', 'ffmpeg')
+ try:
+ subprocess.run([ffmpeg, '-v', 'warning', '-y', '-f', 'lavfi', '-i',
+ 'testsrc2=size=1280x720:rate=30', '-t', '20',
+ '-c:v', 'libx264', '-preset', 'ultrafast', '-pix_fmt', 'yuv420p', str(media)],
+ env=env, stdout=log, stderr=subprocess.STDOUT, timeout=120, check=True)
+ except (OSError, subprocess.CalledProcessError) as error:
+ print('fixture failed:', error)
+ print((LOGS / 'fixture.log').read_text('utf8', errors='replace')[-2000:])
+ raise SystemExit(2)
+assert media.exists() and media.stat().st_size > 0
+
+# The control QML is injected into this staging copy of Main.qml only.
+main = app / 'qml/Veyra/Main.qml'
+original = main.read_bytes()
+source = original.decode('utf8')
+loader = ('\nLoader { source: ' + json.dumps((ROOT / 'scripts/acceptance/screen-recording-ui.qml').as_uri())
+ + '; onLoaded: { item.media=' + json.dumps(str(media))
+ + '; item.evidence=' + json.dumps(str(OUT)) + ' } }\n')
+at = source.rfind('}')
+main.write_text(source[:at] + loader + source[at:], encoding='utf8')
+
+args = [str(app / 'veyra_qml_ui.exe'), '--page', 'pro', '--size', '1280x800',
+ '--data-dir', str(OUT / 'profile'), '--exit-after', '120000', str(media)]
+console = LOGS / 'recording-console.log'
+try:
+ with console.open('wb') as log:
+ code = subprocess.run(args, cwd=app, env=env, stdout=log, stderr=subprocess.STDOUT, timeout=280).returncode
+finally:
+ main.write_bytes(original)
+
+text = console.read_text('utf8', errors='replace')
+print('exit', code)
+for line in text.splitlines():
+ if 'RECORD_' in line or '[ERROR]' in line:
+ print(' |', line[:200])
+assert 'RECORD_UI_PASS' in text, 'the recording control test did not pass'
+assert 'RECORD_UI_FAIL' not in text
+
+produced = sorted(recordings.glob('*.mp4'))
+assert produced, 'no mp4 was written into the recording folder'
+report = []
+for file in produced:
+ size = file.stat().st_size
+ assert size > 1024, f'{file} is too small to be a real recording: {size}'
+ probe = {}
+ ffprobe = os.environ.get('FFPROBE', 'ffprobe')
+ try:
+ data = subprocess.check_output([ffprobe, '-v', 'error', '-count_frames', '-show_streams',
+ '-show_format', '-of', 'json', str(file)], env=env, timeout=60)
+ probe = json.loads(data)
+ except (OSError, subprocess.CalledProcessError) as error:
+ print('ffprobe unavailable:', error)
+ report.append({'file': str(file), 'bytes': size, 'probe': probe})
+ if probe:
+ stream = next(x for x in probe['streams'] if x['codec_type'] == 'video')
+ print('video:', stream.get('codec_name'), stream.get('width'), 'x', stream.get('height'),
+ 'frames', stream.get('nb_read_frames'), 'duration', probe['format'].get('duration'))
+
+(LOGS / 'recording-files.json').write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding='utf8')
+print('RECORDING CONTROL PASS', json.dumps([{'file': r['file'], 'bytes': r['bytes']} for r in report], ensure_ascii=False))
diff --git a/scripts/acceptance/screen-recording-ui.qml b/scripts/acceptance/screen-recording-ui.qml
new file mode 100644
index 00000000..054ee1e2
--- /dev/null
+++ b/scripts/acceptance/screen-recording-ui.qml
@@ -0,0 +1,69 @@
+// Used only in the task's staging copy of Main.qml, with the production bridge.
+// Drives the real recording path: open a file, start the recorder, let it run,
+// stop it, and report the file the engine wrote.
+import QtQuick
+Item {
+ id: test
+ property string media: ""
+ property string evidence: ""
+ property var appWindow: Window.window
+ property int step: 0
+ property int ticks: 0
+ property int recordedTicks: 0
+
+ function find(item, name) {
+ if (item.objectName === name) return item
+ for (const child of item.children || []) {
+ const hit = find(child, name)
+ if (hit) return hit
+ }
+ return null
+ }
+ function require(ok, why) {
+ if (!ok) { console.error("RECORD_UI_FAIL", step, why); timer.stop(); Qt.quit(); throw new Error(why) }
+ }
+ Connections {
+ target: veyra
+ function onNotice(message, error) { console.log("RECORD_NOTICE", message, error) }
+ }
+ Timer {
+ id: timer
+ interval: 200; repeat: true; running: true
+ onTriggered: {
+ if (++test.ticks > 900) { test.require(false, "180-second deadline"); return }
+ if (!test.media.length) return
+ if (test.step === 0) {
+ // The source is opened from the command line; wait for the picture.
+ if (!veyra.hasSource || test.ticks < 20) return
+ test.require(veyra.setPreference("recordDir", test.evidence + "/recordings"),
+ "the recording folder preference was refused")
+ veyra.startRecording()
+ test.step = 1
+ } else if (test.step === 1) {
+ if (!veyra.recording) {
+ if (test.ticks > 100) test.require(false, "the recorder never started")
+ return
+ }
+ test.recordedTicks = test.ticks
+ test.step = 2
+ } else if (test.step === 2) {
+ // Record a few seconds of the presented picture.
+ if (test.ticks - test.recordedTicks < 25) return
+ test.require(veyra.recording, "the recording stopped on its own")
+ veyra.stopRecording()
+ test.step = 3
+ } else if (test.step === 3) {
+ if (veyra.recording) return
+ const state = veyra.recordingState
+ test.require(state && state.path && state.path.length > 0, "no file was reported")
+ test.require(state.frames > 0, "no frame reached the encoder")
+ test.require(!state.failed, "the recorder reported a failure: " + (state.error || ""))
+ console.log("RECORD_UI_PASS frames=" + state.frames + " dropped=" + state.dropped
+ + " seconds=" + state.seconds + " path=" + state.path
+ + " encoder=" + state.encoder)
+ timer.stop()
+ Qt.quit()
+ }
+ }
+ }
+}