<div dir="ltr">I am using  build from <a href="https://github.com/BtbN/FFmpeg-Builds/releases">https://github.com/BtbN/FFmpeg-Builds/releases</a> for Windows 64 with MSVC compiler, I need to capture screen using c++ code using gdigrab, but  gdigrab not working<br><br><br><br>So I check the ffmpeg exe with formats arg<br><br>     .\ffmpeg.exe -formats<br>Give the result<br><br>D d gdigrab GDI API Windows frame grabber<br><br>Which says gdigrab is there with ffmpeg exe. And I can screen capture with this exe too. I am linking the same lib coming with this exe, so the below code should expected to work with gdigrab<br><br><br><br>avformat_network_init();<br>    <br>    AVFormatContext *formatCtx = nullptr;<br>    AVDictionary *options = nullptr;<br>    <br>    const char *inputSource = "desktop";<br>    const char *inputFormat = "gdigrab";<br><br>    // Initialize options<br>    av_dict_set(&options, "video_size", "800x600", 0);<br>    av_dict_set(&options, "offset_x", "100", 0);<br>    av_dict_set(&options, "offset_y", "100", 0);<br>    av_dict_set(&options, "framerate", "30", 0);<br><br>    // Debug options<br>    char *dump = nullptr;<br>    av_dict_get_string(options, &dump, '=', ',');<br>    qDebug() << "Options: " << dump;<br>    av_free(dump);<br><br><br>    const AVInputFormat *fmt = nullptr;<br>    void *opaque = nullptr;<br><br>    while ((fmt = av_demuxer_iterate(&opaque))) {<br>        qDebug() << fmt->name;<br>    }<br><br><br>    // Find input format<br>   const  AVInputFormat *inputFmt = av_find_input_format(inputFormat);<br>    if (!inputFmt) {<br>        qDebug() << "Error: Input format not found:" << inputFormat;<br>    }<br><br>    // Open input<br>    int ret = avformat_open_input(&formatCtx, inputSource, inputFmt, &options);<br>    if (ret < 0) {<br>        char errbuf[AV_ERROR_MAX_STRING_SIZE];<br>        av_strerror(ret, errbuf, sizeof(errbuf));<br>        qDebug() << "Error: Unable to open input source:" << inputSource << ", " << errbuf;<br>        return;<br>    }<br><br>It always print<br><br>Error: Input format not found: gdigrab<br>Error: Unable to open input source: desktop ,  No such file or directory</div>