2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
FFmpeg is a cross-platform multimedia library. Sometimes it needs to be developed and debugged on other platforms. This article records the basic method of using gdb to debug FFmpeg source code in Linux environment.
To debug FFmpeg source code in Linux environment on Windows platform, you need to compile and generate an exe file with suffix _g.ffmpeg compilationIf you want to use vs debugging on Windows, you need to add –toolchain=msvc when compiling FFmepg to generate a pdb file.
Use msys2, a virtual Linux environment, for gdb debugging. The command line is
gdb ffmpeg_g.exe // 开始启用gdb
set args -i output.h264 test.yuv // 设置参数,输入为output.h264,输出为test.yuv
start // 开始调试
Common commands:
n // next, 逐过程
s // step, 逐语句
list // 显示代码
b n // 设置第n行一个断点
jump n // 跳转到第n行
Using the list command
Here, the entry point of the function is located in the main function of fftoolffmpeg.c. After adding a breakpoint, you can debug it.