Skip to main content
FreeRDP implements a full suite of RDP graphics codecs. They are managed through the rdpCodecs struct (include/freerdp/codecs.h), which holds one context per codec type and is accessible via context->codecs.

rdpCodecs — The Codec Container

The codec container is allocated and freed via:
Before use, prepare the required codecs with a bitmask of FreeRDP_CodecFlags:

Codec Flags


RDP GFX Pipeline (MS-RDPEGFX)

The Graphics Pipeline Extension (Windows 8+) is delivered over the rdpgfx dynamic virtual channel (Microsoft::Windows::RDS::Graphics). It replaces the legacy slow-path graphics orders with an explicit surface model:
  • The server creates surfaces (RDPGFX_CMDID_CREATESURFACE) and maps them to output regions (RDPGFX_CMDID_MAPSURFACETOOUTPUT).
  • Frame boundaries are delimited with RDPGFX_CMDID_STARTFRAME / RDPGFX_CMDID_ENDFRAME.
  • The client acknowledges frames with RDPGFX_CMDID_FRAMEACKNOWLEDGE to implement backpressure.
  • Pixels are delivered via RDPGFX_CMDID_WIRETOSURFACE_1 (uncompressed or codec-compressed) or RDPGFX_CMDID_WIRETOSURFACE_2 (cache-based).
  • A surface-to-surface blit (RDPGFX_CMDID_SURFACETOSURFACE) and an import cache (RDPGFX_CMDID_CACHEIMPORTOFFER / RDPGFX_CMDID_CACHEIMPORTREPLY) further reduce bandwidth.
Codecs available in the GFX pipeline: RemoteFX Progressive, H.264 AVC420/AVC444, ClearCodec, ZGFX (bulk compression).
Enable the GFX pipeline in settings with FreeRDP_SupportGraphicsPipeline = TRUE. Specific codec sub-features are controlled by FreeRDP_GfxProgressive, FreeRDP_GfxAVC420, FreeRDP_GfxAVC444, and FreeRDP_GfxH264.

H.264 / AVC (H264_CONTEXT)

Declared in include/freerdp/codec/h264.h. Supports two chroma sub-sampling modes:

Rate Control

Usage Types

Backend Selection

FreeRDP selects an H.264 subsystem at build time (or runtime where multiple are compiled in):

RemoteFX (RFX_CONTEXT)

Declared in include/freerdp/codec/rfx.h. RemoteFX is a wavelet-based lossless codec optimized for screen content with sharp edges and text.
RemoteFX tiles are 64×64 pixels, encoded in YCbCr with DWT + RLGR entropy coding. FreeRDP supports both RLGR1 and RLGR3 modes.
RemoteFX (FreeRDP_RemoteFxCodec) uses the classic slow-path surface commands. For the GFX pipeline variant use the Progressive codec (FreeRDP_GfxProgressive).

Progressive Codec (PROGRESSIVE_CONTEXT)

Declared in include/freerdp/codec/progressive.h. The Progressive codec (MS-RDPEGFX section 2.2.4) is an evolution of RemoteFX that supports progressive quality refinement: an initial low-quality frame is sent first, then delta frames progressively improve fidelity — useful on bandwidth-constrained links.

NSCodec (NSC_CONTEXT)

Declared in include/freerdp/codec/nsc.h. NSCodec (also known as MS-RDPNSC) is a simple color-space conversion codec that converts RGB bitmaps to YCoCg color space before RLE compression. It targets UI elements with few distinct colors. Enable with FreeRDP_NSCodec = TRUE.

RDP 6.x Bitmap Compression

Legacy bitmap compression used in RDP 6.0 and earlier. FreeRDP provides two contexts: These are used for classic slow-path TS_BITMAP_DATA PDUs and are always available regardless of GFX pipeline support.

Additional Codec Modules


CMake Build Flags Summary

H.264 requires at least one backend (WITH_OPENH264 or WITH_FFMPEG) to be enabled at build time. Without a backend the H264_CONTEXT* in rdpCodecs remains NULL and GFX AVC capabilities will not be advertised.