summary refs log tree commit diff
path: root/.config/mpv/config
blob: c0c6b21484f696dc78e11af62ca5f8c3bd04cb6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# MPV Configuration

autoload-files=no
input-ipc-server=/run/user/1000/mpv
script-opts=ytdl_hook-ytdl_path=/usr/bin/yt-dlp,ytdl_hook-all_formats=yes

#
# Video
#
vo=gpu-next
hwdec=auto-copy
# framedrop=decoder+vo
video-sync=display-resample
# interpolation
window-maximized=yes # prevent wayland problems with buffer resize

# colour shit
hdr-compute-peak=no
# icc-profile=~~/B140QAN02_0.icm
# tone-mapping=mobius
# target-peak=500

#
# Audio
#
alang=jpn,ja,eng,en,ger,de
volume-max=200
audio-channels=auto-safe
audio-file-auto=fuzzy
#af="acompressor=ration=4,loudnorm"
# bs2b filter
# af-add=lavfi=[bs2b=profile=jmeier] #default,cmoy

#
# Subtitles
#
slang=eng,en,ger,de

sub-font=Rosario
sub-font-size=52
sub-blur=0.2
sub-border-color=0.0/0.0/0.0/1.0
sub-border-size=3.0
sub-color=1.0/1.0/1.0
sub-margin-x=100
sub-margin-y=50
sub-shadow-color=0.0/0.0/0.0/0.25
sub-shadow-offset=0

sub-fix-timing=yes
sub-ass-vsfilter-blur-compat=no
# sub-ass-force-style=Kerning=yes

# Some settings fixing VOB/PGS subtitles
# (creating blur & changing yellow subs to gray)
sub-gauss=1.0
sub-gray=yes

#Forces showing subtitles while seeking through the video
demuxer-mkv-subtitle-preroll=yes

#
# OSD
#
osc=no
osd-bar=no
border=no
#
keep-open=yes
stop-screensaver=yes
cursor-autohide=100
cursor-autohide-fs-only
#osd-font="Iosevka Aile"
osd-font=monospace
# osd-font-size=15
# osd-border-size=2
# osd-scale-by-window=yes
# osd-fractions=yes
hidpi-window-scale
load-stats-overlay=yes
load-osd-console=yes
keepaspect-window=yes
autofit-larger=80%x90%

#
# Misc.
#
screenshot-directory=~/Pictures/screenshots/mpv
screenshot-template='%tY%tm%td-%tH%tM%tS-%F-%p'
# screenshot-format=png
# screenshot-jpeg-quality=100
ytdl-format=bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4,best
#ytdl-raw-options=prefer-free-formats=true

#
# PROFILES
#

[protocol.http]
profile-desc="Optimized for streaming video"
glsl-shaders-clr
title="${media-title}"
ytdl-format=bestvideo[height<=?1080]+bestaudio/best[height<=?1080]
demuxer-seekable-cache=yes
demuxer-max-bytes=2048MiB
demuxer-max-back-bytes=1024MiB
script=~/.config/mpv/scripts/mpv-plugin-streamcache/streamcache.lua

[protocol.https]
profile=protocol.http

[url.googledrive.balena]
# profile=protocol.http
profile-cond=not not string.match(get('path'), 'drive.google.com')
cookies-file=~/Downloads/cookies.balena_google_drive.txt
ytdl-raw-options=cookies=~/Downloads/cookies.balena_google_drive.txt

[url.youtube]
profile=protocol.http
profile-cond=not not string.match(get('path'), 'youtube.com')
# ytdl-raw-options=cookies=~/Downloads/cookies.balena_google_drive.txt

[hq]
profile-desc="Optimized for HQ rendering"
# profile-cond=height <= 1440
profile=gpu-hq

[anime]
profile-desc="Optimized for watching anime with ASS subtitles"
sub-auto=fuzzy
deband=yes
# sub-border-size=2
# sub-font-size=45
# sub-margin-y=50
# sub-spacing=1
ordered-chapters-files=/tmp/mpv_ordered_chapters

[cache]
profile=protocol.http

[scale]
profile-desc="Use fancy scaling algorithms"
glsl-shaders-clr
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=ewa_lanczossharp
correct-downscaling=yes
sigmoid-upscaling=yes

