Building static OpenCV with ffmpeg is still looking for shared libavcodec
<p>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.</p>

<p>To do so I set the <code>BUILD_SHARED_LIBS=OFF</code> and <code>WITH_FFPMEG=YES</code>. But when doing import cv2 in the Python shell, I get the error:</p>

<pre><code>ImportError: libavcodec.so.53: cannot open shared object file: No such file or directory
</code></pre>

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

<p>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. T</p>

<p>here 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.</p>

<p>Any ideas?</p>