GStreamer Suite 1.28.1

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 22. GS

- Prev

  FFmpeg-8.0.1

- Next

  Wine

- Up
- Home

# GStreamer Suite 1.28.1

## Introduction to the GStreamer Suite

GStreamer is a streaming media framework that enables applications to share a common set of plugins for tasks such as video encoding and decoding, audio encoding and decoding, audio and video filters, audio visualisation, web streaming and anything else that streams in real-time or otherwise. This page provides most of the set of packages for ease of installation as they mostly have the same instructions.

### Note

This may take a while to build. Feel free to do something else while this is building.

### Important

For the lib32 installation instructions, they require new Meson cross files from MLFS, as `--libdir=/usr/lib32` has been moved to the cross files and no longer appear in the instructions. Install the new cross files so that 32-bit libraries don't get installed in `/usr/lib`.

### GStreamer Suite Dependencies

Required
FFmpeg-8.0.1 (for libav support) and GLib-2.86.4 (GObject Introspection required for GNOME)
Recommended
alsa-lib-1.2.15.3, CDParanoia-III (for building the CDDA plugin), Cairo, FLAC-1.5.0, gdk-pixbuf, GLib-2.86.4 (with GObject Introspection), ISO Codes, LAME-3.100, liba53 (needed to play DVD's), libaom-3.13.1, libdvdread, libdvdnav, libgudev, libjpeg-turbo, libsoup-2, libsoup-3, libva-2.23.0, libogg-1.3.6, libpng-1.6.55, libvorbis-1.3.7, libvpx-1.16.0, mpg123, NASM-3.01, libglvnd-1.7.0, Pango, PulseAudio-17.0, SoundTouch, SVT-AV1-4.0.1, Wayland-Protocols-1.47, x264-20250815, Xorg Libraries, and yasm
Optional
AAlib, CUDA (CUDA-13.1.1 or CUDA-13.0.2) (for GPU acceleration with NVIDIA GPUs), graphene, GTK-3 (for examples), libcdio (for CD-ROM drive access), libdv, libvpl (for GPU acceleration with Intel GPUs), libmpeg2, libnsl, libunwind-1.8.3, Opus-1.6.1, Qt-5, Qt-6, Rustc-1.93.1 (for IEEE 1588:2008 PTP clock support), sdl2-compat-2.32.64, Speex-1.2.1, taglib, Valgrind, v4l-utils, Wayland-1.24.0, alsa-oss, bash-completion, hotdoc, JACK, libavc1394, libcaca, libdw, libiec61883, libraw1394, libshout, libsidplay, libtheora, libvisual, Orc, Tremor, TwoLame, and WavPack

### Note

The optional list is not complete. See BLFS' gst-plugins-bad for dependencies that are missing from the list.

### BLFS Equivalent Packages

This combined page installs what would be in BLFS:

- gstreamer

- gst-plugins-base

- gst-plugins-good

- gst-plugins-bad

- gst-plugins-ugly

- gst-libav

This page does not include gst-plugins-rs. It provides a GTK-4 binding and a dav1d plugin. If you need them, see the linked page in BLFS.

## Downloading the GStreamer Suite

First create a list of files that will be downloaded:

    cat > gstreamer-suite-1.28.1-list << EOF
    gstreamer/gstreamer-1.28.1.tar.xz
    gst-plugins-base/gst-plugins-base-1.28.1.tar.xz
    gst-plugins-good/gst-plugins-good-1.28.1.tar.xz
    gst-plugins-bad/gst-plugins-bad-1.28.1.tar.xz
    gst-plugins-ugly/gst-plugins-ugly-1.28.1.tar.xz
    gst-libav/gst-libav-1.28.1.tar.xz
    EOF

To download the needed files using Wget-1.25.0, use the following commands:

    mkdir gstreamer-suite &&
    cd    gstreamer-suite &&
    grep -v '^#' ../gstreamer-suite-1.28.1-list | wget -i- -c \
        -B https://gstreamer.freedesktop.org/src/

## Installation of the GStreamer Suite

### Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

1. Run the entire script as the root user (not recommended).

2. Use the sudo command from the sudo package.

3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

    as_root()
    {
      if   [ $EUID = 0 ];        then $*
      elif [ -x /usr/bin/sudo ]; then sudo $*
      else                            su -c \\"$*\\"
      fi
    }

    export -f as_root

First do a test to see if the suite is installed, and if it is, remove the previous installation [12]:

    pkgconf gstreamer-1.0
    if test x"$?" = x"0"; then
      as_root rm -rvf /usr/bin/gst-* /usr/{lib,libexec}/gstreamer-1.0
    fi

Now start a subshell that will exit on error:

    bash -e

Install all of the packages by running the following commands:

    for package in $(grep -v '^#' ../gstreamer-suite-1.28.1-list)
    do
      package=$(basename "$package")
      packagedir=${package%.tar.?z*}
      echo "Building $packagedir"
      tar -xf $package
      pushd $packagedir

      case $packagedir in
        gstreamer-[0-9]* )
          extraflags="-D gst_debug=false"
        ;;
        gst-plugins-base-[0-9]* )
          extraflags="--wrap-mode=nodownload"
        ;;
        gst-plugins-bad-[0-9]* )
          extraflags="-D gpl=enabled -D gsm=disabled"
        ;;
        gst-plugins-ugly-[0-9]* )
          extraflags="-D gpl=enabled"
        ;;
        * )
          extraflags=
        ;;
      esac

      mkdir build
      cd    build
        meson setup --prefix=/usr       \
                    --buildtype=release \
                    $(echo $extraflags) \
                    ..
        ninja
        as_root ninja install
      popd
      rm -rf $packagedir
    done

