调试ffmpeg源码教程
今天用Xcode调试分析 encode_video.c
配置ffmpeg 支持libx264和h264_videotoolbox来进行视频编码
cd ffmpeg
./configure --disable-optimizations --disable-stripping --enable-debug=3 --disable-doc --enable-libx264 --enable-gpl --enable-videotoolboxm
make -j 16
make examples
如果没有libx264, 通过 Homebrew 安装一下
brew install x264
ffmpeg 通过pkg-config可以找到x264对应的头文件和库的路径
➜ ffmpeg git:(master) ✗ pkg-config --libs --cflags x264
-DX264_API_IMPORTS -I/opt/homebrew/Cellar/x264/r3060/include -L/opt/homebrew/Cellar/x264/r3060/lib -lx264
配置Xcode
添加target,配置路径
![](https://img-blog.csdnimg.cn/img_convert/5d6a5d5f5fa8c275935010911ddfff22.webp?x-oss-process=image/format,png)
配置可执行文件&