{"id":13835439,"url":"https://github.com/CogentRedTester/mpv-changerefresh","last_synced_at":"2025-07-10T07:32:05.561Z","repository":{"id":113085338,"uuid":"284184268","full_name":"CogentRedTester/mpv-changerefresh","owner":"CogentRedTester","description":"A script to automatically change the refresh rate of the current display to match the playing video","archived":false,"fork":false,"pushed_at":"2024-03-05T19:33:48.000Z","size":69,"stargazers_count":35,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-19T18:49:35.263Z","etag":null,"topics":["display-switcher","mpv-player","mpv-script","refresh-rates"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CogentRedTester.png","metadata":{"files":{"readme":"README.md","changelog":"change-refresh.lua","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-01T04:15:19.000Z","updated_at":"2024-11-06T18:09:17.000Z","dependencies_parsed_at":"2024-01-15T19:44:01.671Z","dependency_job_id":"4f718a1c-e5c7-4bbf-8405-6db70bd9dc9f","html_url":"https://github.com/CogentRedTester/mpv-changerefresh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CogentRedTester%2Fmpv-changerefresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CogentRedTester%2Fmpv-changerefresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CogentRedTester%2Fmpv-changerefresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CogentRedTester%2Fmpv-changerefresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CogentRedTester","download_url":"https://codeload.github.com/CogentRedTester/mpv-changerefresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225627378,"owners_count":17498972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["display-switcher","mpv-player","mpv-script","refresh-rates"],"created_at":"2024-08-04T14:01:02.049Z","updated_at":"2024-11-20T20:31:25.582Z","avatar_url":"https://github.com/CogentRedTester.png","language":"Lua","funding_links":[],"categories":["Video"],"sub_categories":[],"readme":"# change-refresh\n\nThis script uses nircmd (windows only) to change the refresh rate of the display that the mpv window is currently open in\nThis was written because I could not get autospeedwin to work :(\n\nThe script uses a hotkey by default, but can be setup to run on startup.\n\n## Behaviour\nWhen the script is activated it will automatically detect the refresh rate of the current video and attempt to change the display\nto the closes rate on the whitelist. The script will keep track of the original refresh rate of the monitor and revert when either the\ncorrect keybind is pressed, or when mpv exits. The original rate needs to be included on the whitelist and follows\ncustom rate rules (i.e. if the monitor was originally 25Hz and the whitelist contains `25-50`, then it will revert to 50).\n\n## Rate Whitelist\nIf the display does not support the specified resolution or refresh rate it will silently fail\nIf the video refresh rate does not match any on the whitelist it will pick the next highest.\nIf the video fps is higher than any on the whitelist it will pick the highest available\nThe whitelist is specified via the script-opt `rates`. Valid rates are separated via semicolons, do not include spaces and list in ascending order.\n    \n    changerefresh-rates=\"23;24;30;60\"\n\n### Custom Rates\nYou can also set a custom display rate for individual video rates using a hyphen:\n    \n    changerefresh-rates=\"23;24;25-50;30;60\"\nThis will change the display to 23, 24, and 30 fps when playing videos in those same rates, but will change the display to 50 fps when\nplaying videos in 25 Hz\n\n## Monitor Detection\nThe script automatically detects which monitor the mpv window is currently loaded on, and will save the original resolution and rate to revert to.\nThe original resolution is found by quickly switching to and from fullscreen mode, but if the resolution of the monitor never changes then this\nautomatic check can be disabled and the dimensions manually set in the config file.\n\nNote that if the mpv window is lying across multiple displays it may not save the original refresh rate of the correct display\n\n## UHD Mode\nThe script will always use the current dimensions of the monitor when switching refresh rates,\nhowever I have an UHD mode (option is UHD_adaptive) hardcoded to use a resolution of 3840x2160p for videos with a height of \u003e 1440 pixels.\nThis will cause the display to switch to UHD for UHD video, and back to the previous resolution for any other video. This is only useful if your computer\ncan handle playing UHD files directly, but not upscaling to UHD.\n\n\n## Keybinds\nThe keybind to switch refresh rates is f10 by default, but this can be changed by setting different script bindings in input.conf.\nThe keybinds, and their behaviour are as follows:\n\n    f10         match-refresh           detects the video fps and attempts to change the monitor refresh\n    Ctrl+f10    revert-refresh          revert the display to the original refresh rate\n                toggle-fps-type         switch between using the estimated and specified fps for the video\n                set-default-refresh     set the current resolution/refresh as the default\n\n## Script Messages\nYou can also send refresh change commands directly using script messages:\n    \n    script-message change-refresh [width] [height] [rate] [display]\n\nDisplay stands for the display number (starting from 0) which is printed to the console when the display is changed.\nLeaving out this argument will auto-detect the currently used monitor, like the usual behaviour.\n\nThese script messages completely bypass the whitelist and rate associations and are sent to nircmd directly, so make sure you send a valid integer.\nThey are also completely independant from the usual automatic reversion system, so you'll have to handle that yourself.\n\n\n## Configuration\nSee `changerefresh.conf` for the full options list, this file can be placed into the script-opts folder inside the mpv config directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCogentRedTester%2Fmpv-changerefresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCogentRedTester%2Fmpv-changerefresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCogentRedTester%2Fmpv-changerefresh/lists"}