bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.63k stars 731 forks source link

Build ffmpeg on Ubuntu 20.04 failed #1294

Open kwankin-yau opened 1 year ago

kwankin-yau commented 1 year ago

According to Wiki document Building FFMPEG JavaCPP preset on Ubuntu 16.04, I try build FFMPEG on my Ubuntu 20.04, but I have tried many times, and always failed on step "4.3. Build FFmpeg (time consuming)", result in the following error messages:

make[1]: Entering directory '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/mfx_dispatch-1.35.1'
 /bin/mkdir -p '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libmfx.la '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib'
libtool: install: /usr/bin/install -c .libs/libmfx.lai /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/libmfx.la
libtool: install: /usr/bin/install -c .libs/libmfx.a /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/libmfx.a
libtool: install: chmod 644 /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/libmfx.a
libtool: install: ranlib /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/libmfx.a
libtool: finish: PATH="/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/bin:/home/yau/jdk1.8.0_261/bin:/home/yau/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/pkgconfig'
 /usr/bin/install -c -m 644 libmfx.pc '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/pkgconfig'
 /bin/mkdir -p '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/include/mfx'
 /usr/bin/install -c -m 644 mfx/mfxadapter.h mfx/mfxastructures.h mfx/mfxaudio.h mfx/mfxaudio++.h mfx/mfxcamera.h mfx/mfxcommon.h mfx/mfxdispatcherprefixedfunctions.h mfx/mfxdefs.h mfx/mfxenc.h mfx/mfxjpeg.h mfx/mfxla.h mfx/mfxmvc.h mfx/mfxpak.h mfx/mfxpcp.h mfx/mfxplugin.h mfx/mfxplugin++.h mfx/mfxsc.h mfx/mfxscd.h mfx/mfxsession.h mfx/mfxstructures.h mfx/mfxvideo.h mfx/mfxvideo++.h mfx/mfxvp8.h mfx/mfxvp9.h mfx/mfxvstructures.h mfx/mfxbrc.h mfx/mfxfei.h mfx/mfxfeihevc.h mfx/ts_ext_buffers_decl.h mfx/ts_struct_decl.h mfx/ts_typedef.h '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/include/mfx'
make[1]: Leaving directory '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/mfx_dispatch-1.35.1'
sed 's#@@PREFIX@@#/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64#' ffnvcodec.pc.in > ffnvcodec.pc
install -m 0755 -d '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/include/ffnvcodec'
install -m 0644 include/ffnvcodec/*.h '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/include/ffnvcodec'
install -m 0755 -d '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/pkgconfig'
install -m 0644 ffnvcodec.pc '/home/yau/src/javacpp-presets/ffmpeg/cppbuild/linux-x86_64/lib/pkgconfig'
gcc -m64 is unable to create an executable file.
If gcc -m64 is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

I am not familiar with FFmpeg build process, please help!

saudet commented 1 year ago

That guide is too old. Use the commands from this script: https://github.com/bytedeco/javacpp-presets/blob/master/.github/actions/deploy-ubuntu/action.yml

kwankin-yau commented 1 year ago

I have tried the commands extracted from action.yml in a new ubuntu docker container, but always produces the same error which I have post previously, I known it must be some wrong with my complication or environment, but I has no idea how to deal with this yet, and because the VAAPI version have been bumped to 1.x, and 1.x does not compatible with 0.x, so I think the future release of ffmpeg-platform compiled with VAAPI 1.x would be popular with most user.

saudet commented 1 year ago

@silenium-dev started working on VAAPI 1.x in pull #1296. Please help over there!

saudet commented 1 year ago

FFmpeg 6.0 builds fine on Ubuntu 20.04: https://github.com/bytedeco/javacpp-presets/actions/runs/5211614179

Please refer to the build script: https://github.com/bytedeco/javacpp-presets/blob/master/.github/actions/deploy-ubuntu/action.yml

We need to update https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments accordingly...