parch-mpv/etc/mpv/mpv.conf

273 lines
9 KiB
Text

######
# UI #
######
no-border # hide the window title bar
msg-color=yes # color log messages on terminal
term-osd-bar=yes # display a progress bar on the terminal
no-hidpi-window-scale # used on 5K iMac to prevent scaling by OSX
force-window=immediate # Do not wait with showing the video window until it has loaded. (This will
# resize the window once video is loaded. Also always shows a window with
# audio.)
# fs=yes # Start in fullscreen mode by default.
# force starting with centered window
geometry=40%:60%
# don't allow a new window to have a size larger than 90% of the screen size
autofit-larger=60%x60%
# Do not close the window on exit.
#keep-open=yes
# Disable the On Screen Controller (OSC).
osc=no
# Keep the player window on top of all other windows.
ontop=no
###########
# General #
###########
# Main reference:
# https://mpv.io/manual/master/
--keep-open # Don't terminate if the current file is the last playlist entry.
--save-position-on-quit # Always save the current playback position on quit.
#showFileNameInTitle
script-opts='osc-title=${filename}'
#ScreenShot
screenshot-format=jpg
screenshot-jpeg-quality=100
screenshot-high-bit-depth=yes
screenshot-directory="~/Pictures/ScreenShot/mpv"
# OpenGL settings
gpu-api=opengl
# Vulkan settings
# gpu-api=vulkan
# vulkan-async-compute=yes
# vulkan-async-transfer=yes
# vulkan-queue-count=1
# vd-lavc-dr=yes
# Enable hardware decoding if available.
hwdec=auto
reset-on-next-file=audio-delay,mute,pause,speed,sub-delay,video-aspect-override,video-pan-x,video-pan-y,video-rotate,video-zoom,volume
##############
# Colorspace #
##############
# see https://github.com/mpv-player/mpv/wiki/Video-output---shader-stage-diagram
target-prim=auto
# target-prim=bt.709 # target Rec.709 for SDR TVs
# target-prim=bt.2020 # target Rec.2020 (wide color gamut) for HDR TVs
target-trc=auto
gamma-auto
vf=format=colorlevels=full:colormatrix=auto
video-output-levels=full
#########################
# Motion Interpolation #
#########################
override-display-fps=60
video-sync=display-resample
interpolation=yes
tscale=oversample # smoothmotion
################
# Anti-Ringing #
################
scale-antiring=0.7 # luma upscale deringing
dscale-antiring=0.7 # luma downscale deringing
cscale-antiring=0.7 # chroma upscale deringing
# Enable fuzzy searching for subtitles.
sub-auto=fuzzy
# Display English subtitles if available.
slang=en,eng,english
# Play Farsi audio if available, fall back to English otherwise.
alang=fa,en
# Set max volume to 100%
volume-max=150
volume=75
# Change title to filename instead of media-title
title='${filename} - mpv'
script-opts='osc-title=${filename}'
# Save video's volume amount and position
# It's when you quit mpv without killing the instance (not working with Shift+Q)
save-position-on-quit
# Adjusting the window size for music.
[extension.mp3]
geometry=250x250
# If webm file is selected, playback forever.
[extension.webm]
loop-file=inf
# If gif file is selected, playback forever.
[extension.gif]
loop-file=inf
# If image is selected, keep it forever.
image-display-duration=inf
###################################
# Protocol Specific Configuration #
###################################
# Pretend to be a web browser. Might fix playback with some streaming sites,
# but also will break with shoutcast streams.
user-agent="Mozilla/5.0"
[protocol.http]
hls-bitrate=max # use max quality for HLS streams
cache=yes
no-cache-pause # don't pause when the cache runs low
[protocol.https]
profile=protocol.http
[protocol.ytdl]
profile=protocol.http
# youtube-dl video quality configuration
# ytdl-format=bestvideo[height<=480]+bestaudio/best[height<=480]
# ytdl-format=bestvideo[height<=720]+bestaudio/best[height<=720]
# ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]
# ytdl-format=bestvideo[height<=2160]+bestaudio/best[height<=2160]
ytdl-format=auto
# Misc
## youtube-dl subtitle configuration (non-auto-generated subtitles)
## Swith to yt-dlp
script-opts=ytdl-all-subs,ytdl_hook-ytdl_path=yt-dlp
########################################################################## FOR SCRIPTS ###########################################################################
[Idle]
profile-cond=p["idle-active"]
profile-restore=copy-equal
keepaspect=no
background=1
cursor-autohide=1000 # autohide the curser after 1s
#############################################################
# Upscaling & Processing Based on Source Video's Resolution #
#############################################################
# Chroma subsampling means that chroma information is encoded at lower resolution than luma
# In MPV, chroma is upscaled to luma resolution (video size) and then the converted RGB is upscaled to target resolution (screen size)
# For detailed analysis of upscaler/downscaler quality, see https://artoriuz.github.io/blog/mpv_upscaling.html
fbo-format=rgba16f # use with gpu-api=opengl
# fbo-format=rgba16hf # use with gpu-api=vulkan
# fbo-format is not not supported in gpu-next profile
glsl-shaders-clr
# luma upscaling
# note: any FSRCNNX above FSRCNNX_x2_8-0-4-1 is not worth the additional computional overhead
glsl-shaders="~/.config/mpv/shaders/FSRCNNX_x2_8-0-4-1.glsl"
scale=ewa_lanczos
# luma downscaling
# note: ssimdownscaler is tuned for mitchell and downscaling=no
glsl-shaders-append="~/.config/mpv/shaders/SSimDownscaler.glsl"
dscale=mitchell
linear-downscaling=no
# chroma upscaling and downscaling
glsl-shaders-append="~/.config/mpv/shaders/KrigBilateral.glsl"
cscale=mitchell # ignored with gpu-next
sigmoid-upscaling=yes
############
# Profiles #
############
[4k60] # 2160p @ 60fps (3840x2160 UHDTV)
profile-desc=4k60
profile-cond=((width ==3840 and height ==2160) and p["estimated-vf-fps"]>=31)
# deband=yes # necessary to avoid blue screen with KrigBilateral.glsl
deband=no # turn off debanding because presume wide color gamut
interpolation=no # turn off interpolation because presume 60fps
# UHD videos are already 4K so no luma upscaling is needed
# UHD videos are YUV420 so chroma upscaling is still needed
glsl-shaders-clr
# glsl-shaders="~/.config/mpv/shaders/KrigBilateral.glsl" # enable if your hardware can support it
interpolation=no # no motion interpolation required because 60fps is hardware ceiling
# no deinterlacer required because progressive
[4k30] # 2160p @ 24-30fps (3840x2160 UHDTV)
profile-cond=((width ==3840 and height ==2160) and p["estimated-vf-fps"]<31)
# deband=yes # necessary to avoid blue screen with KrigBilateral.glsl
deband=no # turn off debanding because presume wide color gamut
# UHD videos are already 4K so no luma upscaling is needed
# UHD videos are YUV420 so chroma upscaling is still needed
glsl-shaders-clr
# glsl-shaders="~/.config/mpv/shaders/KrigBilateral.glsl" # enable if your hardware can support it
# apply motion interpolation
# no deinterlacer required because progressive
[full-hd60] # 1080p @ 60fps (progressive ATSC)
profile-desc=full-hd60
profile-cond=((width ==1920 and height ==1080) and not p["video-frame-info/interlaced"] and p["estimated-vf-fps"]>=31)
# apply all luma and chroma upscaling and downscaling settings
interpolation=no # no motion interpolation required because 60fps is hardware ceiling
# no deinterlacer required because progressive
[full-hd30] # 1080p @ 24-30fps (NextGen TV/ATSC 3.0, progressive Blu-ray)
profile-desc=full-hd30
profile-cond=((width ==1920 and height ==1080) and not p["video-frame-info/interlaced"] and p["estimated-vf-fps"]<31)
# apply all luma and chroma upscaling and downscaling settings
# apply motion interpolation
# no deinterlacer required because progressive
[full-hd-interlaced] # 1080i @ 24-30fps (HDTV, interlaced Blu-rays)
profile-desc=full-hd-interlaced
profile-cond=((width ==1920 and height ==1080) and p["video-frame-info/interlaced"] and p["estimated-vf-fps"]<31)
# apply all luma and chroma upscaling and downscaling settings
# apply motion interpolation
vf=bwdif # apply FFMPEG's bwdif deinterlacer
[hd] # 720p @ 60 fps (HDTV, Blu-ray - progressive)
profile-desc=hd
profile-cond=(width ==1280 and height ==720)
# apply all luma and chroma upscaling and downscaling settings
interpolation=no # no motion interpolation required because 60fps is hardware ceiling
# no deinterlacer required because progressive
[sdtv-ntsc] # 640x480, 704x480, 720x480 @ 30fps (NTSC DVD - interlaced)
profile-desc=sdtv-ntsc
profile-cond=((width ==640 and height ==480) or (width ==704 and height ==480) or (width ==720 and height ==480))
# apply all luma and chroma upscaling and downscaling settings
# apply motion interpolation
vf=bwdif # apply FFMPEG's bwdif deinterlacer
[sdtv-pal] # 352x576, 480x576, 544x576, 720x576 @ 30fps (PAL broadcast or DVD - interlaced)
profile-desc=sdtv-pal
profile-cond=((width ==352 and height ==576) or (width ==480 and height ==576) or (width ==544 and height ==576) or (width ==720 and height ==576))
# apply all luma and chroma upscaling and downscaling settings
# apply motion interpolation
vf=bwdif # apply FFMPEG's bwdif deinterlacer
[default]
########################################################################## FOR SCRIPTS ###########################################################################