centricular / gstwebrtc-demos

Superseded by https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-examples/webrtc - Demo apps for using gstreamer's webrtc implementation
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-examples/webrtc
BSD 2-Clause "Simplified" License
490 stars 197 forks source link

Cannot find NICE when configuring gst-plugins-bad #63

Closed tobiasfriden closed 5 years ago

tobiasfriden commented 5 years ago

Hello,

I am trying to build gstreamer 1.14.4 in a raspbian-stretch based Docker container.

However, when I get to installing gst-plugins-bad the configuration script does not seem to find libnice. Running ./configure --prefix=/usr in the gst-plugins-bad-1.14.4 folder yields the following output:

configure: *** checking feature: WebRTC ***
configure: *** for plug-ins: webrtc ***
checking for NICE... no
configure: *** These plugins will not be built: webrtc

However I have installed libnice with apt-get install libnice-dev and also built the source from https://github.com/libnice/libnice.git. gst-inspect-1.0 nice yields:

Plugin Details:
  Name                     nice
  Description              Interactive UDP connectivity establishment
  Filename                 /usr/lib/gstreamer-1.0/libgstnice.so
  Version                  0.1.14.1
  License                  LGPL
  Source module            libnice
  Binary package           libnice
  Origin URL               http://telepathy.freedesktop.org/wiki/

My Dockerfile:

FROM raspbian/stretch

RUN apt-get update && apt-get install -y --no-install-recommends \
    autoconf `# libnice` \
    automake `# libnice` \
    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 \
    perl \
    python \
    wget \
    zlib1g 

# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gstreamer10.html
RUN wget https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.14.4.tar.xz \
    && tar xvfJ gstreamer-1.14.4.tar.xz > /dev/null \
    && cd gstreamer-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

    # gst-plugins-base
RUN wget https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.14.4.tar.xz \
    && tar xvfJ gst-plugins-base-1.14.4.tar.xz > /dev/null \
    && cd gst-plugins-base-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

RUN git clone https://github.com/libnice/libnice.git \
    && cd libnice \
    && ./autogen.sh --prefix=/usr --with-gstreamer --enable-static --enable-static-plugins --enable-shared --without-gstreamer-0.10 --disable-gtk-doc --enable-compile-warnings=no \
    && make install

# gst-plugins-good
RUN wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.14.4.tar.xz \
    && tar xvfJ gst-plugins-good-1.14.4.tar.xz > /dev/null \
    && cd gst-plugins-good-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

# gst-plugins-bad
RUN wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.14.4.tar.xz \
    && tar xvfJ gst-plugins-bad-1.14.4.tar.xz > /dev/null \
    && cd gst-plugins-bad-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

    # gst-plugins-ugly
 RUN wget https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.14.4.tar.xz \
    && tar xvfJ gst-plugins-ugly-1.14.4.tar.xz > /dev/null \
    && cd gst-plugins-ugly-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

# gst-rtsp-server
 RUN wget https://gstreamer.freedesktop.org/src/gst-rtsp-server/gst-rtsp-server-1.14.4.tar.xz \
    && tar xvfJ gst-rtsp-server-1.14.4.tar.xz > /dev/null \
    && cd gst-rtsp-server-1.14.4 \
    && ./configure --prefix=/usr \
    && make \
    && make install 

RUN rm -rf gst*

When built from the base image maxmcd/gstreamer:1.14-buster instead I can get it working, and the only difference I can find is that apt-cache policy libnice-dev shows version 0.1.14 in that case instead of 0.1.13. Is 0.1.14 required for the WebRTC plugin?

Any help greatly appreciated!

tp-m commented 5 years ago

Is 0.1.14 required for the WebRTC plugin?

Yes, libnice >= 0.1.14 is required.

tobiasfriden commented 5 years ago

Ok thanks, that at least explains the issue. Any idea how libnice 0.1.14 can be installed on raspbian stretch? The apt-get repository only contains version 0.1.13.

tp-m commented 5 years ago

You can install it into /usr/local or a custom prefix and then make configure find it by setting PKG_CONFIG_PATH and at runtime LD_LIBRARY_PATH (or add the dir to /etc/ld.so.conf*).

You could also not install libnice from package and instead just install from source into /usr ?

Or you make a debian package from a newer version :)

tobiasfriden commented 5 years ago

Actually I apparently was already installing the source to /usr with this:

RUN git clone https://github.com/libnice/libnice.git \
    && cd libnice \
    && ./autogen.sh --prefix=/usr --with-gstreamer --enable-static --enable-static-plugins --enable-shared --without-gstreamer-0.10 --disable-gtk-doc --enable-compile-warnings=no \
    && make install

But the configure script was default using the apt-get installed version. Removing it resolved the issue, thanks!