安装ffmpeg
git clone [https://git.ffmpeg.org/ffmpeg.git](https://git.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-share \
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libopus --enable-libxvid \
--samples=fate-suite/
make
make install
这些命令会把ffmpeg安装到mac本地,大概十分钟左右
开发
创建一个普通的c文件
#include
#include
#include
#include
#include
#include
#include
#include
#include
int main(int argc, char **argv){
........... 开发的代码
return 0;
}
运行
g++ main.cpp -o main -L/usr/local/lib -lavutil -lavformat -lavcodec -lavdevice -lavfilter -lswresample -lswscale
把要链接类库链接到执行文件,然后编译输出
再次输入./main 运行代码