Readit News logoReadit News
etra0 · a year ago
A fantastic mediaplayer, quite minimalistic and performant; it does what it's supposed to do!

Also has a fantastic commit where the author rants about locales: https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f02... worth a read for some chuckles.

josephg · a year ago
As strange as it is to say, I think avoiding problems like this might be one of the biggest productivity boosts from new languages like Go, Rust, Swift, etc. New ecosystems get a chance to “do over” the standard library and flush all the horrible legacy choices made before we knew better (locales, UTF16, etc).

The standard library in Zig, Go, Rust, and many others is miles ahead of the C standard library or posix api. That is reason enough to use them.

bbarnett · a year ago
I'm skeptical that rust magically deals with, for example, character sets in 30 year old subtitle files, in a way that makes C seem inadequate.

Legacy compatibility has value.

account42 · a year ago
You can create/use a different string processing library without jumping to a completely different language.
beagle3 · a year ago
A long, informative read, with some profanities. Highly recommended!

25 years ago, Spolsky wrote an article called “everything you wanted to know about Unicode and character sets”. Those of you who only lived in the post Unicode/UTF world might find that one informative as wel.

thayne · a year ago
> Imagine they had done this for certain other things. Like errno, with all the brokenness of the locale API.

They did. See for example time functions like localtime (and localtime_r) and tzset. It is admittedly locale adjacent, since it depends on the locale. But the time zone is also global state, so it is impossible to get the time in a different timezone with standard apis in multi-threaded portable (for posix) c code.

yard2010 · a year ago
> Both C locales and wchar_t are shitfucked retarded legacy braindeath. If the C/POSIX standard committee had actually competent members, these would have been deprecated or removed long ago. (I mean, they managed to remove gets().) To justify this emotional outbreak potentially insulting to unknown persons, I will write a lot of text. Those not comfortable with toxic language should pretend this is a religious text.

What a legend.

Narushia · a year ago
Worth noting that the author of that commit has not been associated with mpv development in years.
account42 · a year ago
Which is a shame because he's highly techinally competent.
kasabali · a year ago
in other words: they've kicked him out of his own project
codedokode · a year ago
Wow that comment is so educating. I guess I'll pay more attention now to standard functions I use in C code.

As for weirdness of C standard, I guess it is because they wanted to make it compatible with obscure proprietary platforms which might not even exist anymore.

efilife · a year ago
> All in all, I believe this proves that software developers as a whole and as a culture produce worse results than drug addicted butt fucked monkeys randomly hacking on typewriters while inhaling the fumes of a radioactive dumpster fire fueled by chinese platsic toys for children and Elton John/Justin Bieber crossover CDs for all eternity.

This was a great read

ptdorf · a year ago
Oh man! This was GOLD. Thanks.
telegtron · a year ago
Loved the last paragraph of the long, justified rant. Hilarious:

“All in all, I believe this proves that software developers as a whole and as a culture produce worse results than drug addicted butt fucked monkeys randomly hacking on typewriters while inhaling the fumes of a radioactive dumpster fire fueled by chinese platsic toys for children and Elton John/Justin Bieber crossover CDs for all eternity.”

racked · a year ago
I actually thought that last paragraph really undermined his case, because rather than substantiating like he did before, here he goes all out and just insults whoever he can think of; people who take it in the ass, greybeards, the Chinese, listeners of bland music...

I get him though. It's one of those writings from a foul mood. There was probably more going on in his life than some trouble dealing with locales.

entropie · a year ago
I started to use it on linux a few years ago.

Now its on every device, even on my android tablet. Its perfect. Minimalistic, sane defaults, fast and just works.

It can even play natively over ssh. Its awesome

> mpv sftp://mit@nyx/home/mit/Work/merged.mp4

Recently I needed a hotkey to rotate a video (which seems not like any player can easily do this; for mpv it was a 'r cycle_values video-rotate "90" "180" "270" "0"' in the in input.conf)

ivanjermakov · a year ago
You can also play videos over http, many websites are supported, even YouTube:

    mpv <yt link>

vocx2tx · a year ago
It uses yt-dlp as the download backend, so it works with anything that yt-dlp handles.
account42 · a year ago
I wish seeking word work better in this mode though. There is no reason seecon should freeze the player for minutes or indefinitely if the whole video can be downloaded from start to finish in seconds.
Venn1 · a year ago
If you're on Linux, don't forget to enable hardware acceleration by adding hwdec=auto to mpv.conf. Works with AMD/Intel/NVIDIA.

https://interfacinglinux.com/2024/01/10/hardware-acceleratio...

troad · a year ago
Huh. Apparently I've been watching videos on mpv for years without HW acceleration. Good thing I read this; thanks!
shmerl · a year ago
I do it like this:

    vo=gpu-next
    gpu-api=vulkan
    hwdec=vulkan
    gpu-context=waylandvk
