ResolutionAutomation:Moonlight串流时自动匹配主机分辨率,支持自定义覆盖设置

Automates changing the host resolution to match the client resolution of Moonlight, with capabilities of supersampling if required

分支3Tags19
ecc623a3创建于 2025年9月22日61次提交
文件最后提交记录最后更新时间
Performance Improves and BugFixes (#21) The log parsing has been re-written to use C# to improve performance by a significant amount. And it will now check the client resolution setting for about 10 seconds, if it changes (implying the log file was stale) it will now set the resolution again making sure they match. Powershell Window no longer pops up before and after stream2 年前
update chatGPT bot instructions 1 年前
Sunshine 0.21.0 Release 2 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
fix: update refresh rate setting variable for clarity 1 年前
merge changes from SunshineScriptInstaller for Apollo support 1 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
merge changes from SunshineScriptInstaller for Apollo support 1 年前
Initial commit3 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
add vibeshine advert 7 个月前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
bug fixes from SunshineScriptInstaller 1 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
24H2 Support (#83) Changes backend to Sunshine Script Installer and adds support for 24H21 年前
change: Default Override for Steam Deck Users Changes the override to 2560x1600 for steam deck users, due to the resolution not being available for most users unless they have CRU on their machine to enable such a resolution 3 年前
update sunshine base script, add new refresh rate option 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


Vibeshine

Vibeshine is a custom fork of Sunshine that makes display swaps smoother and more reliable as well as add exclusive features like Playnite integration, Windows Graphic Capture in Service mode and more! It is the closest experience you can get to Geforce Experience because you can add games directly with their box art in the Web UI.

You can download it here: Vibeshine

Vibeshine also supports changing resolution in the Audio/Video tab, at Step 2: Pre stream setup select any of the options other than disabled (default).

NOTE: You do not need to use this script after installing Vibeshine, but I am still maintaining it for users who rather remain on Sunshine or Apollo.


Installation Instructions

  1. Store the downloaded folder in a location you intend to keep. If you delete this folder or move it, the automation will stop working.
  2. To install, double click the Install.bat file.
  3. 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

  1. When you start streaming any application in Sunshine, it will start the script.
  2. The script reads the environment variables passed to it via Sunshine, which contains client information such as screen resolution.
  3. It sets the host's resolution to match the Moonlight resolution (including refresh rate), unless overridden with the overrides file.
  4. The script waits for Sunshine to be suspended for more than 120 seconds or until the user ends the stream.
  5. 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"
    ]

项目介绍

Automates changing the host resolution to match the client resolution of Moonlight, with capabilities of supersampling if required

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

PowerShell96.2%
C#3.44%
Batchfile0.36%