Solved Cannot build Kodi 18.8 with shared FFmpeg-4-3-1-Matrix-Alpha1
#1
Hi,

just tested the latest LibreELEC 9.2.4 - Kodi 18.8 and learned that it can finally play DVB streams without any glitches. Up to LibreELEC 8.2.3 - Kodi 18.7 (or 18.6 ?) when starting to play DVB streams by either OMX / MMAL acceleration, there were some interruptions for the first few seconds. I remember I noticed this issue with my first build of Kodi Leia 18.01 (I believe), detailed it here in the forum at that time, suspected there are some buffering issues in either Kodi or FFMpeg and kept running Kodi 17.
Went on and investigated the Kodi commits between 18.6 and 18.8, couldn't catch anything relevant and learned that the LibreELEC folks are using a new version of FFMpeg - 4-3-1-Matrix-Alpha1.

Built 4-3-1-Matrix-Alpha1 myself, installed it and prepared to build Kodi, just to find out that the Kodi 18.8 build script - dependency checking, doesn't like this version of FFMpeg.
Here is what I tried:
- my build preparation line:
Code:
cmake ../xbmc-18.8-Leia -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/vc -DENABLE_INTERNAL_CROSSGUID=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_FMT=ON -DCORE_SYSTEM_NAME=linux -DCORE_PLATFORM_NAME=rbpi -DWITH_CPU=arm1176jzf-s -DCMAKE_C_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" -DCMAKE_CXX_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft"
Kodi Error: -- FFmpeg 4.0 not found, falling back to internal build

Moved on and tried my luck with the rather huge pile of nested conditional statements from: xbmc-18.8-Leia/cmake/modules/FindFFMPEG.cmake
- edited: set(REQUIRED_FFMPEG_VERSION 4.3)
Result -> Kodi Error: -- FFmpeg 4.3 not found, falling back to internal build

Tried adding:
-DFFMPEG_PATH=/usr/local
-- FFmpeg 4.3 not found, falling back to internal build

-DWITH_FFMPEG=/usr/local
-- Warning: FFmpeg version checking disabled
-- FFmpeg undef not found, falling back to internal build

Then recompiled & reinstalled FFmpeg-4-3-1-Matrix-Alpha1 with:
--prefix=/usr \
--libdir=/usr/lib \
--shlibdir=/usr/lib
Didn't help ...

This is the FFMpeg output - checked and noticed that I'm meeting the libs versions requirements from xbmc-18.8-Leia/cmake/modules/FindFFMPEG.cmake:

ffmpeg version 4.3.1-Kodi Copyright © 2000-2020 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --extra-ldflags='-L /opt/vc/lib/' --extra-cflags='-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft' --extra-cxxflags='-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft' --extra-libs='-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm' --target-os=linux --enable-ffplay --enable-ffmpeg --disable-vaapi --disable-vdpau --disable-debug --enable-stripping --disable-neon --enable-rpi --enable-mmal --enable-omx --enable-omx-rpi --disable-static --enable-shared --enable-nonfree --disable-version3 --enable-logging --disable-doc --enable-pic --enable-optimizations --disable-extra-warnings --enable-avdevice --enable-avcodec --enable-avformat --enable-swscale --enable-postproc --enable-avfilter --disable-devices --enable-pthreads --enable-network --enable-gnutls --disable-openssl --disable-gray --enable-swscale-alpha --disable-small --enable-dct --enable-fft --enable-mdct --enable-rdft --disable-crystalhd --enable-runtime-cpudetect --disable-hardcoded-tables --disable-encoders --enable-encoder=ac3 --enable-encoder=aac --enable-encoder=wmav2 --enable-encoder=mjpeg --enable-encoder=png --disable-muxers --enable-muxer=spdif --enable-muxer=adts --enable-muxer=asf --enable-muxer=ipod --enable-muxer=mpegts --enable-demuxers --enable-parsers --enable-bsfs --enable-protocol=http --disable-indevs --disable-outdevs --enable-filters --disable-avisynth --enable-bzlib --disable-lzma --disable-alsa --disable-frei0r --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libopencv --disable-libdc1394 --disable-libfreetype --disable-libgsm --disable-libopenjpeg --disable-librtmp --disable-libtheora --disable-libvo-amrwbenc --disable-libvorbis --disable-libvpx --disable-libx264 --disable-libxavs --disable-libxvid --enable-zlib --enable-asm --disable-altivec --disable-symver --enable-libass
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100


