mpv Settings

Discuss technology, especially things related to free software, self-hosting, privacy, and anything in the associated Kaczynskiverse.
Post Reply
User avatar
Thricegreat
Posts: 171
Joined: Tue Jun 09, 2026 9:30 am
Has thanked: 162 times
Been thanked: 210 times
Contact:

mpv Settings

Post by Thricegreat »

This is my setting. Mainly for low-latency. Usually to listen to music. So if you want better image quality or something, this is not for you.

Personally it feels that using the mpv app on a smartphone with this setting is better than many DAPs.

Code: Select all

profile=fast
hwdec=auto

## Low-latency
audio-buffer=0
#vd-lavc-threads=1
cache-pause=no
demuxer-lavf-o-add=fflags=+nobuffer
demuxer-lavf-probe-info=nostreams
demuxer-lavf-analyzeduration=0.1
video-sync=audio
interpolation=no
video-latency-hacks=yes
stream-buffer-size=4k
#untimed
opengl-glfinish=yes
opengl-swapinterval=0
swapchain-depth=1
demuxer-lavf-buffersize=2
demuxer-mkv-probe-start-time=no
input-preprocess-wheel=no

scale=bilinear
cscale=bilinear
tscale=linear
dscale=bilinear

fs
sid=no
volume-max=262


ytdl=yes
ytdl-format=ytdl

[extension.png]
loop
[extension.jpg]
loop
[extension.jpeg]
loop
[extension.webp]
loop
[extension.gif]
loop
Although this is not about mpv, I would write this too anyway. I use these ffmpeg options to convert flac into opus. I use flac to preserve audios. But the latency of flac is very high and that of opus is very low. So when I listen to music, I use opus instead.

Code: Select all

ffmpeg -i file:example.flac -c:v copy -c:a libopus -b:a 336k -application lowdelay -compression_level 0 -frame_duration 2.5 example.opus
336 kbps bitrate is because I need more bitrate when I use 2.5 frame duration. As I remember, that corresponds to 192 kbps opus with the default setting. That is surely transparent.

Just try these and feel how the audio sounds.
User avatar
drummyfish
Posts: 103
Joined: Wed May 27, 2026 1:10 pm
Location: Moravia (Czech Republic)
Has thanked: 167 times
Been thanked: 170 times
Contact:

Re: mpv Settings

Post by drummyfish »

Excuse my potentially dumb question, but why does latency matter when listening to music?
love everyone, help selflessly
User avatar
Thricegreat
Posts: 171
Joined: Tue Jun 09, 2026 9:30 am
Has thanked: 162 times
Been thanked: 210 times
Contact:

Re: mpv Settings

Post by Thricegreat »

drummyfish wrote: Mon Jun 22, 2026 3:43 pm
Excuse my potentially dumb question, but why does latency matter when listening to music?
It is not a dumb question at all. :) I regard latency as something like screen resolution. Though technically it is more like screen fps. Low-latency is like more fps for audios and thus more sensitive. Think of a game with no lag vs a game with full of lags. The former is more sensitive. No latency as the ideal means you can hear the sound at the exact same time the computer starts to produce the output.

Although it depends, humans can percieve even small latency. Especially in a large space. Because sounds are waves so that they need time to propagate. Usually experienced musicians start to notice at 10ms. Performers themselves could notice even at 5ms.
User avatar
drummyfish
Posts: 103
Joined: Wed May 27, 2026 1:10 pm
Location: Moravia (Czech Republic)
Has thanked: 167 times
Been thanked: 170 times
Contact:

Re: mpv Settings

Post by drummyfish »

Thricegreat wrote: Mon Jun 22, 2026 4:07 pm
It is not a dumb question at all. :) I regard latency as something like screen resolution. Though technically it is more like screen fps. Low-latency is like more fps for audios and thus more sensitive. Think of a game with no lag vs a game with full of lags. The former is more sensitive. No latency as the ideal means you can hear the sound at the exact same time the computer starts to produce the output.
Oh sure, latency in audio matters. It is a delay, but we must ask delay in respect to what, right? In a video game you want the latency low because you want to have a quick audio feedback to your actions -- you press a mouse button and ideally you should immediately hear a gunshot. This is even more important with musical instruments, I have to set the buffer size to very small values when I play my keyboard through my computer because even 200 ms latency is too much for drumming for example. With movies it isn't even necessary to decrease buffer size to better sync audio with video, the audio track can simply be arbitrarily offset so that it starts to play slightly earlier or later than the video.

