Building static OpenCV with ffmpeg is still looking for shared libavcodec

asked 2016-01-05 00:22:38 -0500

Romanzo gravatar image

updated 2016-01-05 00:23:31 -0500

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

edit retag flag offensive close merge delete

Comments

That's not possible using official opencv

LBerger gravatar imageLBerger ( 2016-01-05 01:42:14 -0500 )edit

ok thanks. Is there any other library i can use other than ffmpeg thread video? and which would be under BSD?. I saw GStreamer is also LGPL

Romanzo gravatar imageRomanzo ( 2016-01-05 18:13:01 -0500 )edit