Solved mpv freez the system

Hi!

After update
multimedia/mpv to version 0.40.0.1 with binary package I have a problem. Many times it freeze the laptop and help just power off.
I didn't change anything and in mpv.conf I have just:
Code:
# Dont allow windows to be larger than the screen
autofit-larger=50%x50%
# Hardware decoding
hwdec=auto
# normal top-level option
fullscreen=no
Thank you.
mpv.gif
 
hi mate

try these options

Code:
vo=gpu
hwdec=vaapi

i have these packages installed on my dell xps 15 2019
which has an nvidia gpu and intel as well

Code:
libva-intel-driver-2.4.1_3     VAAPI legacy driver for Intel GMA 4500 (Gen4) to UHD 630 (Gen9.5)
libva-2.22.0                   VAAPI wrapper and dummy driver
gstreamer1-vaapi-1.24.8        GStreamer hardware video decoding via VA-API plug-in

do you have ffmpeg installed and this package

Code:
openh264-2.3.0,2               Cisco implementation of H.264 codec

my mpv config


im on freebsd 14.2 p2 quarterly branch

this is my mpv version

pkg info mpv
mpv-0.39.0_1,1

it is possible for badly encoded videos to cause mpv to crash the system
 
I will try. I have amd gpu and I am on latest branch.
And I have Openbox but many years as I am rusing MPV I didn't have problems.
I have installed openh264-2.3.0,2.
Thank you very much.

Code:
 pkg info mpv
mpv-0.40.0,1
Name           : mpv
Version        : 0.40.0,1
Installed on   : Sun Mar 30 16:34:09 2025 EDT
Origin         : multimedia/mpv
Architecture   : FreeBSD:14:amd64
Prefix         : /usr/local
Categories     : wayland multimedia audio
Licenses       : LGPL21+, GPLv2+
Maintainer     : multimedia@FreeBSD.org
WWW            : https://mpv.io
Comment        : Free and open-source general-purpose video player
Options        :
    ALSA           : off
    ARCHIVE        : on
    CACA           : off
    CDIO           : off
    DOCS           : on
    DRM            : on
    DVDNAV         : on
    EXAMPLES       : on
    JACK           : off
    LCMS2          : on
    LIBBLURAY      : off
    LUA            : off
    LUAJIT         : on
    LUA_NONE       : off
    MANPAGES       : on
    MUJS           : off
    NVDEC          : on
    OPENAL         : off
    OPENGL         : on
    PIPEWIRE       : off
    PULSEAUDIO     : off
    RUBBERBAND     : off
    SDL            : off
    SIXEL          : off
    SNDIO          : off
    UCHARDET       : on
    V4L            : on
    VAAPI          : on
    VAPOURSYNTH    : off
    VDPAU          : on
    VULKAN         : on
    WAYLAND        : on
    X11            : on
    ZIMG           : off
Shared Libs required:
    libEGL.so.1
    libX11.so.6
    libXext.so.6
    libXpresent.so.1
    libXrandr.so.2
    libXss.so.1
    libXv.so.1
    libarchive.so.13
    libass.so.9
    libavcodec.so.60
    libavdevice.so.60
    libavfilter.so.9
    libavformat.so.60
    libavutil.so.58
    libc.so.7
    libdisplay-info.so.2
    libdrm.so.2
    libdvdnav.so.4
    libgbm.so.1
    libjpeg.so.8
    liblcms2.so.2
    libluajit-5.1.so.2
    libm.so.5
    libplacebo.so.349
    libswresample.so.4
    libswscale.so.7
    libthr.so.3
    libuchardet.so.0
    libva-drm.so.2
    libva-wayland.so.2
    libva-x11.so.2
    libva.so.2
    libvdpau.so.1
    libvulkan.so.1
    libwayland-client.so.0
    libwayland-cursor.so.0
    libwayland-egl.so.1
    libxkbcommon.so.0
    libz.so.6
Shared Libs provided:
    libmpv.so.2
Annotations    :
    FreeBSD_version: 1401000
    build_timestamp: 2025-03-27T02:03:55+0000
    built_by       : poudriere-git-3.4.2-7-gf78625a5
    cpe            : cpe:2.3:a:mpv:mpv:0.40.0:::::freebsd14:x64
    port_checkout_unclean: no
    port_git_hash  : 29f3f1e48
    ports_top_checkout_unclean: no
    ports_top_git_hash: 41118d5f4
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 6.79MiB
Description    :
Mpv is based on the MPlayer and mplayer2 projects which it greatly improves.
It supports a wide variety of video file formats, audio and video codecs, and
subtitle types. Special input URL types are available to read input from
a variety of sources other than disk files. Depending on platform, a variety of
different video and audio output methods are supported.
 
FWIW... to check vaapi set up...

First identify your CPU architecture. Find your cpu name and look it up on intel.com

for example
$ cpuid | grep -i brand
Extended brand string: "Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz"

Chip support page is here
- from that page note Code Name 'Products formerly Arrandale', this is the architecture name.

Look up the architecture name here

Find your codename in the list and check whether it was released before or after Broadwell. In this example Arrandale was released in 2010, before Broadwell which was released in 2014. Then choose which intel driver package to install as below.

$ pkg ins libva-intel-driver # for pre-broadwell cpus OR
$ pkg ins intel-media-driver # for broadwell and later cpus

Finally install libva tools
$ pkg ins libva-utils

Now run vainfo and check output looks reasonable. On my core i3-560m I get

$ vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_22
/usr/local/lib/dri/hybrid_drv_video.so init failed
Not using hybrid_drv_video.so
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ironlake Mobile - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc

I'm not sure of the significance of the hybrid driver init failing is. But we get some valid VA entrypoints.

After doing this...

1. mpv with hwdec=vaapi works with hardware video decoding

2. in firefox, go to about:support and search for HARDWARE_VIDEO_DECODING
- if it shows 'available' as per my screenshot below, you get hardware video decode in firefox, eg for yt videos.
- you don't need to change any about:config settings (AFAIK!)
- you DO need to restart FF after installing the intel driver

screenshot_2025-04-06_at_17:35:44.png


So you now have hardware accelerated video decoding operational in both mpv and the firefox video player :)
 
FWIW... to check vaapi set up...

First identify your CPU architecture. Find your cpu name and look it up on intel.com

for example
$ cpuid | grep -i brand
Extended brand string: "Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz"
And what is in case of AMD cpu and gpu?
And my settings
Code:
autofit-larger=50%x50%
# Hardware decoding
vo=gpu
hwdec=vaapi
# normal top-level option
fullscreen=no

works but before update of mpv to version 0.40.0.1 I didn't have on my laptop T495 no settings and for my use everything worked.
 
I did change now hwdec from vaapi to vdpau and it works. I have just "problem" as I have before with messgae related to sound:
"Audio device underrun detected".
 
Back
Top