[FFmpeg-user] Statci compile of FFmpeg 7.0 with OpenCV 4.9.0

MediaStream mediastream at gmail.com
Fri Apr 12 08:00:16 EEST 2024


Greetings and Salutations!

Attempting to compile FFmpeg 7.0 (April 10 snapshot)  with OpenCV and
others statically.
Running on Ubuntu server 20 and binary is for Linux x86 machines.
Config.log is here: https://www.file.io/D8Hl/download/zBoNM5VCLfZJ


1.  Compiled and installed OpenCV 4.9.0 with: `cmake -DWITH_CUDA=OFF
-DCMAKE_BUILD_TYPE=Release -DWITH_OPENGL=ON -DOPENCV_ENABLE_NONFREE=ON
 -DCMAKE_CXX_FLAGS="-lcblas -std=c++11" -DENABLE_CXX11=ON
-DOPENCV_GENERATE_PKGCONFIG=YES ..` OpenCV built OK without errors.

2. moded  /usr/local/include/opencv4/opencv2/core/cvdef.h according to
p.22 here: https://www.funix.org/fr/linuxdoc/video/video-sous-linux.pdf

3. installed other libs with apt or build by hand (graphite2 needed a
`cmake -DBUILD_SHARED_LIBS=OFF ..`)

4. Now FFmpeg 7.0 : CFLAGS=-I/usr/local/include
-I/usr/local/include/opencv4 LDFLAGS=-L/usr/local/lib
-L/usr/local/lib64
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 ./configure
--prefix=${INSTALL_PATH} --enable-avfilter --enable-bzlib --enable-gpl
--enable-libass --enable-libmp3lame --enable-libvpx --enable-libx264
--enable-libx265 --enable-libxvid --enable-nonfree --enable-postproc
--enable-pthreads --enable-runtime-cpudetect --enable-static
--enable-swscale --enable-zlib --enable-libfreetype
--enable-libfontconfig --enable-libfribidi --enable-libfdk-aac
--enable-libopencv --enable-librist --enable-libsrt --enable-libaom
--enable-frei0r --enable-libopus --enable-version3
--disable-decoder=libgsm --disable-encoder=libgsm --disable-doc
--disable-ffplay --x86asmexe="${INSTALL_PATH}"/bin/nasm
--enable-libsvtav1 --disable-shared --enable-libharfbuzz
--enable-libwebp --pkg-config-flags=--static --extra-ldflags=-static
--extra-libs='-lx264 -ldl -lxvidcore -lmp3lame -lpthread -lm -lbz2 -lz
-lvpx -lass -lfontconfig -lexpat -lfreetype -lfribidi -lx265 -lfdk-aac
-laom -lopus -lwebp -lharfbuzz' --x86asmexe="${INSTALL_PATH}"/bin/nasm

5. Errors. unsure why there are so many Windows and GPU errors...?
Errors highlights from log:
    Line 15576: wmv2_decoder_select='blockdsp error_resilience idctdsp
intrax8 msmpeg4dec videodsp wmv2dsp'
    Line 15800: /tmp/ffconf.aEmuluEs/test.c:3:2: error: #error
"unsatisfied condition: defined __UCLIBC__"
    Line 15827: /tmp/ffconf.aEmuluEs/test.c:3:2: error: #error
"unsatisfied condition: defined __UCLIBC__"
    Line 15845: /tmp/ffconf.aEmuluEs/test.c:2:11: error: 'localtime_r'
undeclared here (not in a function); did you mean 'localtime'?
    Line 15907: /tmp/ffconf.aEmuluEs/test.c:3:2: error: #error
"unsatisfied condition: defined(__BYTE_ORDER__) && (__BYTE_ORDER__ ==
__ORDER_BIG_ENDIAN__)"
    Line 15941: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
intrin.h: No such file or directory
    Line 16074: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
arm_neon.h: No such file or directory
    Line 16192: /tmp/ffconf.aEmuluEs/test.c:3:57: error: 'struct
sockaddr' has no member named 'sa_len'
    Line 16239: collect2: error: ld returned 1 exit status
    Line 16249: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
atomic.h: No such file or directory
    Line 16262: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
mbarrier.h: No such file or directory
    Line 16275: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 16317: /tmp/ffconf.aEmuluEs/test.c:1:18: error: '_Float16' is
not supported on this target
    Line 16333: /tmp/ffconf.aEmuluEs/test.c:3:50: error:
'_aligned_malloc' undeclared (first use in this function); did you
mean 'check__aligned_malloc'?
    Line 16378: /tmp/ffconf.aEmuluEs/test.c:3:49: error:
'arc4random_buf' undeclared (first use in this function); did you mean
'check_arc4random_buf'?
    Line 16426: collect2: error: ld returned 1 exit status
    Line 16576: collect2: error: ld returned 1 exit status
    Line 16598: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
conio.h: No such file or directory
    Line 16614: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error: io.h:
No such file or directory
    Line 16630: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
lzo/lzo1x.h: No such file or directory
    Line 16646: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
mach/mach_time.h: No such file or directory
    Line 16701: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
sys/sysctl.h: No such file or directory
    Line 16717: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    ...
    Line 16909: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 16986: /tmp/ffconf.aEmuluEs/test.c:2:10: fatal error:
X11/extensions/Xvlib.h: No such file or directory
    Line 16997: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
direct.h: No such file or directory
    Line 17015: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
dxgidebug.h: No such file or directory
    Line 17026: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error: dxva.h:
No such file or directory
    Line 17037: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
dxva2api.h: No such file or directory
    Line 17048: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error: io.h:
No such file or directory
    Line 17080: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
mftransform.h: No such file or directory
    Line 17091: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
net/udplite.h: No such file or directory
    Line 17109: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
pthread_np.h: No such file or directory
    Line 17169: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
valgrind/valgrind.h: No such file or directory
    Line 17185: gcc: error: unrecognized command-line option '-framework'
    Line 17198: gcc: error: unrecognized command-line option '-framework'
    Line 17211: gcc: error: unrecognized command-line option '-framework'
    Line 17219: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    ...
    Line 17325: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 17342: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
android/native_window.h: No such file or directory
    Line 17360: /tmp/ffconf.aEmuluEs/test.c:2:10: fatal error:
media/NdkImage.h: No such file or directory
    Line 17379: /tmp/ffconf.aEmuluEs/test.c:3:10: fatal error:
camera/NdkCameraManager.h: No such file or directory
    Line 17391: gcc: fatal error: cannot execute 'cc1obj': execvp: No
such file or directory
    ...
    Line 17481: gcc: fatal error: cannot execute 'cc1obj': execvp: No
such file or directory
    Line 17501: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
   ...
    Line 17630: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 17643: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error: d3d9.h:
No such file or directory
    Line 17659: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
mfapi.h: No such file or directory
    Line 17671: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
vdpau/vdpau.h: No such file or directory
    Line 17683: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
vdpau/vdpau.h: No such file or directory
    Line 17695: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
vdpau/vdpau.h: No such file or directory
    Line 17769: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 17786: /tmp/ffconf.aEmuluEs/test.c:1:10: fatal error:
windows.h: No such file or directory
    Line 17867: /tmp/ffconf.aEmuluEs/test.c:3:54: error:
'pthread_set_name_np' undeclared (first use in this function); did you
mean 'check_pthread_set_name_np'?
    Line 17886: /tmp/ffconf.aEmuluEs/test.c:3:53: error:
'pthread_setname_np' undeclared (first use in this function); did you
mean 'check_pthread_setname_np'?
    Line 26781: collect2: error: ld returned 1 exit status


More information about the ffmpeg-user mailing list