【发布时间】:2013-01-09 13:45:46
【问题描述】:
我的 ffmpeg 版本缺少“libtheora”编解码器,我下载了这个版本的“libtheora”以使其工作。 http://www.theora.org/downloads/ 问题是解压缩zip文件后,我不知道如何安装它。自述文件没有提供很多细节。我只运行make吗? 以前有人这样做过吗?
【问题讨论】:
标签: ffmpeg ogg-theora
我的 ffmpeg 版本缺少“libtheora”编解码器,我下载了这个版本的“libtheora”以使其工作。 http://www.theora.org/downloads/ 问题是解压缩zip文件后,我不知道如何安装它。自述文件没有提供很多细节。我只运行make吗? 以前有人这样做过吗?
【问题讨论】:
标签: ffmpeg ogg-theora
用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
【讨论】:
ffmpeg2theora 这个命令不正确!这是最简单最正确的一个:shell ffmpeg2theora <file_input.mp4> --videoquality 7 --audioquality 4 --output <file_output.ogv> 问候
您可以使用 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
对我来说,它就像魔术一样。
【讨论】:
在阅读了长长的邮件列表并因为人们粗鲁而感到难过之后,我终于为我解决了这个问题。似乎有必要使用--extra-ldflags 和--extra-cflags 指定库路径。所以就我而言,它看起来像这样:
./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"
当然,根据您所需的库和版本,这可能会有所不同。
【讨论】:
您是否尝试过 Macports (http://www.macports.org/) 来安装 ffmped 或 libtheora? 如果你没有它...下载安装它。 然后进入你的控制台并执行这个:
sudo port install libtheora
【讨论】: