Skip to content

GUACAMOLE-2351: Add "enable-h264" RDP parameter to offer H.264 within the Graphics Pipeline. - #733

Open
jeremiahmorgan-web wants to merge 1 commit into
apache:mainfrom
jeremiahmorgan-web:GUACAMOLE-2351
Open

jeremiahmorgan-web wants to merge 1 commit into
apache:mainfrom
jeremiahmorgan-web:GUACAMOLE-2351

Conversation

@jeremiahmorgan-web

Copy link
Copy Markdown

Problem

When the RDP Graphics Pipeline is enabled, guacd offers RemoteFX but never
H.264. Servers that implement the pipeline with H.264 only, such as KDE's KRDP,
refuse the connection ("Client does not support H.264 in YUV420 mode!").

Change

Adds an RDP parameter, enable-h264, default false. When true and the pipeline
is enabled, guacd also offers H.264, if FreeRDP can decode it. If not, guacd logs
a warning and offers RemoteFX alone. With the parameter unset, nothing changes.

It is opt-in because a server supporting both codecs may then choose H.264, and
guacd must decode it before re-encoding for the browser.

The parameter is not yet in the web admin form, which would need a small
companion PR to guacamole-client, if wanted.

Testing

On main at bb1ba8e, with FreeRDP 3.15 and 2.11.7 unless noted:

Server Unpatched or parameter unset Parameter true
KRDP 6.3.5 (3.15 only) refused (unpatched) works in a browser, including pointer and keyboard
FreeRDP shadow server no H.264 H.264 used
xrdp 0.10.1 no H.264 no H.264
Windows Server 2025 no H.264 H.264 on 2.11.7; none on 3.15

A stock xfreerdp3 3.15 also got no H.264 from that Windows server, so that
result does not appear to come from this change. I did not find out why.

With the parameter true, disable-gfx prevented H.264 on the shadow server, xrdp
and Windows. A stub making h264_context_new() return NULL (3.15) produced the
warning, and the desktop was drawn without H.264.

FreeRDP 3.15 builds need -Wno-error=deprecated-declarations, with or without
this change.

Not tested: KRDP with a FreeRDP 2 build, GNOME Remote Desktop, and a FreeRDP
actually built without an H.264 backend.

Disclosure

Written with the help of an AI coding assistant (Claude, by Anthropic), and
reviewed and tested by me. The commit carries a Generated-by: line, following
the ASF generative tooling guidance.

🤖 Generated with Claude Code

… the Graphics Pipeline.

Generated-by: Claude Opus 5.5 (Anthropic)

@necouchman necouchman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth checking for H.264 support at compile time, in the configure.ac file? How likely is it that someone is going to take a version of Guacamole compiled against a FreeRDP version that supports H.264 and attempt to run it on a system that has FreeRDP without H.264 support?

@jeremiahmorgan-web

Copy link
Copy Markdown
Author

Is it worth checking for H.264 support at compile time, in the configure.ac file?

A compile-time check looks workable on FreeRDP 3: on the 3.15 Debian package,
freerdp/config.h defines WITH_GFX_H264, WITH_OPENH264 and WITH_VIDEO_FFMPEG. I
didn't find an equivalent in the headers of the 2.11.7 package, so FreeRDP 2
would need something else, or would have to go without the check.

That's why I lean towards the runtime check: the same code works on both major
versions. It would also catch a build that loads OpenH264 at runtime
(WITH_OPENH264_LOADING) when the library is missing, although I haven't tested
that case. The cost is one small function that only runs when enable-h264 is set.

I'm happy to switch to a configure.ac check if you'd prefer it. How would you want
FreeRDP 2 handled in that case?

How likely is it that someone is going to take a version of Guacamole compiled against a FreeRDP version that supports H.264 and attempt to run it on a system that has FreeRDP without H.264 support?

I'd guess that mismatch is rare. A normal distribution package should be built and run against the same FreeRDP.

@necouchman

Copy link
Copy Markdown
Contributor

Is it worth checking for H.264 support at compile time, in the configure.ac file?

A compile-time check looks workable on FreeRDP 3: on the 3.15 Debian package, freerdp/config.h defines WITH_GFX_H264, WITH_OPENH264 and WITH_VIDEO_FFMPEG. I didn't find an equivalent in the headers of the 2.11.7 package, so FreeRDP 2 would need something else, or would have to go without the check.

Is this because it just lacks any acknowledgement that it's compiled with H.264 support? Or does FreeRDP 2.x even support H.264 encoding?

That's why I lean towards the runtime check: the same code works on both major versions. It would also catch a build that loads OpenH264 at runtime (WITH_OPENH264_LOADING) when the library is missing, although I haven't tested that case. The cost is one small function that only runs when enable-h264 is set.

I'm happy to switch to a configure.ac check if you'd prefer it. How would you want FreeRDP 2 handled in that case?

How likely is it that someone is going to take a version of Guacamole compiled against a FreeRDP version that supports H.264 and attempt to run it on a system that has FreeRDP without H.264 support?

I'd guess that mismatch is rare. A normal distribution package should be built and run against the same FreeRDP.

Right - which is why it seems better to do a compile-time check rather than a run-time check. I get that the cost is relatively small, but, still, seems like compile-time would be better. Unless FreeRDP 2.x can be compiled with H.264 and lacks a way of defining that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants