# A Straightforward method to build ffmpeg for OpenCV?

**URL:** <https://forum.opencv.org/t/a-straightforward-method-to-build-ffmpeg-for-opencv/8402>\
**Category:** C++\
**Tags:** ffmpeg, windows, build, videoio\
**Created:** [April 14, 2022, 6:05pm UTC](https://forum.opencv.org/t/a-straightforward-method-to-build-ffmpeg-for-opencv/8402 "2022-04-14T18:05:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wynters](https://avatars.discourse-cdn.com/v4/letter/w/f6c823/32.png) [@Wynters](https://forum.opencv.org/u/Wynters)\
**Post date:** [April 14, 2022, 6:05pm UTC](https://forum.opencv.org/t/a-straightforward-method-to-build-ffmpeg-for-opencv/8402/1 "2022-04-14T18:05:25Z")

</div>

I have been working and doing research into how to build the opencv\_ffmpegxxx.dll.

I’m working with OpenCV 4.5.5, the contrib modules and Visual Studio 2019. I AM able to compile OpenCV to dll’s and the world version but getting ffmpeg to build is beyond me.

I set the ffmpeg setting in CMake. Nothing, though I do see a number of mentions in the world dll. Perhaps it is being built but if so, I still can’t use that version with Darknet since it “appears” to need the opencv\_ffmpegxxx.dll.

After scouring the web I’ve downloaded many versions of ffmpeg. I’ve tried to build them separately, which won’t work for my needs, but I tried. I tried replacing the code in the opencv-master version but still no dll build.

There surely must be a simple and straightforward way to do this. I’m working with Windows 10, Visual Studio 2019, C++, and OpenCV 4.5.5 with the extra modules.

Any ideas out there? I don’t mind if it’s so simple that I completely overlooked it. I would simply like to build the complete version of OpenCV with the ffmpeg dll.

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [April 14, 2022, 6:57pm UTC](https://forum.opencv.org/t/a-straightforward-method-to-build-ffmpeg-for-opencv/8402/2 "2022-04-14T18:57:44Z")

</div>

Here you go

> [@Cap\_ffmpeg\_impl.hpp changes are not applied to opencv build](https://forum.opencv.org/t/cap-ffmpeg-impl-hpp-changes-are-not-applied-to-opencv-build/2980/6):
>
> Hello zadok, Maybe you already found a solution for your problem. If it’s not the case, I share with you a tutorial I made to build the opencv\_videoio\_ffmpeg\*.dll. It’s made to be use by anybody so don’t be mad if you found it too childish. Tutorial to compil you own modified version of opencv\_videoio\_ffmpeg\*.dll Goal: We will modify the library to change the pixel format used when writing raw video with the fourcc codec 0x00000000 which stand for BI\_RGB label. There is no fourcc label to us…

Or if you have the ffmpeg libs you could modify the cmake script to link against that instead of using the dll.