Finally, exit the shell that was started earlier:

    exit

## lib32 Installation of the GStreamer Suite

First do a test to see if the suite is installed, and if it is, remove the previous installation:

    i686-pc-linux-gnu-pkg-config gstreamer-1.0
    if test x"$?" = x"0"; then
      as_root rm -rvf /usr/lib32/gstreamer-1.0
    fi

Now start a subshell that will exit on error:

    bash -e

Install all of the packages by running the following commands:

    for package in $(grep -v '^#' ../gstreamer-suite-1.28.1-list)
    do
      package=$(basename "$package")
      packagedir=${package%.tar.?z*}
      echo "Building lib32-$packagedir"
      tar -xf $package
      pushd $packagedir

      case $packagedir in
        gstreamer-[0-9]* )
          extraflags="-D gst_debug=false"
        ;;
        gst-plugins-base-[0-9]* )
          extraflags="--wrap-mode=nodownload -D qt5=disabled"
        ;;
         gst-plugins-good-[0-9]* )
          extraflags="$([ -f /usr/lib32/libmp3lame.so ] || echo "-D lame=disabled")"
          extraflags+=" -D qt5=disabled -D qt6=disabled"
        ;;
        gst-plugins-bad-[0-9]* )
          extraflags="-D gpl=enabled -D gsm=disabled"
        ;;
        gst-plugins-ugly-[0-9]* )
          extraflags="-D gpl=enabled"
        ;;
        * )
          extraflags=
        ;;
      esac

      mkdir build
      cd    build
        meson setup --prefix=/usr       \
                    --buildtype=release \
                    --cross-file=lib32  \
                    $(echo $extraflags) \
                    ..
        ninja
        DESTDIR=$PWD/DESTDIR ninja install
        as_root cp -vR DESTDIR/usr/lib32/* /usr/lib32
        rm -rf DESTDIR
      popd
      rm -rf $packagedir
      as_root /sbin/ldconfig
    done

Finally, exit the shell that was started earlier:

    exit

## Command Explanations

### Note

Inspect `meson_options.txt` or `meson.options` for a full list of options.

`--buildtype=release`: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

`-D gpl=enabled`: Without this switch, plugins with dependencies on (A)GPL licensed libraries are not built.

`-D gsm=disabled`: This switch disables linking to the GSM library if it is installed, as it will cause a build failure.

`-D qt{5,6}=disabled`: On a multilib system, while Qt-5 or Qt-6 may be installed, it is far less likely for them to be installed for lib32. meson falsely detects them being installed if 64-bit installations are detected, which leads to linker errors. If you have installed lib32-Qt-{5,6}, remove these parameters.

$([ -f /usr/lib32/libmp3lame.so ] ...: This command searches for a library from one of the recommended dependencies, and if it can't find the library, the command invokes `-D lame=disabled` to disable LAME support for the 32-bit build as meson can't detect if it is the right architecture or not.

## Contents

Installed Programs: gst-device-monitor-1.0, gst-discoverer-1.0, gst-inspect-1.0, gst-launch-1.0, gst-play-1.0, gst-stats-1.0, gst-tester-1.0, gst-transcoder-1.0, gst-typefind-1.0, and playout
Installed Libraries: libgstadaptivedemux-1.0, libgstallocators-1.0, libgstanalytics-1.0, libgstapp-1.0, libgstaudio-1.0, libgstbadaudio-1.0, libgstbase-1.0, libgstbasecamerabinsrc-1.0, libgstcheck-1.0, libgstcodecparsers-1.0, libgstcodecs-1.0, libgstcontroller-1.0, libgstcuda-1.0, libgstdxva-1.0, libgstfft-1.0, libgstgl-1.0, libgstinsertbin-1.0, libgstisoff-1.0, libgstmpegts-1.0, libgstmse-1.0, libgstnet-1.0, libgstpbutils-1.0, libgstphotography-1.0, libgstplay-1.0, libgstplayer-1.0, libgstreamer-1.0, libgstriff-1.0, libgstrtp-1.0, libgstrtsp-1.0, libgstsctp-1.0, libgstsdp-1.0, libgsttag-1.0, libgsttranscoder-1.0, libgsturidownloader-1.0, libgstva-1.0, libgstvideo-1.0, libgstwayland-1.0, libgstwebrtc-1.0, and several plugins under /usr/lib{,32}/gstreamer-1.0
Installed Directories: /usr/include/gstreamer-1.0/gst/{allocators,app,audio,fft,gl,pbutils}, /usr/include/gstreamer-1.0/gst/{audio,basecamerabinsrc,cuda}, /usr/include/gstreamer-1.0/gst/{codecparsers,insertbin,interfaces}, /usr/include/gstreamer-1.0/gst/{isoff,mpegts,play,player,sctp}, /usr/include/gstreamer-1.0/gst/{riff,rtp,rtsp,sdp,tag,video}, /usr/include/gstreamer-1.0/gst/{transcoder,uridownloader,va}, /usr/include/gstreamer-1.0/gst/{wayland,webrtc}, /usr/share/gst-plugins-base, /usr/share/gstreamer-1.0/presets, and /usr/{include,lib{,32},libexec,share}/gstreamer-1.0

### Short Descriptions

gst-device-monitor-1.0 | is a command line tool that can be used to test GStreamer's device monitoring functionality
gst-discoverer-1.0 | is a tool that can be used to print basic metadata and stream information about a media file
gst-inspect-1.0 | is a tool that prints out information on available GStreamer plugins, information about a particular plugin, or information about a particular element
gst-launch-1.0 | is a tool that builds and runs basic GStreamer pipelines
gst-play-1.0 | is a command line tool that can be used to test basic playback using the playbin element
gst-stats-1.0 | is a tool used to gather statistics about GStreamer operations
gst-tester-1.0 | runs a test plan in TAP compatible format while integrating with the meson test harness
gst-transcoder-1.0 | is used to transcode a stream into a different format
gst-typefind-1.0 | uses the GStreamer type finding system to determine the relevant GStreamer plugin to parse or decode files, and the corresponding MIME type
playout | is an example application used to sequentially play a list of audio-video files
`libgstbase-1.0` | provides some base classes to be extended by elements and utility classes that are most useful for plugin developers
`libgstcheck-1.0` | provides functionality for writing unit tests that use the check framework
`libgstcontroller-1.0` | provides functionality to animate element properties over time
`libgstnet-1.0` | provides network elements and objects
`libgstreamer-1.0` | provides all of the core GStreamer services, including initialization, plugin management and types, as well as the object hierarchy that defines elements and bins, along with some more specialized elements

[12] Removal of previous installation is required or else processes may hang or not function properly due to mixed versions being installed.

- Prev

  FFmpeg-8.0.1

- Next

  Wine

- Up
- Home