gpt4 book ai didi

docker - 如何在 Alpine 中使用 libass/l-smash/x264/fdk-aac 静态编译 ffmpeg

转载 作者:行者123 更新时间:2023-12-04 23:26:35 31 4
gpt4 key购买 nike

我正在尝试构建具有依赖关系的静态二进制文件。它失败了:

ERROR: libass not found using pkg-config



我关注 https://github.com/zimbatm/ffmpeg-static/blob/master/build.sh作为样本

这是 docker
git clone --depth 1 https://github.com/l-smash/l-smash \
&& git clone --depth 1 git://source.ffmpeg.org/ffmpeg \
&& git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git \
&& git clone --depth 1 https://github.com/mulx/aacgain.git \
&& git clone --depth 1 git://git.videolan.org/x264.git \
&& hg clone https://bitbucket.org/multicoreware/x265 \
&& git clone --depth 1 https://chromium.googlesource.com/webm/libvpx \
&& git clone --depth 1 git://git.opus-codec.org/opus.git \
&& git clone --depth 1 https://github.com/libass/libass.git

mkdir /usr/local/src/nasm
cd /usr/local/src/nasm
curl http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2 | tar -xj -C .
cd nasm-2.13.01
./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install

mkdir /usr/local/src/harfbuzz/
cd /usr/local/src/harfbuzz/
curl https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.4.6.tar.bz2 | tar -xj -C .
cd harfbuzz-1.4.6

./configure --prefix=$TARGET_DIR \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install

cd /usr/local/src/libass
./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR --enable-static --disable-shared \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install

# Build L-SMASH
# =================================
cd /usr/local/src/l-smash
./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install
# =================================

# Build libx264
# =================================
cd /usr/local/src/x264
./configure --prefix=$TARGET_DIR --enable-static --disable-shared --disable-opencl --enable-pic \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install
# =================================


# Build libx265
# =================================
cd /usr/local/src/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$TARGET_DIR" -DENABLE_SHARED:bool=off ../../source
make --quiet -j ${NUM_CORES} \
&& make --quiet install
# =================================

# Build libfdk-aac
# =================================
cd /usr/local/src/fdk-aac
autoreconf -fiv \
&& ./configure --prefix=$TARGET_DIR --disable-shared \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install
# # =================================

# # Build libvpx
# # =================================
# cd /usr/local/src/libvpx
# ./configure --disable-examples --disable-unit-tests --enable-pic \
# && make --quiet -j ${NUM_CORES} \
# && make --quiet install
# # =================================

# # Build libopus
# # =================================
# cd /usr/local/src/opus
# ./autogen.sh \
# && ./configure --disable-shared \
# && make --quiet -j ${NUM_CORES} \
# && make --quiet install
# =================================


# Build ffmpeg.
# =================================

# --enable-libx265 - Remove until we can figure out compile error
cd /usr/local/src/ffmpeg
[ ! -f config.status ] && PATH="$BIN_DIR:$PATH" \
PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig" ./configure \
--extra-libs="-ldl" \
--prefix="$TARGET_DIR" \
--pkg-config-flags="--static" \
--extra-cflags="-I$TARGET_DIR/include" \
--extra-ldflags="-L$TARGET_DIR/lib" \
--extra-ldexeflags="-static" \
--bindir="$BIN_DIR" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfontconfig \
--enable-libfreetype \
--enable-libfribidi \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree \
--enable-postproc \
--enable-pic \
--enable-pthreads \
--enable-shared \
--disable-stripping \
--disable-static \
&& make --quiet -j ${NUM_CORES} \
&& make --quiet install
# Remove all tmpfile

最佳答案

你为什么要 git 克隆,然后还要下载源包?

libass 默认构建静态库

libass 要求您运行 autogen.sh 以生成配置脚本

试试这样

git clone  https://github.com/libass/libass.git 
&& cd libass
&& ./autogen.sh
&& ./configure
&& make
&& make install
&& pkg-config libass
&& cd ../

L-smash 默认也构建静态库
&& git clone https://github.com/l-smash/l-smash
&& cd l-smash
&& ./configure
&& make install
&& cd ../

关于docker - 如何在 Alpine 中使用 libass/l-smash/x264/fdk-aac 静态编译 ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44379055/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com