使用vscode调试ffmpeg源码

ffmpeg的编译配置
bash 复制代码
# --enable-debug 设置为调试级别
# --disable-stripping 如果不加此选项,会strip去掉符号信息
./configure --prefix={output_path} --enable-debug --disable-stripping
make -j10
VSCode的配置

将以下文件对比替换工程.vscode目录下的相同文件

  • launch.json
XML 复制代码
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "debug_ffmpeg",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/../offical_ffmpeg/debug/bin/${fileBasenameNoExtension}",
      "args": [
        "-i",
        "http://xxx/test_shot_hls.m3u8",
        "-r",
        "1.00",
        "-f",
        "image2",
        "/Users/admin/test_output/live_%06d.jpeg"
      ],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}/",
      "environment": [],
      "externalConsole": false,
      "launchCompleteCommand": "exec-run",
      "linux": {
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb"
      },
      "osx": {
        "MIMode": "lldb"
      },
      "windows": {
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
      },
      "preLaunchTask": "precompile_ffmpeg",
      "sourceFileMap": {
        "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
      }
    },
    {
      "name": "debug_ffmpeg_examples",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/../offical_ffmpeg/doc/examples/${fileBasenameNoExtension}",
      "args": [
        "1.aac"
      ],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}/",
      "environment": [],
      "externalConsole": false,
      "launchCompleteCommand": "exec-run",
      "linux": {
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb"
      },
      "osx": {
        "MIMode": "lldb"
      },
      "windows": {
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
      },
      "preLaunchTask": "precompile_ffmpeg_examples",
      "sourceFileMap": {
        "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
      }
    }
  ]
}
  • tasks.json
XML 复制代码
{
  "tasks": [
    {
      "label": "precompile_ffmpeg",
      "type": "shell",
      "command": "cd ${workspaceFolder} && make -j16"
    },
    {
      "label": "precompile_ffmpeg_examples",
      "type": "shell",
      "command": "cd ${workspaceFolder} && make examples -j16"
    }
  ],
  "version": "2.0.0"
}
  • settings.json
XML 复制代码
{
  "files.associations": {
    "*.ipp": "cc",
    "any": "cpp",
    "array": "cpp",
    "atomic": "cpp",
    "bit": "cpp",
    "*.tcc": "cpp",
    "bitset": "cpp",
    "cctype": "cpp",
    "chrono": "cpp",
    "clocale": "cpp",
    "cmath": "cpp",
    "codecvt": "cpp",
    "complex": "cpp",
    "condition_variable": "cpp",
    "csignal": "cpp",
    "cstdarg": "cpp",
    "cstddef": "cpp",
    "cstdint": "cpp",
    "cstdio": "cpp",
    "cstdlib": "cpp",
    "cstring": "cpp",
    "ctime": "cpp",
    "cwchar": "cpp",
    "cwctype": "cpp",
    "deque": "cpp",
    "forward_list": "cpp",
    "list": "cpp",
    "map": "cpp",
    "set": "cpp",
    "unordered_map": "cpp",
    "unordered_set": "cpp",
    "vector": "cpp",
    "exception": "cpp",
    "string_view": "cpp",
    "fstream": "cpp",
    "functional": "cpp",
    "future": "cpp",
    "initializer_list": "cpp",
    "iomanip": "cpp",
    "iosfwd": "cpp",
    "iostream": "cpp",
    "istream": "cpp",
    "limits": "cpp",
    "memory": "cpp",
    "mutex": "cpp",
    "new": "cpp",
    "numeric": "cpp",
    "optional": "cpp",
    "ostream": "cpp",
    "ratio": "cpp",
    "sstream": "cpp",
    "stdexcept": "cpp",
    "streambuf": "cpp",
    "string": "cpp",
    "system_error": "cpp",
    "thread": "cpp",
    "type_traits": "cpp",
    "tuple": "cpp",
    "typeindex": "cpp",
    "typeinfo": "cpp",
    "utility": "cpp",
    "valarray": "cpp",
    "variant": "cpp",
    "data_type_def.h": "c",
    "ctype.h": "c"
  },
  "cmake.sourceDirectory": "${workspaceFolder}"
}
  • c_cpp_properties.json
XML 复制代码
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        },
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}
相关推荐
hunandede1 小时前
FFmpeg 4.3 音视频-多路H265监控录放C++开发十三.2:avpacket中包含多个 NALU如何解析头部分析
c++·ffmpeg·音视频
MonkeyKing_sunyuhua1 天前
FFmpeg将mp4的文件转化为m4a
ffmpeg
zanglengyu1 天前
RK3568硬解码并与Qt界面融合显示深入探究
开发语言·qt·ffmpeg·rk3568硬解码rtsp
橘子味的茶二2 天前
ffmpeg内存模型
ffmpeg
TPCloud2 天前
windows 11编译安装ffmpeg(包含ffplay)
windows·ffmpeg·源码安装·mysys
runing_an_min3 天前
ffmpeg视频滤镜:缓入缓出-fade
ffmpeg·音视频·fade·缓出·缓入
ssslar3 天前
FFMPEG录屏(22)--- Linux 下基于X11枚举所有显示屏,并获取大小和截图等信息
linux·运维·ffmpeg
MonkeyKing_sunyuhua3 天前
FFmpeg 怎么裁剪m4a的音频,从一个时间点开始,裁剪15秒钟的视频
ffmpeg·音视频
DO_Community3 天前
教程:FFmpeg结合GPU实现720p至4K视频转换
ffmpeg·音视频
x66ccff3 天前
使用NVIDIA GPU加速FFmpeg视频压制:完全指南
ffmpeg·音视频