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.
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.
> 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.
> 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.
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.
> 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.
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.”
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.
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)
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.
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`)
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.
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.
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?"
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.
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.
+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.
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.
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...
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.
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...
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.
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.
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.
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.
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.
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 :)
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.
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.
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.
Legacy compatibility has value.
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.
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.
What a legend.
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.
This was a great read
“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.”
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.
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)
https://interfacinglinux.com/2024/01/10/hardware-acceleratio...
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.
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...
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.
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...
Additionally, https://subdl.com/ with https://github.com/alexanderwink/subdl is a great resource for finding and downloading subtitles from the comand line.
This may also be due to legal issues / restrictions in the contract they had with that content's right holders or subtitles providers.
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.
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.
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.
Given how VLC is basically bulletproof and will play absolutely anything thrown at it - it's great to hear that mpv is up there ...
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.
- 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
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
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.
Other services are strictly premium, paid affairs. Still not as good as mpv.