Skip to content

KVM-Control Plus v0.1.2

Choose a tag to compare

@Alihkhawaher Alihkhawaher released this 10 Oct 21:50
· 2 commits to main since this release

KVM-Control Plus v0.1.2

Two fixes, both reported from watching real video, both caused by code that
assumed something instead of asking for it.

The picture was the wrong colour

The NV12 → RGB conversion hard-coded studio-swing BT.601 for every format.
MediaFoundation disagrees, and says so on the media type:

colour: BT.709 (media type says BT.709), full 0-255 (media type says 0-255)

MJPG (the format selected here) is decoded by MediaFoundation's JPEG decoder, and
JPEG is full-range by definition. Applying studio-swing maths to full-range
data stretches contrast by ~16% and clips everything from luma 235 upward to flat
white. Measured on a ramp:

source luma what you saw what it should be
64 56 64
128 130 128
200 214 200
235 255 235
240 255 240

21 of 256 luma levels — 8% of the tonal range — were crushed to flat white, and
every mid-tone sat 7–16% high. That is the washed-out, too-bright picture with no
highlight detail. On top of that the coefficients were BT.601 applied to BT.709
content, which shifts hues.

Range and matrix are now read from the negotiated media type, with a per-format
fallback (MJPG ⇒ full range), and both the decision and its reason are printed in
the log and shown in the LINK & FORMATS panel. The conversion is a pure
function with unit tests over known ramps — the capture device is not always
awake, so a test is the only reproducible proof.

Latency is now measured, and lower

There was no way to tell whether "the picture is behind" was true. Now each frame
carries the instant it was sampled, and the window reports N ms now / N ms worst — N fps (also overlaid on the video, and logged once a second).

Three changes to the capture path:

  • MF_LOW_LATENCY is requested on the source reader. It never was, so
    MediaFoundation was free to buffer ahead.
  • The UI no longer redraws at the display's refresh rate. The capture thread
    wakes it when a frame actually arrives.
  • Chroma is read once per 4:2:0 pair, instead of being recomputed for every
    pixel.

Also fixed along the way: the reader was told its row pitch was width × 4 — an
RGB32 leftover from before the switch to NV12 — while the conversion ignored the
reported stride entirely. Both now use the stride the media type reports.

Download

KVM-Control-Plus.exe — one file, no installer, no DLLs, no runtime to fetch.
Statically linked CRT, 8.3 MB, icon and version info embedded.

The README now explains the colour rules and how the latency number is produced.