markus-perl / ffmpeg-build-script

The FFmpeg build script provides an easy way to build a static FFmpeg on OSX and Linux with non-free codecs included.
MIT License
1.05k stars 334 forks source link

How to add libxml2 for DASH support? #223

Open danj2k opened 5 months ago

danj2k commented 5 months ago

Is there a way to modify this build script to include libxml2 for DASH support in ffmpeg?

I tried adding the libxml2 related code fragment from #128 but this did not work.

It seemed like it built it as I saw this in the output:

building libxml2 - version snapshot
=======================
Downloading ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz as snapshot.tar.gz
... Done
Extracted snapshot.tar.gz
$ execute ./configure --prefix=/home/danj/ffmpeg-build-script/workspace --enable-static --disable-shared --disable-dependency-tracking --without-python
$ make -j 4
$ make install

But when trying the resulting ffmpeg binary I just get:

ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --enable-nonfree --enable-gpl --enable-openssl --enable-libsvtav1 --enable-libx264 --enable-libx265 --enable-libvpx --enable-libxvid --enable-libvidstab --enable-libzimg --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libfdk-aac --enable-libwebp --enable-libfreetype --enable-libsrt --enable-libzmq --disable-ffnvcodec --enable-amf --disable-debug --disable-shared --enable-pthreads --enable-static --enable-version3 --extra-cflags='-I/home/danj/ffmpeg-build-script/workspace/include -Wno-int-conversion' --extra-ldexeflags= --extra-ldflags=-L/home/danj/ffmpeg-build-script/workspace/lib --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/home/danj/ffmpeg-build-script/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/home/danj/ffmpeg-build-script/workspace --extra-version=
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Unrecognized option 'cenc_decryption_key'.
Error splitting the argument list: Option not found

Can anyone suggest what I need to add or change to make this work?

danj2k commented 5 months ago

Answering my own question, it seems like it just needed an extra line to add --enable-libxml2 to the CONFIGURE_OPTIONS:

if build "libxml2" "snapshot"; then
        download "ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz" "snapshot.tar.gz"
        execute execute ./configure --prefix="${WORKSPACE}" --enable-static --disable-shared --disable-dependency-tracking --without-python
        execute make -j $MJOBS
        execute make install
        build_done "libxml2" "snapshot"
fi
CONFIGURE_OPTIONS+=("--enable-libxml2")