Skip to content

Instantly share code, notes, and snippets.

@towc
Created December 27, 2018 15:31
Show Gist options
  • Save towc/bfbc05bc4f78b82d6fe43463c925ce43 to your computer and use it in GitHub Desktop.
Save towc/bfbc05bc4f78b82d6fe43463c925ce43 to your computer and use it in GitHub Desktop.
FROM ubuntu:bionic
ARG GST_VERSION=master
ARG PREFIX=/usr
ENV TZ=Europe/Vienna
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN export TERM=linux DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
#COPY apt-preferences /etc/apt/preferences
#RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
#RUN echo 'deb http://ftp.de.debian.org/debian testing main' >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf `# libnice` \
automake `# libnice` \
autotools-dev \
autopoint \
bison \
build-essential \
ca-certificates \
flex \
gettext \
git \
gnutls-dev `# libnice` \
gtk-doc-tools `# libnice` \
libffi-dev \
libglib2.0 \
libnice-dev \
libopus-dev \
libpcre3-dev \
libsrtp-dev \
libssl-dev `# needed for DTLS requirement`\
libtool `# libnice` \
libvpx-dev \
libx264-dev \
mount \
meson \
perl \
python3 \
gobject-introspection `# needed for gst-python`\
libgirepository1.0-dev `# needed for gst-python`\
python-gi-dev \
python3-dev \
wget \
zlib1g
#RUN apt-get install -y -t testing python3.6
#RUN wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
#RUN tar xvf Python-3.6.3.tgz
#RUN cd Python-3.6.3
#RUN ./configure --enable-optimizations
#RUN make -j8
#RUN sudo make altinstall
WORKDIR /tmp
RUN git clone https://github.com/sctplab/usrsctp \
&& cd usrsctp \
&& ./bootstrap \
&& ./configure --prefix ${PREFIX} --libdir /usr/lib/$(dpkg-architecture --query DEB_BUILD_MULTIARCH) \
&& make -j$(nproc) \
&& make install \
&& ldconfig
WORKDIR /tmp
RUN set -ex && for module in gstreamer gst-python gst-libav gst-rtsp-server gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly; do \
git clone https://gitlab.freedesktop.org/gstreamer/$module.git --branch ${GST_VERSION} ; done
WORKDIR /tmp/gstreamer
RUN ./autogen.sh --disable-gtk-doc --prefix=${PREFIX} --enable-introspection \
&& make -j$(nproc) \
&& make install \
&& ldconfig
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get install -yq python3-pip libwebrtc-audio-processing-dev && pip3 install --upgrade meson
RUN apt-get remove libnice-dev libnice10 -yq
WORKDIR /tmp
RUN git clone https://gitlab.freedesktop.org/libnice/libnice.git
RUN cd libnice && mkdir build \
&& meson build/ --prefix=${PREFIX} -Dintrospection=enabled \
&& ninja -C build install
ENV PYTHON=/usr/bin/python3
WORKDIR /tmp/gst-plugins-base
RUN set -ex && \
./autogen.sh --disable-gtk-doc --prefix=${PREFIX} --enable-introspection \
&& make -j$(nproc) \
&& make install \
&& ldconfig
WORKDIR /tmp/gst-plugins-good
RUN set -ex && \
./autogen.sh --disable-gtk-doc --prefix=${PREFIX} \
&& make -j$(nproc) \
&& make install \
&& ldconfig
WORKDIR /tmp/gst-plugins-ugly
RUN set -ex && \
./autogen.sh --disable-gtk-doc --prefix=${PREFIX} \
&& make -j$(nproc) \
&& make install \
&& ldconfig
RUN ldconfig
WORKDIR /tmp/gst-plugins-bad
RUN mkdir build \
&& meson build/ --prefix=${PREFIX} -Denable-sctp=enabled -Dintrospection=enabled -Dwebrtc=enabled \
&& ninja -C build install
WORKDIR /tmp/gst-python
RUN mkdir build \
&& meson build/ --prefix=${PREFIX} -Dpygi-overrides-dir=/usr/lib/python3/dist-packages/gi/overrides -Dpython=python3 \
&& ninja -C build install
ENV GST_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/gstreamer-1.0
RUN set -ex && gst-inspect-1.0 python \
&& gst-inspect-1.0 webrtc \
&& gst-inspect-1.0 nice \
&& gst-inspect-1.0 sctp \
&& python3 -c 'import gi; gi.require_version("Gst", "1.0")' \
&& python3 -c 'import gi; gi.require_version("GstWebRTC", "1.0")'
RUN apt-get install -y libjson-glib-dev
WORKDIR /opt
RUN git clone https://github.com/centricular/gstwebrtc-demos.git \
&& cd gstwebrtc-demos/sendrecv/gst \
&& make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment