我无法将视频文件转码为 webm,因为我的机器无法找到 libvorbis。 当我运行以下命令时:
ffmpeg -y -i /public/uploads/tmp/1382112521-11953-7661/webm_Untitled.mov -vcodec libvpx -acodec libvorbis -s 640x360 -b 1500k -ab 160000 -f webm -g 30 -aspect 1.7777777777777777 /public/uploads/tmp/1382112521-11953-7661/tmpfile.webm
我收到错误
Unknown encoder 'libvorbis'
不过,我已经在我的机器上安装了libvorbis(当我尝试"brew install libvorbis"时,它告诉我:警告:libvorbis-1.3.3已经安装)。
如何解决这个问题?
以下是完整日志:
ffmpeg -y -i /public/uploads/tmp/1382112521-11953-7661/webm_Untitled.mov -vcodec libvpx -acodec libvorbis -s 640x360 -b 1500k -ab 160000 -f webm -g 30 -aspect 1.7777777777777777 /public/uploads/tmp/1382112521-11953-7661/tmpfile.webm
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Oct 18 2013 12:20:19 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libvpx
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/public/uploads/tmp/1382112521-11953-7661/webm_Untitled.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2013-09-27 20:08:57
Duration: 00:00:02.14, start: 0.000000, bitrate: 17460 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17292 kb/s, 29.88 fps, 29.83 tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2013-09-27 20:08:57
handler_name : Core Media Data Handler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s
Metadata:
creation_time : 2013-09-27 20:08:57
handler_name : Core Media Data Handler
Please use -b:a or -b:v, -b is ambiguous
Unknown encoder 'libvorbis'
编辑 2020:
Homebrew 现在默认安装 libvorbis,因此您只需运行:
brew install ffmpeg
如果您使用的是自制软件,请尝试以下操作:
brew install ffmpeg --with-libvorbis
。或者,如果您已经尝试过使用 Homebrew 安装 ffmpeg...
brew reinstall ffmpeg --with-libvorbis
如果你也想要libvpx:
brew reinstall ffmpeg --with-libvpx --with-libvorbis
您的 ffmpeg 构建没有使用--enable-libvorbis
编译,如果您希望在 ffmpeg
中支持 libvorbis ,则需要这样做,但您有一些选择:
注意:Vorbis 已被 Opus 淘汰,因此请考虑改用 libopus,尤其是在编码为 VP9/VP8 (WebM) 时。
下载内部版本
这是一个简单的选择。已经编译的 macOS 版本的 ffmpeg 可用,并带有 libvorbis 支持。您可以下载可执行文件,并选择性地将其放入 /usr/local/bin
.
自制
核心
Hombrew 核心 FFmpeg 公式默认包含对 libvorbis 的支持(截至 2019-03-01)。首先,安装自制软件,然后运行:
brew install ffmpeg
但是,核心公式不再支持其他非默认选项,例如 --with-aom
,因此如果要对其进行自定义,请参阅下面的选项。
自制-FFMPEG
这是一个第三方点击,它提供了一个自制公式,其中包含您可以启用的许多其他选项。首先,安装自制软件,然后:
卸载
ffmpeg
如果您从自制核心安装它:brew uninstall ffmpeg
然后从homebrew-ffmpeg安装ffmpeg:
brew tap homebrew-ffmpeg/ffmpeg brew install homebrew-ffmpeg/ffmpeg/ffmpeg
有关更多选项和信息,请参阅 Homebrew-ffmpeg。
编译
有关手动编译的完整说明,请参阅 FFmpeg Wiki:macOS。
> Homebrew在2018年底停止支持--with-libvorbis
选项。预编译的二进制文件包含适用于Linux,macOS和Windows的libvorbis:https://ffmpeg.org/download.html
这个问题已经通过这里使用以下方法重建 ffmpeg 的建议得到解决:
./configure --disable-encoder=vorbis --enable-libvorbis; make; make install
http://xiphmont.livejournal.com/51160.html