From 222828a0e677ac7e7320ffc8d256765fccd6a069 Mon Sep 17 00:00:00 2001 From: Gardel Date: Sun, 7 Dec 2025 23:29:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20ffmpeg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5e9fef0e7..5bb5ddd72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,37 @@ +FROM debian:bookworm-slim AS builder + +ENV DEBIAN_FRONTEND=noninteractive \ + PREFIX=/usr/local + +RUN apt-get update && apt-get install -y \ + autoconf automake build-essential cmake git \ + libass-dev libfreetype6-dev libgnutls28-dev \ + libmp3lame-dev libopus-dev libvorbis-dev \ + libvpx-dev libx264-dev libx265-dev \ + libtool pkg-config texinfo wget yasm nasm \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /tmp/ffmpeg +RUN wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ + tar xjf ffmpeg-snapshot.tar.bz2 && \ + cd ffmpeg && \ + ./configure \ + --prefix=${PREFIX} \ + --enable-gpl \ + --enable-gnutls \ + --enable-libass \ + --enable-libfreetype \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libx264 \ + --enable-libx265 \ + --enable-nonfree \ + --enable-version3 && \ + make -j$(nproc) && \ + make install + FROM python:3.13.5-slim-bookworm COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ @@ -8,8 +42,13 @@ WORKDIR /app COPY pyproject.toml . # 编译器 -RUN apt-get update && apt-get install -y build-essential +RUN apt-get update && apt-get install -y build-essential \ + libass9 libfreetype6 libgnutls30 libmp3lame0 \ + libopus0 libvorbis0a libvorbisenc2 libvpx7 \ + libx264-164 libx265-199 +COPY --from=builder /usr/local /usr/local +RUN ldconfig && ffmpeg -version # 安装依赖 RUN uv sync