-
-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug where OpenCV does not link with FFMPEG #1732
Conversation
@@ -973,6 +973,7 @@ if(AV_BUILD_OPENCV) | |||
CONFIGURE_COMMAND | |||
${CMAKE_COMMAND} | |||
${CMAKE_CORE_BUILD_FLAGS} | |||
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to add a variable
set(FFMPEG_CMAKE_FLAGS -DFFMPEG_ROOT=${CMAKE_INSTALL_PREFIX})
And add it bellow as it's done for the other libs "${TIFF_CMAKE_FLAGS} ${PNG_CMAKE_FLAGS} ${JPEG_CMAKE_FLAGS} ${LIBRAW_CMAKE_FLAGS}"
@furbrain Will you have time to make the adjustments proposed in the review? |
I've tested using the FFMPEG_ROOT option as suggested above - this does not seem to let the opencv cmake find the ffmpeg libraries - possibly because it's actually looking for libav[codec|format|device|etc] libraries etc. I'm not very good with cmake (python is more my area of expertise) and honestly I've struggled to debug why it doesn't work. I can't see any major harm from telling cmake to look in the general installation prefix for libraries. Phil |
I cannot compile from source as cuda seems to really dislike me for whatever reason. Would it be possible by any chance for you to pass me a tarball for the meshroom distribution built using this patch? or even, just a tarball of the alicevision build, as hopefully I should just be able to delete the existing alicevision directory and replace it with this fixed build. |
@furbrain Do you mind if i take this over as there hasn't been any progress in a little while? I believe I have a working solution that addresses some of @fabiencastan's concerns. Basically OpenCV is VERY particular about where packages are installed, especially FFmpeg and it doesn't provide a way of specifying where FFmpeg is located. @fabiencastan's fix will not work as there is no way of specifying (that i have been able to find) the FFmpeg install path. The way around this when compiling OpenCV from source is adding the FFmpeg install location to the prefix path as @furbrain did such that the Adding the line: set(FFMPEG_CMAKE_FLAGS -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}) to the FFmpeg build section and then adding This would change would the CMAKE_PREFIX_PATH for just OpenCV to include the install path for FFmpeg. I've tested this using the Docker container and checked the output of Thanks, |
This is fine by me!
…On Sun, 24 Nov 2024, 08:39 c-ewing, ***@***.***> wrote:
@furbrain <https://github.com/furbrain> Do you mind if i take this over
as there hasn't been any progress in a little while? I believe I have a
working solution that addresses some of @fabiencastan
<https://github.com/fabiencastan>'s concerns.
Basically OpenCV is *VERY* particular about where packages are installed,
especially FFmpeg and it doesn't provide a way of specifying where FFmpeg
is located. @fabiencastan <https://github.com/fabiencastan>'s fix will
not work as there is no way of specifying (that i have been able to find)
the FFmpeg install path. The way around this when compiling OpenCV from
source is adding the FFmpeg install location to the prefix path as
@furbrain <https://github.com/furbrain> did such that the find_package()
used in OpenCV's build also searches in the install prefix defined during
the AliceVision build.
Adding the line:
set(FFMPEG_CMAKE_FLAGS -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH})
to the FFmpeg build section and then adding {FFMPEG_CMAKE_FLAGS} to the
OpenCV section
This would change would the CMAKE_PREFIX_PATH for *just* OpenCV to
include the install path for FFmpeg.
I've tested this using the Docker container and checked the output of /opt/AliceVision_install/bin-deps/opencv_version
-v and verified that OpenCV is built against FFmpeg.
Thanks,
cewing
—
Reply to this email directly, view it on GitHub
<#1732 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAW3PXNNKSVHTIQPILZELQT2CGGEBAVCNFSM6AAAAABMVVMTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVHA3TGNJYGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Currently when building
opencv
, it does not findffmpeg
, even though it has been built and installed. This means that KeyframeSelector does not run under linux (opencv automatically bundles its own version of ffmpeg under windows).Features list
Implementation remarks
This PR simply lets the opencv cmake know where to look for various libraries (and fixes a minor bug in getting the base docker image)