-{ pkgs, lib, config, ... }:
+{ pkgs, ... }:
{
-home.packages = [
- pkgs.mpv
-];
-xdg.configFile."mpv/input.conf".text = ''
- # Volume normalization
- # See https://github.com/mpv-player/mpv/issues/3979
- Alt+a cycle-values af "dynaudnorm=f=75:g=25:n=0:p=0.58" "loudnorm" ""
- Alt+f cycle video-unscaled
-'';
-xdg.configFile."mpv/mpv.conf".text = ''
- # Do not require DISPLAY for audio files
- audio-display=no
- hwdec=auto-safe
- profile=gpu-hq
- # Terminal is disabled by --player-operation-mode=pseudo-gui in mpv.desktop
- terminal=yes
- vo=gpu
- ytdl-format=18/mp4-480p/hls-480p/http-360p/mp4
-'';
+ home.packages = [
+ pkgs.mpv
+ ];
+ xdg.configFile."mpv/input.conf".text = ''
+ # Volume normalization
+ # See https://github.com/mpv-player/mpv/issues/3979
+ Alt+a cycle-values af "loudnorm=I=-25:TP=-1.5:LRA=1:linear=false" "dynaudnorm=framelen=4000:gausssize=151:coupling=1:peak=0.58" "speechnorm" ""
+ Alt+f cycle video-unscaled
+
+ # Show all chapters (like a right-clic on |<< or >>|)
+ c show_text ''${chapter-list}
+ = show-text ''${playlist}
+ ! show-text ''${track-list}
+
+ # q is easier to type than Q
+ q quit-watch-later
+ ESC quit-watch-later
+ Q quit
+ ENTER playlist-next force
+ '';
+ xdg.configFile."mpv/mpv.conf".text = ''
+ hwdec=auto-safe
+ profile=gpu-hq
+ vo=gpu
+
+ ytdl-format=18/mp4-480p/hls-480p/http-360p/mp4
+
+ # Don't wait ages for the window to finally show up.
+ force-window=immediate
+
+ stop-screensaver=yes
+
+ slang=eng,en,enUS,en-US,fr,fr-FR
+ alang=eng,en,enUS,en-US,fr,fr-FR
+
+ # Higher quality screenshots. Low compression rate to speed up saving.
+ screenshot-directory=~/Images/mpv
+ screenshot-format=avif
+ screenshot-avif-encoder=libsvtav1
+ screenshot-avif-pixfmt=yuv420p
+ # TODO: change crf= wrt. resolution
+ screenshot-avif-opts=crf=24,aq-mode=complexity
+ screenshot-high-bit-depth=yes
+ screenshot-tag-colorspace=yes
+
+ [extension.gif]
+ interpolation=no
+ '';
}