我是一名系统管理员,我想将ffmpeg
其及其库安装到我的 Ubuntu 服务器上,因为其中一个用户的 Web 应用程序需要它来转码音频文件。
但是为什么它依赖于这么多 Ubuntu 服务器不需要的软件包?我看到一些 X 库、wayland、mesa 驱动程序、nvidia libs、fontconfig、pango 等。
我显然不会x11grab
在我的服务器上做类似的事情或直接“播放”视频。
~$ sudo apt install ffmpeg
[sudo] password for ahfas:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
fontconfig i965-va-driver intel-media-va-driver libaacs0 libaom0 libass9 libavc1394-0 libavcodec58 libavdevice58 libavfilter7 libavformat58 libavresample4 libavutil56 libbdplus0 libbluray2 libbs2b0
libcaca0 libcairo-gobject2 libcairo2 libcdio-cdda2 libcdio-paranoia2 libcdio18 libchromaprint1 libcodec2-0.9 libdatrie1 libdc1394-22 libfftw3-double3 libflite1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
libgdk-pixbuf2.0-common libgme0 libgomp1 libgraphite2-3 libgsm1 libharfbuzz0b libiec61883-0 libigdgmm11 libjack-jackd2-0 libjbig0 libjpeg-turbo8 libjpeg8 liblilv-0-0 libmp3lame0 libmpg123-0 libmysofa1
libnorm1 libopenal-data libopenal1 libopenjp2-7 libopenmpt0 libopus0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpgm-5.2-0 libpixman-1-0 libpostproc55 libraw1394-11 librsvg2-2
librsvg2-common librubberband2 libsamplerate0 libsdl2-2.0-0 libserd-0-0 libshine3 libsnappy1v5 libsndio7.0 libsord-0-0 libsoxr0 libspeex1 libsratom-0-0 libssh-gcrypt-4 libswresample3 libswscale5
libthai-data libthai0 libtheora0 libtiff5 libtwolame0 libva-drm2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libvpx6 libwavpack1 libwayland-cursor0 libwayland-egl1 libwebp6 libwebpmux3 libx264-155
libx265-179 libxcb-render0 libxcursor1 libxkbcommon0 libxss1 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers ocl-icd-libopencl1 va-driver-all vdpau-driver-all
Suggested packages:
ffmpeg-doc i965-va-driver-shaders libbluray-bdj libfftw3-bin libfftw3-dev jackd2 libportaudio2 opus-tools libraw1394-doc librsvg2-bin serdi sndiod sordi speex opencl-icd libvdpau-va-gl1
nvidia-vdpau-driver nvidia-legacy-340xx-vdpau-driver nvidia-legacy-304xx-vdpau-driver
The following NEW packages will be installed:
ffmpeg fontconfig i965-va-driver intel-media-va-driver libaacs0 libaom0 libass9 libavc1394-0 libavcodec58 libavdevice58 libavfilter7 libavformat58 libavresample4 libavutil56 libbdplus0 libbluray2
libbs2b0 libcaca0 libcairo-gobject2 libcairo2 libcdio-cdda2 libcdio-paranoia2 libcdio18 libchromaprint1 libcodec2-0.9 libdatrie1 libdc1394-22 libfftw3-double3 libflite1 libgdk-pixbuf2.0-0
libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgme0 libgomp1 libgraphite2-3 libgsm1 libharfbuzz0b libiec61883-0 libigdgmm11 libjack-jackd2-0 libjbig0 libjpeg-turbo8 libjpeg8 liblilv-0-0 libmp3lame0
libmpg123-0 libmysofa1 libnorm1 libopenal-data libopenal1 libopenjp2-7 libopenmpt0 libopus0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpgm-5.2-0 libpixman-1-0 libpostproc55 libraw1394-11
librsvg2-2 librsvg2-common librubberband2 libsamplerate0 libsdl2-2.0-0 libserd-0-0 libshine3 libsnappy1v5 libsndio7.0 libsord-0-0 libsoxr0 libspeex1 libsratom-0-0 libssh-gcrypt-4 libswresample3
libswscale5 libthai-data libthai0 libtheora0 libtiff5 libtwolame0 libva-drm2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libvpx6 libwavpack1 libwayland-cursor0 libwayland-egl1 libwebp6 libwebpmux3
libx264-155 libx265-179 libxcb-render0 libxcursor1 libxkbcommon0 libxss1 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers ocl-icd-libopencl1 va-driver-all
vdpau-driver-all
0 upgraded, 107 newly installed, 0 to remove and 0 not upgraded.
Need to get 54.6 MB of archives.
After this operation, 237 MB of additional disk space will be used.
Do you want to continue? [Y/n]
虽然使用--no-install-recommends
会摆脱大多数与图形相关的包(例如 X、wayland、nvidia 驱动程序),但我只是好奇为什么ffmpeg
默认需要这些包?
我的 Ubuntu 版本:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
答案1
ffmpeg
在 Ubuntu 20.04 上(以及其他版本)是一个元包,其中包括ffplay
和其他组件(尽管服务器用户可能不想要/不需要) 需要图形显示环境...因此您认为的依赖项与桌面环境有关。
不幸的是,服务器用户在从官方 Ubuntu 存储库安装预编译包时别无选择,只能接受并忍受这些额外的依赖项。
但是,它们可以省略ffplay
和 x11grab 依赖项(例如libsdl2-dev
, , libva-dev
, libvdpau-dev
,libxcb1-dev
和libxcb-shm0-dev
libxcb-xfixes0-dev
)如果他们选择编译FFmpeg来自源头。