Skip to content

Commit 4085dbb

Browse files
chore(docker): add aac-encoder plugin to bundled images
Add a dedicated build stage for the aac-encoder plugin in the demo, full, and full-gpu Dockerfiles. The plugin depends on libfdk-aac-dev at build time and libfdk-aac2 at runtime. No models are required. The GPU image uses a standard rust:1.92-slim-bookworm base for the aac-encoder stage since AAC encoding is CPU-only (no CUDA needed). Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
1 parent ba5ac82 commit 4085dbb

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

Dockerfile.demo

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,36 @@ RUN mkdir -p /build/models && \
528528
tar xf supertonic-v2-onnx.tar.bz2 && \
529529
rm supertonic-v2-onnx.tar.bz2
530530

531-
# Stage 13: Build Slint UI plugin
531+
# Stage 13: Build AAC Encoder plugin
532+
FROM rust:1.92-slim-bookworm AS aac-encoder-builder
533+
534+
WORKDIR /build
535+
536+
# Install build dependencies (libfdk-aac-dev needed by shiguredo_fdk_aac)
537+
RUN apt-get update && apt-get install -y \
538+
pkg-config \
539+
libssl-dev \
540+
libclang-dev \
541+
clang \
542+
libfdk-aac-dev \
543+
&& rm -rf /var/lib/apt/lists/*
544+
545+
# Copy only what's needed to build aac-encoder plugin
546+
COPY Cargo.toml Cargo.lock ./
547+
COPY crates/core ./crates/core
548+
COPY sdks/plugin-sdk ./sdks/plugin-sdk
549+
COPY plugins/native/aac-encoder ./plugins/native/aac-encoder
550+
551+
# Build aac-encoder plugin
552+
RUN --mount=type=cache,id=cargo-registry-aac-encoder,target=/usr/local/cargo/registry \
553+
--mount=type=cache,id=cargo-git-aac-encoder,target=/usr/local/cargo/git \
554+
--mount=type=cache,id=aac-encoder-target,target=/build/plugins/native/aac-encoder/target \
555+
cd plugins/native/aac-encoder && \
556+
cargo build --release --target-dir target && \
557+
mkdir -p /build/plugins/native && \
558+
cp target/release/libaac_encoder.so /build/plugins/native/
559+
560+
# Stage 14: Build Slint UI plugin
532561
FROM rust:1.92-slim-bookworm AS slint-builder
533562

534563
WORKDIR /build
@@ -573,6 +602,7 @@ RUN apt-get update && apt-get install -y \
573602
libgomp1 \
574603
libfontconfig1 \
575604
fonts-dejavu-core \
605+
libfdk-aac2 \
576606
gdb \
577607
curl \
578608
&& rm -rf /var/lib/apt/lists/*
@@ -630,6 +660,9 @@ COPY --chown=app:app --from=supertonic-builder /build/models/supertonic-v2-onnx
630660
# Copy slint plugin (no models needed)
631661
COPY --chown=app:app --from=slint-builder /build/plugins/native/* /opt/streamkit/plugins/native/
632662

663+
# Copy aac-encoder plugin (no models needed)
664+
COPY --chown=app:app --from=aac-encoder-builder /build/plugins/native/* /opt/streamkit/plugins/native/
665+
633666
# Copy sample pipelines + small bundled audio samples (Opus/Ogg only)
634667
COPY --chown=app:app samples/pipelines /opt/streamkit/samples/pipelines
635668
COPY --chown=app:app samples/audio/system/*.ogg samples/audio/system/*.ogg.license /opt/streamkit/samples/audio/system/

Dockerfile.full

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,36 @@ RUN PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --no-cache-dir huggingface-hub && \
467467
cd /build/models && \
468468
python3 -c "from huggingface_hub import snapshot_download; snapshot_download('entai2965/nllb-200-distilled-600M-ctranslate2', local_dir='nllb-200-distilled-600M-ct2-int8', local_dir_use_symlinks=False)"
469469

470-
# Stage 11: Build Slint UI plugin
470+
# Stage 11: Build AAC Encoder plugin
471+
FROM rust:1.92-slim-bookworm AS aac-encoder-builder
472+
473+
WORKDIR /build
474+
475+
# Install build dependencies (libfdk-aac-dev needed by shiguredo_fdk_aac)
476+
RUN apt-get update && apt-get install -y \
477+
pkg-config \
478+
libssl-dev \
479+
libclang-dev \
480+
clang \
481+
libfdk-aac-dev \
482+
&& rm -rf /var/lib/apt/lists/*
483+
484+
# Copy only what's needed to build aac-encoder plugin
485+
COPY Cargo.toml Cargo.lock ./
486+
COPY crates/core ./crates/core
487+
COPY sdks/plugin-sdk ./sdks/plugin-sdk
488+
COPY plugins/native/aac-encoder ./plugins/native/aac-encoder
489+
490+
# Build aac-encoder plugin
491+
RUN --mount=type=cache,id=cargo-registry-aac-encoder,target=/usr/local/cargo/registry \
492+
--mount=type=cache,id=cargo-git-aac-encoder,target=/usr/local/cargo/git \
493+
--mount=type=cache,id=aac-encoder-target,target=/build/plugins/native/aac-encoder/target \
494+
cd plugins/native/aac-encoder && \
495+
cargo build --release --target-dir target && \
496+
mkdir -p /build/plugins/native && \
497+
cp target/release/libaac_encoder.so /build/plugins/native/
498+
499+
# Stage 12: Build Slint UI plugin
471500
FROM rust:1.92-slim-bookworm AS slint-builder
472501

473502
WORKDIR /build
@@ -512,6 +541,7 @@ RUN apt-get update && apt-get install -y \
512541
libgomp1 \
513542
libfontconfig1 \
514543
fonts-dejavu-core \
544+
libfdk-aac2 \
515545
gdb \
516546
curl \
517547
&& rm -rf /var/lib/apt/lists/*
@@ -563,6 +593,9 @@ COPY --chown=app:app --from=matcha-builder /build/models/matcha-icefall-en_US-lj
563593
# Copy slint plugin (no models needed)
564594
COPY --chown=app:app --from=slint-builder /build/plugins/native/* /opt/streamkit/plugins/native/
565595

596+
# Copy aac-encoder plugin (no models needed)
597+
COPY --chown=app:app --from=aac-encoder-builder /build/plugins/native/* /opt/streamkit/plugins/native/
598+
566599
# Copy sample pipelines
567600
COPY --chown=app:app samples /opt/streamkit/samples
568601

Dockerfile.full-gpu

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,36 @@ RUN PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --no-cache-dir \
590590
tokenizers && \
591591
python3 plugins/native/helsinki/download-models.py
592592

593-
# Stage 12: Build Slint UI plugin
593+
# Stage 12: Build AAC Encoder plugin (CPU-only, no CUDA needed for audio encoding)
594+
FROM rust:1.92-slim-bookworm AS aac-encoder-builder
595+
596+
WORKDIR /build
597+
598+
# Install build dependencies (libfdk-aac-dev needed by shiguredo_fdk_aac)
599+
RUN apt-get update && apt-get install -y \
600+
pkg-config \
601+
libssl-dev \
602+
libclang-dev \
603+
clang \
604+
libfdk-aac-dev \
605+
&& rm -rf /var/lib/apt/lists/*
606+
607+
# Copy only what's needed to build aac-encoder plugin
608+
COPY Cargo.toml Cargo.lock ./
609+
COPY crates/core ./crates/core
610+
COPY sdks/plugin-sdk ./sdks/plugin-sdk
611+
COPY plugins/native/aac-encoder ./plugins/native/aac-encoder
612+
613+
# Build aac-encoder plugin
614+
RUN --mount=type=cache,id=cargo-registry-aac-encoder,target=/usr/local/cargo/registry \
615+
--mount=type=cache,id=cargo-git-aac-encoder,target=/usr/local/cargo/git \
616+
--mount=type=cache,id=aac-encoder-target,target=/build/plugins/native/aac-encoder/target \
617+
cd plugins/native/aac-encoder && \
618+
cargo build --release --target-dir target && \
619+
mkdir -p /build/plugins/native && \
620+
cp target/release/libaac_encoder.so /build/plugins/native/
621+
622+
# Stage 13: Build Slint UI plugin
594623
FROM rust:1.92-slim-bookworm AS slint-builder
595624

596625
WORKDIR /build
@@ -638,6 +667,7 @@ RUN apt-get update && apt-get install -y \
638667
libgomp1 \
639668
libfontconfig1 \
640669
fonts-dejavu-core \
670+
libfdk-aac2 \
641671
libvulkan1 \
642672
gdb \
643673
curl \
@@ -709,6 +739,9 @@ COPY --chown=app:app --from=matcha-builder /build/models/matcha-icefall-en_US-lj
709739
# Copy slint plugin (no models needed)
710740
COPY --chown=app:app --from=slint-builder /build/plugins/native/* /opt/streamkit/plugins/native/
711741

742+
# Copy aac-encoder plugin (no models needed)
743+
COPY --chown=app:app --from=aac-encoder-builder /build/plugins/native/* /opt/streamkit/plugins/native/
744+
712745
# Copy sample pipelines
713746
COPY --chown=app:app samples /opt/streamkit/samples
714747

0 commit comments

Comments
 (0)