Video

MPV youtube-quality

Rina Kawakita 2020. 1. 8. 23:50

MPV youtube-quality

A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly, as though you were using the web player.

 

https://github.com/jgreco/mpv-youtube-quality

 

jgreco/mpv-youtube-quality

A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly - jgreco/mpv-youtube-quality

github.com

~/.config/mpv/script-opts/youtube-quality.conf

# KEY BINDINGS

# invoke or dismiss the quality menu
toggle_menu_binding=ctrl+u
# move the menu cursor up
up_binding=UP
# move the menu cursor down
down_binding=DOWN
# select menu entry
select_binding=ENTER

# formatting / cursors
selected_and_active=▶ - 
selected_and_inactive=● - 
unselected_and_active=▷ - 
unselected_and_inactive=○ - 

# font size scales by window, if false requires larger font and padding sizes
scale_playlist_by_window=no

# playlist ass style overrides inside curly brackets, \keyvalue is one field, extra \ for escape in lua
# example {\\fnUbuntu\\fs10\\b0\\bord1} equals: font=Ubuntu, size=10, bold=no, border=1
# read http://docs.aegisub.org/3.2/ASS_Tags/ for reference of tags
# undeclared tags will use default osd settings
# these styles will be used for the whole playlist. More specific styling will need to be hacked in
#
# (a monospaced font is recommended but not required)
style_ass_tags={\fnSpoqaHanSansJP\i0\shad0.5\fs30\bord1\c&H9aa7c0>&\3a&H00&}

# paddings for top left corner
text_padding_x=800
text_padding_y=100


# how many seconds until the quality menu times out
menu_timeout=10

#use youtube-dl to fetch a list of available formats (overrides quality_strings)
fetch_formats=yes

# list of ytdl-format strings to choose from
quality_strings=[ {"4320p" : "bestvideo[height<=?4320p]+bestaudio/best"}, {"2160p" : "bestvideo[height<=?2160]+bestaudio/best"}, {"1440p" : "bestvideo[height<=?1440]+bestaudio/best"}, {"1080p" : "bestvideo[height<=?1080]+bestaudio/best"}, {"720p" : "bestvideo[height<=?720]+bestaudio/best"}, {"480p" : "bestvideo[height<=?480]+bestaudio/best"}, {"360p" : "bestvideo[height<=?360]+bestaudio/best"}, {"240p" : "bestvideo[height<=?240]+bestaudio/best"}, {"144p" : "bestvideo[height<=?144]+bestaudio/best"} ]