Encoding

August 17, 2026 ยท View on GitHub

This subsystem synchronizes the client and the server's encodings so that each end can use the most appropriate codecs for exchanging data.

ComponentLink
clientxpra.client.subsystem.encoding
client connectionxpra.server.source.encoding
serverxpra.server.subsystem.encoding

The client advertises an encoding dictionary. The interoperability fields are:

CapabilityPurpose
optionsEncodings the client can accept
coreConcrete decoder encodings, without aliases
window-iconEncodings accepted for window icons
settingRequested default encoding
rgb_formatsRaw RGB pixel formats the backing can paint
full_csc_modesCodec-to-colourspace conversion modes
quality, min-qualityRequested quality bounds
speed, min-speedRequested speed bounds
video_max_sizeMaximum video dimensions
batchDamage batching parameters

Codec profile maps such as h264 extend these fields. Unknown codec diagnostic and version fields are advisory.

Any video codec map may also carry a level (ie: h264 โ†’ level = 4.1), which caps the resolution, framerate and bitrate the server's encoder may use, so that a client with a constrained decoder can ask for a stream it can keep up with. A <colourspace>.level key applies to that colourspace only. The level is written the same way for every codec, and the server converts it to whatever its encoder expects. It is a request: a server whose encoder cannot honour it logs a warning and encodes at the level it would have chosen anyway. Without this capability, no level is imposed and every encoder signals the lowest level the stream it is producing actually requires.

Packet TypeDirectionArgumentsPurpose
encoding-setclient to serverencoding name, optional window IDsSelect an encoding
encoding-setserver to clientproperties dictionaryPublish updated encoding and video specifications
encoding-optionsclient to serveroptions dictionaryUpdate quality, speed, scaling or batching
encoding-configclient to serverencoding capability dictionaryReplace the client's decoder configuration