# [gpuscale]
# profile-desc="Use GLSL shaders to scale via GPU (FSRCNNX)"
# profile=gpu-hq
# hwdec=auto-copy
# gpu-api=opengl
# fbo-format=rgba16f
# cscale=mitchell
# dscale=mitchell
# linear-downscaling=no
# glsl-shaders-clr
# glsl-shaders=~~/shaders/default-shader-pack/shaders/FSRCNNX_x2_8-0-4-1.glsl
# glsl-shaders=~~/shaders/default-shader-pack/shaders/KrigBilateral.glsl
# glsl-shaders=~~/shaders/default-shader-pack/shaders/SSimDownscaler.glsl

# [gpuscale-high]
# profile-desc="Use GLSL shaders to scale via GPU (FSRCNNX x16)"
# profile=gpu-hq
# hwdec=auto-copy
# gpu-api=opengl
# fbo-format=rgba16f
# cscale=mitchell
# dscale=mitchell
# linear-downscaling=no
# glsl-shaders-clr
# glsl-shaders=~~/shaders/default-shader-pack/shaders/FSRCNNX_x2_16-0-4-1.glsl
# glsl-shaders=~~/shaders/default-shader-pack/shaders/KrigBilateral.glsl
# glsl-shaders=~~/shaders/default-shader-pack/shaders/SSimDownscaler.glsl

[interpolate]
profile-desc="Increase framecount by interpolating (with vapoursynth)"
profile=gpu-hq
vf-toggle=@vsfmt:format=yuv420p
vf-toggle=@vsscale:scale=w=-1:h=540
vf-toggle=@vs:vapoursynth=~~/vapoursynth/interpolate.vpy:4:4
sws-scaler=spline

[svp]
profile-desc="[irrelevant] Integrate with SVP"
# Everything below here only applies to this profile until another profile is declared!
input-ipc-server=/tmp/mpvsocket     # Receives input from SVP
hr-seek-framedrop=no                # Fixes audio desync
resume-playback=no                  # Not compatible with SVP
hwdec=auto-copy
hwdec-codecs=all
autofit-larger=100%x100%

[reset]
profile-desc="Reset everything to vanilla mpv"
profile=default
load-scripts=no
osc=yes
osd-bar=yes

[3d]
profile-desc="[irrelevant] Transform 3d video file to 2d"
vf-add='stereo3d:ab2l:ml'

[skip-silence]
profile-desc="Skip over silent parts"
af-add='silenceremove=0:0:0:-1:0.001:-45dB:0:rms'

[webcam]
profile-desc="Optimized for showing internal webcam feed"
osc=no
profile=low-latency
# video-sync=display-desync # needed or external audio will fail
# demuxer-lavf-o=input_format=mjpeg,video_size=848x480
# framedrop=no
# no-demuxer-thread
opengl-glfinish=yes
opengl-swapinterval=0
vf-add=hflip

[downmix]
ad-lavc-downmix=no
# == pan ==
# <output channel layout> | <output channel definition>
# FL = front left
# FC = front center
# BL = back left
# SL = side left
# LFE = low frequency
#
# == dynaudnorm ==
# g (gausssize): 3-301 (must be odd; default: 31), window size (in frames) of smoothing filter around current frame
#   larger: stronger smoothing -> less gain variation
# f (framelen): 10-8000 ms (default: 500), length of the section of audio used to detect peaks
# r (targetrms): 0.0-1.0 (default: 0.0 disabled), use RMS (root mean square) of signal instead of peak - better approx. of "perceived loudness"
#   adjusts frames to a constant RMS value
# p (peak): (default: 0.95 leaves 5% headroom), target peak value
#af-add='lavfi=[pan=2.1| FL < FC+0.8FL+0.1*BL+0.1*SL | FR < FC+0.8*FR+0.1*BR+0.1*SR | LFE < LFE,dynaudnorm=g=41:f=700:r=0.9]'
#af-add='lavfi=[pan=5.1| FL < 0.8*FL | FR < 0.8*FR | LFE < LFE | FC < FC | BL < BL | BR < BR,dynaudnorm=g=41:f=700:r=0.9]'
af-add='lavfi=[pan=5.1| FL = 0.5*FL | FR = 0.5*FR | LFE = LFE | FC = FC | BL = 0.3*BL | BR = 0.3*BR]'

# image viewer settings

[mvi]
profile-desc="mpv image viewer"
profile=gpu-hq
sub-auto=no
audio-file-auto=no
term-status-msg=
title="${?media-title:${media-title}}${!media-title:No file} - mvi"
video-aspect-override=no
loop-file=inf
image-display-duration=inf
input-conf=~/.config/mvi/input.conf

[extension.jpg]
profile=mvi
[extension.png]
profile=mvi
[extension.gif]
profile=mvi