Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile-dev-dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:22.04
FROM ubuntu:26.04

COPY docker/build-gstreamer/install-dependencies /
COPY docker/build-gstreamer/install-dev-dependencies /

RUN ["/install-dependencies"]
RUN ["/install-dev-dependencies"]
8 changes: 1 addition & 7 deletions Dockerfile-dev-downloaded.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
FROM restreamio/gstreamer:$TARGET_ARCH-dev-dependencies

ARG GSTREAMER_VERSION=1.22.12

ARG GSTREAMER_CEF_REPOSITORY=https://github.com/centricular/gstcefsrc
ARG GSTREAMER_CEF_CHECKOUT=b63340852fc93b0ab67b07200e1ff44f59ba6769
ARG GSTREAMER_VERSION=1.28.3

COPY docker/cef-config.sh /.cef-config.sh

COPY docker/sccache.toml /sccache.toml

COPY docker/build-gstreamer/download /download

RUN ["/download"]
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile-latest-dev-with-source.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM restreamio/gstreamer:$TARGET_ARCH-dev-downloaded

ARG WEBKIT_USE_SCCACHE=0

ENV DEBUG=true
ENV OPTIMIZATIONS=false

Expand Down
2 changes: 0 additions & 2 deletions Dockerfile-latest-prod-dbg.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM restreamio/gstreamer:$TARGET_ARCH-dev-downloaded

ARG WEBKIT_USE_SCCACHE=0

ENV DEBUG=true
ENV OPTIMIZATIONS=true

Expand Down
2 changes: 0 additions & 2 deletions Dockerfile-latest-prod.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM restreamio/gstreamer:$TARGET_ARCH-dev-downloaded

ARG WEBKIT_USE_SCCACHE=0

ENV DEBUG=false
ENV OPTIMIZATIONS=true