However what I don't understand is what latency means when you are only listening to music. The only effect of latency here is how quickly the music starts to play or stops when you press a button, or how quickly it reacts to volume changes and so on, but I don't see how it would matter whether music starts to play 100 or 300 milliseconds after you press the play button. I may be missing something, but aren't you actually talking about something else than latency? When you say "resolution" (or FPS, which is temporal resolution), the analogue to that in audio is sampling frequency (and possibly quantization), and although 48 KHz is pretty much the standard beyond which most people can't tell the difference, this can actually have some effect that trained ears can recognize. Lossless compression can have an effect too.
love everyone, help selflessly
User avatar
Thricegreat
Posts: 171
Joined: Tue Jun 09, 2026 9:30 am
Has thanked: 162 times
Been thanked: 210 times
Contact:

Re: mpv Settings

Post by Thricegreat »

drummyfish wrote: Mon Jun 22, 2026 5:03 pm
Thricegreat wrote: Mon Jun 22, 2026 4:07 pm
It is not a dumb question at all. :) I regard latency as something like screen resolution. Though technically it is more like screen fps. Low-latency is like more fps for audios and thus more sensitive. Think of a game with no lag vs a game with full of lags. The former is more sensitive. No latency as the ideal means you can hear the sound at the exact same time the computer starts to produce the output.
Oh sure, latency in audio matters. It is a delay, but we must ask delay in respect to what, right? In a video game you want the latency low because you want to have a quick audio feedback to your actions -- you press a mouse button and ideally you should immediately hear a gunshot. This is even more important with musical instruments, I have to set the buffer size to very small values when I play my keyboard through my computer because even 200 ms latency is too much for drumming for example. With movies it isn't even necessary to decrease buffer size to better sync audio with video, the audio track can simply be arbitrarily offset so that it starts to play slightly earlier or later than the video.

However what I don't understand is what latency means when you are only listening to music. The only effect of latency here is how quickly the music starts to play or stops when you press a button, or how quickly it reacts to volume changes and so on, but I don't see how it would matter whether music starts to play 100 or 300 milliseconds after you press the play button. I may be missing something, but aren't you actually talking about something else than latency? When you say "resolution" (or FPS, which is temporal resolution), the analogue to that in audio is sampling frequency (and possibly quantization), and although 48 KHz is pretty much the standard beyond which most people can't tell the difference, this can actually have some effect that trained ears can recognize. Lossless compression can have an effect too.
Your explanation makes sense while in fact I rather found that latency matters experimentally. What I wrote is a theory to support the results which was invented years ago and I remember it only vaguely now.

Maybe I have been remembering incorrectly, or that was simply false and there are other reasons for the results.

Thank you for the explanation. I will rethink of why latency matters experimentally.
User avatar
vulonkaaz
Posts: 35
Joined: Thu Jun 04, 2026 12:58 pm
Location: Luxembourg
Has thanked: 6 times
Been thanked: 65 times
Contact:

Re: mpv Settings

Post by vulonkaaz »

thats the weirdest shit i've ever read also i'm not sure what -c:v copy is supposed to do in a FLAC file conversion

all I change in my mpv settings is set the cache size to like a gigabyte so that when I remotely play videos it wouldn't just stop playing if my network crashed, also sometimes i change settings to allow hardware decoding but most of the time i can't be bothered
Image
User avatar
Thricegreat
Posts: 171
Joined: Tue Jun 09, 2026 9:30 am
Has thanked: 162 times
Been thanked: 210 times
Contact:

Re: mpv Settings

Post by Thricegreat »

vulonkaaz wrote: Mon Jun 22, 2026 6:41 pm
thats the weirdest shit i've ever read also i'm not sure what -c:v copy is supposed to do in a FLAC file conversion
Since some anime BD Rips contain FLAC files as their audios, I use it for those video files too. Though the example was a simple flac->opus. I made it as a function in the shell.
Post Reply