Hacker News new | past | comments | ask | show | jobs | submit login
Mpv – A free, open source, and cross-platform media player (mpv.io)
474 points by peter_d_sherman on July 18, 2022 | hide | past | favorite | 176 comments



My favorite feature is "video-sync=display-resample". This gives you perfect frame pacing by synchronizing the video to vertical refresh and resampling the audio to match. If you set your refresh rate to an integer multiple of the frame rate, every frame will be shown for the exact same time. The audio resampling compensates for very small discrepancies between speeds by imperceptibly changing the audio speed. It's similar to the proprietary DirectShow filter "ReClock", but AFAIK ReClock does not dynamically adjust the speed to compensate for clock drift like MPV does, in which case you could theoretically still get imperfect frame pacing. (I haven't actually used ReClock so I could be mistaken here.)

Also great is MPV's support for arbitrary OpenGL shaders. This can include very complicated shaders, e.g. real-time neural network upscaling:

https://github.com/igv/FSRCNN-TensorFlow/releases

SD video can look surprisingly good after upscaling with this.


One of my least favorite features of VLC (tied with network stream interruptions killing the playback rather than reconnecting) is that VLC guesses your audio hardware's sampling rate itself (rather than using the hardware's self-reported rate), and resamples even audio-only files that match your hardware's self-reported rate. And every time you seek in a file, VLC's guess of the hardware sampling rate is thrown off, causing VLC to start pitch-shifting the sound just enough (usually just barely, but sometimes up to 1 semitone) for you to notice and start doubting your sanity, if the audio pitch actually changed or if you're hallucinating things. There's a long-running bug report at https://code.videolan.org/videolan/vlc/-/issues/14287.

I think PipeWire does something similar to synchronize multiple audio devices without a shared word clock, but I haven't tested how much its rate analyzer drifts when starting/stopping playback or in steady state.


> tied with network stream interruptions killing the playback rather than reconnecting

So I'm not alone in hating this! How come this was never fixed?

I didn't want to switch from MX Player (Android), which worked quite well, for ages, but finally gave up because with MX Player you have to go look for some codecs.zip every (major?) update. (must be related to the licenses)

On top of VLC not being able to reconnect to the source, it also doesn't show the title of the video. So every time the stream dies I have to remember which episode I was on.


Exactly the same thing happens with mpv if you shift the audio manually. I experienced that recently. After shifting, whenever I go forward or backward it gets out of sync + the performance decreases ( without the shift going forward or backwards is instant)


I have experienced this with IPTV on Kodi, but I've only ever noticed it on the BBC News countdown tune, sining a semitone up and down. AFAIK that's using ffmpeg


> Also great is MPV's support for arbitrary OpenGL shaders. This can include very complicated shaders, e.g. real-time neural network upscaling:

Holy shit, I had no idea about this (that mpv could load OpenGL shaders nor that there is shaders that do RT neural upscaling), literally blowing my mind.



For line art, try "FSRCNNX_x2_16-0-4-1_anime_enhance.glsl": https://github.com/HelpSeeker/FSRCNN-TensorFlow/releases/tag...

Or if you don't want noise reduction, try "FSRCNNX_x2_8-0-4-1_LineArt.glsl": https://github.com/igv/FSRCNN-TensorFlow/releases (in checkpoints_params.7z)

Both are IMO sharper and more accurate than ACNet.


Wow this one produces even sharper images. Thanks!


The display sync resampling is amazing.

When I first experienced it, it made me realize how terrible VLC is; VLC can't play back video at a consistent framerate, and this is particularly noticeable in panning scenes in videos, especially anime.

People talk about VLC like it's a poster-child of open source, but really, I just see a bloated, crash-prone program that doesn't even do its primary function particularly well or efficiently.


VideoLAN is responsible for a whole lot of open source code that benefits the entire video ecosystem, like x264/x265/dav1d. Even if you dislike VLC, I think this is underselling their contributions to the world.

Also, I find VLC is a safe recommendation for someone who just wants to casually play some video files. It's fairly user friendly, it runs on literally everything, and it supports most multimedia formats anyone could ever care about. I like and use MPV, but I use VLC on some Android TV devices because it's readily available and runs buttery smooth on crappy hardware.


This is probably a interference of a chosen output method and a system compositor behavior (or its recent changes). Compositor redirection broke synchronization for most old code, and available interoperation and bypass methods have been changing with time. This was the reason media players and games introduced new fullscreen modes. Players, including VLC, have been capable of stutter-less video output for decades, the problem is that there is usually more to show on screen than just the video, and the user wants other things to happen in parallel.

