compilation 1.17.6 stops with la fonction « ffm_audio_encode

The place to discuss linux version of MakeMKV
Post Reply
prof27
Posts: 5
Joined: Mon Mar 04, 2024 6:02 pm

compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by prof27 »

Hi. On a mageia-5.1 old but good enough for me i 'd ever compiled makemkv 1.16.7.
but compilation 1.17.6 failed this time:
here is the Konsole output:
tmp/libffabi/src/ffabi.c.o: dans la fonction « ffm_audio_encode_init »:
ffabi.c:(.text+0xc4d): référence indéfinie vers « av_channel_layout_from_mask »
tmp/libffabi/src/ffabi.c.o: dans la fonction « ffm_audio_encode_put_frame »:
ffabi.c:(.text+0xf85): référence indéfinie vers « av_channel_layout_copy »
tmp/libffabi/src/ffabi.c.o: dans la fonction « ffm_get_channel_layout_string »:
ffabi.c:(.text+0x19c6): référence indéfinie vers « av_channel_layout_from_mask »
ffabi.c:(.text+0x19ea): référence indéfinie vers « av_channel_layout_describe »
collect2: erreur: ld a retourné 1 code d'état d'exécution
Makefile:88: recipe for target 'out/libmakemkv.so.1.full' failed
make: *** [out/libmakemkv.so.1.full] Error 1

I used ffmpeg-6.0. Think perhaps the problem is here.

Code: Select all

