Using Visual Studio Code to debug ffmpeg
C:\msys64
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch
export http_proxy=<myusername>:<mypassword>@proxy-host-name:8080
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export socks_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
pacman -S -y -u
or
pacman -Syu
pacman -S git
pacman -S make diffutils nasm yasm
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-i686-gcc
C/C++
Code Outline
Code Navigation
vscode-icons
cd c:\msys64
mingw64.exe
cd ~
git clone https://github.com/FFmpeg/FFmpeg.git
cd ~/FFmpeg
./configure --enable-debug=3 --disable-optimizations
make -j8
build x264/x265 with ffmpeg
sudo apt install libx264-dev libx265-dev
cd ~/FFmpeg
./configure --enable-debug=3 --disable-optimizations --enable-libx264 --enable-libx265 --enable-gpl
make -j8
ffmpeg_g.exe
ffmpeg.exe
ffprobe_g.exe
ffprobe.exe
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/ffmpeg_g.exe",
"args": [
"-hwaccel",
"dxva2",
"-i",
"test.mp4",
"tmp.yuv",
"-y"
],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}
int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
const void *pp, unsigned pp_size,
const void *qm, unsigned qm_size,
int (*commit_bs_si)(AVCodecContext *,
DECODER_BUFFER_DESC *bs,
DECODER_BUFFER_DESC *slice))
{
// ...
#if CONFIG_D3D11VA
if (ff_dxva2_is_d3d11(avctx))
hr = ID3D11VideoContext_SubmitDecoderBuffers(D3D11VA_CONTEXT(ctx)->video_context,
D3D11VA_CONTEXT(ctx)->decoder,
buffer_count, buffer11);
#endif
#if CONFIG_DXVA2
if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) {
DXVA2_DecodeExecuteParams exec = {
.NumCompBuffers = buffer_count,
.pCompressedBuffers = buffer2,
.pExtensionData = NULL,
};
hr = IDirectXVideoDecoder_Execute(DXVA2_CONTEXT(ctx)->decoder, &exec);
}
#endif
if (FAILED(hr)) {
av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", (unsigned)hr);
result = -1;
}
}