>
Tech News

I replaced VLC for 4K. This open-source player actually keeps up.

VLC has been my default video player for years. It plays every format, works on every platform, and is free. But when I started watching more 4K content, VLC started breaking my trust. The problem was stuttering on HEVC (High Efficiency Video Coding, a modern video compression standard also known as H.265) 10-bit files, dropped frames on 60fps (frames per second) content, and a hardware-accel toggle that worked on Tuesday and silently disabled itself by Friday. I tried VLC’s preferences menu, scoured the forums, and gave up. Then I tried mpv (a free, open-source media player that is built around a command-line core and a scriptable configuration model) and the 4K content started playing. This is what I learned, including the part where I had to learn what a config file is.

The actual reason VLC choked on 4K

VLC is a Qt-based (a cross-platform application framework used for building desktop UIs) application, and the rendering pipeline goes through Qt’s video output abstraction. The abstraction is great for portability, but it adds a copy step between the decoder and the screen, and that copy step is what dropped frames on HEVC 10-bit at 4K resolution on my 2019 Intel MacBook Pro. The hardware acceleration in VLC’s preferences is a per-output toggle, and the version I was running had a bug where the toggle would silently revert after a crash. I am not the first person to hit this, and I will not be the last.

mpv does not use a UI abstraction layer. It renders directly to the GPU (graphics processing unit) via a built-in video output backend, and the config is a plain text file you can read. When I opened a 4K HEVC 10-bit file in mpv, the same hardware acceleration I had been fighting in VLC just worked. The dropped frames were gone, the audio was in sync, and the player did not need me to toggle anything.

The config file that makes mpv behave

mpv comes with a sensible default config, but the defaults are tuned for the lowest common denominator. The first thing I added to ~/.config/mpv/mpv.conf (a hidden text file in your home directory where mpv stores its configuration) was a hardware acceleration flag and a cache size bump. The full block I use today is short, and I will paste it below because most guides on the internet bury the actual lines.

  • hwdec=auto-safe tells mpv to use hardware decoding when the codec (the compression format used to encode the video stream) is supported, and to fall back to software when it is not. The safe variant does not pick a hardware path that is known to be buggy on some drivers.
  • cache=yes enables a network cache for streaming URLs. This matters for IPTV (Internet Protocol Television, video streamed over the internet rather than broadcast) and for any file you load over SMB (Server Message Block, the Windows file-sharing protocol).
  • demuxer-max-bytes=400MiB raises the demuxer (the component that splits a media file into separate audio and video streams) buffer ceiling for high-bitrate 4K content. The default is 200 MiB, which is fine for 1080p but tight for some 4K HDR (High Dynamic Range, a format that includes brighter highlights and darker shadows than standard video) Blu-ray rips.
  • gpu-api=vulkan on Linux forces the Vulkan rendering backend. On macOS, mpv uses Metal by default, and on Windows it uses Direct3D 11 by default. You usually do not need to change this, but if a specific file refuses to render correctly, the gpu-api switch is the first knob to try.
  • vo=gpu is the default video output, and you almost never need to change it. I mention it because some older guides suggest vo=vdpau (a Linux-specific GPU video acceleration API) for Nvidia cards, which is outdated.

That is the whole config. mpv does not need a preferences menu, a registry entry, or a hidden XML file. The config is a text file, the text file has comments, and you can read it in five minutes.

What mpv does not do well

mpv is a player, not a media library. There is no library view, no cover art, no “recently added” list, and no metadata editor. If you want a GUI (graphical user interface) library front-end for mpv, the most common choices are SMPlayer and Celluloid (the GNOME front-end, formerly GNOME MPV). Both wrap mpv in a Qt or GTK (GIMP Toolkit, the widget library used by GNOME) shell that adds a library view on top. Both inherit mpv’s config file, so the hardware acceleration still works.

The other thing mpv does not do is auto-update. The macOS package I installed is the latest stable release, and the project ships a new stable roughly every six months. If you want the bleeding edge, you build from source, and the source build is well documented. If you do not want to build from source, the homebrew formula (a Homebrew package definition, used by the macOS package manager) is up to date.

The 4K test that made me switch

The file that broke VLC was a 4K HEVC 10-bit rip of a nature documentary at 60fps. On VLC, the file played for about 90 seconds and then started dropping every fifth frame. On mpv with the config above, the same file played for two hours without a single dropped frame. I ran the same test on a 4K AV1 sample (AV1 is a royalty-free video codec developed by the Alliance for Open Media, used by YouTube and Netflix for high-resolution streams), and mpv played it at full frame rate on hardware acceleration while VLC fell back to software decoding and ran at roughly 12fps.

The honest comparison: if you watch 1080p H.264 content (the most common codec for Blu-ray and streaming), VLC is fine. The difference between VLC and mpv at 1080p is in the noise. At 4K HEVC 10-bit, 4K AV1, and any 4K HDR content, mpv wins by a wide margin, and the win is not a small one.

Trade-offs

mpv is not a free win in time. The config file is a real learning curve if you have never edited one. The lack of a media library means you give up the “open the app and see my files” UX (user experience) that VLC, IINA, and the Windows Media Player legacy apps have been building for two decades. On macOS, the lack of native Touch Bar support is a minor annoyance if you have a Touch Bar Mac.

In my case, the trade-off was worth it because I was spending 6-8 hours a week watching 4K content, and the dropped frames were making me not want to watch at all. Your math will be different if you are mostly watching 1080p, or if you want a media library, or if you have a media server (Plex, Jellyfin, Emby) that already does the library part for you. mpv plays files; it does not organize them.

The migration took about 90 minutes, including reading the man page and writing the config. The thing that was harder than expected was learning the keyboard shortcuts, which are completely different from VLC’s. The thing that was easier than expected was the config file itself; it is shorter than the VLC preferences pane.

If you watch 4K HEVC 10-bit, 4K AV1, or any 4K HDR content on a regular basis, mpv is a clear win. If you watch mostly 1080p and want a library view, IINA (a macOS-native mpv front-end) gives you a library and still uses mpv’s backend.

Bottom line

mpv is the player for 4K content that VLC is not. The config file is small, the hardware acceleration just works, and the dropped frames are gone. The trade-off is a learning curve and no media library. If you only watch 1080p, VLC is fine and the switch is not worth it. If you watch 4K regularly, the switch is worth every minute of config time.

Filed under: #android

Leave a comment