Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building static OpenCV with ffmpeg is still looking for shared libavcodec

I'm trying to build a static OpenCV python with ffmpeg enabled to run on AWS Lambda. I Need to upload OpenCV my cv2.so in a zip file.

To do so I set the BUILD_SHARED_LIBS=OFF and WITH_FFPMEG=YES. But when doing import cv2 in the python shell, I get the error:

ImportError: libavcodec.so.53: cannot open shared object file: No such file or directory.

If I set WITH_FFPMEG=NO I don't get this error anymore but I need ffmpeg to read a video.

What I would like to do is opencv to use the static libavcodec library not the shared one. I thought setting up BUILD_SHARE_LIBS to off would be enough but it's not. There are no flags in the cmake file which let you specified the path to libavcodec. I've been looking for sometimes but I can't find a solution.

Any ideas?

Thanks for your help

Building static OpenCV with ffmpeg is still looking for shared libavcodec

I'm trying to build a static OpenCV python with ffmpeg enabled to run on AWS Lambda. I Need to upload OpenCV my cv2.so in a zip file.

To do so I set the BUILD_SHARED_LIBS=OFF and WITH_FFPMEG=YES. But when doing import cv2 in the python shell, I get the error:

ImportError: libavcodec.so.53: cannot open shared object file: No such file or directory.

If I set WITH_FFPMEG=NO I don't get this error anymore but I need ffmpeg to read a video.

What I would like to do is opencv to use the static libavcodec library not the shared one. I thought setting up BUILD_SHARE_LIBS to off would be enough but it's not. There are no flags in the cmake file which let you specified the path to libavcodec. I've been looking for sometimes but I can't find a solution.

Any ideas?

Thanks for your help