It's true that VLC requires arcane knowledge of its architecture to configure all of its options, but basic operation still assumes you've read the fine manual.


Computer monitors (60fps) can’t play anime at a constant framerate (24fps). Computer monitors aren’t TVs.


Computer monitors are not all 60hz, and I cited anime as one example; TV and movies also have jerky playback.

VLC does the behavior described (jerky playback) on both a Mac with 60hz display that is several years old, and on a cutting edge PC that has a refresh rate more than five times the framerate of anime and supports variable refresh rate.

mpv plays anime butter-smooth on both systems.

I love it when I get a supremely condescending explanation that is also wrong.


> Computer monitors are not all 60hz, and I cited anime as one example; TV and movies also have jerky playback.

The ones that are 60hz are 60hz, and that's not the reason monitors aren't TVs. They aren't TVs because they don't have one of 1. black frame insertion 2. 60->120fps motion interpolation, so you have persistence of vision issues. (aka motion blur, jerkiness, or both at once)

Movies are also 24fps, though of course they're different from animation because they have built in motion blur (same as if you recorded with 1/24 exposure time vs 1/1000).

mpv's video retiming works some of the time, but means it changes the pitch of audio which is sometimes unacceptable, same as old NTSC->PAL transfers.

…if your monitor has variable refresh rate why are you using retiming?


>They aren't TVs because they don't have one of 1. black frame insertion 2. 60->120fps motion interpolation

Most older LCD TVs do not have either black frame insertion or motion interpolation. BFI causes motion artifacts (trailing ghost images) if the frame rate of the video is less than the refresh rate. Motion interpolation also adds its own artifacts.

>mpv's video retiming works some of the time, but means it changes the pitch of audio

The best way to use it is to set custom monitor timings (e.g. with xrandr) so that the adjustment needed is too small to detect. There are various scripts to automate this, although I haven't personally tried any (I just change mode manually).

>if your monitor has variable refresh rate why are you using retiming?

I have a VRR monitor, but I still use retiming because it only has a 6 bit panel, and VRR makes temporal dithering artifacts ("frame rate control") visible.


Yeah, those LCD panels aren't actually good enough to be TVs. A lot of them were 60hz as well, or at best 120hz with HDMI 2.0 which didn't support VRR so your playback device probably wouldn't send them 24fps.


Amazing! I tried it with a 360p video and scaling the player window to 1080p and it's looking sharp. The original looks blurry when you scale the window to 1080p.


> My favorite feature is "video-sync=display-resample". This gives you perfect frame pacing by synchronizing the video to vertical refresh …

Does that mean video in 23.976 frames per second will be sped up and play at 30?


You can force it to do that if you really want to, but by default it will speed it up to 24.00fps and play it alternating between 2 and 3 screen refreshes for each frame (i.e. 3:2 pulldown without the interlacing).


Is there any way to make it work with adaptive refresh to play the video at exactly its native speed and adjust the display refresh rate instead? Or should that just work automatically?


VRR support for MPV is disabled by default in /usr/share/drirc.d/00-mesa-defaults.conf. I am not sure why, because it works for me if enabled. Just fullscreen MPV and it will change the display refresh rate. This requires VRR enabled in both Xorg and your monitor's settings. I have not tried this with Wayland.


I have no idea why I wrote 30, when I was thinking 24.

Thank you for the answering the question I didn’t manage to pose!


No, I forget what the exact limit is, but it does change the speed more than ~0.5%. So going from 59.97 to 60 or vice versa, but not 24 to 30 or 50 to 60.

But Yeah, I am in LOVE with this feature, even for 30fps footage on a 60fps screen. The more stable frame times make a huge difference.


No.


Does mpv's resampling have anything to do with RetroArch's dynamic rate control? I remember reading something to that effect years ago.

https://github.com/libretro/docs/blob/master/archive/ratecon...


Yes, it's essentially the same thing.


Shouldn't display adaptive sync work better for syncing to video framerate though? Trying to resample the video to display refresh rate instead sounds like a worse approach.


If VRR works well with your hardware then it is probably a better option. You can edit /usr/share/drirc.d/00-mesa-defaults.conf to enable VRR with MPV.


Yeah, I noticed that mpv already uses it in the KDE Wayland session somehow, disregarding Mesa settings.

Also, wasn't there some new VESA standard specifically for video (as an addition to regular adaptive sync)?

MediaSync? https://www.adaptivesync.org

