调试ffmpeg

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
                }
            ]
        }
    ]
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值