Ask Your Question

How to build opencv so it statically link to ffmpeg?

asked 2015-03-04 18:47:14 -0500

davidshen gravatar image

I want to do two things:

  • A static opencv version that when my program link to it, my executable can run independently
  • A dynamic opencv version that I do not need to worry about dependencies like ffmpeg

I know I can use


to build a static version. But how do I specify using static link with ffmpeg?

edit retag flag offensive close merge delete


For static linking with ffmpeg you will first need to build ffmpeg from scratch as static library before building OpenCV. However keep in mind that the license of ffmpeg does not allow you to use a static built version in commercial products!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-06 02:40:07 -0500 )edit

How can you tell opencv to use this static ffmpeg? there is no option in the cmake to link ffmpeg?

Romanzo gravatar imageRomanzo ( 2015-12-30 21:39:44 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-06 04:48:34 -0500

wl2776 gravatar image

You can download FFmpeg binaries from here.

Agree with @StevenPuttemans about licensing.

edit flag offensive delete link more

Question Tools



Asked: 2015-03-04 18:47:14 -0500

Seen: 3,152 times

Last updated: Mar 04 '15