Not sure what it's supposed to mean though.


I have a freesync 165hz display. What is the best mpv setting? In theory it should be possible to perfectly show video on my monitor without any stretching or pacing problems.


Nice! Is there any similarly good filter out there for frame interpolation? I love smooth videos just havent had the time to look around too much.


Have you tried the built-in one?

  interpolation
  tscale=oversample
It makes cheap animation (with low 'real' FPS) pretty smooth, and doesn't seem to affect other videos in any noticeable way.


Unfortunately this is not quite the same thing, It just plays around with how the existing frames are displayed instead of generating new ones based on the motion vectors in video files.

It is best described by MPV's documentation at https://github.com/mpv-player/mpv/wiki/Interpolation



How much does it have to adjust playback speed to get frames to an even multiple of refresh rate? Like 2%, or 20? This feature isn't for me -- I'm a big fan of the +/- 10% playback speed '['/']' buttons -- but it sounds neat.


By default, it only makes very small changes. See the "video-sync-max-video-change" setting.


Agree here. mpv plays for hours without a single frame upset.

The final icing on the cake is I use a small LUA hook to set the refresh rate of the projector to match the source material.


In my experience with Reclock's interface: it does track CPU clock drift.


Mpv has an interesting commit message that rants about the insanity of C locales: https://github.com/mpv-player/mpv/commit/1e70e82baa91


"Interesting" indeed:

> 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 the final paragraph after the author wrote a novel in the git commit message.


The guy who made this commit has this in his Github bio:

> Creator of @mpv-player. I was kicked out of the project, but all the backstabbers will pay for it in due time. GNOME is the plague.


Dont trust the current wm4 github account. The original account was deleted and someone made one with the same name.


The current account is run by a 4chan troll, if I remember correctly.


I did not really think I was the only one who gets frustrated, but wow - My rants are not quite that inventive/descriptive...


bwahaha. what a gem; thank you!

"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."

I'm going to steal this.


One of the best commit messages of all time. Convinced me I was not wrong for hating legacy C library cruft.


Eric S. Raymond commented on that commit, congratulating wm4.


After skimming that message I think I'll save this for later. I probably would use it for some project I need to use locales with :-)


great rant, but then he submits code like

  if (mpa && mpa->locale)
         freelocale(mpa->locale);

which are known to cause bugs fairly easily (see gotofail [0])

[0] https://embeddedgurus.com/barr-code/2014/03/apples-gotofail-...


"Interesting" is certainly one way to put "author displaying blatant homophobic attitudes."

Edit: referencing anal sex and two musicians, one of whom is effeminate and the other gay(and famously popular among gay people), all as insults. The author is a mix of misogynistic and homophobic.


I think the reference to Elton John and Bieber is more a dig at the quality of Bieber's music, not anyone's (actual or perceived)sexual orientation, and that it's inclusion on the same CD is tainting Elton John's legacy.

So if anything he respects and likes the famously gay person, so wouldn't characterize that as homophobic.

Won't speak to the anal sex reference because I haven't read the whole thing yet.


> referencing anal sex and two musicians, one of whom is effeminate and the other gay(and famously popular among gay people), all as insults.

It sounds like you believe that only gay people have anal sex, and that only gay people enjoy the music of Elton John and Justin Beiber, is that correct?


Maybe not everyone's mind goes where yours seems to. In particular your analysis depends heavily on Bieber being effeminate, which is not an adjective I'd associate with him. Maybe this guy's just making fun of their music? Or are gay musicians exempt from all mockery now?


Genuinely curious: it's obviously, well, manic, but which part of that quote is homophobic?


These are nowhere near "blatant". Maybe you're the homophobic one?


"Those not comfortable with toxic language should pretend this is a religious text"


> Those not comfortable with toxic language should pretend this is a religious text.

Not going to lie, I laughed a little. But you're right.


but hey, he fixed it!


One of my favorite features of mpv, it integrates with yt-dlp to play youtube videos just given the URL!

    mpv 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'


Worth noting, yt-dlp doesn't just handle YouTube (as the name and your comment might imply) but basically any multimedia on the web. Another example:

    mpv 'https://www.instagram.com/p/CfZK86fozXa/'
Or

    mpv 'https://twitter.com/thesalaam10/status/1547180911606767616'
And many more sites. Here is the full list of supported websites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites....


I use this in combination with https://addons.mozilla.org/en-US/firefox/addon/send-to-mpv-p... as my pimary way to play video content on the web. It's nice having everything play in a consistent player with consistent controls as well as tons of useful features.


And with `--vo=tct` argument, you can watch youtube videos directly on your terminal! No GUI necessary!

    mpv --vo=tct "https://youtube.com/watch?v=dQw4w9WgXcQ"


Or if you want to play something without video at all for e.g. music livestreams, that can be done too. Example below uses the famous lofi girl stream.

    mpv --no-video --vo=null --ytdl-format='bestaudio/best' 'https://www.youtube.com/watch?v=jfKfPfyJRdk'


> mpv --no-video --vo=null --ytdl-format='bestaudio/best' 'lofi hip hop radio - beats to relax/study to'

With --ytdl-format='bestaudio' there's no need to disable the video track or use the null vo.


Maybe that behavior is Linux-exclusive? Under macOS and Windows, if I only use --ytdl-format='bestaudio/best' with livestreams mpv will spawn a window with the video.


I'm on Windows as well. Just get rid of the 'best' argument for '--ytdl-format'. Also, 'bestaudio' is mostly only known as a keyword for Youtube videos.


It can also use SDL or DRM to render video on the console. I use this for viewing video and images (even pdfs, with imagemagick) without a graphical environment.


Check fbpdf2, fbida and links -g.


Pair it with GPU acceleration for smooth and low CPU overhead playback for livestreams:

    mpv -vo=gpu --hwdec=vaapi --gpu-context=wayland  https://www.twitch.tv/gorgc


Shove that into ~/.config/mpv/mpv.conf (each parameter on its own line and without the dash prefix) if you don't want to repeat yourself over and over again.


For some reason hwdec doesn't seem to make much difference for me in terms of power or CPU usage. Also worth mentioning is profile=gpu-hq (can just uncomment in the example config).


I recommend this for watching lectures & other long videos. Compared to the web player mpv gives finer control of playback speed and seeking forwards and backwards.


Emacs has a mode to control mpv for easy note taking which seems perfect for this https://github.com/kljohann/mpv.el



Really great for studying other languages too. Can quickly go back and relisten to the same section over and over and over again without an ad popping in midway through a listen.


One of the best features of mpv that I miss sorely on other players, (notably PotPlayer[0] on Windows) is that it has first class scripting support.

You can write Lua/Javascript and bind it to a hotkey and run your own scripts, pass in current video, playback position, download subtitles etc.

[0]: I use mpv.net on Windows, too, but PotPlayer has better UX.


Writing scripts for mpv is really fun. I would recommend it for anyone especially for people who are learning programming. There is a lot of room for innovation and creativity. The development feedback loop is quick, interactive and visual.


For anyone already acquainted with emmylua/vscode-lua I'd recommend using my type declarations for mpv—need to push some commits for recent changes but it's completely functional

https://github.com/disco0/mpv-types-lua


Just curious why Lua is frequently used as plugin script? I would like to use an already familiar one like Python instead of to learn a new one.


LUA is essentially build as a plugin language. It's simple and well behaved, very easy to spawn when you need it and throw it away when you are done with it. It can also be isolated, if you don't want to give people access to file-io functions for example, you just don't load them into the interpreter and everything works as expected.

Most other language are not like that, they rely on global state and want to take full control your program. The interpreter also tends to be full of functions you can't get rid of, so they are impossible to secure. Even simple things like spawning two independent interpreters are often not supported. A language like Python really wants you to extend Python with modules, not extend your program with Python.

Long story short, writing a Lua interpreter is just a couple of lines of code: https://www.lua.org/pil/24.1.html


As an example, the MMORPG "Elder Scrolls Online" [1], uses Lua as the interface and plugin ("addons") language. This allows feature-rich, very useful UI modifications such as "Bandits User Interface" [2]

[1] https://www.elderscrollsonline.com/

[2] https://www.esoui.com/downloads/info1643-BanditsUserInterfac...


Python is familiar because you already know it. Lua is much easier to learn than python.

Also, you can look for a python transpiler to lua, or any that you like. Take your pick.

https://github.com/hengestone/lua-languages


Lua is so similar to Python that you could learn the basics in one afternoon since you already know Python. The official book is a great start: https://www.lua.org/pil/1.html


It is very easy to embed to C/C++ codebase, much faster than almost any other scripting languages (luajit) and adds a minimal amount to the binary size.


Much faster than C in some cases.


Still no crossfade support though, unfortunately.


My favourite feature of mpv is small but neat: going frame-by-frame forwards and backwards with the keys "." and ",". VLC can step forwards, but not backwards, which frustrated me a fair bit, because I like first stepping really fast forwards to go into the general vicinity of the frame I wanted to catch, necessarily overshooting the target a bit and then backing off a bit and narrowing down the frame with greater precision. VLC didn't allow me to do that, overshooting meant I needed to do the whole thing all over again; but mpv got me covered.


And worse yet, on VLC, often after single-stepping enough times, the video player or decoder stops advancing on pressing e. Resuming playback will either take a while to start playing or stop the file altogether.


One of my favorite things about Mpv is that it's basically a clear cut example on how to use the FFmpeg api. It's written in a way that's fairly straightforward to follow, and was rather instrumental in me understanding the hardware acceleration API of FFmpeg.


Yes, that's true. I even contributed one feature to mpv. It was easy to port some features regarding VAAPI post processing - extra deinterlace modes and correctly handling bottom field first videos that Kodi had, but mpv didn't at the time.


Has no one made a library that abstracts away the complexity of the ffmpeg api?


iina - for macos (based on mpv)

https://github.com/iina/iina


iina is great -- wish it had cross platform support because it is one of the best mpv implementations I have seen.


Celluloid (formerly GNOME MPV) for Linux is simple but pretty great imho


Some time around 2016 or so, shortly after getting my first Mac, I started using this. It became my default audio/video player in less than a day.


I was surprised to learn that mpv doesn't support the Raspberry Pi, and the maintainers don't seem interested in supporting it[0] even though VLC works fine.

[0] https://github.com/mpv-player/mpv/issues/7492#issuecomment-9...


There's omxplayer as a command line video player for the Raspberry Pi.


MPV is great for setting upscaling filters like Anime4k or Nvidia Image Scaling. All you have to do is add a glsl file to the shaders folder and voilà, you get a crisp, clean image on the other side. I often watch 1080p to upscaled 4k shows and anime through this method.


It's the go-to player for watching a video with two subtitles, quite essential if you happen to watch a movie with someone and both need different subs.


This has always worked much more smoothly than vlc for me on raspberry pis


I really like mpv and use it on my laptop, but I thought the package in the raspberry pi os repo didn't support acceleration? Which is why I've been using vlc for videos (e.g. hevc 4k videos).


My favorite is the Media Player Classic Black Edition (MPC-BE)

https://sourceforge.net/projects/mpcbe/ & https://github.com/Aleksoid1978/MPC-BE

I love the (optionally) minimal UI it has.


I don't love that a russian makes it.


don't forget to enable hardware accelerated decoding.

i found it to be off by default in many installations.

press "i" during playback to see if it's being utilized. or simply compare CPU usage before and after (should be drastic). also radeontop and intel_gpu_top will help in debugging / getting it working.

https://wiki.archlinux.org/title/mpv#Hardware_video_accelera...


I disabled hardware acceleration, it was on by default. I think seeking is faster with it off and I believe there was another advantage, which I don't remember now. I find that CPU usage is negligible, but YMMV.


On older hardware it makes a huge difference. Also very useful if you are on a battery, in my experience it can be the difference between 2 hours or 6 hours of battery life. I think it's off by default because hardware acceleration sometimes introduces visual artifacts but these are so minor I would prefer the extra 4 hours of battery life and not giving a hot laptop. YMMV and indeed it may not be noticeable on newer hardware and maybe not an issue if there are no batteries.


If you use jellyfin jellyfin-mpv-shim lets you play streams in mpv without worrying about transcoding.

https://github.com/jellyfin/jellyfin-mpv-shim

Other fun tricks

If you use jaro instead of xdg-open you can make video links automatically open in mpv while regular web links open in your browser of choice.

https://github.com/isamert/jaro

