Skip to content

Instantly share code, notes, and snippets.

@Quackdoc
Last active December 30, 2023 21:04
Show Gist options
  • Save Quackdoc/bacd7f5eb78df5fffdca08c0e9720563 to your computer and use it in GitHub Desktop.
Save Quackdoc/bacd7f5eb78df5fffdca08c0e9720563 to your computer and use it in GitHub Desktop.
mpv testing conf
#s cycle tone-mapping
#A cycle target-trc
#a cycle target-prim
## These kinda suck to actually use without macro pad
Ctrl+! set vid 1
Ctrl+@ set vid 2
Ctrl+# set vid 3
Ctrl+$ set vid 4
F1 set vid 1
F2 set vid 2
F3 set vid 3
F4 set vid 4
F13 set aid 1
F14 set aid 2
CTRL+1 no-osd change-list glsl-shaders set "~~/shaders/FSR.glsl"; show-text "FSR"
CTRL+2 no-osd change-list glsl-shaders set "~~/shaders/NVSharpen.glsl;~~/shaders/FSR.glsl" ; show-text "FSR-NV"
CTRL+3 no-osd change-list glsl-shaders set "~~/shaders/NVScaler.glsl"; show-text "NVscaler"
CTRL+4 no-osd change-list glsl-shaders set "~~/shaders/NVSharpen.glsl"; show-text "NVsharpen"
#CTRL+4 no-osd change-list glsl-shaders set "~~/shaders/FSRCNNX_x2_8-0-4-1.glsl"; show-text "FSRCNNX 8"
#CTRL+5 no-osd change-list glsl-shaders set "~~/shaders/FSRCNNX_x2_16-0-4-1.glsl"; show-text "FSRCNNX 16"
CTRL+6 no-osd change-list glsl-shaders set "~~/shaders/CRT.glsl"; show-text "CRT"
CTRL+7 no-osd change-list glsl-shaders set "~~/shaders/CAS.glsl"; show-text "CAS"
CTRL+0 no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared"
#CTRL+9 cycle target-trc ; show-text "TRC CYCLE"
# vim: syntax=config
border = no # Optional, but recommended
#wayland-edge-pixels-pointer=0
#wayland-edge-pixels-touch=0
log-file=~/.mpv-log.log
profile=video
#vaapi-device=/dev/dri/renderD129
############
# Profiles #
############
#icc-profile=~~/icc/icc.icm
### Screen shots ###
screenshot-format=jxl
screenshot-directory=~/Pictures/mpv
screenshot-jxl-distance=1.0
screenshot-tag-colorspace=yes
screenshot-high-bit-depth=yes
screenshot-jxl-effort=7
#screenshot-webp-lossless=yes
[video]
profile=gpu-hq
vo=gpu-next
gpu-api=vulkan
gpu-context=waylandvk
hwdec=vaapi
vd-lavc-film-grain=auto
ao=pipewire
#geometry=1920x1080
geometry=35%
hr-seek=yes
#log-file=/home/quack/Documents/mpv.log
cscale=mitchell
scale=ewa_lanczos
deband=yes
deband-iterations=16
deband-threshold=64
profile=spline
#### Vsync OFF ####
vulkan-swap-mode=mailbox
#vulkan-swap-mode=immediate
opengl-swapinterval=0
wayland-disable-vsync=yes
video-sync=audio
interpolation=no
#vulkan-async-transfer=yes
#vf=fps=48
### Custom config options ###
#ytdl-format=bestvideo[vcodec*=avc]+bestaudio/best
#ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]
ytdl-format=bestvideo+bestaudio/best
ytdl-raw-options=retries=infinite
ytdl-raw-options=fragment-retries=infinite
#ytdl-raw-options=write-subs=
#slang=eng,en,en-en-nP7-2PuUl7o,en-en,en-it,fra,fre,fr,fr-en-nP7-2PuUl7o,fr-en,fr-it
#sub=0
[spline]
profile-restore=copy
tone-mapping=spline
gamut-mapping-mode=perceptual
hdr-compute-peak=yes
#tone-mapping-mode=luma
hdr-contrast-recovery=0.5
#target-peak=100
[comp]
input-ipc-server=/tmp/mpvsocket
profile=video
screenshot-format=png
screenshot-directory=~/Pictures/mpv
screenshot-jxl-distance=1.0
screenshot-tag-colorspace=no
screenshot-high-bit-depth=yes
screenshot-jxl-effort=7
#screenshot-webp-lossless=yes
[SDR]
#profile-cond=get('video-params/gamma','pq') ~= "pq" and get('video-params/gamma','hlg') ~= "hlg"
#gpu-api=d3d11
target-trc=pq
target-prim=bt.2020
gamut-mapping-mode=perceptual
hdr-compute-peak=no
tone-mapping=spline
inverse-tone-mapping=no
target-colorspace-hint=yes
target-peak=400
[TM]
#target-trc=pq
#target-prim=bt.2020
gpu-api=vulkan
target-peak=400
hdr-compute-peak=no
tone-mapping=bt.2446a
inverse-tone-mapping=no
target-colorspace-hint=no
#sig-peak=1000
[intel]
#profile-cond=p["video-format"] == "av1"
profile-restore=copy
vulkan-device='Intel(R) Arc(TM) A380 Graphics'
#d3d11-adapter=intel
#hwdec=d3d11va
#vd-lavc-film-grain=cpu
vo=gpu-next
#gpu-api=d3d11
target-colorspace-hint=no
[dovihdr]
target-trc=pq
target-prim=bt.2020
target-peak=1000
hdr-compute-peak=no
gpu-api=d3d11
target-colorspace-hint=yes
[bench]
audio=no
untimed=yes
video-sync=display-desync
vulkan-swap-mode=mailbox
opengl-swapinterval=0
wayland-disable-vsync=yes
[image]
profile-cond=get('current-tracks/video/image')
profile-cond=get('current-tracks/audio/none')
image-display-duration=inf
#loop
input-conf=~~/input-pic.conf
background=0/0
alpha
deband=no
scale=nearest
cscale=nearest
dscale=nearest
#scale=spline36
#cscale=spline36
#dscale=mitchell
#correct-downscaling
#sigmoid-upscaling
#linear-downscaling
#linear-upscaling
video-aspect-override=no
dither-depth=no
vo=gpu-next
gpu-api=vulkan
gpu-context=waylandvk
screenshot-format=png
screenshot-directory=~/Pictures/mpv
screenshot-high-bit-depth=yes
[HDR]
vo=gpu-next
gpu-api=vulkan
gpu-context=displayvk
target-colorspace-hint
#target-trc=bt.1886
#target-trc=pq
[HDR-DV]
profile=gpu-hq
vo=gpu-next
hwdec=auto-copy
target-colorspace-hint=yes
hdr-compute-peak=no
target-trc=pq
target-prim=bt.2020
target-peak=1000
[av1]
profile-cond= p["video-format"] == "av1"
profile-restore=copy
hwdec=vaapi-copy
[yt-1440]
ytdl-raw-options='live-from-start='
ytdl-raw-options='download-sections=[#0 - infinite]'
[smooth]
video-sync=display-resample
#vf=fps=60
interpolation=yes
tscale=oversample
interpolation-threshold=1
interpolation-preserve
[HDRTOY-pq]
#profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "pq"
#Empty Profile
[HDRTOY-hlg]
#profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "hlg"
#Empty Profile
[lowlatency]
no-cache
untimed
no-demuxer-thread
video-sync=audio
vd-lavc-threads=1
[LOWFPS]
profile-desc=cond:get('container-fps',0) <= 30 and get('container-fps',0) > 29
vf=fps=fps=60
[LOWERFPS]
profile-desc=cond:get('container-fps',0) <= 24 and get('container-fps',0) > 23
vf=fps=fps=48
[ALMOSTTHERE]
profile-desc=cond:get('container-fps',0) < 48 and get('container-fps',0) > 47
vf=fps=fps=48
##comparison filters
[diff]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference [vo]'
[diffb] #increase gamma to help visibility for low diff images
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d], [d] eq=gamma=2[vo]'
[diffosc]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d],[d]split=2[out][blend],[blend] oscilloscope[h], [out] [h] overlay [vo]'
[diffwave]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d],[d]split=2[out][blend],[blend] waveform[h], [out] [h] overlay [vo]'#https://trac.ffmpeg.org/wiki/WaveformMonitor
[over]
lavfi-complex="[vid2]format=yuva444p,lut=c3=128,negate[video2withAlpha],[vid1][video2withAlpha]overlay[vo]"
##side
[2side]
lavfi-complex='[vid1] [vid2] hstack [vo]' # 2 side by side
[2sidesplit]
--lavfi-complex="[vid1]crop=iw/2:ih:0:0[left], [vid2]crop=iw/2:ih:iw/2:0[right], [left][right]hstack[vo]" #split screen 2
[3side]
lavfi-complex='[vid1] [vid2] hstack [out], [out] [vid3] hstack [vo]' # 3 side by side
[quad]
lavfi-complex='[vid1] [vid2] hstack [out1], [vid3] [vid4] hstack [out2], [out1] [out2] vstack [vo]' # 4 in a quadrant
profile=video
[video]
no-border
gpu-api=vulkan
vo=gpu-next
profile=high-quality
hr-seek
hwdec=auto
target-colorspace-hint=no
## This can sometimes cause issues and need to be disabled
vd-lavc-film-grain=gpu
### Video manipulation ###
scale=ewa_lanczos4sharpest
cscale=mitchell
dscale=catmull_rom
#linear-upscaling
sigmoid-upscaling
## Debanding can sometimes be quite detrimental,
## but most of the content I watch now has bad banding.
deband=yes
deband-iterations=16
deband-threshold=64
dither=error-diffusion
temporal-dither
error-diffusion=floyd-steinberg
## atkinson burkes jarvis-judice-ninke
#temporal-dither-period=1
#### Vsync OFF ####
## Mainly useful for VRR.
vulkan-swap-mode=immediate
opengl-swapinterval=0
d3d11-sync-interval=0
video-sync=audio
interpolation=no
vulkan-async-transfer=yes
## May be useful to set;
#swapchain-depth
#vulkan-queue-count
## Some devices may need exclusive fs
#d3d11-exclusive-fs=yes
### Screenshots ###
screenshot-format=jxl
screenshot-dir=~/Pictures/mpv
#screenshot-jxl-distance=0.5
screenshot-tag-colorspace=no
screenshot-high-bit-depth=yes
screenshot-jxl-effort=4
### YTDL ###
#ytdl-format="bestvideo[vcodec*=av01]+bestaudio/best"
#ytdl-format="bestvideo[height=480]+bestaudio/best"
#ytdl-raw-options=extractor-args=youtube:player_client=ios
#ytdl-format="bestvideo[vcodec*=avc]/bestvideo[vcodec*=av01]+bestaudio/best"
#ytdl-format="bestvideo+bestaudio/best"
ytdl-raw-options=cookies-from-browser=firefox
## Potato time
#ytdl-format=bestvideo[height=144]+bestaudio
#ytdl-format=598+599
profile=spline
[image]
profile-cond=get('current-tracks/video/image')
profile-cond=get('current-tracks/audio/none')
image-display-duration=inf
#loop
input-conf=~~/input-pic.conf
background=0/0
alpha
deband=no
scale=nearest
cscale=nearest
dscale=nearest
video-aspect-override=no
dither-depth=no
### Screenshots ###
screenshot-format=png
screenshot-dir=~/Pictures/mpv
screenshot-tag-colorspace=no
screenshot-high-bit-depth=yes
### Specific ###
[intel]
profile-cond=p["video-format"] == "av1"
profile-restore=copy
vulkan-device='Intel(R) Arc(TM) A380 Graphics'
d3d11-adapter=intel
d3d11va-zero-copy=no
hwdec=d3d11va
vd-lavc-film-grain=gpu
vo=gpu-next
gpu-api=vulkan
## setting it here just in case, since it will crash
## if this is enabled and tries to do it on main display
target-colorspace-hint=no
[spline]
profile-restore=copy
tone-mapping=spline
gamut-mapping-mode=perceptual
hdr-compute-peak=yes
#tone-mapping-mode=luma
hdr-peak-percentile=99.995
hdr-contrast-recovery=0.5
hdr-contrast-smoothness=2.0
#target-peak=100
[dovihdr]
#profile-cond=TODO
target-trc=pq
target-prim=bt.2020
target-peak=1000
hdr-compute-peak=no
gpu-api=d3d11
target-colorspace-hint=yes
d3d11va-zero-copy=yes
[HDR]
#profile-cond=get('video-params/gamma','pq') ~= "pq" and get('video-params/gamma','hlg') ~= "hlg"
gpu-api=d3d11
target-colorspace-hint=yes
d3d11va-zero-copy=yes
hdr-compute-peak=no
[TM]
#target-trc=pq
#target-prim=bt.2020
gpu-api=vulkan
target-peak=400
hdr-compute-peak=no
tone-mapping=bt.2446a
inverse-tone-mapping=no
target-colorspace-hint=no
#sig-peak=1000
[hdr-toys-inverse]
gpu-api=vulkan
vo=gpu-next
target-colorspace-hint=no
#hdr-compute-peak=no
tone-mapping=clip
target-trc=gamma2.2
#target-prim=bt.709
glsl-shader=~~/shaders/hdr-toys/transfer-function/bt709_inv.glsl
#glsl-shader=~~/shaders/hdr-toys/tone-mapping/hable.glsl
glsl-shader=~~/shaders/hdr-toys/gamut-mapping/jedypod.glsl
glsl-shader=~~/shaders/hdr-toys/transfer-function/bt1886.glsl
#glsl-shader-opts=L_hdr=5000
#glsl-shader-opts=L_sdr=100
## I don't actually use these but they may be useful later
#[hdr-pq]
#profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "pq"
#[hdr-toys-hlg]
#profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "hlg"
[bench]
audio=no
untimed=yes
video-sync=display-desync
vulkan-swap-mode=immediate
opengl-swapinterval=0
d3d11-sync-interval=0
#wayland-disable-vsync=yes
[smooth]
video-sync=display-resample
#vf=fps=60
interpolation=yes
tscale=oversample
interpolation-threshold=1
interpolation-preserve
[decodecache]
demuxer-seekable-cache=yes
demuxer-max-bytes=1Gib
demuxer-max-back-bytes=1Gib
## frame double into VRR range
[LOWFPS]
profile-desc=cond:get('container-fps',0) <= 30 and get('container-fps',0) > 29
profile-restore=copy
vf=fps=fps=60
[LOWERFPS]
profile-desc=cond:get('container-fps',0) <= 24 and get('container-fps',0) > 23
profile-restore=copy
vf=fps=fps=48
[ALMOSTTHERE]
profile-desc=cond:get('container-fps',0) < 48 and get('container-fps',0) > 47
profile-restore=copy
vf=fps=fps=48
## I no longer use this, but it's a good example
[Interlaced]
#profile-desc=cond:p["video-frame-info/interlaced"]
vf=lavfi=yadif
## More examples
#[FHD]
#profile-restore = copy
#profile-cond=((width >=1920 and height >=1080) and (width <=3839 and height <=2159))
#scale=mitchell
#[UHD]
#profile-restore = copy
#profile-cond=((width >=3840 and height >=2160) and (width <=7679 and height <=4319))
#scale=ewa_lanczos4sharpest
#[8K UHD]
#profile-restore = copy
#profile-cond=(width <=7680 and height <=4320)
#dscale=bicubic
[lowlatency]
untimed
no-demuxer-thread
#video-sync=audio
vd-lavc-threads=1
no-cache
### Comparison Utils ###
## comparison filters
## Most of these aren't terribly useful, but
## can sometimes show something unique
[diff]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference [vo]'
[diffb] #increase gamma to help visibility for low diff images
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d], [d] eq=gamma=2[vo]'
[diffglow]
lavfi-complex='[vid1] [vid2] blend=all_mode=glow [vo]'
[diffexc]
lavfi-complex='[vid1] [vid2] blend=all_mode=exclusion [vo]'
[diffpho]
lavfi-complex='[vid1] [vid2] blend=all_mode=phoenix [d], [d] eq=gamma=0.2[vo]'
[diffxor]
lavfi-complex='[vid1] [vid2] blend=all_mode=xor [vo]'
[diffosc]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d],[d]split=2[out][blend],[blend] oscilloscope[h], [out] [h] overlay [vo]'
[diffwave]
lavfi-complex='[vid1] [vid2] blend=all_mode=difference[d],[d]split=2[out][blend],[blend] waveform[h], [out] [h] overlay [vo]'#https://trac.ffmpeg.org/wiki/WaveformMonitor
[over]
lavfi-complex="[vid2]format=yuva444p,lut=c3=128,negate[video2withAlpha],[vid1][video2withAlpha]overlay[vo]"
## side
[2side]
lavfi-complex='[vid1] [vid2] hstack [vo]' # 2 side by side
[2sidesplit]
profile-restore=copy
lavfi-complex="[vid1]crop=iw/2:ih:0:0[left], [vid2]crop=iw/2:ih:iw/2:0[right], [left][right]hstack[vo]"
[3side]
lavfi-complex='[vid1] [vid2] hstack [out], [out] [vid3] hstack [vo]' # 3 side by side
[quad]
lavfi-complex='[vid1] [vid2] hstack [out1], [vid3] [vid4] hstack [out2], [out1] [out2] vstack [vo]' # 4 in a quadrant
@murlakatamenka
Copy link

Hey, thanks for sharing interesting blog posts!


Do you have any feelings about not having spaces around =, i.e. key=val? I mean, you do code stuff and everywhere (except bash) key = val is the norm. Just curious.

@Quackdoc
Copy link
Author

I don't really personally have a preference either way, I feel like it is standard to use key=val when possible inside of scripts and on cli, and key = val inside of other tooling, but when it comes to preference I try to just do what other folk do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment