How to Fix: “dyld: Library not loaded: /usr/local/opt/x264/lib/libx264.155.dylib” when running ffmpeg

问题描述:

最近一次使用yt-dlp下载视频时出现以下错误,可能是最近调整系统所致。该问题与yt-dlp无关,实则ffmpeg包出现了问题。

dyld: Library not loaded: /usr/local/opt/x264/lib/libx264.155.dylib
  Referenced from: /usr/local/bin/ffmpeg
  Reason: image not found

ERROR: ffmpeg exited with code -6

尝试在终端运行ffmpeg,出现相同错误提示,确认是ffmpeg包问题。

$ ffmpeg
dyld: Library not loaded: /usr/local/opt/x264/lib/libx264.155.dylib
  Referenced from: /usr/local/bin/ffmpeg
  Reason: image not found
Abort trap: 6

解决方案:

1.取消ffmpeg链接

$ brew unlink ffmpeg
Unlinking /usr/local/Cellar/ffmpeg/4.2.1_2... 113 symlinks removed.

2.重新安装ffmpeg

$ brew install ffmpeg

3.尝试再次运行ffmpeg

$ ffmpeg -version
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100

发表评论

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据