在windows上编译ffplay参考:用msys2与mingw编译FFmpeg
使用vscode mingw编译和调试c/c++程序的步骤可以参考:vscode 在windows下使用gcc+mingw调试 c/c++程序
注意编译ffmpeg的时候configure设置下--enable-debug=3 --disable-stripping --disable-optimizations
的选项
./configure --prefix=build_out \
--enable-gpl \
--enable-sdl2 \
--enable-version3 \
--enable-nonfree \
--disable-doc \
--enable-debug=3 --disable-stripping --disable-optimizations
创建一个launch.json文件,主要修改下program和args,program指向ffplay_g.exe的路径,args为命令行的参数。
{
"configurations": [
{
"name": "C/C++: gcc.exe 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
"program": "C:\\workspace\\FFmpeg\\build_out\\ffplay_g.exe",
"args": ["C:\Users\smallest\Desktop\demo.mp4"],
"stopAtEntry": false,
"cwd": "C:\\msys64\\mingw64\\bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe 生成活动文件"
}
],
"version": "2.0.0"
}
然后运行vscode的Run->Start Debugging选项
网友评论