Expand Down
67 changes: 34 additions & 33 deletions Dockerfile-prod-base.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:26.04

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -7,32 +7,32 @@ RUN \
apt-get dist-upgrade -y && \
apt-get install -y --no-install-recommends \
ca-certificates \
libatk1.0-0 \
libatk-bridge2.0-0 \
libatk1.0-0t64 \
libatk-bridge2.0-0t64 \
libatk-adaptor \
libatspi2.0-0 \
libatspi2.0-0t64 \
libunwind8 \
libdw1 \
libdw1t64 \
libgmp10 \
libgsl27 \
libglib2.0-0 \
libgsl28 \
libglib2.0-0t64 \
libcap2 \
libcups2 \
liborc-0.4-0 \
libcups2t64 \
liborc-0.4-0t64 \
iso-codes \
libgl1 \
libgles1 \
libgles2 \
libgudev-1.0-0 \
libgbm1 \
libgraphene-1.0-dev \
libpng16-16 \
libpng16-16t64 \
libjpeg8 \
libogg0 \
libopus0 \
libpango-1.0-0 \
libvisual-0.4-0 \
libtheora0 \
libtheora1 \
libvorbis0a \
libxkbcommon0 \
libxcomposite1 \
Expand All @@ -54,20 +54,20 @@ RUN \
bubblewrap \
libseccomp2 \
xdg-dbus-proxy \
libsoup2.4-1 \
libsoup-3.0-0 \
libvulkan1 \
libass9 \
libchromaprint1 \
libcurl3-gnutls \
libcurl3t64-gnutls \
libaom3 \
libbz2-1.0 \
liblcms2-2 \
libbs2b0 \
libdca0 \
libfaac0 \
libfaac0t64 \
libfaad2 \
libflite1 \
libssl3 \
libssl3t64 \
ladspa-sdk \
libfdk-aac2 \
libgsm1 \
Expand All @@ -77,48 +77,49 @@ RUN \
liblilv-0-0 \
libmodplug1 \
mjpegtools \
libmjpegutils-2.1-0 \
libmjpegutils-2.2-0 \
libmpcdec6 \
libdvdnav4 \
libdvdread8 \
libdvdread8t64 \
librsvg2-2 \
librtmp1 \
libsbc1 \
libsndfile1 \
libsoundtouch1 \
libspandsp2 \
libsrt1.4-openssl \
libspandsp2t64 \
libsrt1.5-openssl \
libsrtp2-1 \
libvo-aacenc0 \
libvo-amrwbenc0 \
libwebrtc-audio-processing1 \
libwebrtc-audio-processing-1-3 \
libwebrtc-audio-coding-1-3 \
libofa0 \
libzvbi0 \
libopenexr25 \
libzvbi0t64 \
libopenexr-3-1-30 \
libwildmidi2 \
libx265-199 \
libzbar0 \
libx265-215 \
libzbar0t64 \
wayland-protocols \
libaa1 \
libmp3lame0 \
libcaca0 \
libdv4 \
libmpg123-0 \
libvpx7 \
libdv4t64 \
libmpg123-0t64 \
libvpx12 \
libshout3 \
libspeex1 \
libtag1v5 \
libtag2 \
libtwolame0 \
libwavpack1 \
liba52-0.7.4 \
libx264-163 \
libx264-165 \
libopencore-amrnb0 \
libopencore-amrwb0 \
libmpeg2-4 \
libavcodec58 \
libavfilter7 \
libavformat58 \
libavutil56 \
libavcodec62 \
libavfilter11 \
libavformat62 \
libavutil60 \
libva2 \
libva-wayland2 \
xvfb \
Expand Down
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker-gstreamer
[![Docker Pulls](https://img.shields.io/docker/pulls/restreamio/gstreamer)](https://hub.docker.com/r/restreamio/gstreamer)

Ubuntu 22.04-based container images with upstream GStreamer and plugins pre-installed
Ubuntu 26.04-LTS-based container images with upstream GStreamer and plugins pre-installed

Following components are present:
* GStreamer
Expand All @@ -10,39 +10,21 @@ Following components are present:
* gst-plugins-bad (with `msdk`)
* gst-plugins-ugly
* gst-libav
* gstreamer-vaapi
* libnice (newer version from git)
* WPE WebKit (newer version from upstream release)
* gstreamer-va
* libnice
* gstcefsrc

GStreamer and components are tracking upstream master branches (with minor fixes on top) and are usually updated a few times a month.
There are also builds of stable upstream releases available as well.

Base OS is Ubuntu 22.04.
Base OS is Ubuntu 26.04 LTS

NOTE:
* 1.18.2.0 images and older were based on Ubuntu 20.04
* 2020-12-30T23-16-11Z images and older were based on Ubuntu 20.04
* 1.18.4.0 images and older were based on Ubuntu 20.10
* 2021-06-08T14-12-58Z images and older were based on Ubuntu 20.10

## SCCache support

The sysroot includes WPEWebKit, which is a huge project and requires a good
build machine. However in case you have access to a
[SCCache](https://github.com/mozilla/sccache) scheduler online, you can use it
to build WPEWebKit:

```bash
export SCCACHE_SCHEDULER=https://sccache.corp.com
export SCCACHE_AUTH_TOKEN=s3cr3t
export WEBKIT_USE_SCCACHE=1
./build-latest.sh
```

The configuration template stored in `sccache.toml` is filled with the scheduler
address and authentication token supplied through the corresponding environment
variables.
* 2026-05-07T12-07-24Z images and older were based on Ubuntu 22.04

# Builds on Docker Hub
Builds use Restream-specific patches by default, but there are also vanilla upstream builds available.
Expand Down
9 changes: 1 addition & 8 deletions build-latest.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#!/bin/bash
set -e

if [[ $WEBKIT_USE_SCCACHE == '1' ]]; then
sed 's;@@SCCACHE_SCHEDULER@@;'"${SCCACHE_SCHEDULER}"';g' sccache.toml > docker/sccache.toml
sed -i 's;@@SCCACHE_AUTH_TOKEN@@;'"${SCCACHE_AUTH_TOKEN}"';g' docker/sccache.toml
else
echo > docker/sccache.toml
fi

ARCH=$(uname -m)

TAG_BASENAME="restreamio/gstreamer:$ARCH"
Expand All @@ -21,7 +14,7 @@ docker_build() {
}

# Make sure to always have fresh base image
docker pull ubuntu:22.04
docker pull ubuntu:26.04
# Install dev dependencies
docker build -t $TAG_BASENAME-dev-dependencies -f Dockerfile-dev-dependencies .

Expand Down
15 changes: 4 additions & 11 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@ if [[ -z "$1" ]]; then
exit 1
fi

if [[ $WEBKIT_USE_SCCACHE == '1' ]]; then
sed 's;@@SCCACHE_SCHEDULER@@;'"${SCCACHE_SCHEDULER}"';g' sccache.toml > docker/sccache.toml
sed -i 's;@@SCCACHE_AUTH_TOKEN@@;'"${SCCACHE_AUTH_TOKEN}"';g' docker/sccache.toml
else
echo > docker/sccache.toml
fi

# Make sure to always have fresh base image
docker pull ubuntu:22.04
docker pull ubuntu:26.04
# Install dev dependencies
docker build -t restreamio/gstreamer:dev-dependencies -f Dockerfile-dev-dependencies .
# Download source code
docker build -t restreamio/gstreamer:dev-downloaded \
--build-arg GSTREAMER_VERSION=$1 \
-f Dockerfile-dev-downloaded .
# Build dev image with source code included
docker build --build-arg WEBKIT_USE_SCCACHE=$WEBKIT_USE_SCCACHE -t restreamio/gstreamer:$1-dev-with-source -f Dockerfile-dev-with-source .
docker build -t restreamio/gstreamer:$1-dev-with-source -f Dockerfile-dev-with-source .
# Build dev image with just binaries
docker build -t restreamio/gstreamer:$1-dev -f Dockerfile-dev .
# Build base production image with necessary dependencies
docker build -t restreamio/gstreamer:prod-base -f Dockerfile-prod-base .
# Build production image optimized binaries and no debug symbols (-O3 LTO)
docker build --build-arg WEBKIT_USE_SCCACHE=$WEBKIT_USE_SCCACHE -t restreamio/gstreamer:$1-prod -f Dockerfile-prod .
docker build -t restreamio/gstreamer:$1-prod -f Dockerfile-prod .
# Build production image optimized binaries and debug symbols
docker build --build-arg WEBKIT_USE_SCCACHE=$WEBKIT_USE_SCCACHE -t restreamio/gstreamer:$1-prod-dbg -f Dockerfile-prod-dbg .
docker build -t restreamio/gstreamer:$1-prod-dbg -f Dockerfile-prod-dbg .
37 changes: 13 additions & 24 deletions docker/build-gstreamer/compile
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,26 @@ gcc -O2 -Wall -Wextra -fPIC -shared -o /usr/lib/libfakemallinfo.so /fake_mallinf
mkdir -p /compiled-binaries/usr/lib
cp /usr/lib/libfakemallinfo.so /compiled-binaries/usr/lib/libfakemallinfo.so

pushd gstreamer
# TODO: Hack: `-D gupnp=disabled` is for libnice, because libgupnp-igd causes memory leaks
# msdk=enabled is for gst-plugings-bad to include msdk elements
# with_x11=no is for gstreamer-vaapi to exclude X11-related functionality (that would otherwise require extra dependencies)
MESON_OPTIONS="-Dvaapi=enabled -Dgpl=enabled -Dgst-examples=disabled -Dexamples=disabled -Dtests=disabled -Ddoc=disabled -Dqt5=disabled -Dpython=disabled -Dges=disabled -Ddevtools=disabled -Dintrospection=disabled -Dlibnice:gupnp=disabled -Dgstreamer-vaapi:x11=disabled -Dgstreamer-vaapi:encoders=enabled"

ARCH=$(dpkg --print-architecture)
if [[ $ARCH == "amd64" ]]; then
MESON_OPTIONS="$MESON_OPTIONS -Dgst-plugins-bad:msdk=enabled "
fi
export CC=`which clang`
export CXX=`which clang++`

git apply /compile-patch/0001-libnice.wrap-fix-incomplete-TCP-ICE-candidate-crash.patch
pushd gstreamer
# `-Dlibnice:gupnp=disabled` is for libnice, because libgupnp-igd causes memory leaks.
MESON_OPTIONS="-Dgpl=enabled -Dgst-examples=disabled -Dexamples=disabled -Dtests=disabled -Ddoc=disabled -Dqt5=disabled -Dpython=disabled -Dges=disabled -Ddevtools=disabled -Dintrospection=disabled -Dlibnice:gupnp=disabled"

if [[ $DEBUG == 'true' ]]; then
if [[ $OPTIMIZATIONS == 'true' ]]; then
meson build -D prefix=/usr $MESON_OPTIONS -D buildtype=debugoptimized
meson setup build --prefix=/usr --buildtype=debugoptimized $MESON_OPTIONS
else
meson build -D prefix=/usr $MESON_OPTIONS -D buildtype=debug
meson setup build --prefix=/usr --buildtype=debug $MESON_OPTIONS
fi
else
meson build -D prefix=/usr $MESON_OPTIONS -D buildtype=release -D b_lto=true
meson setup build --prefix=/usr --buildtype=release -Db_lto=true $MESON_OPTIONS
fi

git apply /compile-patch/0001-baseparse-always-update-the-input-pts-if-available-from.patch
git apply /compile-patch/0001-compositor-add-rounded-corners-property-for-sink-pad.patch
git apply /compile-patch/0001-compositor-add-box-shadow-property-for-sink-pads.patch
git apply /compile-patch/0001-pad-Check-data-NULL-ness-when-probes-are-stopped-fixed-in-1.24.8.patch
git apply /compile-patch/0001-Reduce-logs-verbosity-in-webrtcbin-when-a-FEC-decode.patch
git apply /compile-patch/0001-glvideomixer-update-API-to-be-compatible-with-versio.patch
git apply /compile-patch/0001-GstAudioAggregator-fix-structure-unref.patch
git apply /compile-patch/0001-gsth264parser-fix-uint32-to-int32-truncation.patch
git apply /compile-patch/gstreamer/0001-compositor-add-rounded-corners-property-for-sink-pad.patch
git apply /compile-patch/gstreamer/0002-compositor-add-box-shadow-property-for-sink-pads.patch
git apply /compile-patch/gstreamer/0003-Reduce-logs-verbosity-in-webrtcbin-when-a-FEC-decode.patch

# This is needed for other plugins to be built properly
ninja -C build install
Expand All @@ -53,8 +42,8 @@ popd

# Build the GStreamer CEF plugin
pushd gstcefsrc
git apply /compile-patch/0001-cefsrc-download-minimal-package.patch
git apply /compile-patch/0001-cefsrc-unmultiply-alpha.patch
git apply /compile-patch/cefsrc/0001-cefsrc-download-minimal-package.patch
git apply /compile-patch/cefsrc/0002-cefsrc-unmultiply-alpha.patch

source /.cef-config.sh
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/cef -GNinja -DCEF_VERSION=$CEF_VERSION -DCEF_MINIMAL_PACKAGE=ON
Expand Down
5 changes: 3 additions & 2 deletions docker/build-gstreamer/download
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ set -e

git clone -b "$GSTREAMER_VERSION" https://gitlab.freedesktop.org/gstreamer/gstreamer.git

git clone --no-checkout "$GSTREAMER_CEF_REPOSITORY"
source /.cef-config.sh
git clone --no-checkout "$CEF_REPOSITORY"
pushd gstcefsrc
git checkout "$GSTREAMER_CEF_CHECKOUT"
git checkout "$CEF_CHECKOUT"
popd
Loading
Loading