You can replace hwdec=vulkan with hwdec=vaapi if Vulkan video doesn't work.

vladvasiliu · a year ago
Is there a reason why one would prefer vulkan over vaapi, or the other way round?
NavinF · a year ago
Why would that be disabled by default?
crossroadsguy · a year ago
Because if you don't have to enable a flag or two in a text config file what's the fun of using Linux after all :)
diggan · a year ago
Doesn't work on all systems, I presume. Better to default to something that definitely works everywhere.

https://github.com/mpv-player/mpv/blob/a3baf94ab9f3b43a8027d...

Would be appropriate to have true/false/auto instead of auto==true though, so auto wouldn't use it unless it confirmed to be working.

varenc · a year ago
In addition to what others have said, hardware decoding comes with other drawbacks. There’s occasionally decoding inaccuracies and there’s no support for most video filters (unless you’re using `auto-copy`)
krzys · a year ago
If you autodetect hw accel, even the slowest underpowered gpu might get returned, which could result in worstened user experience compared to just using cpu.
mzajc · a year ago
It breaks on suspend-to-memory for my system with a nVIDIA GPU. I assume that's a driver problem, though.
nijave · a year ago
Not sure why but I've had lots of issues with worse performance (lagging/stuttering) on Fedora (I think kernel 6.10) with a Vega 64. Every year or so I'll give it a try and it just won't work well and I give up again.
steelframe · a year ago
Yeah, I just pacman-installed mpv and tried running it on a 4k video. My CPU fan immediately kicked on, and top showed multiple cores getting involved. Kept scrolling this HN post to learn about hwdec=auto. Coming from mplayer and vlc my immediate question is, "What tradeoffs are the maintainers trying to make by not making this the default?"
synergy20 · a year ago
great to know this. thanks!
gorgoiler · a year ago
This is an extremely venerable project, formerly known as mplayer. There are half a million commits going back to 2001, and that’s just from when the CVS repo was converted to Subversion.

streamlink and mpv on a fanless Minix z100 running Ubuntu was a nigh-on perfect Olympics experience.

https://streamlink.github.io/

https://www.minix.com.hk/products/z100-0db-fanless-n100-mini...

thrdbndndn · a year ago
I don't think mplayer and mpv are the same thing. It forked mplayer (among others), but mplayer is still its own thing.
smeg_it · a year ago
I switch from mplayer to mpv some years ago but I don't remember when. I use it daily as my media center player.
ksdnjweusdnkl21 · a year ago
It sounds stupid but the killer feature for me is possibility to have multiple subtitles visible, all easily configurable with a few keybinds (track, offset, position, size etc). No streaming service provides this, and they actively omit subtitle languages that aren't "relevant" to your geolocation. I cannot respect a service like that.
scbrg · a year ago
+1. This is a fantastic feature. I haven't even bothered learning the keybindings (perhaps I should), I just start with --sid1= and --sid2= and it works well enough.

Neither me nor my significant other are native English speakers, but we have different native languages. I'm comfortable enough with English, but like having English subtitles since I have a hard time with some dialects and occasionally just miss a word or two due to noisy audio. My SO likes having subtitles in their native language.

Being able to have multiple subtitles makes it possible for both of us to get the experience we like, at the cost of a little screen real estate. Well worth it.

ksdnjweusdnkl21 · a year ago
They are not default keybinds, but like any configuration can be cycled or set at runtime. Actually I don't use the keybindings much directly since my default config usually is fine, but have a remote GUI to configure it when needed.
exikyut · a year ago
Depending on the aspect ratio of the video and playback viewport, you could move the subtitles into the potential black bar underneath.

If there is no black bar, you could get one of those long narrow LCDs off AliExpress, set up the driver, add it as an X display with the right positioning... and then drag the mpv window across that and the TV. Should work. Those little LCDs are just silly expensive though...

iwishiknewlisp · a year ago
Mpv is great with subtitles. Not just being able to switch through subtitle tracks and configure positioning, but also being able to automatically find and play external subtitle files when playing a video. I wrote an article about this: https://www.baeldung.com/linux/mpv-subtitles-automatic. Only issue I found is the documentation for what subtitle formats are supported is lacking. You have to look through ffmpeg code to actually find what formats are actuallly supported.

Additionally, https://subdl.com/ with https://github.com/alexanderwink/subdl is a great resource for finding and downloading subtitles from the comand line.

