我的mpv插件配置

首先去github上,把scripts文件夹中的脚本都下载下来使用了,然后,在脚本放到~/.config/mpv/文件夹中后,别忘记使用

chmod +x *

命令,让scripts文件夹下面的脚本都具有可执行属性。

在此晒下我的mpv.conf的配置,如下:

# vim: syntax=config

###########
# General #
###########

save-position-on-quit
no-border                               # no window title bar
msg-module                              # prepend module name to log messages
msg-color                               # color log messages on terminal
term-osd-bar                            # display a progress bar on the terminal
use-filedir-conf                        # look for additional config files in the directory of the opened file
#pause                                  # no autoplay
keep-open                               # keep the player open when a file's end is reached
autofit-larger=100%x95%                 # resize window in case it's larger than W%xH% of the screen
deinterlace=yes                        # 'auto' does not imply interlacing-detection
cursor-autohide-fs-only                 # don't autohide the cursor in window mode, only fullscreen
input-media-keys=no                     # enable/disable OSX media keys
cursor-autohide=1000                    # autohide the curser after 1s

screenshot-format=png
screenshot-png-compression=8
screenshot-template='~/Desktop/%F (%P) %n'

hls-bitrate=max                         # use max quality for HLS streams
ytdl-raw-options=format="[protocol!=http_dash_segments][protocol!=rtmp]"


#########
# Cache #
#########

cache=yes
cache-default=81960                     # size in KB  BTW: before is 8000000 it is too big
cache-backbuffer=25000                  # size in KB
cache-initial=0                         # start playback when your cache is filled up with x kB
cache-secs=10                           # how many seconds of audio/video to prefetch if the cache is active


#############
# OSD / OSC #
#############

osd-level=1                             # enable osd and display --osd-status-msg on interaction
osd-duration=2500                       # hide the osd after x ms
osd-status-msg='${time-pos} / ${duration}${?percent-pos: (${percent-pos}%)}${?vo-drop-frame-count:${!vo-drop-frame-count==0: Dropped: ${vo-drop-frame-count}}}\n${?chapter:Chapter: ${chapter}}'

osd-font='Source Sans Pro'
osd-font-size=32
osd-color='#CCFFFFFF'                   # ARGB format
osd-border-color='#DD322640'            # ARGB format
#osd-shadow-offset=1                    # pixel width for osd text and progress bar
osd-bar-align-y=0                       # progress bar y alignment (-1 top, 0 centered, 1 bottom)
osd-border-size=2                       # size for osd text and progress bar
osd-bar-h=2                             # height of osd bar as a fractional percentage of your screen height
osd-bar-w=60                            # width of " " "


#############
# Subtitles #
#############

sub-use-margins
sub-ass-force-margins

demuxer-mkv-subtitle-preroll            # try to correctly show embedded subs when seeking
sub-auto=fuzzy                          # external subs don't have to match the file name exactly to autoload
sub-paths=ass:srt:sub:subs:subtitles    # search for external subs in the listed subdirectories
embeddedfonts=yes                       # use embedded fonts for SSA/ASS subs
sub-fix-timing=no                       # do not try to fix gaps (which might make it worse in some cases)
sub-ass-force-style=Kerning=yes         # allows you to override style parameters of ASS scripts

sub-font-size=48            # Font Size UPDATE: 2017-02-20
sub-codepage=utf8:gb18030       # for support Chinese

# the following options only apply to subtitles without own styling (i.e. not ASS but e.g. SRT)
#sub-font="Source Sans Pro Semibold"
#sub-font-size=36
#sub-color="#FFFFFFFF"
#sub-border-color="#FF262626"
#sub-border-size=3.2
#sub-shadow-offset=1
#sub-shadow-color="#33000000"
#sub-spacing=0.5


#############
# Languages #
#############

#slang=enm,en,eng,de,deu,ger             # automatically select these subtitles (decreasing priority)
#alang=en,eng,de,deu,ger       # automatically select these audio tracks (decreasing priority)


#########
# Audio #
#########

audio-file-auto=fuzzy                   # external audio doesn't has to match the file name exactly to autoload
audio-pitch-correction=yes              # automatically insert scaletempo when playing with higher speed
volume-max=200                          # maximum volume in %, everything above 100 results in amplification
volume=100                              # default volume, 100 = unchanged


################
# Video Output #
################

# Active VOs (and some other options) are set conditionally
# See here for more information: https://github.com/wm4/mpv-scripts/blob/master/auto-profiles.lua
# The script was slightly modified, functions from scripts/auto-profiles-functions.lua are imported

# Defaults for all profiles
vo=opengl
tscale=linear


[high-quality]
profile-desc=cond:is_desktop() and get('width', math.huge) < 3840
scale=ewa_lanczossharp
cscale=ewa_lanczossoft
dscale=mitchell
scale-antiring=0.7
cscale-antiring=0.7
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes

[mid-quality]
profile-desc=cond:(is_laptop() and not on_battery() and get('width', math.huge) < 1920) or (is_desktop() and get('width', math.huge) >= 3840)
scale=spline36
cscale=bilinear
dscale=mitchell
scale-antiring=1.0
cscale-antiring=1.0
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes

[low-quality]
profile-desc=cond:is_laptop() and (on_battery() or get('width', math.huge) >= 1920)
scale=bilinear
cscale=bilinear
dscale=bilinear
scale-antiring=0.0
cscale-antiring=0.0
dither-depth=no
correct-downscaling=no
sigmoid-upscaling=no
deband=no

[60FPS]
profile-desc=cond:is_laptop() and get('container-fps', 0) >= 59
scale=bilinear
cscale=bilinear

[4K]
profile-desc=cond:get('width', -math.huge) >= 3840
vd-lavc-threads=32

[4K-inverted]
profile-desc=cond:get('width', -math.huge) < 3840
vd-lavc-threads=0


[default]


###################################
# Protocol Specific Configuration #
###################################

[protocol.https]
#cache=yes
#cache-default=500000                    # size in KB
#cache-backbuffer=250000                 # size in KB
cache-secs=100                          # how many seconds of audio/video to prefetch
user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0'

[protocol.http]
#cache=yes
#cache-default=500000                    # size in KB
#cache-backbuffer=250000                 # size in KB
cache-secs=100                          # how many seconds of audio/video to prefetch
user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0'

[extension.gif]
cache=no
no-pause
loop-file=yes

[extension.webm]
#cache=no
#no-pause
#loop-file=yes

在配置好了之后,我们的mpv还缺少一个功能,有些视频没有字幕需要我们在线匹配,在github上面,有一个非常好的插件可以使用来匹配中文字幕,地址如下:

mpv-assrt

猜你喜欢

转载自blog.csdn.net/lz710117239/article/details/80209181