Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Samillion/mpv-boxtowide
A simple mpv script to change 4:3 aspect-ratio of video files/streams to 16:9 automatically.
https://github.com/Samillion/mpv-boxtowide
mpv mpv-player mpv-script
Last synced: 2 months ago
JSON representation
A simple mpv script to change 4:3 aspect-ratio of video files/streams to 16:9 automatically.
- Host: GitHub
- URL: https://github.com/Samillion/mpv-boxtowide
- Owner: Samillion
- License: agpl-3.0
- Created: 2018-06-06T23:24:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-11T04:14:41.000Z (3 months ago)
- Last Synced: 2024-11-11T05:21:14.701Z (3 months ago)
- Topics: mpv, mpv-player, mpv-script
- Language: Lua
- Homepage:
- Size: 3.4 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mpv - BoxToWide - A simple mpv script to change 4:3 aspect-ratio of video files/streams to 16:9 automatically. (Video)
README
## mpv-boxtowide
![Terminal](https://github.com/user-attachments/assets/ee932972-4b86-494d-973e-a286e6cdf078)This script detects if a video has a 4:3 aspect ratio and automatically adjusts it to 16:9 (wide).
It is designed for libraries with older 4:3 content, stretching them to 16:9 without manual intervention. The script aligns with my preference for a simple [mpv configuration](https://github.com/Samillion/mpv-conf) to fit this straightforward use case.
## Options
To adjust options, simply change the values inside `local options` within the script.```lua
local options = {
-- target aspect ratio for conversion
target_ratio = "16:9",-- usually 4:3 would only need 1.3333
-- many old videos use weird ratios, this min/max range covers most of them
min_ratio = 1.28,
max_ratio = 1.39,-- file extensions the script will do a ratio check on
video_exts = {
"3g2", "3gp", "asf", "avi", "f4v", "flv", "m2t", "m2ts", "m4v", "mj2",
"mkv", "mov", "mp4", "mpeg", "mpe", "mpg", "mts", "ogv", "rmvb", "ts",
"webm", "wmv", "y4m"
},-- regex to detect urls (for ytdl videos)
url_pattern = "^%a+://",
}
```## How to install
Simply place `boxtowide.lua` in the corresponding mpv scripts location of your operating system:- Windows: `%APPDATA%\mpv\scripts\` or `C:\users\USERNAME\AppData\Roaming\mpv\scripts\`
- Linux: `~/.config/mpv/scripts/` or `/home/USERNAME/.config/mpv/scripts/`
- Mac: `~/.config/mpv/scripts/` or `/Users/USERNAME/.config/mpv/scripts/`> [!NOTE]
> More information about files locations can be found [here](https://mpv.io/manual/master/#files)```
config/mpv
│ input.conf
│ mpv.conf
│
└───scripts
boxtowide.lua
```