This must be a frequently asked question, but I can't find the answer in the FAQ, or in the recent archive of this list, or by using
google with the keywords I thought of.

I would like to use libavcodec.dll and libavformat.dll in my Windows
XP Visual C++ 2008 project. However, I would prefer not to download a whole new compiler environment and compile ffmpeg from sources, just to get the dlls.

Is there anyplace I can find relatively recent precompiled dll's
and a matching header file?

Dani AI

Generated

— short, practical update (and : a small correction to the 2009 view).

Prebuilt Windows FFmpeg DLLs and development files are widely available today (you don’t have to build from scratch). The official FFmpeg download page points to trusted Windows packagers; popular maintained options that include binaries plus headers/dev files are the Gyan builds and several GitHub build projects that provide MSVC-compatible packages. FFmpeg Download · Gyan FFmpeg builds. (ffmpeg.org)

Practical route for Visual Studio (including older VS versions): pick a shared build that matches your target architecture (x86 vs x64) and extract the package’s include/ and lib/ (or .lib) files into your project paths. If the package provides only a MinGW-style .dll.a import library, create an MSVC import .lib from the DLL using dumpbin + lib.exe (on Windows) or llvm-dlltool (on Linux). Example commands:

dumpbin /exports path\to\avformat-xxx.dll > exports.txt
# craft a .def (LIBRARY / EXPORTS ...) from exports.txt, then:
lib /def:avformat.def /out:avformat.lib /machine:x86

Or on Linux:

llvm-dlltool -m i386 -d avformat.def -l avformat.lib

(These are standard recipes for making MSVC import libs from DLLs.) (stackoverflow.com)

If you want MSVC-built FFmpeg libraries instead of converting MinGW artifacts, FFmpeg supports building with MSVC (via MSYS2 + NASM and ./configure --toolchain=msvc) — but note official MSVC support is for Visual Studio 2013 and newer; for older VS2008 the easiest options are either MinGW-built DLLs (use import libs or LoadLibrary) or upgrade/use a newer toolchain / vcpkg which can produce MSVC-compatible packages. Also remember FFmpeg exposes a C API (wrap includes in extern "C" { ... } when using C++); do not mix C++ ABI objects across compilers. (ffmpeg.org)

Quick troubleshooting checklist: 1) match DLL bitness to your exe, 2) put the DLLs next to the .exe or on PATH, 3) ensure the correct MSVC runtime is installed for MSVC-built DLLs, 4) wrap FFmpeg headers with extern "C", 5) use a dependency tool (modern replacement for depends.exe: “Dependencies”) to find missing DLLs. If simple linking fails, falling back to explicit LoadLibrary + GetProcAddress avoids import-library format issues. (github.com)

Summary: for VS2008 the fastest path is to grab a prebuilt shared package (Gyan or similar), generate or obtain an MSVC .lib if needed, and match architecture and runtimes; if long-term support/modern builds are required, consider upgrading the toolchain or using vcpkg / MSYS2+MSVC to build clean MSVC libraries. (gyan.dev)

Recommended Answers

All 3 Replies

As far as i know, it not possible to compile ffmpeg under Visual C++, it doesn't support the C++ standard. You have to compile it the gcc under linux or MiniGW!

Is there any other alternative of "ffmpeg" that can be used with C++???

dont use Visual C++, use gcc/MiniGW, ffmpeg is powerfull!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.