Configure H.264/AVC hardware encoding for Remote Desktop Connections
Configurer le codage matériel H.264/AVC pour les connexions Bureau à distance
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.
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
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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 DWordDisable
# 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 DWordRevert 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