Releases: Nonary/ResolutionAutomation
v3.0
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
- Host must be Windows.
- Sunshine 0.21.0 or higher
Caveats:
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > System > For Developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- On older versions of Windows 11 it can be found at: Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
- Due to Windows API restrictions, this script does not work on cold reboots (hard crashes or shutdowns of your computer).
- If you're cold booting, simply sign into the computer using the "Desktop" app on Moonlight, then end the stream, then start it again.
GFE Users
- You'll need to use the Geforce Experience version of this script instead.
- The current release for Geforce Experience users is: https://github.com/Nonary/ResolutionAutomation/releases/tag/2.0.15_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because Sunshine configuration is be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
- It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides (Setting)
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, make modifications to the overrides section in the settings.json file
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
"overrides": [
// recommended for steam deck users, uncomment to enable, but make sure you have 3840x2400 added on your host!
// sunshine has issues downscaling to smaller resolutions, so it is recommended to stream above native (you will see a significant difference)
// simply uncomment below line once done
//"2560x1440x90=3840x2400x60",
"1280x720x60=3840x2160x60"
]
Recent Changes
- Migrated over to Sunshine Script Installer Template
- Fixed compatibility issues with 24H2 users
- Overhauled settings file.
v2.3.1
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
- Host must be Windows.
- Sunshine 0.21.0 or higher
Caveats:
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > System > For Developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- On older versions of Windows 11 it can be found at: Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
- Due to Windows API restrictions, this script does not work on cold reboots (hard crashes or shutdowns of your computer).
- If you're cold booting, simply sign into the computer using the "Desktop" app on Moonlight, then end the stream, then start it again.
GFE Users
- You'll need to use the Geforce Experience version of this script instead.
- The current release for Geforce Experience users is: https://github.com/Nonary/ResolutionAutomation/releases/tag/2.0.15_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because Sunshine configuration is be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
- It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Fixed a bug that caused overrides to fail and set resolution as an empty value.
Troubleshooting
ChatGPT users (including free accounts) can troubleshoot and resolve most common issues with this script by talking to the AI through this link: https://chat.openai.com/g/g-2mF6ae5iI-resolution-matcher-support
v2.3.0
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
- Host must be Windows.
- Sunshine 0.21.0 or higher
Caveats:
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > System > For Developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- On older versions of Windows 11 it can be found at: Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
- Due to Windows API restrictions, this script does not work on cold reboots (hard crashes or shutdowns of your computer).
- If you're cold booting, simply sign into the computer using the "Desktop" app on Moonlight, then end the stream, then start it again.
GFE Users
- You'll need to use the Geforce Experience version of this script instead.
- The current release for Geforce Experience users is: https://github.com/Nonary/ResolutionAutomation/releases/tag/2.0.15_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because Sunshine configuration is be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
- It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Improved stability of script when mixed with the MonitorSwapper Script
- Fixed an issue with the script when users had installed Sunshine at a different file location than default.
- Fixed a bug that caused the revert on pause to never function, by default this is set to 120 seconds and can be changed in new settings.json file.
- Fixed an issue where overrides file could cause program to crash if empty lines where contained in it.
Troubleshooting
ChatGPT Plus users can troubleshoot and resolve most common issues with this script by talking to the AI through this link: https://chat.openai.com/g/g-2mF6ae5iI-resolution-matcher-support
v2.2.0
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
- Host must be Windows.
- Sunshine 0.21.0 or higher
Caveats:
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > System > For Developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- On older versions of Windows 11 it can be found at: Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
- Due to Windows API restrictions, this script does not work on cold reboots (hard crashes or shutdowns of your computer).
- If you're cold booting, simply sign into the computer using the "Desktop" app on Moonlight, then end the stream, then start it again.
GFE Users
- You'll need to use the Geforce Experience version of this script instead.
- The current release for Geforce Experience users is: https://github.com/Nonary/ResolutionAutomation/releases/tag/2.0.15_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because Sunshine configuration is be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
- It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Script no longer relies on parsing log files for Sunshine, which significantly improves performance and stability of the script.
- It's using the newly released feature in Sunshine 0.21.0, which provides client information to processes launched from Sunshine.
- So that means you need to have the latest available Sunshine version at the time of this release (0.21.0).
Troubleshooting
ChatGPT Plus users can troubleshoot and resolve most common issues with this script by talking to the AI through this link: https://chat.openai.com/g/g-2mF6ae5iI-resolution-matcher-support
v2.0.15_gfe
Note
This version is meant exclusively for GeForce Experience users, if you're using Sunshine please download the latest release by clicking the link below instead.
https://github.com/Nonary/ResolutionAutomation/releases/latest
ELI5
Changes your host resolution to match exactly with Moonlight's resolution.
Why
The biggest use case for matching resolution is for people with different aspect ratios on the client and host, such as Steam Deck and Widescreen Users.
If you do not match the resolution/aspect ratio, it will either squish or stretch the stream and or letterbox... or in some cases both!
This can also be used to supersample games on client device (such as streaming 1080p and keeping host at 4k).
Requirements
GFE Users
None, should work "out of the box"
Install instructions
First, store this folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
If you have to move the folder, move it, then run the installation script again.
To install, simply double click the Install Script.bat file.
To uninstall, simply double click the Uninstall Script.bat file.
If you get a SmartScreen warning, tell it to proceed anyway, this will only happen once.
How it works
- Waits for NVStreamer process to be launched if GFE, otherwise it waits for a connection from Sunshine.
- Reads the NVStreamerCurrentLog.txt or Sunshine.log file to capture the hosts resolution and moonlights resolution.
- Sets the hosts resolution to match the Moonlight resolution (including refresh rate).
- Waits for NVStreamer Process to end or Sunshine connection to either suspend or terminate.
- Sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth.
Or, some devices may perform better when streaming at a lower resolution.
If you want your host to change the resolution to something higher than the client, use the overrides file to do this.
Format: WidthxHeightxRefresh=WidthxHeightxRefresh
Resolution on the left is what triggers the override, the one on the right is what the host will be set to.
For example, to stream at 720p and keep the host at 4k resolution you would add this line:
1280x700x60=3840x2160x60
Recent Changes
Removed the sunshine specific code from the GFE version, it should now work as expected for GFE users.
Sunshine Pre-release (Nightly)
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
For Sunshine Users
- Host must be Windows.
- Must be using Sunshine Nightly Version
Caveats
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- Prepcommands do not work from cold reboots, and will prevent Sunshine from working until you logon locally.
- You should add a new application (with any name you'd like) in the WebUI and leave both the command and detached command empty.
- When adding this new application, make sure global prep command option is disabled.
- That will serve as a fallback option when you have to remote into your computer from a cold start.
- Normal reboots issued from start menu, will still work without the workaround above as long as Settings > Accounts > Sign-in options and "Use my sign-in info to automatically finish setting up after an update" is enabled which is default in Windows 10 & 11.
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
GFE Users
- You'll need to use the Geforce Experience version of this script instead.
- The current release for Geforce Experience users is: https://github.com/Nonary/ResolutionAutomation/releases/tag/2.0.14_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because in the coming future, Sunshine configuration will be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
- It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Script no longer relies on parsing log files for Sunshine, which significantly improves performance and stability of the script.
- It's using the newly released feature in Sunshine, which provides client information to processes launched from Sunshine.
- So that means you need to have Sunshine Nightly version installed in order to benefit from this change.
v2.0.14 - GeForce Experience
Note
If you're using Sunshine 0.19.1 or greater, it is recommended to use the pre-command version. This release is meant for GeForce Experience users or those who want to run this script in the background as opposted to direct integration with Sunshine itself.
https://github.com/Nonary/ResolutionAutomation/releases/latest
ELI5
Changes your host resolution to match exactly with Moonlight's resolution.
Why
The biggest use case for matching resolution is for people with different aspect ratios on the client and host, such as Steam Deck and Widescreen Users.
If you do not match the resolution/aspect ratio, it will either squish or stretch the stream and or letterbox... or in some cases both!
This can also be used to supersample games on client device (such as streaming 1080p and keeping host at 4k).
Requirements
For Sunshine Users
- Host must be Windows
- Sunshine must be installed a service (it does not work with the zip version of Sunshine)
- Sunshine logging level must be set to Debug
- Users must have read permissions to
%WINDIR%/Temp/Sunshine.log
(do not change other permissions, just make sure Users has at least read permissions)
GFE Users
None, should work "out of the box"
Install instructions
First, store this folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
If you have to move the folder, move it, then run the installation script again.
To install, simply double click the Install Script.bat file.
To uninstall, simply double click the Uninstall Script.bat file.
If you get a SmartScreen warning, tell it to proceed anyway, this will only happen once.
How it works
- Waits for NVStreamer process to be launched if GFE, otherwise it waits for a connection from Sunshine.
- Reads the NVStreamerCurrentLog.txt or Sunshine.log file to capture the hosts resolution and moonlights resolution.
- Sets the hosts resolution to match the Moonlight resolution (including refresh rate).
- Waits for NVStreamer Process to end or Sunshine connection to either suspend or terminate.
- Sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth.
Or, some devices may perform better when streaming at a lower resolution.
If you want your host to change the resolution to something higher than the client, use the overrides file to do this.
Format: WidthxHeightxRefresh=WidthxHeightxRefresh
Resolution on the left is what triggers the override, the one on the right is what the host will be set to.
For example, to stream at 720p and keep the host at 4k resolution you would add this line:
1280x700x60=3840x2160x60
v2.0.14
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
For Sunshine Users
- Host must be Windows.
- Sunshine must be installed as a service (it does not work with the zip version of Sunshine).
- Sunshine logging level must be set to Debug.
- Users must have read permissions to
%WINDIR%/Temp/Sunshine.log
(do not change other permissions, just make sure Users has at least read permissions).
Caveats
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- Prepcommands do not work from cold reboots, and will prevent Sunshine from working until you logon locally.
- You should add a new application (with any name you'd like) in the WebUI and leave both the command and detached command empty.
- When adding this new application, make sure global prep command option is disabled.
- That will serve as a fallback option when you have to remote into your computer from a cold start.
- Normal reboots issued from start menu, will still work without the workaround above as long as Settings > Accounts > Sign-in options and "Use my sign-in info to automatically finish setting up after an update" is enabled which is default in Windows 10 & 11.
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
GFE Users
- Unsupported.
- If you want this script to work with GeForce Experience you can use the GFE release here: https://github.com/Nonary/ResolutionAutomation/releases/2.0.15_gfe
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because in the coming future, Sunshine configuration will be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the
Sunshine.log
file to capture Moonlight's resolution. - It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Improved performance of log parsing by over tenfold.
- Fixed an issue that caused the script to set the wrong resolution, if the log parsing was too slow or if it contained stale data.
- Adjusted the do/undo commands to be hidden, they will no longer pop open a powershell window when you start and end a stream.
2.0.12
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
For Sunshine Users
- Host must be Windows.
- Sunshine must be installed as a service (it does not work with the zip version of Sunshine).
- Sunshine logging level must be set to Debug.
- Users must have read permissions to
%WINDIR%/Temp/Sunshine.log
(do not change other permissions, just make sure Users has at least read permissions).
Caveats
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- Prepcommands do not work from cold reboots, and will prevent Sunshine from working until you logon locally.
- You should add a new application (with any name you'd like) in the WebUI and leave both the command and detached command empty.
- When adding this new application, make sure global prep command option is disabled.
- That will serve as a fallback option when you have to remote into your computer from a cold start.
- Normal reboots issued from start menu, will still work without the workaround above as long as Settings > Accounts > Sign-in options and "Use my sign-in info to automatically finish setting up after an update" is enabled which is default in Windows 10 & 11.
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
GFE Users
- Unsupported.
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because in the coming future, Sunshine configuration will be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the
Sunshine.log
file to capture Moonlight's resolution. - It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Fixed a bug that caused the script to stall out Sunshine that could not be recovered until restarting the service.
2.0.13
Host Resolution Matching for Moonlight Streaming
This script changes your host resolution to match exactly with Moonlight's resolution. This is mostly used for users who have different aspect ratios between the client and host, or anyone who wishes to match the resolution while streaming.
Requirements
For Sunshine Users
- Host must be Windows.
- Sunshine must be installed as a service (it does not work with the zip version of Sunshine).
- Sunshine logging level must be set to Debug.
- Users must have read permissions to
%WINDIR%/Temp/Sunshine.log
(do not change other permissions, just make sure Users has at least read permissions).
Caveats
- If using Windows 11, you'll need to set the default terminal to Windows Console Host as there is currently a bug in Windows Terminal that prevents hidden consoles from working properly.
- That can be changed at Settings > Privacy & security > Security > For developers > Terminal [Let Windows decide] >> (change to) >> Terminal [Windows Console Host]
- Prepcommands do not work from cold reboots, and will prevent Sunshine from working until you logon locally.
- You should add a new application (with any name you'd like) in the WebUI and leave both the command and detached command empty.
- When adding this new application, make sure global prep command option is disabled.
- That will serve as a fallback option when you have to remote into your computer from a cold start.
- Normal reboots issued from start menu, will still work without the workaround above as long as Settings > Accounts > Sign-in options and "Use my sign-in info to automatically finish setting up after an update" is enabled which is default in Windows 10 & 11.
- The script will stop working if you move the folder, simply reinstall it to resolve that issue.
GFE Users
- Unsupported.
Installation Instructions
- Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
- To install, double click the Install.bat file.
- To uninstall, double click the Uninstall.bat file.
This script will ask for elevated rights because in the coming future, Sunshine configuration will be locked from modifications for non-administrator users.
How it Works
- When you start streaming any application in Sunshine, it will start the script.
- The script reads the
Sunshine.log
file to capture Moonlight's resolution. - It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the
overrides
file. - The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
- It sets the host resolution back to the same resolution it was prior to starting the stream (including refresh rate).
This will only work if the resolution is available to be used, so you will need to make sure to use NVIDIA Custom Resolution or CRU to add the client resolution first.
Overrides File
You may have a mobile device that you wish to stream at a lower resolution to save bandwidth or some devices may perform better when streaming at a lower resolution. If you want your host to change the resolution to something higher than the client, use the overrides
file to do this.
Format
WidthxHeightxRefresh=WidthxHeightxRefresh
The resolution on the left is what triggers the override, and the one on the right is what the host will be set to.
Example
To stream at 720p and keep the host at 4k resolution, you would add this line:
1280x700x60=3840x2160x60
Recent Changes
- Added missing overrides.txt file to release