How To: Configuring MPV for Best Video Quality Including 4K Upscaling Updated

Overview

Previously, I covered upscaling lower resolution video in my article, “How to Upscale Lower Resolution Video to 4K“.

As of Fall 2023, the the best graphics subsystem for the MPV media player is a combination of vo_gpu_next, libplacebo and Vulkan. This includes recent Windows-based PCs, Linux-based devices, and Android-based devices.

Although Apple devices running macOS, iOS, and tvOS prefer Metal 3, currently, there is not a Metal backend for MPV. Previously, that meant that MPV had to use Apple’s deprecated OpenGL subsystem. Now, it is possible to use MoltenVK for significant performance gains over OpenGL. You can use HomeBrew to install MPV and MoltenVK on your Mac.

mpv.conf & User Shaders

I maintain a Github repo with my recommended settings and user shaders, here. They are tailored to high quality rendering of traditional live TV and video disc formats. I have personally tested them on my Mac Studio running MacOS Sonoma. On Macs, you can download and install them in your ~[user profile]/.config/mpv folder.

Beyond upscaling, my configuration files include optimizations for resolution, colorspace, dithering, debanding, motion interpolation, and anti-ringing. And, FFMPEG’s bwdif filter for motion adaptive deinterlacing is applied to interlaced video, such as live TV.

Since I wrote the original version of this article, I have switched to FSRCNNX for luma upscaling. For luma downscaling, I recommend SSimDownscaler. For chroma upscaling and downscaling, I now recommend KrigBilateral.

In past versions of this article, I recommended using the RAVU prescaler, which is a neural network based upscaler that uses weights trained with machine learning techniques. But, that model doesn’t have a deep architecture. RAVU is based on linear regression with a single layer. By contrast, FSRCNNX uses 2D convolution layers. It is an implementation of the Fast Super-Resolution Convolutional Neural Network in TensorFlow, an open source machine learning platform.

João Vitor Chrisóstomo profiled MPV’s luma and chroma upscaling algorithms, here. He compared performance in terms of frames per second. And, he evaluated quality based on SSIM, PSNR, MS-SSIM, PSNR-HVS-M and IW-SSIM measurements.

For luma-upscaling on any content other than animation, he determined that FSRCNNX is the best quality upscaler, performance-wise. Due to how human eyes perceive chroma v. luma, the method of chroma-upscaling is less important. While KrigBilateral is superior to other algorithms, if you are performance constrained on your computer, you can fall back on Mitchell without a significant impact on video quality.

Automatic Profile Loading Based on Source Video Resolution

The profiles are defined in mpv.conf, above. Using the auto-profiles.lua script, MPV will apply different profile settings depending on the source video’s resolution, frame rate, and whether it is interlaced.



Updated on December 10th, 2023