Files
dotfiles/.config/mpv/mpv.conf##default
2025-11-18 23:48:27 -08:00

173 lines
5.0 KiB
Plaintext

profile=high-quality
user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
glsl-shaders="" # Disable heavy shaders for regular content
# glsl-shaders="~~/shaders/ArtCNN_C4F32_DS.glsl"
# glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
scale=spline36 # Faster than ewa_lanczos for high-res video when shaders are off
dither=fruit # Lighter dithering aimed at 8-bit or FRC panels
# --- Window & interface ---
ontop=yes
border=no
no-border
autofit=50% # Start at half of the screen to avoid oversized windows on UHD displays
osc=no
blend-subtitles=video # Keeps subtitles composited into the video plane
opengl-early-flush=no # Delay buffer flushes to reduce micro-stutter on some GPUs
# --- Subtitle defaults ---
sub-font="JetBrainsMono Nerd Font"
sub-font-size=45
sub-auto=fuzzy
slang=en,eng
subs-with-matching-audio=no
sub-fix-timing=yes
sub-ass-override=scale
sub-gauss=1.0
sub-gray=yes
sub-pos=90
# --- Audio chain ---
volume=75
ao=pipewire,pulse
audio-spdif=ac3,dts-hd,truehd
audio-stream-silence=yes # Keep the device primed to avoid startup pops
audio-wait-open=0.1 # Shorten audio device warm-up for snappier playback
# --- Networking & remote sources ---
ytdl-format=bestvideo+bestaudio/best
ytdl-raw-options=sub-langs=en.*,write-auto-subs=
ytdl-raw-options-append=sponsorblock-mark=all
ytdl-raw-options-append=sponsorblock-remove=sponsor,selfpromo,interaction
# --- Video output & decoding ---
vo=gpu-next
hwdec=nvdec
hwdec-codecs=all
gpu-api=vulkan
gpu-context=waylandvk
vulkan-queue-count=2
vulkan-async-compute=yes # Use independent compute queues for tone mapping/shaders
vulkan-async-transfer=yes # Parallelize frame uploads to free the graphics queue
vd-lavc-dr=yes # Direct rendering keeps frames resident on the GPU longer
vd-lavc-threads=0 # Let ffmpeg auto-pick the optimal thread count
video-sync=display-resample # Smoothly match video speed to the display refresh
# --- Scaling, interpolation, and dithering ---
scale=ewa_lanczossharp
dscale=catmull_rom
cscale=ewa_lanczos
tscale=oversample
interpolation=yes
interpolation-preserve=no
interpolation-threshold=0.5 # Only blend nearby frames to reduce SOE artifacts
sigmoid-upscaling=yes # Protect highlights when upscaling SDR video
temporal-dither=yes # Prefer temporal noise over spatial patterns on SDR panels
# Dithering presets reference:
# fruit -> 8-bit / 8-bit + FRC displays
# ordered -> True 10-bit / 12-bit displays
# error-diffusion -> High-end GPUs
dither=error-diffusion
dither-depth=auto
error-diffusion=sierra-lite # Balanced diffusion kernel for 8-bit panels
# --- Antiring controls ---
scale-antiring=0.5
dscale-antiring=0.5
cscale-antiring=0.5
# --- Post-processing ---
deband=yes
deband-iterations=2
deband-threshold=24
deband-range=16
deband-grain=4
# --- IPC & automation ---
input-ipc-server=/tmp/mpvsocket # Allows external tools (e.g., SVP) to control mpv
# --- Screenshot workflow ---
screenshot-format=webp
screenshot-webp-lossless=yes
screenshot-high-bit-depth=yes
screenshot-sw=no # Force GPU path so tone mapping stays consistent
screenshot-directory="/truenas/sudacode/pictures/mpv"
screenshot-template="%f-%wH.%wM.%wS.%wT-#%#00n"
# --- Session persistence ---
save-position-on-quit
watch-later-dir="~~/.watch-later"
resume-playback=yes
save-watch-history
watch-history-path="~~/state/watch_history.jsonl"
# --- HDR/SDR hints ---
target-colorspace-hint=yes
# --- Caching & buffers ---
cache=yes
demuxer-max-bytes=1GiB # Buffer up to 1 GiB for high-bitrate remuxes
demuxer-max-back-bytes=200MiB # Keep recent data handy for quick reverse seeks
cache-secs=30
demuxer-readahead-secs=30
[anime]
profile-desc="Anime upscaling with ArtCNN"
glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
scale=ewa_lanczossharp
dither=error-diffusion
deband=yes # Crucial for anime gradients
[movies]
profile-desc="Movies and TV shows"
profile-cond=width >= 1920 and filename:match("mkv$|mp4$")
glsl-shaders=""
scale=ewa_lanczos
target-peak=800
[hdr]
target-colorspace-hint=yes
tone-mapping-param=0.5
tone-mapping-max-boost=2.0
allow-delayed-peak-detect=yes
# For SDR content on HDR display (or vice versa)
icc-profile-auto=yes
[svp]
interpolation=no
input-ipc-server=/tmp/mpvsocket
hr-seek-framedrop=no
resume-playback=no
[Idle]
profile-cond=p["idle-active"]
profile-restore=copy-equal
title=' '
keepaspect=no
[immersion]
cookies=yes
cookies-file=/truenas/sudacode/japanese/cookies.Japanese.txt
ytdl-raw-options=mark-watched=,write-auto-subs=,sub-langs=ja.*
ytdl-raw-options-append=cookies=/truenas/sudacode/japanese/cookies.Japanese.txt
ytdl-raw-options-append=sponsorblock-mark=all
ytdl-raw-options-append=sponsorblock-remove=sponsor,selfpromo,interaction
ytdl-format=bestvideo+bestaudio/best
sub-auto=fuzzy
slang=ja,jpn
alang=ja,jpn
vlang=ja,jpn
glsl-shaders="~~/shaders/ArtCNN_C4F32.glsl"
scale=ewa_lanczossharp
dither=error-diffusion
deband=yes # Crucial for anime gradients
[anime-subs]
profile-cond=p["slang"] == "ja" or p["slang"] == "ja.hi"
sub-font="Noto Sans CJK JP"
sub-font-size=42
sub-border-size=1.2
sub-shadow-color=0.0/0.0/0.0/0.6
sub-shadow-offset=3
sub-hinting=light