If you use elfeed its nice to watch video entries in mpv without a side trip to the browser. Stolen from Prot somewhere or other.

  (defun prot/elfeed-mpv-dwim ()
  "Play entry link with external `mpv' program.
  When there is an audio enclosure (podcast), play just the audio.
  Else spawn a video player at a resolution that accounts for the
  current monitor's width."
  (interactive)
  (let\* ((entry (if (eq major-mode 'elfeed-show-mode)
   elfeed-show-entry
   (elfeed-search-selected :ignore-region)))
  (link (elfeed-entry-link entry))
  (enclosure (elt (car (elfeed-entry-enclosures entry)) 0)) ; fragile?
  (audio "")
  ;; Here the display width checks if I am on the laptop
  (height (if (<= (display-pixel-width ) 1366) 720 1080))
  (video (format "--ytdl-format=bestvideo[height<=?%s]+bestaudio/best" height))
  ;; (buf (pop-to-buffer "*elfeed-mpv-output*"))
  )
  (run-hooks 'prot/elfeed-mpv-hook)
  (if enclosure              ; make this its own parametrised function
  (progn
   (start-process "f fuckoff audio-mpv" nil "mpv"  enclosure)
   (message (concat "Launching MPV for " (propertize enclosure 'face 'success))))
  (start-process "f fuckoff video-mpv" nil "mpv" video link)
  (message (concat "Launching MPV for " (propertize link 'face 'success))))))
At one point I wrote script to prompt for a name if passed more than one argument and create a playlist and remember the last n playlists and regular files opened so you could in turn pull up this list and narrow with rofi but as of late I'm just adding videos to jellyfin.

Umpv is a script that emulates single instance mode whereby arguments are simply pushed to the existing players playlist instead of opening a new player.

https://github.com/mpv-player/mpv/blob/master/TOOLS/umpv


I have never understood why this player doesn't have a GUI where settings can be adjusted. It only has a bare-bones window. Command-line has it's place, but I don't think poring over man pages to find the command-line switch to change an algo or whatever is called for is the correct interface for a video player.

A video player is an interface for the human. Command-lines are better for things that need to interface with a computer.


There are plenty of wrappers for it that are even older than it (because they were once for mplayer/mplayer2.)

If you're confused that the programmers of media playing and manipulating software aren't interested in GUIs that plenty of other people have volunteered to write, I don't know what to tell you.

My favorite (really the only one I've used for many years) is smplayer. It gets everything about GUI right that VLC gets horribly wrong. Notably, its developers only work on a GUI, and don't develop mpv. It's cross-platform, too.

edit: https://en.wikipedia.org/wiki/Mpv_(media_player)#Interface_a...


> I have never understood why this player doesn't have a GUI where settings can be adjusted.

I'll start by saying that `mpv` is likely not for you.

Personally, I see little value in such complex GUI. 99% of the times I double click on a video and I want it to play. I don't need a fancy wizard to customise any settings.

I just have tiny config file I created in 2016 and it still works today -- and the fact that it's a text file means it's just been part of my dotfiles all this time and carries over onto new systems.


double-click? So you /do/ use a GUI! I type 'mpv filename' in my terminal. I don't need a fancy GUI to choose my files.


Sure. I use MPV on every machine I have so windows too - where I doubleclick.


There are GUIs based on mpv that provide a user-friendly interface and just use mpv for playback, see Celluloid [0].

[0]: https://celluloid-player.github.io/


I never invoke mpv from my command line shell, I invoke it through my file managers (Dolphin or dired). I configure mpv using my text editor to edit the configuration file at ~/.config/mpv/mpv.conf. If I want to make on-the-fly changes I use my mouse and keyboard to invoke key bindings. If I don't have a keybinding set for whatever I want to change and don't want to edit my config for it, then I can use the built-in REPL to change it (but I very rarely have a reason to do this.)

> correct interface for a video player.

That 'correctness' is subjective. It isn't correct for you, but it is for me.


Text is the universal interface. It can be easily be output and input by both people and computers.

That said, there are plenty of video players with very robust GUIs. What's wrong with having one that is focused on people who want to use the command line?


> I have never understood why this player doesn't have a GUI where settings can be adjusted.

I'm not into MPV, but as a MPlayer (http://www.mplayerhq.hu) user, I perfectly understand your point, however there's a reason some software still uses TUIs. Video players are different beasts compared to other apps; very often you end up changing one or more settings in a per video basis, which makes the text interface a lot more useable than having to look for that control to tweak among hundreds. Also, external interfaces can be added almost trivially; Mpv itself is embedded in a lot of GUI software without the user even noticing.

When I first started using MPlayer (ages ago, had to compile it every time, codecs back then had to be "imported" from Windows, etc.) I also thought the text interface was clumsy and old looking, then I familiarized with it, used it on a daily basis to transcode videos using the MEncoder companion encoding software, and after some time MPlayer became, and still is, my favorite video player under Linux.

> A video player is an interface for the human. Command-lines are better for things that need to interface with a computer.

I have memories of assistants learning Wordstar key sequences faster than many current geeks learn vi ones. It's wonderful how sometimes humans can adapt.

Just to clarify: I love well made GUIs; it's just that sometimes they're less necessary than we think.


The control trend lately is to have a global search in settings (and also commands).


You're not going to understand 95% of mpv's settings without a very detailed explanation anyway, unless you're one of its developers.

Anyhow, I configured mine back when I switched to it (probably around 2013), and never had to touch it again. Doesn't seem like a huge problem.


I think the man page for MPV is a little too detailed. Sometimes all you need is a list of flags and a brief description of what they do - but some documentation (looking at you rsync and mpv) is designed to teach you mastery over the tool - which is a little overkill most of the time.


The detailed manpage is great. The more details the manpage has for each flag, the easier it is for me to find the flag I'm looking for by searching for related terms. Longer descriptions means a greater chance of my related search term hitting a relevant result.

Common flags and short descriptions of them can be found with `mpv --help` or `tldr mpv`

rsync is another example of a manpage I love. Very detailed means very useful. With a detailed manpage, I don't have to waste my time figuring out where the real manual is.


> Sometimes all you need is a list of flags and a brief description of what they do [...]

$ mpv --list-<options|properties>

Pipe to a grep-like program for keywords.


>I have never understood why this player doesn't have a GUI where settings can be adjusted.

Have you ever had a look at how long the mpv settings documentation is?

https://mpv.io/manual/master/


mpv is not for you.

I think it's perfect.


If you want a GUI try IINA it is built on top of mpv and is polished.


That's what I use


I chose mpv (and before that, mplayer) exactly because it doesn't have all that bling.


I share your sentiment. People make GUIs for MPV but I'd rather just use a media player designed for GUI users out of the box. Got nothing against ffmpeg, wonderful tool, just some things I think need a proper GUI.


SMplayer is awesome frontend and cross platform.


Meta: While these are good tools, what's going on here? Seems like a number of these older opensource projects have hit the HN frontpage today.


I've always used mplayer for command line video playback. How does mpv compare to that?


To a first degree approximation, it's the actively-developed fork of mplayer.


It is mplayer but better.


mpv is the successor to mplayer2, which was the successor of mplayer.


You can use --vo=tct if you're on console. Also I heard MPV has Sixel support now, but I couldn't get it working when I tried.


I'm sorry if this is obvious, but did you double-check your mpv was built with Sixel support? `mpv --vo=help` will list the video outputs your build of mpv supports; sixel should be listed there if your mpv was built with it, but I suspect most distros package mpv without sixel support.


A problem I had with MPV was that turning it up past 100% had very obvious distortion whereas VLC didn't have this when at the same volume so unfortunately, I am stuck with VLC on Linux unless I figure out whats wrong.


I don't know how VLC does it, but the asoftclip ffmpeg filter probably does what you want.


Thanks, will give that a go


You realise how gain works, right? If it’s above 100% it will clip because there isn’t infinite headroom


Sure, but something else seems to be going on:

> whereas VLC didn't have this when at the same volume


Soft limiting, as opposed to clipping, avoids audible distortion.



I've been using mpv for the last couple of years as my main media player simply because it was the best one I could find that supports ReShade, because I'm a weirdo who likes fuzzy CRT shaders on my 90s television rips (and other things too)


Can anyone who’s used both explain the differences / advantages of this over vlc?


It loads much faster than VLC and it also seems faster in general. The GUI is very minimalistic and you can leave only the video itself (with the 'no-border' setting). It has a bunch of nice little features/settings, but it requires some exploration and changing config files...

I switched from VLC to mpv some years ago and never looked back. It's just better for opening random video/audio files, IMO.


For one thing, VLC on macOS has become so unreliable it's more or less unusable. Randomly won't play valid video streams, slow or completely broken seeking, and even intermittently crashes.

I switched to IINA and haven't looked back, it's incredibly good for most cases. Unfortunate that it's Mac-only software; not a multi-platform capable solution.

https://iina.io/

MPV is the only video player I'm aware of which is available for every common desktop platform and works consistently across them.


Odd, I would have described VLC on mac as “bulletproof”. Are you maybe on an M1 mac?


mpv has better support for playing videos from the web. You can paste a youtube link into vlc's "Open Network Stream..." dialogue, but because VLC doesn't use yt-dlp for this it often doesn't work at all (it presently doesn't work for me) and works with fewer websites than mpv.

Also mpv's json IPC interface is easier to use with better documentation than any of VLC's numerous remote control protocols (which aren't mentioned in the manpage, and have incomplete hand-wavy documentation spread across numerous poorly organized wiki pages.)


One very neat feature, mpv can play videos (with sound) directly in your terminal (no extra windows needed):

    mpv --vo=tct 'https://www.instagram.com/p/CfZK86fozXa/'


It sucks, it uses too much CPU. DRM/KMS it's MUCH better.


I had better luck with it on older hardware than VLC.


I have the impression that the “Ten Thousand” [1] effect has increased quite significantly in the last couple of months.

I have seen multiple submissions from different users pointing to homepages of software that is already very popular. I guess this is a sign that the current most active Hacker News users are also in the youngest age group, which makes all these programs look new.

Just the other day someone posted about the Vala programming language [2].

SpaceVIm [3], although, this was mostly a 2.0 release announcement.

I wonder if Hacker News administrators have considered creating a separate page for these submissions to keep the front page clean. Basically, put previously-submitted links into a “revival” page, and novelty links in the “new” page.

[1] https://xkcd.com/1053/

[2] https://news.ycombinator.com/item?id=32113825

[3] https://news.ycombinator.com/item?id=31986851


Then again I always come into these threads for the comments, even (/especially) when I know the software bring discussed.

There is usually interesting discussion, info and tips - like in this thread.


It's the reddit effect. As reddit's popularity keep increasing for the past 5 years or so, HN links posted on the platform get that much more attention. Specially true for indians, pakistanis and chinese.


mpv also does fine as a simple image viewer. Bind image mime types to /usr/bin/mpv, and you're golden. If you want a slideshow, run `mpv /path/to/image/dir`.


I prefer feh normally but I did for some reason prefer it for viewing the hourly weather (US specific but maybe similar is available elsewhere). I bind a key to

mpv --no-terminal --no-osc --image-display-duration=inf --title=weather --x11-name=weather --wayland-app-id=weather

followed by the weather.gov url (the image link there with selected options goes to the current. I also have a kitty +kitten icat alias for viewing in the terminal, although for hourly weather I usually use mpv. Also small radar images that are available (0 = latest 9 = oldest, radar names shown on main radar.weather.gov page next to the circled checkmark):

https://radar.weather.gov/ridge/lite/

Those I look at via icat since I'll keep them around to see how things are moving if I don't head out right away. For longer term weather there is a text forcast:

https://tgftp.nws.noaa.gov/data/forecasts/zone/

Some of the files are confusingly similar but with subtle differences that I don't remember. I use:

alias tw='/bin/curl -s '\''https://tgftp.nws.noaa.gov/data/forecasts/zone/or/orz006.txt...' | sed '\'':a; /^[[:space:]]*$/ { $d; N; ba; }'\'''


I love mpv. It is my default media player in both Linux and Android.


I'm glad that Plex is using mpv these days. Makes it a lot nicer to use on my Apple TV, since you can basically throw anything at it without the need for transcoding.


nyanmp, a brutal suckless-like x11/vulkan/alsa linux open-source video player based on ffmpeg: https://rocketgit.com/user/sylware/nyanmp/source

(grin)


If the idea is radical minimalism, what advantage does nyanmp have over ffplay?


Curious as to what the advantages of this are over mpv?


License (AGPLv3) doesn't make sense for a video player. It only scares any use in corporate environment.


Makes sense to me. Software for common people, but not for corporations or people with an abnormal legal paranoia. WTFPL is probably also good for this, lawyers seem to hate it but normal people are free to use it without worry.

Imagine the motivation somebody might have for releasing their software under a noncommercial freeware license. AGPLv3 is not a noncommercial freeware license but it de facto filters big tech corps as a noncommercial license might, with the added bonus of allowing the use of any GPLv2-or-later code. Best of both worlds.


I love mpv - it works much better on my Linux laptop than vlc for some reason, (I think wayland related).


I use it for most media playback, except some like MIDI that aren't supported.


mpv is what powers smplayer, my absolute favorite movie player app (sooo much better than vlc).

By itself, mpv isn't very user-friendly though, it needs to be wrapped up in a third-party GUI, then its power really shines.


Still waiting for them to build an Apple Silicon build. Great player though.


Would highly recommend IINA. macOS native video player that uses mpv as a backend. 100% free and open source. https://github.com/iina/iina


A superb piece of software.


Problem with MPV is that they don't provide any compiled binaries.


Is that such a big issue when binary packages are available from pretty much every package manager out there?


They are all not official and don't inspire confidence.


Haruna is a nice front-end of it for Qt


Have you never used anything other than a DVD or Windows media player? This is ancient!

It's very good, but frankly, why is this news to anyone?


But still relevant and sparked interesting discussion




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: