Bug 507015 - KRdp serves a grayish video stream (looks like a limited range video displayed as full range)
Summary: KRdp serves a grayish video stream (looks like a limited range video displaye...
Status: RESOLVED FIXED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.3.5
Platform: Debian stable Linux
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-14 08:12 UTC by Rongrong
Modified: 2025-10-24 22:01 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.0
Sentry Crash Report:


Attachments
KRdp_KRDC (234.92 KB, image/png)
2025-07-14 08:12 UTC, Rongrong
Details
KRdp_Remmina (350.19 KB, image/png)
2025-07-14 08:13 UTC, Rongrong
Details
OBS_Studio_Screen_Capture_PipeWire (349.55 KB, image/png)
2025-07-14 08:13 UTC, Rongrong
Details
Sunshine_Moonlight_H264_422 (1.15 MB, image/png)
2025-07-14 08:14 UTC, Rongrong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rongrong 2025-07-14 08:12:17 UTC
Created attachment 183213 [details]
KRdp_KRDC

SUMMARY
KRdp serves a grayish video stream. It looks like something you get when plugging a legacy HDMI monitor into a modern computer, i.e., a video stream with a limited (16-235) quantization range displayed as full (0-255) quantization range.

STEPS TO REPRODUCE
1. Set up krdpserver
2. Connect to it with KRDC or Remmina
3. See a grayish video stream

OBSERVED RESULT
The video stream is grayish. Meanwhile, Screen Capture (PipeWire) in OBS Studio and Sunshine+Moonlight (H264 YUV422) all show correct colors. See attachments for details.

EXPECTED RESULT
The video stream shouldn't be greyish and should show correct colors.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 13
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
I've tried building KPipeWire+KRdp 6.4.2, and this issue is still reproducible.
Comment 1 Rongrong 2025-07-14 08:13:09 UTC
Created attachment 183214 [details]
KRdp_Remmina
Comment 2 Rongrong 2025-07-14 08:13:35 UTC
Created attachment 183215 [details]
OBS_Studio_Screen_Capture_PipeWire
Comment 3 Rongrong 2025-07-14 08:14:31 UTC
Created attachment 183216 [details]
Sunshine_Moonlight_H264_422
Comment 4 Bug Janitor Service 2025-10-16 10:15:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kpipewire/-/merge_requests/221
Comment 5 Bug Janitor Service 2025-10-16 10:19:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/krdp/-/merge_requests/126
Comment 6 Arjen Hiemstra 2025-10-24 09:12:13 UTC
Git commit cb00651ab5de86d42652958a15adfbc0a8d08f91 by Arjen Hiemstra.
Committed on 24/10/2025 at 09:04.
Pushed by ahiemstra into branch 'master'.

Add support for encoding in full color range

Without extra metadata, decoders don't know what color range the frames
of a video use. Most video players will assume correctly that they are
using limited range, except for FFmpeg. This presents a problem for KRdp
as all clients that we support use FFmpeg indirectly for decoding, which
leads to incorrect colors on decode.

To avoid that, add an option to set what color range we should use when
encoding, and use that for the h264 encoders. This allows KRdp to
request full range encoding. The default is still limited range, as this
is also what the upstream default is.

M  +5    -0    src/encoder.cpp
M  +3    -0    src/encoder_p.h
M  +8    -1    src/h264vaapiencoder.cpp
M  +4    -0    src/libopenh264encoder.cpp
M  +3    -1    src/libx264encoder.cpp
M  +10   -0    src/pipewirebaseencodedstream.cpp
M  +7    -0    src/pipewirebaseencodedstream.h
M  +9    -0    src/pipewireproduce.cpp
M  +3    -0    src/pipewireproduce_p.h

https://invent.kde.org/plasma/kpipewire/-/commit/cb00651ab5de86d42652958a15adfbc0a8d08f91
Comment 7 Nate Graham 2025-10-24 22:01:06 UTC
Git commit a60e7b15b681d8a49106ca634654f5ce213eac59 by Nate Graham, on behalf of Arjen Hiemstra.
Committed on 24/10/2025 at 21:57.
Pushed by ngraham into branch 'master'.

Encode frames in full color range

FFmpeg assumes full color range when decoding by default, even though
the encoding default is limited range. This leads to color issues in
clients. To work around that, request encoding to be performed in full
color range.

M  +1    -0    src/PlasmaScreencastV1Session.cpp
M  +2    -0    src/PortalSession.cpp

https://invent.kde.org/plasma/krdp/-/commit/a60e7b15b681d8a49106ca634654f5ce213eac59