[PR #98] [MERGED] fix(win): record converts with the BT.709 matrix and tags it #122

Closed
opened 2026-10-15 20:53:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/98
Author: @AltDoug
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @rehan-remade

Base: main ← Head: fix/record-bt709


📝 Commits (2)

  • 1a2087b fix(win): record converts with the BT.709 matrix and tags it
  • e726b09 Merge main into fix/record-bt709

📊 Changes

2 files changed (+21 additions, -1 deletions)

View changed files

📝 tests/test_um.py (+18 -0)
📝 um/win.py (+3 -1)

📄 Description

um win record turns the BGRA capture into yuv420p with -pix_fmt yuv420p, so ffmpeg's auto-inserted scaler uses its default BT.601 matrix, and the .mkv is left untagged (color_space=unknown). Browsers (Chromium) and many players assume BT.709 for HD video, so colours shift slightly in every recording. Measured on a solid (155, 70, 74):

tags decoded as BT.709
before color_space=unknown 161, 77, 71
after color_space=bt709, color_range=tv 154, 69, 73

Fix: convert explicitly with scale=out_color_matrix=bt709:out_range=tv,format=yuv420p and tag the stream -colorspace bt709 -color_range tv. I left primaries and transfer untagged on purpose: the frames are sRGB, and players already default those to BT.709.

Tests: new test_record_encodes_and_tags_bt709 (fails before, passes after); full suite 59 passed on Windows 11, Python 3.12. By hand: the colour table above with libx264 and h264_nvenc, and a real 3 s um win record (gfxcapture + NVENC) probes as color_range=tv|color_space=bt709.

Found and fixed with AI assistance (Claude Code); the repro and the fix were run by hand on Windows 11.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rehan-remade/universal-modder/pull/98 **Author:** [@AltDoug](https://github.com/AltDoug) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `fix/record-bt709` --- ### 📝 Commits (2) - [`1a2087b`](https://github.com/rehan-remade/universal-modder/commit/1a2087beddc5a05ec1a1b000128fe58e50a65ec6) fix(win): record converts with the BT.709 matrix and tags it - [`e726b09`](https://github.com/rehan-remade/universal-modder/commit/e726b095b35d5e599713cd61725a9e271585b16c) Merge main into fix/record-bt709 ### 📊 Changes **2 files changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_um.py` (+18 -0) 📝 `um/win.py` (+3 -1) </details> ### 📄 Description `um win record` turns the BGRA capture into yuv420p with `-pix_fmt yuv420p`, so ffmpeg's auto-inserted scaler uses its default BT.601 matrix, and the .mkv is left untagged (`color_space=unknown`). Browsers (Chromium) and many players assume BT.709 for HD video, so colours shift slightly in every recording. Measured on a solid (155, 70, 74): | | tags | decoded as BT.709 | |---|---|---| | before | `color_space=unknown` | 161, 77, 71 | | after | `color_space=bt709`, `color_range=tv` | 154, 69, 73 | Fix: convert explicitly with `scale=out_color_matrix=bt709:out_range=tv,format=yuv420p` and tag the stream `-colorspace bt709 -color_range tv`. I left primaries and transfer untagged on purpose: the frames are sRGB, and players already default those to BT.709. Tests: new `test_record_encodes_and_tags_bt709` (fails before, passes after); full suite 59 passed on Windows 11, Python 3.12. By hand: the colour table above with libx264 and h264_nvenc, and a real 3 s `um win record` (gfxcapture + NVENC) probes as `color_range=tv|color_space=bt709`. Found and fixed with AI assistance (Claude Code); the repro and the fix were run by hand on Windows 11. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:53:35 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rehan-remade/universal-modder#122
No description provided.