文章目录
下载ffmpeg源码
ffmpeg版本ffmpeg-4.1.10
源码编译
编译命令
./configure --prefix=/home/wencoo/ffmpeg_build/ --enable-debug --disable-stripping
make
make install
–enable-debug 设置调试级别
–disable-stripping 注意一定要加–disable-stripping, 如果不加此选项,ffmpeg在编译时,会使用strip去掉符号信息
编译参数参考编译可调试的debug版本的ffmpeg
vscode设置
创建launch.json文件,内容如下
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "/home/wencoo/ffmpeg_build/bin/ffmpeg",
"args": [
"--help"
],
"stopAtEntry": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}
重点:
- program字段是ffmpeg源码编译完生成的可执行文件路径
- 启动调试按F5
验证
在源码中打断点,查看是否进入调试模式