windows下调试
(1)、使用git clone https://github.com/ShiftMediaProject/FFmpeg.git,下载代码,例如路径为:E:/msvc/source/FFmpeg。
(2)、启动git CMD切换到FFmpeg下的SMP下,运行脚本project_get_dependencies.bat,该过程会下载编译ffmpeg所依赖的所有代码。过程比较耗时,可重复执行该命令,保证所有依赖代码全部下载。
(3)、从https://github.com/ShiftMediaProject/VSNASM/releases下载安装VSNASM。
(4)、从https://github.com/ShiftMediaProject/VSYASM/releases下载安装VSYASM。
(5)、按照msvc\source\FFmpeg\SMP\readme.txt的说明配置环境。
(6)、用VS2017打开FFmpeg/SMP下的ffmepg_deps.sln.编译整个solution,期间会有些头文件,添加一下路径即可。
目录结构:
1 msvc(include, msvc, source)
include是自己第三方库,msvc是自动生成,source是ffmpeg源代码。
2 source(FFmpeg,一些执行脚本后自动下载的第三方库)。
ubuntu下调试
安装vscode, 安装c/c++,Code Runner插件。
sudo apt install libx264-dev libx265-dev
./configure --enable-debug=3 --disable-optimizations --enable-libx264 --enable-libx265 --enable-gpl --disable-x86asm
make -j8
编解launch.json,需要修改的有program和args。
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/ffprobe_g",
"args": [
"-i",
"test.h264",
],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}