First time here? Check out the FAQ!

Ask Your Question
1

How to build opencv so it statically link to ffmpeg?

asked Mar 5 '15

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

cmake -DBUILD_SHARED_LIBS=OFF

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

Preview: (hide)

Comments

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 (Mar 6 '15)edit

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

Romanzo gravatar imageRomanzo (Dec 31 '15)edit

1 answer

Sort by » oldest newest most voted
1

answered Mar 6 '15

wl2776 gravatar image

You can download FFmpeg binaries from here.

Agree with @StevenPuttemans about licensing.

Preview: (hide)

Question Tools

2 followers

Stats

Asked: Mar 5 '15

Seen: 4,170 times

Last updated: Mar 04 '15