FFmpeg 找不到编码器 'libvorbis'。

32

因为我的电脑找不到libvorbis,所以我无法将视频文件转码为webm格式。当我运行以下命令时:

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'
4个回答

71

编辑于2020年:

现在Homebrew默认会安装libvorbis,所以你只需要运行以下命令:

brew install ffmpeg
如果您正在使用Homebrew,请尝试以下内容:
brew install ffmpeg --with-libvorbis

...或者,如果您已经尝试使用Homebrew安装ffmpeg...

brew reinstall ffmpeg --with-libvorbis

如果你也需要libvpx:

brew reinstall ffmpeg --with-libvpx --with-libvorbis

“--with-libvpx” 对于我来说是进行正确的webm转换所必需的。在重新安装libvpx之前,它一直出现这个错误,正如@yndolok所建议的:“输出流未找到编码器(编解码器vp8)”。 - JamesWilson
2
看起来很有前途,brew info ffmpeg 确实显示 libvorbis 没有默认安装。但是当我尝试运行这些命令时,在 Mojave 上使用 Homebrew 2.0.2 会出现 Error: invalid option: --with-libvorbis 的错误。似乎在我的 shell 中该标志没有被正确应用。 - vhs
我遇到了这个错误:无效选项:--with-libvpx - nour

4
您的ffmpeg构建未编译使用--enable-libvorbis,如果您想在ffmpeg中使用libvorbis支持,则需要该选项,但您有一些选择: 注意: Vorbis已被Opus取代,因此请考虑改用libopus - 特别是如果您要编码为VP9/VP8(WebM)。

下载构建

这是一个简单的选项。已经编译好的macOS版本的ffmpeg可用,并且配备了libvorbis支持。您只需下载可执行文件,可选择将其放置在/usr/local/bin中。


Homebrew

核心

Hombrew核心FFmpeg配方默认包含对libvorbis的支持(截至2019年3月1日)。首先,安装Homebrew,然后运行:

brew install ffmpeg

然而,核心公式不再支持附加的非默认选项,例如--with-aom,因此如果您想自定义它,请参见下面的选项。
homebrew-ffmpeg
这是一个第三方tap,提供了一个Homebrew公式,其中包含许多可以启用的附加选项。首先,安装Homebrew,然后:
  1. Uninstall ffmpeg if you installed it from Homebrew core:

    brew uninstall ffmpeg
    
  2. Then install ffmpeg from homebrew-ffmpeg:

    brew tap homebrew-ffmpeg/ffmpeg
    brew install homebrew-ffmpeg/ffmpeg/ffmpeg
    

更多选项和信息请参见homebrew-ffmpeg


编译

如需手动编译的完整说明,请参见FFmpeg Wiki: macOS


3

0

您的链接是一个404。 - vhs

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接