Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#18901 closed enhancement (fixed)

mpv-0.37.0 (needs additional packages to be added)

Reported by: Bruce Dubbs Owned by: Douglas R. Reno
Priority: normal Milestone: 12.1
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

New minor version.

Change History (13)

comment:1 by Bruce Dubbs, 5 months ago

Owner: changed from blfs-book to Bruce Dubbs
Status: newassigned

comment:2 by Bruce Dubbs, 5 months ago

Release 0.37.0

This release requires FFmpeg 4.4 or newer and libplacebo 6.338.0 or newer.

This is the first release to unconditionally require libplacebo, but note that the new improved renderer (vo_gpu_next) is not yet the default.

Features

New

  • ao_oss: add SPDIF passthrough support
  • hwtransfer: implement support for HW->HW format conversions
  • stream/dvbin: add support for delivery system ISDB-T
  • audio/chmap: support up to 64 channels (including 22.2 layout)
  • libmpv: add mpv_time_ns()
  • vo_gpu, vo_gpu_next: add Vulkan support for macOS
  • meson: make libplacebo a required dependency
  • hwdec: support videotoolbox hwdec with libplacebo

Changed

  • msg: print warning and error messages to stderr
  • options: restore old default subtitle selection behavior
  • input.conf: swap wheel up/down with wheel left/right

Removed

  • waf: remove waf as a build system
  • osc.lua: remove toggle for forced only subpictures (appeared as [F])
  • mac: remove runtime checks and compatibility for macOS older than 10.15
  • cocoa: remove deprecated OpenGL cocoa backend

Options and Commands

Added

  • vo_gpu_next: add --hdr-peak-percentile
  • player: add --term-remaining-playtime option
  • x11: add --x11-wid-title option
  • vo_gpu_next: add --libplacebo-opts
  • player: add --subs-match-os-language option (replaces 'auto' option)
  • vo: add --video-crop
  • win32: add --window-corners, --window-affinity, --title-bar, --backdrop-type
  • sub: add --sub-stretch-durations option

Changed

  • builtin.conf: add --hdr-peak-percentile=99.995 to gpu-hq profile
  • player: add 'always' option to --subs-fallback-forced
  • demux_playlist: default to --directory-mode=lazy
  • builtin.conf: add --allow-delayed-peak-detect=no to gpu-hq profile
  • vo_gpu, vo_gpu_next: support --icc-3dlut-size=auto
  • demux: prepend some cache options with --demuxer-
  • builtin.conf: modernize internal profiles for higher quality rendering by default, rename 'gpu-hq' profile to 'high-quality', add 'fast' profile
  • vo_gpu, vo_gpu_next: default to dscale=hermite
  • builtin.conf: remove deprecated 'opengl-hq' profile
  • options: remove a bunch of old option fallbacks/deprecated ones
  • vo_gpu: allow --deband-iterations to be 0
  • stream_cdda: deprecate --cdda-toc-bias and always check for offsets
  • options: disable --allow-delayed-peak-detect by default
  • options: adjust default of --watch-later-options

Deprecated

  • command: deprecate shared-script-properties
  • demux_cue: deprecate --demuxer-cue-codepage for --metadata-codepage

Removed

  • player: remove special 'auto' option from alang/slang/vlang (previous default)
  • vo_gpu: remove --tone-mapping-mode
  • vo_gpu: remove --scale-wblur, --scale-cutoff etc.
  • vo_gpu: remove --scaler-lut-size
  • m_option: drop support for -del for list options

Fixes and Minor Enhancements

  • build: remove unneeded libdl requirement for vaapi
  • zimg: fix abort on subsampled input with odd heights
  • video_writer: fix gamma for YUV screenshots
  • player/video: fix possible crash when changing lavfi-complex
  • ad_spdif: fix segfault due to early deallocation
  • ao_pipewire: fix race conditon with setting the media role
  • draw_bmp: fix overflowing coordinates in mark_rcs
  • ao_sndio: use sio_flush() to improve controls responsiveness
  • vo_vdpau: fix hwdec for this vo
  • vo_gpu, vo_gpu_next: fix setting an empty dscale
  • vd_lavc: repeatedly attempt to fallback if hwdec fails in reinit
  • options: fix relative time parsing on negative input
  • win32: signal DPI changes correctly
  • mp_image: properly infer color levels for some pixfmts
  • vo_gpu_next: add ability to use named hook params
  • vo_gpu_next: take into account PAR when taking screenshots
  • ao_audiotrack: support more channel layouts
  • osc.lua: support speed-independent time-remaining display
  • sub: fix switching tracks while paused
  • audio: fix clipping with gapless audio enabled
  • player/video: avoid spamming logs with EOF
  • player/command: detect aspect ratio name and show it in stats.lua
  • wayland: keyboard input fixes
  • demux_playlist: remove len restriction on headerless m3u
  • win32: fix display resolution calculation on mulitple monitors
  • vo_gpu_next: multiple adjustments and fixes to interpolation
  • loadfile: avoid infinite playlist loading loops
  • context_drm_egl: don't free EGL properties if they are null
  • x11: require xrandr 1.4, remove xinerama support
  • drm_common: skip cards that don't have connected outputs
  • win32_common: fixes minimized window being focused on launch
  • ao/jack: set device_buffer to JACK buffer size
  • meson: rename all features with underscores
  • input: add new keys: Back, Tools, ZoomIn, ZoomOut
  • win32: don't ignore --screen and --fs-screen
  • input: add missing keypad key defines and Windows multimedia keys
  • player: use audio pts corresponding to playing audio on EOF
  • command: add sub-ass-extradata property
  • vo_dmabuf_wayland: unmap osd surface when not needed
  • player: always write redirect entries for resuming playback
  • stats.lua: reorganize how video params are displayed
  • stats.lua: display HDR metadata
  • osc.lua: add scrolling to the seekbar
  • demux_lavf: prefer track durations over container durations to determine total
  • vo: vulkan: allow picking devices by UUID
  • video: allow overriding container crop if it is present
  • vo_gpu, vo_gpu_next, screenshot: support applying crop for screenshots
  • sd_lavc: account for floating point inaccuracy, fix sub PTS
  • stream: accept dav:// and davs:// urls
  • filter_kernels: refine some constants
  • filter_kernels: add ewa_lanczos4sharpest
  • osc.lua: add scrolling to audio/sub buttons
  • demux_mkv: support cropping and rotation
  • vo_dmabuf_wayland: support 90 degree rotations
  • filter_kernels: add hermite filter
  • vo: avoid unnecessary redraws when the OSD shows
  • scripting: support DLL cplugins
  • af_scaletempo2: various bug fixes
  • sdl_gamepad: fix button detection on modern controllers
  • vo_dmabuf_wayland: support osd rendering when there's no video
  • demux_playlist: add --directory-mode=auto
  • vo_gpu_next: use proper color for subtitles
  • win32: add an option to change window affinity and control title bar state
  • win32: reduce top border thickness to imitate DWM invisible borders
  • wayland: remove gnome-specific idle-inhibit warning
  • win32: pass window handle to the window-id property
  • osc.lua: fix calculation for slider's min-max average
  • recorder: fix a couple of memory leaks
  • af_scaletempo2: raise max playback rate to 8.0
  • osc.lua: move the idle logo behind other overlays
  • hwdec_drmprime: add nv16 support
  • various: change internal timing code to work in nanoseconds instead of microseconds
  • vo: increase display refresh rate estimation limit from 99 Hz to 400 Hz
  • external_files: base cover-art-whitelist on cover-art-auto-exts
  • path: don't override cache and state paths with --config-dir
  • codec_tags: map some more image mimetypes
  • af/vf-command: add ability to target a specific lavfi filter
  • win32: prevent white window flash on startup
  • demux_playlist: use --metacode-codepage when parsing playlist files
  • video: revert racey change that led to stutter and deadlocking
  • console.lua: various improvements
  • command: add playlist-next-playlist and playlist-prev-playlist
  • ytdl_hook.lua: set metadata with single tracks
  • defaults.lua: add a disabled parameter to timer constructors
  • terminal-unix: race condition fixes
  • af_scaletempo2: better defaults
  • hwtransfer: handle hwcontexts that don't implement frame constraints
  • stream_cdda: remove fallback for ancient libcdio versions
  • osdep: drop support for C11 without atomics
  • dvbin: do a big cleanup on code style and functions
  • ytdl_hook.lua: parse the separate cookies field
  • sub: update subtitles if current track is an image
  • javascript: use --js-memory-report option instead of MPV_LEAK_REPORT
  • ao_coreaudio: signal buffer underruns
  • ytdl_hook.lua: support thumbnails
  • demux: make hysteresis-secs respect cache-secs
  • mp_image: pass rotation correctly to/from AVFrame correctly
  • various: add new internal mp_thread abstraction and use it
  • drm: use present_sync mechanism for presentation feedback
  • vo_gpu: apply ICC profile and dithering only to window screenshots
  • audio: introduce ao_read_data_nonblocking() and use it in relevant backends
  • wayland: obey initial size hints set by the compositor
  • command: export storage aspect ratio (sar) properties
  • vo: delay vsync samples by at least 10 refreshes to improve convergence time
  • vo_sdl: fix broken mouse wheel multiplier
  • vo_gpu_next: simplify cache code and don't re-save when unmodified

This listing is not complete. Check DOCS/client-api-changes.rst for a history of changes to the client API, and DOCS/interface-changes.rst for a history of changes to other user-visible interfaces.

comment:3 by Douglas R. Reno, 5 months ago

Owner: changed from Bruce Dubbs to Douglas R. Reno
Status: assignednew
Summary: mpv-0.37.0mpv-0.37.0 (needs additional packages to be added)

Bruce has asked me to take this on because it requires several new packages. The libplacebo dependency is unconditional.

The chain essentially goes...

libplacebo

  • Vulkan: needs vulkan-icd-loader and vulkan-headers
  • OpenGL: needs glad and then glfw

For a while we've sort of ignored Vulkan, but I think it's time that we add support for it to the book. It's now used in a lot of different applications, and in the book currently we have references to mesa, gtksourceview5, gtk4, qt5, qt6, gst-plugins-bad, and pipewire.

Looking at Arch paints a slightly different picture. They also have Vulkan listed for ffmpeg, and libplacebo listed for VLC. I will add both of those in as optionals in a commit later today so it's easier for me to track them.

Vulkan drivers will need to be enabled in Mesa, and that's where most hardware support will come from, but that should be good. :)

Vulkan is described as "a low-overhead, cross-platform API, open standard for 3D graphics and computing developed by Khronos Group, a successor to OpenGL.". On benchmarks and applications which use it, the performance increase is quite notable. The support should be present for AMDGPU and Intel GPUs, as well as SWRast and Nouveau through the NVK driver in Mesa. The kernel support for this driver, known as NVK, was added in February.

For testing, I'm going to use Half-Life 2 with Vulkan support, Portal, and VKMark. I'll also use MPV and VLC to play videos and try to get those both to use the Vulkan renderer. I will also handle testing on 32-bit.

This will take me a few days to get to, but I may have it in as early as the weekend.

comment:4 by Douglas R. Reno, 5 months ago

Status: newassigned

in reply to:  3 comment:5 by Xi Ruoyao, 5 months ago

Replying to Douglas R. Reno:

Bruce has asked me to take this on because it requires several new packages. The libplacebo dependency is unconditional.

The chain essentially goes...

libplacebo

  • Vulkan: needs vulkan-icd-loader and vulkan-headers
  • OpenGL: needs glad and then glfw

Is it select-able at build time or we must have these four dependencies? If it's select-able I prefer only adding Vulkan dependencies.

comment:6 by Tim Tassonis, 5 months ago

I installed glad and then tried to build libplacebo, using the following commands:

meson setup --prefix=/opt/X11 --buildtype=release -Dvulkan=disabled ..

../src/include/libplacebo/vulkan.h:21:10: fatal error: vulkan/vulkan.h: No such file or directory

21 | #include <vulkan/vulkan.h>

So, it seems, it needs at least some vulkan headers.

What package does provide those?

comment:7 by Tim Tassonis, 5 months ago

Sorry for asking before checking myself, they are here:

https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.270.tar.gz

comment:8 by Tim Tassonis, 5 months ago

Just as some input from me:

I successfully built mpv-0.37.0 by

mkdir build
cd build || exit
cmake -DCMAKE_INSTALL_PREFIX=/usr -S ..  
sudo make install
mkdir build
cd build || exit
meson setup --prefix=/opt/X11 --buildtype=release -Ddemos=false -Dvulkan=disabled ..
ninja || exit
DESTDIR=$DESTDIR ninja install # or sudo, of course

After that, the new mpv builds and runs fine, and by specifying:

mpv -vo gpu-next $file

it will use the new "Shader-based GPU renderer"

So, I suppose, these are the minimal new dependencies.

comment:9 by Tim Tassonis, 5 months ago

Seems that vlc 3.0.20 and libplacebo-6.338.1 don't mix well, my vlc compile failed with placebo installed.

Maybe there is a patch for vlc, in the meantime

--disable-libplacebo

in vlc also works.

comment:10 by Douglas R. Reno, 5 months ago

Things are moving decently well with Vulkan.

I've installed assimp and vkmark on my system to run a series of tests/benchmarks using Vulkan. Here are the results from my development system:

renodr [ /sources ]$ vkmark                                                                                                                       
=======================================================                                                                                           
    vkmark 2017.08                                                                                                                                
