Open in the explorer

Configure H.264/AVC hardware encoding for Remote Desktop Connections

Configurer le codage matériel H.264/AVC pour les connexions Bureau à distance

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Remote Desktop Services › Remote Desktop Session Host › Remote Session Environment FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Services Bureau à distance › Hôte de la session Bureau à distance › Environnement de session à distance
Supported on
At least Windows Server 2016, Windows 10 FR: Au moins Windows Server 2016, Windows 10
ADMX file
TerminalServer.admx
Internal name
TerminalServer/TS_SERVER_AVC_HW_ENCODE_PREFERRED

Explanation

This policy setting lets you enable H.264/AVC hardware encoding support for Remote Desktop Connections. When you enable hardware encoding, if an error occurs, we will attempt to use software encoding. If you disable or do not configure this policy, we will always use software encoding.

French text from Windows 11 26H2

Ce paramètre de stratégie vous permet d'activer la prise en charge de l'encodage matériel H.264/AVC pour les connexions Bureau à distance. Lorsque vous activez l'encodage matériel, si une erreur se produit, nous essayons d'utiliser l'encodage logiciel. Si vous désactivez ou ne configurez pas cette stratégie, nous utilisons toujours l'encodage logiciel.

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
Value name
AVCHardwareEncodePreferred
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: TerminalServer/TS_SERVER_AVC_HW_ENCODE_PREFERRED
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AVCHardwareEncodePreferred' -Value 1 -Type DWord

Disable

# Disable: TerminalServer/TS_SERVER_AVC_HW_ENCODE_PREFERRED
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AVCHardwareEncodePreferred' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": TerminalServer/TS_SERVER_AVC_HW_ENCODE_PREFERRED
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'AVCHardwareEncodePreferred' -ErrorAction SilentlyContinue

Availability