Solved Running pkg upgrade today broke mpv

Today I ran pkg update, pkg upgrade. I then went to play a video using mpv, and got a message of not being able to open libavcodec.so.60

Did a quick websearch and it seems this problem happens from time to time. There were various suggestions, and I chose the one of reinstalling mpv from ports. Had one small problem of a conflict of dependencies, py311-docutils conflicted with py39-docutils. However, I was able to uninstall the existing py39-docutils. It didn't remove anything else. After reinstalling mpv, using ports, the video played.

I apologize for the paucity of information. I was pretty sleepy and didn't bother to note exact error messages, but I'm putting this here in case someone else does an upgrade today and runs into the same issue. It *seems* (that is, worked for me), that it can be solved by reinstalling mpv from ports (which doesn't take more than a few minutes). I also didn't pay close attention to what, if anything, was removed during the pkg upgrade. So, as a bug report, this is pretty useless, again, I'm posting in case it hits anyone else. Though I can't be sure that something obvious was removed, it may just be a library version bump or the like.
Also, for packages I have it set to latest, not quarterly.

I realized I had a test box to try so got better error messages.

When I first tried to play a video with mpv, I got
Code:
ld-elf.so.1: /usr/local/lib/libavcodec.so.60: version LIBAVCODEC_60 required by /usr/local/bin/mpv not defined

But see Mikael's post below. You may just have to pkg delete mpv, then pkg install mpv
 
Same here, on two different machines, both running 14.3-RELEASE-p5.

/usr/local/lib/libavcodec.so.60 belongs to ffmpeg.

Here is what pkg upgrade included:
Code:
The following 9 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        ffmpeg: 6.1.2_16,1 -> 6.1.2_17,1 [FreeBSD]
        firefox: 145.0.1_1,2 -> 145.0.2,2 [FreeBSD]
        libarchive: 3.8.2,1 -> 3.8.3,1 [FreeBSD]
        libdeflate: 1.24 -> 1.25 [FreeBSD]
        libheif: 1.19.8_4 -> 1.19.8_5 [FreeBSD]
        luajit: 2.1.0.20251016 -> 2.1.0.20251116 [FreeBSD]
        utf8proc: 2.11.1 -> 2.11.2 [FreeBSD]
        x265: 3.6_1 -> 4.1 [FreeBSD]
        xorg-server: 21.1.18_1,1 -> 21.1.20,1 [FreeBSD]

Number of packages to be upgraded: 9

The process will require 1 MiB more space.
92 MiB to be downloaded.

Proceed with this action? [y/N]: y

mpv was not updated but pkg delete mpv followed by pkg install mpv installs a newer build of mpv.

Before:
Code:
% mpv
mpv v0.40.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Sep 18 2025 01:26:10

After:
Code:
% mpv
mpv v0.40.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Nov 25 2025 01:54:48

I'm curious what went wrong here?
 
FWIW, it must be a -RELEASE thing because it did not happen to me, mpv continued to work just fine without issues (and yes, ffmpeg was updated this morning for me too). I run -STABLE and my mpv build is Oct 14 2025 08:01:21
 
Today I ran pkg update, pkg upgrade. I then went to play a video using mpv, and got a message of not being able to open libavcodec.so.60

Did a quick websearch and it seems this problem happens from time to time. There were various suggestions, and I chose the one of reinstalling mpv from ports. Had one small problem of a conflict of dependencies, py311-docutils conflicted with py39-docutils. However, I was able to uninstall the existing py39-docutils. It didn't remove anything else. After reinstalling mpv, using ports, the video played.

I apologize for the paucity of information. I was pretty sleepy and didn't bother to note exact error messages, but I'm putting this here in case someone else does an upgrade today and runs into the same issue. It *seems* (that is, worked for me), that it can be solved by reinstalling mpv from ports (which doesn't take more than a few minutes). I also didn't pay close attention to what, if anything, was removed during the pkg upgrade. So, as a bug report, this is pretty useless, again, I'm posting in case it hits anyone else. Though I can't be sure that something obvious was removed, it may just be a library version bump or the like.
Also, for packages I have it set to latest, not quarterly.

I realized I had a test box to try so got better error messages.

When I first tried to play a video with mpv, I got
Code:
ld-elf.so.1: /usr/local/lib/libavcodec.so.60: version LIBAVCODEC_60 required by /usr/local/bin/mpv not defined

But see Mikael's post below. You may just have to pkg delete mpv, then pkg install mpv
I didn't delete just reinstall and works.
 
here, neither musique nor mpv output but static. Previously, mpv had sound but it was terribly slow which changed it into not-music... too many config options for the port along with no web resource that led anywhere, so had to give up. [ other programs work fine, howsoever ]
 
I don't think it was due to pkgbasify, but that's just my feeling, not based on knowledge. From fernandel's post, I didn't even have to do as much work as I did, sounds like pkg update, pkg upgrade would have fixed it. For what it's worth, (probably very little), on a VM only running a few things, that uses pkgbasify, I updated from 15.0-RCsomething to 15.0-RELEASE with mpv having no trouble.
 
The complete answer is that someone forgot to update the portrevision of all ports that depends on libavcodec.
I don't think it's that simple.
 
Same.
As mentioned by Mikael, reinstalling multimedia/mpv via pkg delete mpv and pkg install mpv solved the issue for me on 14.3-RELEASE.

here, neither musique nor mpv output but static. Previously, mpv had sound but it was terribly slow which changed it into not-music... too many config options for the port along with no web resource that led anywhere, so had to give up. [ other programs work fine, howsoever ]
I encounter similar problems after reinstalling mpv. Some audio streams appear distorted or having the wrong output format. Indeed I discovered mpv/ffmpeg doesn't resample audio streams from floating point format to signed 32bit integer automatically anymore:
Code:
$ ffprobe -v error -select_streams a:0 -show_entries stream=sample_fmt clair.mp4
[STREAM]
sample_fmt=fltp
[/STREAM]
Code:
$ mpv --no-video clair.mp4
○ Video  --vid=1  (vp9 1920x1080 30 fps) [default]
● Audio  --aid=1  (aac 2ch 44100 Hz 128 kbps) [default]
AO: [oss] 44100Hz stereo 2ch float
A: 00:00:04 / 08:09:33 (0%)
Testing this in a boot environment before the updates, mpv apparently resampled the float format to s32 automatically: AO: [oss] 44100Hz stereo 2ch s32

I don't know if this changed behavior in mpv or ffmpeg was intentional.

I'm using bitperfect mode with disabled vchans:
Code:
$ sysctl dev.pcm.0
dev.pcm.0.mode: 3
dev.pcm.0.bitperfect: 1
dev.pcm.0.buffersize: 4096
dev.pcm.0.play.vchans: 0
dev.pcm.0.%iommu:
dev.pcm.0.%parent: hdaa1
dev.pcm.0.%pnpinfo:
dev.pcm.0.%location: nid=20
dev.pcm.0.%driver: pcm
dev.pcm.0.%desc: Realtek ALC1220 (Rear Analog Line-out)
And, apparently, Realtek ALC1220 doesn't play well with audio samples in floating point format, which results in the observed effects of having somekind of distorted playback.

(Float support was added to OSS recently, but I think this hasn't landed in 14.3-RELEASE yet, it's probably available in the upcoming 15.0-RELEASE.)

So I have two solutions right now:
  • Disable bitperfect mode and let the kernel resample to an integer format: # sysctl dev.pcm.0.bitperfect=0
  • Manually change sample format with mpv: $ mpv --no-video --audio-format=s32 clair.mp4
 
Back
Top