fix: WITHOUT_FACERECOGNITION build flag

to avoid double loading of protobuf, implicitly loaded by opencv,
we need to deactivate the build of two face detection plugins that
use opencv (which loads protobuf implicitly). This fixes bug #185
This commit is contained in:
Jaromil
2025-11-27 00:11:16 +01:00
parent 27af2abfb4
commit 7a044cba04
4 changed files with 45 additions and 20 deletions

View File

@@ -10,6 +10,10 @@ The presence of optional libraries on the system will trigger compilation of ext
+ [Cairo](http://cairographics.org) required for cairo- filters and mixers
## Optional build flags
+ `-DWITHOUT_FACERECOGNITION=ON` - Disable face recognition plugins (facedetect and facebl0r) to avoid protobuf conflicts with applications like MLT
It is recommended to use a separate `build` sub-folder.
```
@@ -18,6 +22,13 @@ cd build && cmake ../
make
```
To disable face recognition plugins (recommended when using with MLT):
```
mkdir -p build
cd build && cmake -DWITHOUT_FACERECOGNITION=ON ../
make
```
Also ninja and nmake are supported through cmake:
```
cmake -G 'Ninja' ../

View File

@@ -8,6 +8,8 @@ set (VERSION 2.5.1)
include(GNUInstallDirs)
option (WITHOUT_OPENCV "Disable plugins dependent upon OpenCV" OFF)
option (WITHOUT_FACERECOGNITION "Disable facedetect plugin to avoid protobuf conflicts" OFF)
if (NOT WITHOUT_OPENCV)
find_package (OpenCV)
endif ()

View File

@@ -1,3 +1,8 @@
# facebl0r filter - requires OpenCV (and protobuf)
# This filter can cause conflicts with applications that also use protobuf
# such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON
if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION)
set (SOURCES facebl0r.cpp)
set (TARGET facebl0r)
@@ -11,3 +16,4 @@ set_target_properties (${TARGET} PROPERTIES PREFIX "")
target_link_libraries(${TARGET} ${OpenCV_LIBS})
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
endif()

View File

@@ -1,3 +1,8 @@
# facedetect filter - requires OpenCV (and protobuf)
# This filter can cause conflicts with applications that also use protobuf
# such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON
if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION)
set (SOURCES facedetect.cpp)
set (TARGET facedetect)
@@ -11,3 +16,4 @@ set_target_properties (${TARGET} PROPERTIES PREFIX "")
target_link_libraries(${TARGET} ${OpenCV_LIBS})
install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR})
endif()