一,首先下载FFmpeg 的代码。
git clone https://git.ffmpeg.org/ffmpeg.git
git clone https://git.ffmpeg.org/ffmpeg.git
Cloning into 'ffmpeg'...
remote: Enumerating objects: 30813, done.
remote: Counting objects: 100% (30813/30813), done.
remote: Compressing objects: 100% (15751/15751), done.
remote: Total 657297 (delta 24564), reused 18376 (delta 15039)
Receiving objects: 100% (657297/657297), 163.79 MiB | 1.02 MiB/s, done.
Resolving deltas: 100% (528457/528457), done.
Updating files: 100% (7697/7697), done.
二. 然后对ffmpeg进行配置。
执行
cd ffmpeg/
然后执行
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-videotoolbox --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --cc=clang --host-cflags= --host-ldflags= --disable-x86asm --enable-ffplay
执行遇到的错误:
1.ERROR: libfdk_aac not found
1.brew install fdk-aac
2.ERROR: speex not found using pkg-config
2.brew install speex
2.brew install pkg-config
3.ERROR: libx264 not found
brew install x264
4.brew install x265
5.brew install sdl2
三. 安装
make && make install
网友评论