如何为MacOSX安装libtheora(ffmpeg)

时间:2013-01-09 13:45:47

标签: ffmpeg ogg-theora

我的ffmpeg版本缺少'libtheora'编解码器,我下载了此版本的'libtheora'以使其正常工作。 http://www.theora.org/downloads/ 问题是,在解压缩zip文件后,我不知道如何安装它。 README文件没有提供很多细节。我刚刚运行make吗? 以前做过这个的人吗?

4 个答案:

答案 0 :(得分:4)

使用Homebrew非常简单:

brew install ffmpeg2theora

但实际上它不允许你在此之后转换为OGG / OGV格式。实际上帮助我将MP4转换为OGV格式的是使用 libtheora 支持编译 ffmpeg 。可在此处找到详细说明ffmpeg Mac OSX compilation guide。在此之后我终于能够运行following command

ffmpeg -i input.mkv -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 output.ogv

答案 1 :(得分:4)

您可以使用brew

为ffmpeg安装libtheora
brew install theora

要在ffmpeg中使用它,您应该重新编译ffmpeg。解决方案来源:https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX

brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 xvid yasm

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure  --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
make && sudo make install

就我而言,它就像魔法一样。

答案 2 :(得分:2)

在阅读了一份长长的邮件列表并因为人们粗鲁而感到难过后,我终于为我解决了这个问题。似乎有必要使用--extra-ldflags--extra-cflags指定lib路径。所以在我的情况下它看起来像这样:

./configure  --prefix=/usr/local --enable-gpl --enable-nonfree \
--enable-libass --enable-libfdk-aac --enable-libfreetype \
--enable-libopus --enable-libtheora --enable-libvorbis \
--enable-libvpx --enable-libx264 --enable-libxvid
--extra-ldflags="-L/usr/local/Cellar/lame/3.99.5/lib \
-L/usr/local/Cellar/libogg/1.3.2/lib \
-L/usr/local/Cellar/theora/1.1.1/lib \
-L/usr/local/Cellar/libvorbis/1.3.5/lib \
-L/usr/local/Cellar/xvid/1.3.4/lib" \
--extra-cflags="-I/usr/local/Cellar/lame/3.99.5/include \
-I/usr/local/Cellar/libogg/1.3.2/include \
-I/usr/local/Cellar/theora/1.1.1/include \
-I/usr/local/Cellar/libvorbis/1.3.5/include \
-I/usr/local/Cellar/xvid/1.3.4/include"

取决于您所需的库和版本,当然可能会有所不同。

答案 3 :(得分:0)

您是否尝试过Macports(http://www.macports.org/)安装ffmped或libtheora? 如果你没有它...下载安装它。 然后进入你的控制台并执行:

sudo port install libtheora