From 5bf0344d73662a960b82ba37a44252224b823b5a Mon Sep 17 00:00:00 2001 From: c-ewing <59128151+c-ewing@users.noreply.github.com> Date: Sun, 24 Nov 2024 11:17:23 -0800 Subject: [PATCH] Build OpenCV with FFmpeg on Linux Due to the non-standard install location of FFmpeg during the AliceVision build OpenCV cannot find it. This patch adds FFmpeg to the BUILD_PREFIX of OpenCV to enable the FFmpeg features. --- src/cmake/Dependencies.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmake/Dependencies.cmake b/src/cmake/Dependencies.cmake index e805867c81..523b75974a 100644 --- a/src/cmake/Dependencies.cmake +++ b/src/cmake/Dependencies.cmake @@ -688,6 +688,9 @@ if(AV_BUILD_FFMPEG) BUILD_COMMAND $(MAKE) -j${AV_BUILD_DEPENDENCIES_PARALLEL} DEPENDS ${VPX_TARGET} ) + + set(FFMPEG_CMAKE_FLAGS -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}) + endif() if(AV_BUILD_FLANN) @@ -1004,7 +1007,7 @@ if(AV_BUILD_OPENCV) ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DOPENCV_EXTRA_MODULES_PATH=${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib/modules - ${ZLIB_CMAKE_FLAGS} ${TBB_CMAKE_FLAGS} + ${ZLIB_CMAKE_FLAGS} ${TBB_CMAKE_FLAGS} ${FFMPEG_CMAKE_FLAGS} ${TIFF_CMAKE_FLAGS} ${PNG_CMAKE_FLAGS} ${JPEG_CMAKE_FLAGS} ${LIBRAW_CMAKE_FLAGS} -DWITH_TBB=ON -DWITH_FFMPEG=${AV_BUILD_FFMPEG}