$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH ./configure CFLAGS="-std=gnu++11"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin//sed
checking for grep that handles long lines and -e... /usr/bin//grep
checking for egrep... /usr/bin//grep -E
checking for fgrep... /usr/bin//grep -F
checking for ld used by gcc... /usr/bin//ld
checking if the linker (/usr/bin//ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin//nm -B
checking the name lister (/usr/bin//nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin//ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin//nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin//dd
checking how to truncate binary pipes... /usr/bin//dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin//ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin//ld -m elf_x86_64
checking if the linker (/usr/bin//ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin//ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin//ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for -objcopy... no
checking for objcopy... objcopy
checking for -ld... /usr/bin//ld -m elf_x86_64
checking for a BSD-compatible install... /usr/bin//install -c
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for compress2 in -lz... yes
checking openssl/opensslconf.h usability... yes
checking openssl/opensslconf.h presence... yes
checking for openssl/opensslconf.h... yes
checking for AES_encrypt in -lcrypto... yes
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for XML_ParserCreate in -lexpat... yes
checking for pkg-config... /usr/bin//pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ffmpeg... yes
checking whether LIBAVCODEC_VERSION_MAJOR is declared... yes
checking LIBAVCODEC_VERSION_MAJOR... 60
checking whether avcodec_send_frame is declared... yes
checking for struct AVChannelLayout... yes
checking for av_log_format_line... yes
checking for AVCodecParserContext.duration... yes
checking for av_codec_iterate... yes
checking for qt5... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libffabi/src/ffabicfg.h
config.status: libffabi/src/ffabicfg.h is unchanged
config.status: executing libtool commands
I need help because i'm not an informatician...
MrPenguin
Posts: 104
Joined: Thu Oct 19, 2023 11:31 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by MrPenguin »

I have managed to compile MakeMKV 1.17.6 on Fedora 39, which uses ffmpeg 6.0:

Code: Select all

ffmpeg-6.0.1-3.fc39.x86_64
ffmpeg-devel-6.0.1-3.fc39.x86_64
You appear to have a "linker" error. The av_channel_layout_from_mask function should exist in libavutil:

Code: Select all

$ nm -D /usr/lib64/libavutil.so.58.2.100 | grep av_channel_layout_from_mask
0000000000026ea0 T av_channel_layout_from_mask@@LIBAVUTIL_58
This is from my config.log file, for comparison:

Code: Select all

...
configure:17109: checking for ffmpeg
configure:17116: $PKG_CONFIG --exists --print-errors "libavcodec libavutil"
configure:17119: $? = 0
configure:17133: $PKG_CONFIG --exists --print-errors "libavcodec libavutil"
configure:17136: $? = 0
configure:17174: result: yes
configure:17186: checking whether LIBAVCODEC_VERSION_MAJOR is declared
configure:17186: gcc -c -g -O2 -I/usr/include/ffmpeg conftest.c >&5
configure:17186: $? = 0
configure:17186: result: yes
configure:17200: checking LIBAVCODEC_VERSION_MAJOR
configure:17202: gcc -o conftest -g -O2 -I/usr/include/ffmpeg  conftest.c -lavutil -lavcodec -lrt >&5
configure:17202: $? = 0
configure:17202: ./conftest
configure:17202: $? = 0
...
prof27
Posts: 5
Joined: Mon Mar 04, 2024 6:02 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by prof27 »

Thanks for help.
Problem is that many libavutil are founded because i have compiled so many things besides rpm paquets (mageia=fedora for this point). So founded a big bazard.

First I have compiled ffmpeg from tarball. Prefix installation is /us/local.
$ ffmpeg -version
ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --prefix=/usr/local --enable-linux-perf --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-gpl --enable-libtheora --enable-zlib --enable-libx264 --enable-nonfree --enable-version3 --enable-avfilter --enable-libspeex --enable-libopenjpeg --enable-libgsm --enable-postproc --enable-pthreads --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-ffplay --enable-runtime-cpudetect --enable-bzlib --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libx265 --enable-vdpau --enable-libfreetype --enable-libfontconfig --enable-nvenc --enable-cuvid --enable-gray --enable-libfdk-aac --enable-libvpx --enable-libkvazaar --enable-libvidstab --enable-libopus --enable-libtesseract --enable-libsoxr --enable-libpulse --enable-libfribidi --enable-libbluray --enable-libass --enable-libzimg --enable-opencl
...
libavutil 58. 2.100 / 58. 2.100

Seeking for libavutil in /usr/local:
$ find /usr/ -name 'libavutil.so.*.*' gives:
/usr/local/lib/libavutil.so.56.31.100
and
/usr/lib64/libavutil.so.54.7.10
/usr/lib/libavutil.so.54.7.100
/usr/lib/libavutil.so.52.38.100 !

A few old things necessary to not have many pb with dependencies.
ffmpeg is ok. I used it every day.
But command
nm -D /usr/local/lib/libavutil.so.56.31.100 | grep av_channel_layout_from_mask
returns nothing.
MrPenguin
Posts: 104
Joined: Thu Oct 19, 2023 11:31 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by MrPenguin »

The build scripts use pkg-config to locate libraries to compile against, and I suspect it has found the wrong installation of ffmpeg.

There is an environment variable called PKG_CONFIG_PATH which determines which directories pkg-config searches, and the order to search them in. It sounds like you need to execute:

Code: Select all

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig
and then reconfigure MakeMKV.
nm -D /usr/local/lib/libavutil.so.56.31.100 | grep av_channel_layout_from_mask
Your version is 56.31.100, whereas mine is 58.2.100. So your one looks too old - are you sure that is from ffmpeg 6.0.1? Could you have more than one installation of ffmpeg in /usr/local? Or have you accidentally deleted your 58.2.100 version?

Mine is definitely from ffmpeg 6.0.1:

Code: Select all

$ rpm -q --file /usr/lib64/libavutil.so.58.2.100 
ffmpeg-libs-6.0.1-3.fc39.x86_64
And

Code: Select all

$ ffmpeg -version
ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libvpl --enable-runtime-cpudetect
libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100
You will also notice that my ffmpeg uses libavutil.so.58, as it claims:

Code: Select all

$ ldd `which ffmpeg` | grep libavutil
	libavutil.so.58 => /lib64/libavutil.so.58 (0x00007f57c9a00000)
I wonder... did you configure ffmpeg 6.0.1 actually to create libavutil.so.58.2.100 in the first place? You will notice that Fedora also includes the following two configuration options:

Code: Select all

--disable-static --enable-shared
whereas your configuration line does not.
prof27
Posts: 5
Joined: Mon Mar 04, 2024 6:02 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by prof27 »

Hi thanks again.
I was very surprised by the founded versions of libavutil.
Of course one of them would be libavutil 58 as ffmpeg claims .
But it is missing in /usr/local.
So i went to the ffmpeg 's directory and do make install again and obtains the same result
$ find /usr/ -name 'libavutil*' 2>/dev/null to be very wide
/usr/X11R6/include/avidemux/2.6/libavutil
/usr/X11R6/include/libavutil
/usr/doc/ffmpeg/doc/examples/pc-uninstalled/libavutil-uninstalled.pc
/usr/doc/ffmpeg/doc/libavutil.html
/usr/doc/ffmpeg/doc/libavutil.3
/usr/doc/ffmpeg/doc/libavutil.pod.d
/usr/doc/ffmpeg/doc/libavutil.html.d
/usr/doc/ffmpeg/doc/libavutil.texi
/usr/doc/ffmpeg/doc/libavutil.pod
/usr/include/avidemux/2.6/libavutil
/usr/include/libavutil
/usr/lib/libavutil.so.54.7.100
/usr/lib/libavutil.so.54
/usr/lib/libavutil.so.52
/usr/lib/libavutil.so.52.38.100
/usr/lib64/libavutil.so.54.7.100
/usr/lib64/pkgconfig/libavutil.pc
/usr/lib64/libavutil.so
/usr/lib64/libavutil.so.54
/usr/lib64/libavutil.so.52
/usr/lib64/libavutil.so.52.38.100
/usr/share/man/man3/libavutil.3.xz
/usr/local/include/include/avidemux/2.6/libavutil
/usr/local/include/libavutil
/usr/local/lib/pkgconfig/libavutil.pc
/usr/local/lib/libavutil.so.56.31.100
/usr/local/lib/libavutil.so
/usr/local/lib/libavutil.a
/usr/local/lib/libavutil.so.56
/usr/local/share/doc/ffmpeg/libavutil.html
/usr/local/share/man/man3/libavutil.3
but none so.58
HOWEVER:
$ ffmpeg
ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --prefix=/usr/local --enable-linux-perf --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-gpl --enable-libtheora --enable-zlib --enable-libx264 --enable-nonfree --enable-version3 --enable-avfilter --enable-libspeex --enable-libopenjpeg --enable-libgsm --enable-postproc --enable-pthreads --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-ffplay --enable-runtime-cpudetect --enable-bzlib --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libx265 --enable-vdpau --enable-libfreetype --enable-libfontconfig --enable-nvenc --enable-cuvid --enable-gray --enable-libfdk-aac --enable-libvpx --enable-libkvazaar --enable-libvidstab --enable-libopus --enable-libtesseract --enable-libsoxr --enable-libpulse --enable-libfribidi --enable-libbluray --enable-libass --enable-libzimg --enable-opencl
libavutil 58. 2.100 / 58. 2.100 <-----
What is this mystery ?
I must leave but i think to compile again ffmpeg 6,0 on the evening. It is very strange for me what is happening.
MrPenguin
Posts: 104
Joined: Thu Oct 19, 2023 11:31 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by MrPenguin »

Try adding

Code: Select all

--enable-shared --disable-static
to your ffmpeg configuration parameters when you recompile it. I strongly suspect you have not built the shared ffmpeg libraries that MakeMKV needs.
prof27
Posts: 5
Joined: Mon Mar 04, 2024 6:02 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by prof27 »

Hi.
I dit it and it works:
$ find /usr/ -name 'libavutil*.*' 2>/dev/null
/usr/doc/ffmpeg/doc/examples/pc-uninstalled/libavutil-uninstalled.pc
/usr/doc/ffmpeg/doc/libavutil.html
/usr/doc/ffmpeg/doc/libavutil.3
/usr/doc/ffmpeg/doc/libavutil.pod.d
/usr/doc/ffmpeg/doc/libavutil.html.d
/usr/doc/ffmpeg/doc/libavutil.texi
/usr/doc/ffmpeg/doc/libavutil.pod
/usr/lib/libavutil.so.54.7.100
/usr/lib/libavutil.so.54
/usr/lib/libavutil.so.52
/usr/lib/libavutil.so.52.38.100
/usr/lib64/libavutil.so.54.7.100
/usr/lib64/pkgconfig/libavutil.pc
/usr/lib64/libavutil.so
/usr/lib64/libavutil.so.54
/usr/lib64/libavutil.so.52
/usr/lib64/libavutil.so.52.38.100
/usr/share/man/man3/libavutil.3.xz
/usr/local/lib/pkgconfig/libavutil.pc
/usr/local/lib/libavutil.so.56.31.100
/usr/local/lib/libavutil.so.58 <<++++++++++++
/usr/local/lib/libavutil.so.58.2.<+++++++++++++

I 'll try to compile again for makemkv and give you the result later.
Have a good night.
prof27
Posts: 5
Joined: Mon Mar 04, 2024 6:02 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by prof27 »

Hi,
makemkv seems to have compiled after i made some additions in the Makefile about CC and CCXX flags( -std=gnu++11 )because my compiler is old (4.9.2).
It wrote many warnings but it ended with:
objcopy --strip-all --strip-debug --strip-unneeded --discard-all out/mmgplsrv.full out/mmgplsrv
type "sudo make install" to install
This seemed to be good.
After i went to ./out in the sources 's directory.
$ ls .
libdriveio.so.0* libmakemkv.so.1* libmmbd.so.0* makemkv* mmccextr* mmgplsrv*
libdriveio.so.0.full* libmakemkv.so.1.full* libmmbd.so.0.full* makemkv.full* mmccextr.full* mmgplsrv.full*
I did
$ ./makemkv.full
and saws a popup with
"Application failed to initialize
NO_ANSWER_FROM_MAKEMKVCON."

I didn't install it to not overwrite ver 1.16.7
Question is if i didn' install the -bin tarball is this here the problem ?
MrPenguin
Posts: 104
Joined: Thu Oct 19, 2023 11:31 pm

Re: compilation 1.17.6 stops with la fonction « ffm_audio_encode

Post by MrPenguin »

Question is if i didn't install the -bin tarball is this here the problem ?
MakeMKV has two tarballs:
- makemkv-oss-1.17.6.tar.gz
- makemkv-bin-1.17.6.tar.gz

You need to install both of these, because the -oss tarball only creates front-ends and library APIs to execute the contents of the -bin tarball. Basically, the guts of MakeMKV is the -bin tarball :idea:.
Post Reply