mpv: fix video stutter on network streams

cache_pause=no caused frame-wait-frame-wait on uncached videos
because mpv kept playing through buffer underruns instead of
pausing to refill. Flip to cache_pause=yes with a 2s resume
threshold so playback is smooth after the initial buffer fill.

Also: bump demuxer buffers (50→150MiB forward, add 75MiB back for
backward seek without refetch), increase stream_buffer_size from
default 128KiB to 4MiB to reduce syscall overhead, extend network
timeout (10→30s) for slow CDNs, and set a browser-like user agent
to avoid 403s from boorus that block mpv's default UA.

behavior change
This commit is contained in:
pax 2026-04-11 19:51:56 -05:00
parent e939085ac9
commit ac3939ef61

View File

@ -77,10 +77,16 @@ def build_mpv_kwargs(is_windows: bool) -> dict[str, object]:
"vd_lavc_fast": "yes", "vd_lavc_fast": "yes",
"vd_lavc_skiploopfilter": "nonkey", "vd_lavc_skiploopfilter": "nonkey",
"cache": "yes", "cache": "yes",
"cache_pause": "no", "cache_pause": "yes",
"demuxer_max_bytes": "50MiB", "cache_pause_wait": "2",
"cache_pause_initial": "yes",
"cache_secs": "30",
"demuxer_max_bytes": "150MiB",
"demuxer_max_back_bytes": "75MiB",
"demuxer_readahead_secs": "20", "demuxer_readahead_secs": "20",
"network_timeout": "10", "stream_buffer_size": "4MiB",
"network_timeout": "30",
"user_agent": "Mozilla/5.0",
"ytdl": "no", "ytdl": "no",
"load_scripts": "no", "load_scripts": "no",
} }