OpenCV 3 and ffmpeg fun

Had a few hours of  ‘fun’ getting OpenCV3 to build… I will expand on that sometime, meantime some reminders

Some reminders mainly to me…

The main problem was configure for OpenCV would not find ffmpeg, in spite of all the solutions to the problem posted around the web, none worked. In the end I reinstalled OpenCV from source.

Note below the configure needs some specific flags or open CV will get grumpy.

opencv

clear build folder with rm -r


#before doing the

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local</pre>
<pre>

or
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON ..

ffmpeg

ffmpeg build required


./configure --enable-nonfree --enable-pic --enable-shared

You may find ffmpeg complains when it is run of missing libraries, its the usual solution apt-get….

OpenCV
A couple of functions I use from older version has different args, for thos a quick fix os

#contours returns more values so…
(_,contours,_) = cv2.findContours(
#or
contours, hierarchy = cv2.findContours(…)[-2:]
[/sourcecode ]

ps for the java libs it doesnt find thing unless

export JAVA_HOME=/usr/local/jdk1.8.0_20

 

This entry was posted in computing, opencv, python and tagged , , . Bookmark the permalink.

Leave a Reply