And here is the FFmpeg-4-3-1-Matrix-Alpha1 package list (the one I built & installed - went back to the /usr/local build):
PACKAGE DESCRIPTION:
FILE LIST:

usr/local/bin/ffmpeg
usr/local/bin/ffprobe
usr/local/include/libavcodec/
usr/local/include/libavcodec/ac3_parser.h
usr/local/include/libavcodec/adts_parser.h
usr/local/include/libavcodec/avcodec.h
usr/local/include/libavcodec/avdct.h
usr/local/include/libavcodec/avfft.h
usr/local/include/libavcodec/bsf.h
usr/local/include/libavcodec/codec.h
usr/local/include/libavcodec/codec_desc.h
usr/local/include/libavcodec/codec_id.h
usr/local/include/libavcodec/codec_par.h
usr/local/include/libavcodec/d3d11va.h
usr/local/include/libavcodec/dirac.h
usr/local/include/libavcodec/dv_profile.h
usr/local/include/libavcodec/dxva2.h
usr/local/include/libavcodec/jni.h
usr/local/include/libavcodec/mediacodec.h
usr/local/include/libavcodec/packet.h
usr/local/include/libavcodec/qsv.h
usr/local/include/libavcodec/rpi_zc.h
usr/local/include/libavcodec/vaapi.h
usr/local/include/libavcodec/vdpau.h
usr/local/include/libavcodec/version.h
usr/local/include/libavcodec/videotoolbox.h
usr/local/include/libavcodec/vorbis_parser.h
usr/local/include/libavcodec/xvmc.h
usr/local/include/libavdevice/
usr/local/include/libavdevice/avdevice.h
usr/local/include/libavdevice/version.h
usr/local/include/libavfilter/
usr/local/include/libavfilter/avfilter.h
usr/local/include/libavfilter/buffersink.h
usr/local/include/libavfilter/buffersrc.h
usr/local/include/libavfilter/version.h
usr/local/include/libavformat/
usr/local/include/libavformat/avformat.h
usr/local/include/libavformat/avio.h
usr/local/include/libavformat/version.h
usr/local/include/libavutil/
usr/local/include/libavutil/adler32.h
usr/local/include/libavutil/aes.h
usr/local/include/libavutil/aes_ctr.h
usr/local/include/libavutil/attributes.h
usr/local/include/libavutil/audio_fifo.h
usr/local/include/libavutil/avassert.h
usr/local/include/libavutil/avconfig.h
usr/local/include/libavutil/avstring.h
usr/local/include/libavutil/avutil.h
usr/local/include/libavutil/base64.h
usr/local/include/libavutil/blowfish.h
usr/local/include/libavutil/bprint.h
usr/local/include/libavutil/bswap.h
usr/local/include/libavutil/buffer.h
usr/local/include/libavutil/camellia.h
usr/local/include/libavutil/cast5.h
usr/local/include/libavutil/channel_layout.h
usr/local/include/libavutil/common.h
usr/local/include/libavutil/cpu.h
usr/local/include/libavutil/crc.h
usr/local/include/libavutil/des.h
usr/local/include/libavutil/dict.h
usr/local/include/libavutil/display.h
usr/local/include/libavutil/dovi_meta.h
usr/local/include/libavutil/downmix_info.h
usr/local/include/libavutil/encryption_info.h
usr/local/include/libavutil/error.h
usr/local/include/libavutil/eval.h
usr/local/include/libavutil/ffversion.h
usr/local/include/libavutil/fifo.h
usr/local/include/libavutil/file.h
usr/local/include/libavutil/frame.h
usr/local/include/libavutil/hash.h
usr/local/include/libavutil/hdr_dynamic_metadata.h
usr/local/include/libavutil/hmac.h
usr/local/include/libavutil/hwcontext.h
usr/local/include/libavutil/hwcontext_cuda.h
usr/local/include/libavutil/hwcontext_d3d11va.h
usr/local/include/libavutil/hwcontext_drm.h
usr/local/include/libavutil/hwcontext_dxva2.h
usr/local/include/libavutil/hwcontext_mediacodec.h
usr/local/include/libavutil/hwcontext_opencl.h
usr/local/include/libavutil/hwcontext_qsv.h
usr/local/include/libavutil/hwcontext_vaapi.h
usr/local/include/libavutil/hwcontext_vdpau.h
usr/local/include/libavutil/hwcontext_videotoolbox.h
usr/local/include/libavutil/hwcontext_vulkan.h
usr/local/include/libavutil/imgutils.h
usr/local/include/libavutil/intfloat.h
usr/local/include/libavutil/intreadwrite.h
usr/local/include/libavutil/lfg.h
usr/local/include/libavutil/log.h
usr/local/include/libavutil/lzo.h
usr/local/include/libavutil/macros.h
usr/local/include/libavutil/mastering_display_metadata.h
usr/local/include/libavutil/mathematics.h
usr/local/include/libavutil/md5.h
usr/local/include/libavutil/mem.h
usr/local/include/libavutil/motion_vector.h
usr/local/include/libavutil/murmur3.h
usr/local/include/libavutil/opt.h
usr/local/include/libavutil/parseutils.h
usr/local/include/libavutil/pixdesc.h
usr/local/include/libavutil/pixelutils.h
usr/local/include/libavutil/pixfmt.h
usr/local/include/libavutil/random_seed.h
usr/local/include/libavutil/rational.h
usr/local/include/libavutil/rc4.h
usr/local/include/libavutil/replaygain.h
usr/local/include/libavutil/ripemd.h
usr/local/include/libavutil/rpi_sand_fns.h
usr/local/include/libavutil/samplefmt.h
usr/local/include/libavutil/sha.h
usr/local/include/libavutil/sha512.h
usr/local/include/libavutil/spherical.h
usr/local/include/libavutil/stereo3d.h
usr/local/include/libavutil/tea.h
usr/local/include/libavutil/threadmessage.h
usr/local/include/libavutil/time.h
usr/local/include/libavutil/timecode.h
usr/local/include/libavutil/timestamp.h
usr/local/include/libavutil/tree.h
usr/local/include/libavutil/twofish.h
usr/local/include/libavutil/tx.h
usr/local/include/libavutil/version.h
usr/local/include/libavutil/video_enc_params.h
usr/local/include/libavutil/xtea.h
usr/local/include/libswresample/
usr/local/include/libswresample/swresample.h
usr/local/include/libswresample/version.h
usr/local/include/libswscale/
usr/local/include/libswscale/swscale.h
usr/local/include/libswscale/version.h
usr/local/lib/libavcodec.so.58.91.100
usr/local/lib/libavdevice.so.58.10.100
usr/local/lib/libavfilter.so.7.85.100
usr/local/lib/libavformat.so.58.45.100
usr/local/lib/libavutil.so.56.51.100
usr/local/lib/libswresample.so.3.7.100
usr/local/lib/libswscale.so.5.7.100
usr/local/lib/pkgconfig/
usr/local/lib/pkgconfig/libavcodec.pc
usr/local/lib/pkgconfig/libavdevice.pc
usr/local/lib/pkgconfig/libavfilter.pc
usr/local/lib/pkgconfig/libavformat.pc
usr/local/lib/pkgconfig/libavutil.pc
usr/local/lib/pkgconfig/libswresample.pc
usr/local/lib/pkgconfig/libswscale.pc
usr/local/share/ffmpeg/examples/Makefile
usr/local/share/ffmpeg/examples/README
usr/local/share/ffmpeg/examples/avio_list_dir.c
usr/local/share/ffmpeg/examples/avio_reading.c
usr/local/share/ffmpeg/examples/decode_audio.c
usr/local/share/ffmpeg/examples/decode_video.c
usr/local/share/ffmpeg/examples/demuxing_decoding.c
usr/local/share/ffmpeg/examples/encode_audio.c
usr/local/share/ffmpeg/examples/encode_video.c
usr/local/share/ffmpeg/examples/extract_mvs.c
usr/local/share/ffmpeg/examples/filter_audio.c
usr/local/share/ffmpeg/examples/filtering_audio.c
usr/local/share/ffmpeg/examples/filtering_video.c
usr/local/share/ffmpeg/examples/http_multiclient.c
usr/local/share/ffmpeg/examples/hw_decode.c
usr/local/share/ffmpeg/examples/metadata.c
usr/local/share/ffmpeg/examples/muxing.c
usr/local/share/ffmpeg/examples/qsvdec.c
usr/local/share/ffmpeg/examples/remuxing.c
usr/local/share/ffmpeg/examples/resampling_audio.c
usr/local/share/ffmpeg/examples/scaling_video.c
usr/local/share/ffmpeg/examples/transcode_aac.c
usr/local/share/ffmpeg/examples/transcoding.c
usr/local/share/ffmpeg/examples/vaapi_encode.c
usr/local/share/ffmpeg/examples/vaapi_transcode.c
usr/local/share/ffmpeg/ffprobe.xsd
usr/local/share/ffmpeg/libvpx-1080p.ffpreset
usr/local/share/ffmpeg/libvpx-1080p50_60.ffpreset
usr/local/share/ffmpeg/libvpx-360p.ffpreset
usr/local/share/ffmpeg/libvpx-720p.ffpreset
usr/local/share/ffmpeg/libvpx-720p50_60.ffpreset
Reply
#2
Your ffmpeg build is missing libpostproc somehow, I see you build with --enable-postproc , right now I have no idea why it's missing.
Reply
#3
I see now.
You need to pass --enable-gpl to ffmpeg configure otherwise libpostproc will not be built.
Reply
#4
(2020-09-11, 08:04)abga Wrote: learned that the LibreELEC folks are using a new version of FFMpeg - 4-3-1-Matrix-Alpha1.

That is not true, LE are using ffmpeg 4.0.4-Leia-18.4 for their Leia 9.2 builds the same as what's released in builds from Kodi channels, they are only using ffmpeg - 4-3-1-Matrix-Alpha1 for their v10 Matrix builds.

Proof:

v9.2 Branch https://github.com/LibreELEC/LibreELEC.t...kage.mk#L7
Reply
#5
@asavah 

Thanks! 4 eyes are always better than 2. I missed the --enable-gpl in the long list of configure directives and wondered why I didn't get a postproc library, thought it might have got embedded in another library.

@jjd-uk 
You're right, it's 4.0.4-Leia-18.4. I'm using the NoScript Addon in my browser and github is heavily "Microsoftized" lately with Java Scripts, missed to refresh the page after I enabled JavaScript on the page and chose the 9.2 tree. Apparently I was still in the master branch and that got me confused.
So, if it's not FFMpeg that resolved the DVB (TvHeadend PVR) playback glitches, then only some of the Kodi 18.x commits between 18.6 - 18.8 could have done it.


I'll get FFMpeg 4.0.4-Leia-18.4 built with the ton of patches from here:
https://github.com/LibreELEC/LibreELEC.t...eg/patches
and try to build again Kodi18.8. Not sure why i shouldn't use FFMpeg - 4-3-1-Matrix-Alpha1, it has only a relevant (to my use case - no need for DRM) patch ...

Putting this thread on resolved.

Thanks again for the help!
Reply
#6
I had this problem yesterday too.
Reply
#7
kodi 18 only supports ffmpeg 4.0.x
If you want 4.3, you have to use kodi master(v19)
Reply

Logout Mark Read Team Forum Stats Members Help
Cannot build Kodi 18.8 with shared FFmpeg-4-3-1-Matrix-Alpha10