=======================================================                                                                                           
    Vendor ID:      0x1002                                                                                                                        
    Device ID:      0x67EF                                                                                                                        
    Device Name:    AMD Radeon RX 460 Graphics (RADV POLARIS11)                                                                                   
    Driver Version: 96473096                                                                                                                      
    Device UUID:    d3184c17208c9a5d65803da956b51387                                                                                              
=======================================================                                                                                           
[vertex] device-local=true: FPS: 14025 FrameTime: 0.071 ms                                                                                        
[vertex] device-local=false: FPS: 5675 FrameTime: 0.176 ms                                                                                        
[texture] anisotropy=0: FPS: 12628 FrameTime: 0.079 ms                                                                                            
[texture] anisotropy=16: FPS: 12579 FrameTime: 0.079 ms                                                                                           
[shading] shading=gouraud: FPS: 11828 FrameTime: 0.085 ms                                                                                         
[shading] shading=blinn-phong-inf: FPS: 11852 FrameTime: 0.084 ms                                                                                 
[shading] shading=phong: FPS: 11704 FrameTime: 0.085 ms                                                                                           
[shading] shading=cel: FPS: 11977 FrameTime: 0.083 ms                                                                                             
[effect2d] kernel=edge: FPS: 12339 FrameTime: 0.081 ms                                                                                            
[effect2d] kernel=blur: FPS: 6740 FrameTime: 0.148 ms                                                                                             
[desktop] <default>: FPS: 7619 FrameTime: 0.131 ms                                                                                                
[cube] <default>: FPS: 15514 FrameTime: 0.064 ms                                                                                                  
[clear] <default>: FPS: 16170 FrameTime: 0.062 ms                                                                                                 
=======================================================                                                                                           
                                   vkmark Score: 11588                                                                                            
=======================================================

I can tell that the results above are not using llvmpipe. The CPU usage is almost negligible, and forcing it to use llvmpipe (with a -D option to vkmark) results in much lower framerates and very high CPU usage.

I think I'm about 3/4s of the way done. The next step is going to be to test building the packages that can use Vulkan in the book (currently that is pipewire, gst10-plugins-bad, ffmpeg, qt5, qt6, and gtksourceview5). In addition I still need to finish testing on Intel and on my 32-bit system, and libplacebo and it's dependencies still need to be added to the book. VLC also needs to be fixed and tested to work with libplacebo. I will do all of this in my branch, which can be merged once I am done with it. I have been keeping it on-base with trunk to make it easier to merge. On the 32-bit system I primarily plan to test VLC and MPV, as well as run vkmark to get an idea of the results and the performance difference.

GNOME Terminal was recently ported to use Vulkan's codepath for GTK-4 by one of it's developers (https://x.com/hergertme/status/1730070318117699976?s=20). From the tweet:

Christian Hergert @hergertme@fosstodon.org
@hergertme
Got my 15 year old Thinkpad X300 out of storage. It's a 1200mhz Core 2 Duo w/ 4GB RAM 
and Intel 965GM graphics.

The terminal work myself and others have done took a test case from 4 minutes to 2m21s. 
Over 40% reduction in running time even on ancient machines.

When it comes to VLC, Arch has a patch to make it build with libplacebo: https://gitlab.archlinux.org/archlinux/packaging/packages/vlc/-/blob/main/libplacebo-5.patch?ref_type=heads. I haven't tested that yet since I do not currently have libplacebo on my system, but will report back if that works.

For now I'm going to continue building out my 32-bit system, and tonight will also begin doing build tests on packages in the book which use Vulkan.

At this time I do not believe the AMD Vulkan driver is needed. The one from Mesa seems to do a good enough job, at least for my RX 460. Running 'lsof' seems to indicate that the Mesa drivers are being utilized.

Last edited 5 months ago by Douglas R. Reno (previous) (diff)

comment:11 by Douglas R. Reno, 5 months ago

Resolution: fixed
Status: assignedclosed

MPV, libplacebo, and Vulkan have been added to the book at the following commits:

comment:12 by Xi Ruoyao, 5 months ago

Hmm, why are we using a .rc1 for SPIRV-Tools? The latest stable release seems 2023.2.

in reply to:  12 comment:13 by Xi Ruoyao, 5 months ago

Replying to Xi Ruoyao:

Hmm, why are we using a .rc1 for SPIRV-Tools? The latest stable release seems 2023.2.

<renodr> It's what is supposed to match 1.3.268.0 of SPIRV-Headers.

Note: See TracTickets for help on using tickets.