Problems with gst-plugins-bad and Cerbero

Matthew Thyer matthew.thyer at adelaide.edu.au
Wed May 30 04:21:49 UTC 2018


I have now totally given up on Cerbero and have written a script that builds just the subset of GStreamer that I require from the released sources (not git). By setting the variables in the script correctly you can but some or all of GStreamer for the installation prefix of your choice.
The script is Ubuntu or at least Debian specific in that it installs the required prerequisite packages using “sudo apt install”.
Just look for the two comment lines that include “(assumes Ubuntu host)” if you want to modify this behaviour.
You’ll want to carefully consider the prerequisite packages and the arguments to configure for each GStreamer module to get your desired behaviour.
By default, the script will build in folder GStreamer release 1.14.1 for the prefix “/usr/local/gstreamer1.0” in the temporary build folder “~/build”.
By default it only builds the modules “gstreamer”, “gst-plugins-base”, “gst-plugins-good” & “gst-rtsp-server” as that’s what I require.
Note that if you build for a prefix other than “/usr/local” you’ll need to set LD_LIBRARY_PATH to include your prefix/lib or correctly link your application for the appropriate runtime library search path.

The script is:

#!/usr/bin/env bash

# Author: Matthew Thyer
# Date: 24-28 May 2018
# Build and install a subset of GStreamer from released sources.
# Actually a generic autoconf project builder that can build anything
#   with appropriate setting of the environment variables
# Note that sudo must already be installed

# Where we'll fetch, extract and build the sources (must not already exist!)
BUILD_ROOT="${BUILD_ROOT:-~/build}"

# The release to fetch, configure, build & install
RELEASE="${RELEASE:-1.14.1}"

# Installation prefix
PREFIX="${PREFIX:-/usr/local/gstreamer1.0}"
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"

# Prerequisite packages that need to be installed (assumes Ubuntu host)
PREREQS="curl xz-utils build-essential bison flex python3 glib2.0 liborc-0.4-dev"
# If building the x264 codec from the gst-plugins-ugly module you'll also need libx264-dev
#PREREQS="curl xz-utils build-essential bison flex python3 glib2.0 liborc-0.4-dev libx264-dev"

# Where to source the sources
SRC_URL="https://gstreamer.freedesktop.org/src/"

# Arrary of which GStreamer components to build
declare -a COMPONENTS=('gstreamer'
'gst-plugins-base'
'gst-plugins-good'
#'gst-plugins-ugly'
'gst-rtsp-server');

# Common configure flags for each of the above components
COMMON_CONF_FLAGS='--disable-maintainer-mode --disable-examples --disable-gtk-doc-html'

# Array of additional configure flags for each of the above components
declare -a ADDL_CONF_FLAGS=('--disable-tests --disable-benchmarks --disable-check'
'--enable-orc'
'--enable-orc'
#'--enable-orc'
'')

# Number of parallel make jobs
njobs=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)

# Start
prog=`basename $0`
num_comps=${#COMPONENTS[@]}
num_flags=${#ADDL_CONF_FLAGS[@]}

if [ -d "${BUILD_ROOT}" ]; then
   echo "${prog}: ERROR: Build folder \"${BUILD_ROOT}\" already exists!"
   exit 1
fi

if [ $num_comps -ne $num_flags ]; then
   echo "${prog}: ERROR: Arrays COMPONENTS & ADDL_CONF_FLAGS must contain the same number of elements"
   exit 1
fi

# Install prerequisites (assumes Ubuntu host) and make the build root folder
sudo apt update
sudo apt -y upgrade
sudo apt install -y ${PREREQS}
mkdir -p "${BUILD_ROOT}"

x=0
while [ $x -lt $num_comps ]; do
   cd "${BUILD_ROOT}"
   y=`expr $x + 1`

# Fetch
   echo "[(${y}/${num_comps}) ${COMPONENTS[$x]} -> fetch ]"
   echo "Fetching ${SRC_URL}${COMPONENTS[$x]}/${COMPONENTS[$x]}-${RELEASE}.tar.xz"
   curl -LO ${SRC_URL}${COMPONENTS[$x]}/${COMPONENTS[$x]}-${RELEASE}.tar.xz

# Extract
   echo "[(${y}/${num_comps}) ${COMPONENTS[$x]} -> extract ]"
   tar -xJpf ${COMPONENTS[$x]}-${RELEASE}.tar.xz

# Configure
   echo "[(${y}/${num_comps}) ${COMPONENTS[$x]} -> configure ]"
   cd "${COMPONENTS[$x]}-${RELEASE}"
   ./configure --prefix="${PREFIX}" ${COMMON_CONF_FLAGS} ${ADDL_CONF_FLAGS[$x]} 2>&1 | tee configure.log

# Make
   echo "[(${y}/${num_comps}) ${COMPONENTS[$x]} -> make ]"
   make -j $njobs 2>&1 | tee make.log

# Install
   echo "[(${y}/${num_comps}) ${COMPONENTS[$x]} -> make install ]"
   sudo make install 2>&1 | tee make-install.log

   x=$y
done

echo "${prog}: INFO: All done!"
exit 0

From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of David Ing
Sent: Wednesday, 30 May 2018 4:13 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: Re: Problems with gst-plugins-bad and Cerbero

There is currently an unresolved bug related to debian package paths:  https://bugzilla.gnome.org/show_bug.cgi?id=796009

A likely solution is described in the bug related to a ~/custom.cbc file (part of Matthew Thyer's proposed solution).

However, if you just want to rebuild and re-install the one package, this is faster (assuming you are on Linux):

cd gst-plugins-bad
./autogen.sh
make
sudo make install && sudo ldconfig



On Tue, May 29, 2018 at 11:18 AM, Vinicius Tona <vftona at gmail.com<mailto:vftona at gmail.com>> wrote:
Hi,

I have a docker image with GStreamer built using Cerbero.
I want to add some logs in gstwebrtcbin.c to better understand how it works but when I try to follow the documentation<https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html> to recompile gst-plugins-bad I end up not seeing my change in place (Even though it was compiled properly)

I think the problem is my --prefix since I'm running inside cerbero-unstalled but I tried a bunch of paths with no success

Any help will be much appreciated

--
"If we can really understand the problem, the answer will come out of it,
because the answer is not separate from the problem." - Krishnamurti

Vinícius Faria Toná

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180530/58013649/attachment-0001.html>


More information about the gstreamer-devel mailing list