简而言之:我尝试重新安装 ffmpeg: sudo apt install ffmpeg
:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ffmpeg : Depends: libavcodec58 (= 7:4.1.6-1~deb10u1)
Depends: libavdevice58 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libavfilter7 (= 7:4.1.6-1~deb10u1)
[...]
E: Unable to correct problems, you have held broken packages.`
如何解决那些缺失的依赖关系?
完整问题:
当我运行时,ffmpeg -i "./input.mp4" -vcodec libvpx-vp9 -acodec libvorbis -b:v 9M "./output.webm"
结果的比特率不是 9MB,而是小得多,尽管我尝试使用的输入视频的比特率要么正好是 9MB,要么更大。
我感兴趣的是为什么会发生这种情况,除了使用之外,没有什么可以帮助解决这个问题-crf
。这样我就可以通过反复试验使输出文件的比特率与输入文件的比特率相匹配。此问题可能与以下问题相关,也可能无关。也许我应该为此创建一个单独的问题。
由于上述问题,我尝试重新安装 ffmpeg。看起来我已经安装了 ffmpegBasil Gello 的 Kodi 存储库(Debian 主仓库中的 Kodi 版本已经非常过时了)。起初,我尝试通过删除存储库并运行sudo apt-get update && sudo apt-get --reinstall install ffmpeg
我得到的存储库来重新安装 ffmpeg:
Reinstallation of ffmpeg is not possible, it cannot be downloaded.
所以我再次添加该存储库并运行:sudo apt-get --reinstall install ffmpeg/buster-backports
。这是输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'ffmpeg'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavcodec58' because of 'ffmpeg'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavutil56' because of 'libavcodec58'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libswresample3' because of 'libavcodec58'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavdevice58' because of 'ffmpeg'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavfilter7' because of 'libavdevice58'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavformat58' because of 'libavfilter7'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libpostproc55' because of 'libavfilter7'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libswscale5' because of 'libavfilter7'
Selected version '7:4.3.1-6~bpo10+1' (kodi-nightly-debian-repo:1.0/stable-backports [amd64]) for 'libavresample4' because of 'ffmpeg'
The following packages were automatically installed and are no longer required:
i965-va-driver:i386 intel-media-va-driver:i386 libgomp1:i386 libigdgmm5:i386 libsoxr0:i386 libva-drm2:i386 libva-x11-2:i386 libva2:i386
libvdpau-va-gl1:i386 libvdpau1:i386 mesa-va-drivers:i386 mesa-vdpau-drivers:i386 ocl-icd-libopencl1:i386 va-driver-all:i386 vdpau-driver-all:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libavcodec58 libavdevice58 libavfilter7 libavformat58 libavresample4 libavutil56 libpostproc55 libswresample3 libswscale5
Suggested packages:
ffmpeg-doc
The following packages will be REMOVED:
libavcodec-dev libavfilter-dev libavformat-dev libavresample-dev libavutil-dev libavutil56:i386 libpostproc-dev libswresample-dev libswresample3:i386
libswscale-dev
The following packages will be upgraded:
ffmpeg libavcodec58 libavdevice58 libavfilter7 libavformat58 libavresample4 libavutil56 libpostproc55 libswresample3 libswscale5
10 upgraded, 0 newly installed, 10 to remove and 0 not upgraded.
Need to get 9,752 kB of archives.
After this operation, 39.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 ffmpeg amd64 7:4.3.1-6~bpo10+1 [1,584 kB]
Get:2 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavdevice58 amd64 7:4.3.1-6~bpo10+1 [114 kB]
Get:3 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavfilter7 amd64 7:4.3.1-6~bpo10+1 [1,281 kB]
Get:4 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libswscale5 amd64 7:4.3.1-6~bpo10+1 [195 kB]
Get:5 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavformat58 amd64 7:4.3.1-6~bpo10+1 [1,037 kB]
Get:6 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavcodec58 amd64 7:4.3.1-6~bpo10+1 [4,942 kB]
Get:7 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libswresample3 amd64 7:4.3.1-6~bpo10+1 [95.0 kB]
Get:8 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libpostproc55 amd64 7:4.3.1-6~bpo10+1 [91.0 kB]
Get:9 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavresample4 amd64 7:4.3.1-6~bpo10+1 [92.0 kB]
Get:10 https://basilgello.github.io/kodi-nightly-debian-repo buster-backports/main amd64 libavutil56 amd64 7:4.3.1-6~bpo10+1 [320 kB]
Fetched 9,752 kB in 8s (1,242 kB/s)
Reading changelogs... Done
apt-listchanges: Do you want to continue? [Y/n] y
apt-listchanges: Mailing root: apt-listchanges: changelogs for hostname(Reading database ... 427402 files and directories currently installed.)
Removing libavfilter-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libavformat-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libavcodec-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libavresample-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libswscale-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libswresample-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libswresample3:i386 (7:4.3.1-5.1~bpo10+1) ...
Removing libavutil56:i386 (7:4.3.1-5.1~bpo10+1) ...
Removing libpostproc-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
Removing libavutil-dev:amd64 (7:4.3.1-5.1~bpo10+1) ...
(Reading database ... 427211 files and directories currently installed.)
Preparing to unpack .../0-ffmpeg_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking ffmpeg (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../1-libavdevice58_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavdevice58:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../2-libavfilter7_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavfilter7:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../3-libswscale5_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libswscale5:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../4-libavformat58_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavformat58:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../5-libavcodec58_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavcodec58:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../6-libswresample3_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libswresample3:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../7-libpostproc55_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libpostproc55:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../8-libavresample4_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavresample4:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Preparing to unpack .../9-libavutil56_7%3a4.3.1-6~bpo10+1_amd64.deb ...
Unpacking libavutil56:amd64 (7:4.3.1-6~bpo10+1) over (7:4.3.1-5.1~bpo10+1) ...
Setting up libavutil56:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libpostproc55:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libswscale5:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libswresample3:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libavresample4:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libavcodec58:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libavformat58:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libavfilter7:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up libavdevice58:amd64 (7:4.3.1-6~bpo10+1) ...
Setting up ffmpeg (7:4.3.1-6~bpo10+1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 181 files, found 146
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
User sessions running outdated binaries: [...]
现在always的输出sudo apt install ffmpeg
是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ffmpeg : Depends: libavcodec58 (= 7:4.1.6-1~deb10u1)
Depends: libavdevice58 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libavfilter7 (= 7:4.1.6-1~deb10u1)
Depends: libavformat58 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libavresample4 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libavutil56 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libpostproc55 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libswresample3 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
Depends: libswscale5 (= 7:4.1.6-1~deb10u1) but 7:4.3.1-6~bpo10+1 is to be installed
E: Unable to correct problems, you have held broken packages.
如何解决那些缺失的依赖关系?我不能只是重新安装这些,许多其他核心软件包都依赖于它们。
我也尝试过跑步sudo apt-get clean ; sudo apt-get update ; sudo apt-get check ; sudo apt-get purge ffmpeg* -y ; sudo apt-get autoremove -y ; sudo apt-get -f satisfy ffmpeg -y
这没有解决问题。
我正在使用 KDE 运行 Debian 10。任何帮助表示赞赏。
答案1
看起来有人请求安装 libavdevice58 版本 7:4.3.1-6~bpo10+1。这与 Debian 的 vanilla 冲突ffmpeg
,后者依赖于 libavdevice58 版本 7:4.1.6-1~deb10u1。您可以通过在命令行上指定版本来显式请求旧版本:
sudo apt install ffmpeg libavdevice58=7:4.1.6-1~deb10u1
至于编码结果,你应该提出第二个问题。作为导游指出,有几个参数一起发挥作用。您的命令实际上将编码器置于平均比特率模式,而不是恒定比特率模式。请记住,如果源材料足够容易压缩,则编码器可能始终选择保持低于目标比特率。