• 使用vscode调试ffmpeg源码


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

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

    • launch.json
    1. {
    2. "version": "0.2.0",
    3. "configurations": [
    4. {
    5. "name": "debug_ffmpeg",
    6. "type": "cppdbg",
    7. "request": "launch",
    8. "program": "${workspaceFolder}/../offical_ffmpeg/debug/bin/${fileBasenameNoExtension}",
    9. "args": [
    10. "-i",
    11. "http://xxx/test_shot_hls.m3u8",
    12. "-r",
    13. "1.00",
    14. "-f",
    15. "image2",
    16. "/Users/admin/test_output/live_%06d.jpeg"
    17. ],
    18. "stopAtEntry": false,
    19. "cwd": "${workspaceFolder}/",
    20. "environment": [],
    21. "externalConsole": false,
    22. "launchCompleteCommand": "exec-run",
    23. "linux": {
    24. "MIMode": "gdb",
    25. "miDebuggerPath": "/usr/bin/gdb"
    26. },
    27. "osx": {
    28. "MIMode": "lldb"
    29. },
    30. "windows": {
    31. "MIMode": "gdb",
    32. "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
    33. },
    34. "preLaunchTask": "precompile_ffmpeg",
    35. "sourceFileMap": {
    36. "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
    37. }
    38. },
    39. {
    40. "name": "debug_ffmpeg_examples",
    41. "type": "cppdbg",
    42. "request": "launch",
    43. "program": "${workspaceFolder}/../offical_ffmpeg/doc/examples/${fileBasenameNoExtension}",
    44. "args": [
    45. "1.aac"
    46. ],
    47. "stopAtEntry": false,
    48. "cwd": "${workspaceFolder}/",
    49. "environment": [],
    50. "externalConsole": false,
    51. "launchCompleteCommand": "exec-run",
    52. "linux": {
    53. "MIMode": "gdb",
    54. "miDebuggerPath": "/usr/bin/gdb"
    55. },
    56. "osx": {
    57. "MIMode": "lldb"
    58. },
    59. "windows": {
    60. "MIMode": "gdb",
    61. "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
    62. },
    63. "preLaunchTask": "precompile_ffmpeg_examples",
    64. "sourceFileMap": {
    65. "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
    66. }
    67. }
    68. ]
    69. }
    • tasks.json
    1. {
    2. "tasks": [
    3. {
    4. "label": "precompile_ffmpeg",
    5. "type": "shell",
    6. "command": "cd ${workspaceFolder} && make -j16"
    7. },
    8. {
    9. "label": "precompile_ffmpeg_examples",
    10. "type": "shell",
    11. "command": "cd ${workspaceFolder} && make examples -j16"
    12. }
    13. ],
    14. "version": "2.0.0"
    15. }
    • settings.json
    1. {
    2. "files.associations": {
    3. "*.ipp": "cc",
    4. "any": "cpp",
    5. "array": "cpp",
    6. "atomic": "cpp",
    7. "bit": "cpp",
    8. "*.tcc": "cpp",
    9. "bitset": "cpp",
    10. "cctype": "cpp",
    11. "chrono": "cpp",
    12. "clocale": "cpp",
    13. "cmath": "cpp",
    14. "codecvt": "cpp",
    15. "complex": "cpp",
    16. "condition_variable": "cpp",
    17. "csignal": "cpp",
    18. "cstdarg": "cpp",
    19. "cstddef": "cpp",
    20. "cstdint": "cpp",
    21. "cstdio": "cpp",
    22. "cstdlib": "cpp",
    23. "cstring": "cpp",
    24. "ctime": "cpp",
    25. "cwchar": "cpp",
    26. "cwctype": "cpp",
    27. "deque": "cpp",
    28. "forward_list": "cpp",
    29. "list": "cpp",
    30. "map": "cpp",
    31. "set": "cpp",
    32. "unordered_map": "cpp",
    33. "unordered_set": "cpp",
    34. "vector": "cpp",
    35. "exception": "cpp",
    36. "string_view": "cpp",
    37. "fstream": "cpp",
    38. "functional": "cpp",
    39. "future": "cpp",
    40. "initializer_list": "cpp",
    41. "iomanip": "cpp",
    42. "iosfwd": "cpp",
    43. "iostream": "cpp",
    44. "istream": "cpp",
    45. "limits": "cpp",
    46. "memory": "cpp",
    47. "mutex": "cpp",
    48. "new": "cpp",
    49. "numeric": "cpp",
    50. "optional": "cpp",
    51. "ostream": "cpp",
    52. "ratio": "cpp",
    53. "sstream": "cpp",
    54. "stdexcept": "cpp",
    55. "streambuf": "cpp",
    56. "string": "cpp",
    57. "system_error": "cpp",
    58. "thread": "cpp",
    59. "type_traits": "cpp",
    60. "tuple": "cpp",
    61. "typeindex": "cpp",
    62. "typeinfo": "cpp",
    63. "utility": "cpp",
    64. "valarray": "cpp",
    65. "variant": "cpp",
    66. "data_type_def.h": "c",
    67. "ctype.h": "c"
    68. },
    69. "cmake.sourceDirectory": "${workspaceFolder}"
    70. }
    • c_cpp_properties.json
    1. {
    2. "configurations": [
    3. {
    4. "name": "Linux",
    5. "includePath": [
    6. "${workspaceFolder}/**"
    7. ],
    8. "defines": [],
    9. "compilerPath": "/usr/bin/gcc",
    10. "cStandard": "c11",
    11. "cppStandard": "c++17",
    12. "intelliSenseMode": "clang-x64",
    13. "configurationProvider": "ms-vscode.makefile-tools"
    14. },
    15. {
    16. "name": "Mac",
    17. "includePath": [
    18. "${workspaceFolder}/**"
    19. ],
    20. "defines": [],
    21. "macFrameworkPath": [
    22. "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
    23. ],
    24. "compilerPath": "/usr/bin/clang",
    25. "cStandard": "c11",
    26. "cppStandard": "c++17",
    27. "intelliSenseMode": "clang-x64"
    28. }
    29. ],
    30. "version": 4
    31. }

  • 相关阅读:
    Java技术栈总结:数据库MySQL篇
    多个路径下python库导入
    WPF 控件专题 Canvas 控件详解
    web与Shiro整合(RBAC模型+C3p0+Servlet)
    蔡甸17万亩粮田丰收 国稻种芯:夏汛蓄洪水护住28天抗旱期
    【scala】下划线用法总结
    检测摄像头的fps
    elasticsearch运维_分享两个自己整理的比较好用的elasticsearch脚本
    深度解析shell脚本的命令的原理之cd
    软件测试技术之地图导航的测试用例
  • 原文地址:https://blog.csdn.net/yagerfgcs/article/details/133907628