cenamus · a year ago
Especially for things like language learning they are amazing, but services like Amazon show like two (English and the local language) out of the 30 something they have available. And I won't even go into the difference of subtitles and dubbing...
ksdnjweusdnkl21 · a year ago
For language learning there are some scripts that allow you to hover words and show translations for them. I haven't used them myself with mpv, but I found that kind of tools to be invaluable on a browser when learning a language with a foreign script.
OscarDC · a year ago
> actively omit subtitle languages that aren't "relevant" to your geolocation. I cannot respect a service like that.

This may also be due to legal issues / restrictions in the contract they had with that content's right holders or subtitles providers.

ksdnjweusdnkl21 · a year ago
They probably don't want to license them globally, because the expected usage is low. But surely this could be taken into account in the contract / negotiation. Anyway I guess I'm just not in the target audience. But that's what MPV is great for, it allows you to tweak it for that 0.1% use-case.
jwells89 · a year ago
This has always worked well for me, handling anything that’s thrown at it with ease.

Things may have changed since then, but when I first encountered the project several years ago it seemed like the thing that made this project stand out compared to other player projects was a big emphasis on correctness and accurate playback. There have files I’ve encountered that for example VLC will play with quirks (color reproduction is not quite right, etc) that mpv plays perfectly.

arp242 · a year ago
> There have files I’ve encountered that for example VLC will play with quirks (color reproduction is not quite right, etc) that mpv plays perfectly.

This has long since been the case, even back in the MPlayer days in the early 2000s.

I'm not really sure why this is the case though, because I believe both largely rely on the same libraries for many codecs.

jwells89 · a year ago
The explanation I’ve read in the past is that the difference lies in how VLC was initially focused on playback of video streamed over a network (hence the name Video LAN Client), which was generally more rocky a couple decades ago when the quality and bandwidth of the average connection was lower and the only routes between the client and server could be highly indirect or routed through weak nodes.

In that environment, playing at all without constantly dropping out or buffering is the goal, which is more achievable when fudging accuracy/correctness (which wouldn’t have been possible anyway).

Not sure how true that is though, it’s not something I’ve ever verified.

Bluestein · a year ago
> There have files I’ve encountered that for example VLC will play with quirks (color reproduction is not quite right, etc) that mpv plays perfectly.

Given how VLC is basically bulletproof and will play absolutely anything thrown at it - it's great to hear that mpv is up there ...

mixmastamyk · a year ago
While great in general, vlc has many small seek/sync issues, and also seems to be in maintenance mode.
loeg · a year ago
Hm, I've had (significant) issues with color representation playing back "HDR" media in mpv.
adrian_b · a year ago
Then you must have not used "mpv --vo=gpu-next".

Playing HDR and Dolby Vision encoded movies has been solved a long time ago in mpv, but they usually need the option shown above, which may not be the default on your system.

There are plenty of additional options in mpv that provide a finer control of how HDR colors are handled.

While playing a movie with mpv, press "I", so that mpv will display the information it has about the color space supported by your display and the color space used in the movie, which will allow you to verify if they are correct.

jwells89 · a year ago
Not something I have experience with so can’t speak to that.
SSLy · a year ago
was the material purple-green by chance?
gioo · a year ago
mpv is awesome. Shout-out, in no particular order, to:

- Seeds of Might/JySzE's base `mpv.conf`[1]

- uosc, a feature-rich but still minimalist UI[2]

- thumbfast, a fast thumbnailer to be used with uosc or another custom UI[3]

- Eisa01's SmartSkip, which allows to skip intros & more (audio-based)[4]

[1] Windows: https://gist.github.com/JySzE/db4149cad726b3b6955dca8d47a197..., macOS: https://gist.github.com/JySzE/34ee131da3974811a9469e1e3b7d4d... [2] https://github.com/tomasklaen/uosc [3] https://github.com/po5/thumbfast [4] https://github.com/Eisa01/mpv-scripts#smartskip

Cyph0n · a year ago
Not to take away from the work done on the plugin, but that’s a “basic” skip intro implementation.

To reliably be able to find intros/credits, you need to some non-local analysis - basically, you need to look for common chunks of audio across episodes in a season or entire show.

I wrote a CLI tool that can do this, albeit it’s not really “finished” and probably will never be. My initial goal was to use it to develop a Jellyfin plugin, but then I discovered that there was already such a plugin :)

https://github.com/aksiksi/needle

blfr · a year ago
The best media player in existence: superb minimalist UI, makes use of hardware accelaration, and just plays videos.

Its continued excellence is one of the reasons why I will probably remain a pirate for life. Streaming services spend millions on their players and don't come close.

FabHK · a year ago
It seems to me that YouTube cripples their web player on purpose to "entice" you to download their app and upgrade to premium.
blfr · a year ago
I have YouTube ReVanced, which is better than premium, which is still not as good as mpv.

Other services are strictly premium, paid affairs. Still not as good as mpv.

kjkjadksj · a year ago
All it does is entice me to avoid that and go to mpv