Skip to content

Allow building without --enable-nonfree for a redistributable image#57

Open
mormegil6 wants to merge 1 commit into
EnvelopSound:masterfrom
mormegil6:nonfree-opt-in
Open

Allow building without --enable-nonfree for a redistributable image#57
mormegil6 wants to merge 1 commit into
EnvelopSound:masterfrom
mormegil6:nonfree-opt-in

Conversation

@mormegil6

Copy link
Copy Markdown
Contributor

Use case. Publishing a pre-built Earshot image alongside a containerised HOA streaming stack. --enable-nonfree marks the resulting ffmpeg as non-redistributable, which blocks shipping the image through a public registry.

The finding. This build links no nonfree library. From ffmpeg -buildconf in the current image:

--enable-version3 --enable-gpl --enable-nonfree --enable-small --enable-libx264 --enable-libopus --enable-libvpx --disable-debug --disable-doc --disable-ffplay --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs='-lpthread -lm' --prefix=/opt/ffmpeg

The only external codec libraries are libx264 (GPL), libopus (BSD) and libvpx (BSD). There is no libfdk_aac and no openssl. --enable-nonfree only relaxes a licence gate that nothing in the build uses, so removing it changes nothing except the licence stamp.

The change. ARG ENABLE_NONFREE=1. The default build is unchanged, flag included. docker build --build-arg ENABLE_NONFREE=0 drops it and produces a plain GPLv3 binary (via libx264) that can be redistributed.

Verification. Built with ENABLE_NONFREE=0; the configure line loses only --enable-nonfree, and the full end-to-end pipeline (16-channel RTMP contribution in, live DASH out) passed identically:

[test-pipeline] PASS: first segment after 6s (deadline 20s), 14+14 chunks, 16-ch Opus + vp09 manifest OK

Stream probe of an encode made with the no-nonfree binary (the image ships no ffprobe, so this is ffmpeg reading back its own output): 16 discrete channels, hexadecagonal layout, no downmix, VP9 video:

Input #0, matroska,webm, from '/tmp/probe.webm':
  Duration: 00:00:02.01, start: -0.007000, bitrate: 1502 kb/s
    Stream #0:0: Video: vp9, yuv420p(tv), 640x320, SAR 1:1 DAR 2:1, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1: Audio: opus, 48000 Hz, hexadecagonal, fltp (default)

Copilot AI review requested due to automatic review settings July 25, 2026 07:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a build-time switch to control whether FFmpeg is configured with --enable-nonfree, enabling creation of a redistributable image variant without changing the default build output.

Changes:

  • Introduces ARG ENABLE_NONFREE to make --enable-nonfree conditional at build time.
  • Documents the licensing rationale and how to build with ENABLE_NONFREE=0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment on lines +79 to +83
# --enable-nonfree gates GPL-incompatible libraries (e.g. libfdk_aac); this
# build links none of them, so the flag is a no-op that only marks the binary
# non-redistributable. Default on (behaviour unchanged); build with
# --build-arg ENABLE_NONFREE=0 for a redistributable image.
ARG ENABLE_NONFREE=1
The flag gates GPL-incompatible external libraries, but this build links
none: the only codec libraries in the configure line are libx264 (GPL),
libopus (BSD) and libvpx (BSD). Its sole effect is marking the resulting
ffmpeg non-redistributable, which blocks publishing a pre-built Earshot
image to a public registry.

ARG ENABLE_NONFREE=1 keeps the default build byte-for-byte identical;
--build-arg ENABLE_NONFREE=0 drops the flag for a redistributable build.
Verified with ENABLE_NONFREE=0: 16-channel Opus (hexadecagonal, no
downmix) and VP9 output unchanged.
@mormegil6 mormegil6 changed the title Make --enable-nonfree opt-in so the image can be redistributed Allow building without --enable-nonfree for a redistributable image Jul 25, 2026
@mormegil6

Copy link
Copy Markdown
Contributor Author

Fair point on the wording: with the default at 1, nonfree stays enabled and it is the redistributable build that is the opt-in. Retitled accordingly. The default is deliberately unchanged so the stock build stays byte-for-byte identical; flipping the default to 0 would change the licence stamp of every existing build and that call belongs to the maintainers, not this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants