@ -1,4 +1,7 @@
# - - - F F M P E G - - -
OCV_OPTION ( OPENCV_FFMPEG_ENABLE_LIBAVDEVICE "Include FFMPEG/libavdevice library support." OFF
V I S I B L E _ I F W I T H _ F F M P E G )
if ( NOT HAVE_FFMPEG AND OPENCV_FFMPEG_USE_FIND_PACKAGE )
if ( OPENCV_FFMPEG_USE_FIND_PACKAGE STREQUAL "1" OR OPENCV_FFMPEG_USE_FIND_PACKAGE STREQUAL "ON" )
set ( OPENCV_FFMPEG_USE_FIND_PACKAGE "FFMPEG" )
@ -29,6 +32,13 @@ if(NOT HAVE_FFMPEG AND PKG_CONFIG_FOUND)
list ( APPEND FFMPEG_LIBRARIES ${ FFMPEG_libavresample_LIBRARIES } )
list ( APPEND _used_ffmpeg_libraries libavresample )
endif ( )
if ( OPENCV_FFMPEG_ENABLE_LIBAVDEVICE )
ocv_check_modules ( FFMPEG_libavdevice libavdevice ) # o p t i o n a l
if ( FFMPEG_libavdevice_FOUND )
list ( APPEND FFMPEG_LIBRARIES ${ FFMPEG_libavdevice_LIBRARIES } )
list ( APPEND _used_ffmpeg_libraries libavdevice )
endif ( )
endif ( )
set ( HAVE_FFMPEG TRUE )
else ( )
set ( _missing_ffmpeg_libraries "" )
@ -51,6 +61,7 @@ if(HAVE_FFMPEG AND NOT HAVE_FFMPEG_WRAPPER)
set ( _min_libavutil_version 52.3.0 )
set ( _min_libswscale_version 2.1.1 )
set ( _min_libavresample_version 1.0.1 )
set ( _min_libavdevice_version 53.2.0 )
foreach ( ffmpeg_lib ${ _used_ffmpeg_libraries } )
if ( FFMPEG_ ${ ffmpeg_lib } _VERSION VERSION_LESS _min_ ${ ffmpeg_lib } _version )
message ( STATUS "FFMPEG is disabled. Can't find suitable ${ffmpeg_lib} library"
@ -67,6 +78,7 @@ if(HAVE_FFMPEG AND NOT HAVE_FFMPEG_WRAPPER)
unset ( _min_libavutil_version )
unset ( _min_libswscale_version )
unset ( _min_libavresample_version )
unset ( _min_libavdevice_version )
endif ( )
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ -93,7 +105,12 @@ unset(_used_ffmpeg_libraries)
if ( HAVE_FFMPEG_WRAPPER )
ocv_add_external_target ( ffmpeg "" "" "HAVE_FFMPEG_WRAPPER" )
elseif ( HAVE_FFMPEG )
ocv_add_external_target ( ffmpeg "${FFMPEG_INCLUDE_DIRS}" "${FFMPEG_LIBRARIES}" "HAVE_FFMPEG" )
if ( OPENCV_FFMPEG_ENABLE_LIBAVDEVICE AND FFMPEG_libavdevice_FOUND )
set ( HAVE_FFMPEG_LIBAVDEVICE TRUE )
ocv_add_external_target ( ffmpeg "${FFMPEG_INCLUDE_DIRS}" "${FFMPEG_LIBRARIES}" "HAVE_FFMPEG;HAVE_FFMPEG_LIBAVDEVICE" )
else ( )
ocv_add_external_target ( ffmpeg "${FFMPEG_INCLUDE_DIRS}" "${FFMPEG_LIBRARIES}" "HAVE_FFMPEG" )
endif ( )
set ( __builtin_defines "" )
set ( __builtin_include_dirs "" )
set ( __builtin_libs "" )