Skip to content
systemcoding.dev
Media

Choose and Install the Right GStreamer Plugin Packages: base, good, bad and ugly

Learn what the GStreamer base, good, bad, ugly and libav plugin sets contain, how to install them on Linux, and how to map a missing element to its package.

7 min read
Summarize in AI
Flat illustration of video frames passing through a codec, with the GStreamer, FFmpeg and Linux logos.

The most common GStreamer error is not a bug in your pipeline. It is a missing plugin: no element "x264enc", or "Your GStreamer installation is missing a plug-in", or a file that plays video but no audio. The framework itself is small. Almost everything useful lives in plugins, and the plugins are split across several packages with odd names: base, good, bad, ugly and libav. This post explains what the names mean, which elements live where, how to install them on Debian, Ubuntu, Fedora and macOS, and how to find the right package for any element you are missing. It describes the GStreamer 1.26 series.

What the four names really mean

The names come from the project's history, and they describe maintenance and licensing, not quality in the everyday sense.

SetMeaningTypical contents
gst-plugins-basewell-maintained, essential, a reference for plugin writersvideoconvert, audioconvert, videoscale, playbin, appsrc, appsink, tcp, ogg, opus, vorbis
gst-plugins-goodgood quality, LGPL, well supportedqtdemux, matroskademux, v4l2src, rtpmanager, souphttpsrc, vpx, flac, pulseaudio
gst-plugins-badnot yet up to the project's bar for API stability, tests or documentationh264parse, srtsink, webrtcbin, dash, hls, nvcodec, va, x265enc, rtmp2
gst-plugins-uglygood quality but with distribution problems, such as patents or licencesx264enc, a52dec, mpeg2dec, amrnb, dvdreadsrc
gst-libava wrapper around FFmpeg's libavcodec and libavformatavdec_h264, avenc_aac, avdec_mp3, many codecs

"Bad" does not mean broken. Many bad plugins are used in production, webrtcbin and h264parse among them. It means the set is allowed to change its API between releases. "Ugly" does not mean ugly code; it means a distributor in some countries may need a licence to ship it.

The project also keeps gst-plugins-rs (plugins written in Rust, including webrtcsink and fallbacksrc) and gst-rtsp-server as separate packages, and gstreamer-vaapi historically for hardware decoding. Check gst-inspect-1.0 <name>, which prints the "Source module" for each element.

Install on Debian and Ubuntu

The package names follow gstreamer1.0-<set>:

Shell
sudo apt install gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

The first package, gstreamer1.0-tools, holds gst-launch-1.0, gst-inspect-1.0 and gst-discoverer-1.0. Without it the commands do not exist. For development you additionally need the headers:

Shell
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

libgstreamer-plugins-base1.0-dev provides the headers for appsrc, appsink and the video library. Plugin-specific audio and GL pieces are in gstreamer1.0-alsa, gstreamer1.0-pulseaudio, gstreamer1.0-gl and gstreamer1.0-x. Those are the packages that fix "no audio output" and "no video window" problems, because a sink plugin missing from the install leaves autovideosink with nothing to pick.

Install on Fedora and macOS

On Fedora the names differ, and the ugly and libav sets live in RPM Fusion for licensing reasons:

Shell
sudo dnf install gstreamer1 gstreamer1-plugins-base gstreamer1-plugins-good \
  gstreamer1-plugins-bad-free gstreamer1-devel gstreamer1-plugins-base-devel
sudo dnf install gstreamer1-plugins-ugly gstreamer1-libav

The second command requires the RPM Fusion repository to be enabled first. Fedora's -bad-free package leaves out parts of the bad set that cannot ship in the main repository; -bad-freeworld from RPM Fusion adds them back.

On macOS, Homebrew installs the sets as formulas:

Shell
brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav

The official binaries from the GStreamer project are an alternative: they install into /Library/Frameworks/GStreamer.framework, and you add its bin directory to PATH.

Find the package for a missing element

When a pipeline fails with a missing element, the fix is a short procedure. First ask gst-inspect-1.0:

Shell
gst-inspect-1.0 x264enc
Text
No such element or plugin 'x264enc'

Second, ask your package manager which package ships the plugin file. The plugin file is named libgst<plugin>.so, so for x264enc the plugin is x264, and the file is libgstx264.so:

Shell
apt-file search libgstx264.so
Text
gstreamer1.0-plugins-ugly: /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstx264.so

The second field is the package. On Fedora use dnf provides '*/libgstx264.so'. When you do not know the plugin name, read it from a machine that has it: gst-inspect-1.0 x264enc prints Plugin Details: Name x264.

A lookup table for the elements people ask about most:

ElementPlugin set
x264encugly
x265encbad
h264parse, h265parsebad
avdec_h264, avenc_aaclibav
qtdemux, matroskademux, v4l2srcgood
videoconvert, appsinkbase
vaapih264enc (older), vah264encbad (va plugin)
nvh264encbad (nvcodec)
webrtcbinbad
souphttpsrcgood

The table matches the 1.26 series. Elements move between sets when they mature: the va plugin replaced the older gstreamer-vaapi set and was promoted into gst-plugins-bad. When in doubt, trust gst-inspect-1.0 on your system.

Let the framework tell you

playbin and decodebin post a message when they cannot decode a stream: the missing plugin message, which names the media type that has no decoder. Applications can use it to offer an install button. A command-line run prints it as:

Text
ERROR: from element /GstPlayBin:playbin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
../gst/playback/gstdecodebin2.c(4655): gst_decode_bin_expose (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
Missing decoder: H.265 (HEVC) (video/x-h265)

Take the media type from the "Missing decoder" line. Search for an element whose sink caps accept it, using the inspect output:

Shell
gst-inspect-1.0 | grep -i -E "265|hevc"

If nothing appears, install gstreamer1.0-libav or gstreamer1.0-plugins-bad, and rerun. The exact source path in that error line varies by version.

Check what you have

A quick inventory prevents repeated surprises. Count what is installed and sort by source module:

Shell
gst-inspect-1.0 | wc -l
gst-inspect-1.0 --print-plugin-auto-install-info 2>/dev/null | head -n 3
gst-inspect-1.0 videoconvert | grep "Source module"
Text
Source module            gst-plugins-base

The first two commands vary by installation. The last shows the package family for the element, which is the quickest way to learn the table above for elements you use.

Choose by task

Instead of installing everything, pick the sets by job:

  • Play local video and audio: base, good and libav.

  • Encode H.264 in software: add ugly, for x264enc.

  • Network streaming (RTP, RTSP, SRT, HLS, WebRTC): good for RTP, bad for srtsink, hlssink and webrtcbin; gst-rtsp-server for RTSP serving.

  • Capture from cameras on Linux: good, for v4l2src.

  • Hardware encoding or decoding: bad, with its va, nvcodec or v4l2codecs plugins, plus the vendor driver.

  • Embedded targets: build only what you need into your image, and see the Yocto recipes for the fine-grained split.

Installing the full set costs disk space, not performance: unused plugins do not load until an element is requested, and the registry scan is cached after the first run.

Why the split exists, and what it means for you

The split matters in three practical situations. The first is licensing. If you ship an application that bundles GStreamer, plugins in the ugly set and in libav may carry patent obligations or GPL terms that LGPL plugins do not. The Plugin Details licence line in gst-inspect-1.0 shows the licence for each plugin file, and a legal review should start from that list rather than from the set name.

The second is stability. A plugin in the bad set may change element names or properties between minor releases. If you depend on one, pin the GStreamer version in your build and read the release notes before upgrading. The webrtcbin element, for example, changed several properties over the 1.x series.

The third is size. On an embedded device you rarely want all five sets. A Yocto or Buildroot image builds plugins individually, and you choose only the ones your pipeline names. Listing the plugins your pipeline uses is easy: inspect each element name in it and note the "Plugin Details: Name" field.

Verifying a minimal install

After installing, confirm the set that matters for your pipeline with a short test that creates every element it names. Checking that each element exists is the install test:

Shell
for e in filesrc qtdemux h264parse avdec_h264 videoconvert x264enc mp4mux filesink; do
  gst-inspect-1.0 --exists "$e" && echo "ok   $e" || echo "MISS $e"
done
Text
ok   filesrc
ok   qtdemux
ok   h264parse
ok   avdec_h264
ok   videoconvert
ok   x264enc
ok   mp4mux
ok   filesink

--exists makes gst-inspect-1.0 exit with status 0 if the element is available and non-zero if not, so the loop prints MISS for each absent one. Put this check at the top of an installation script or a container build and you find the missing package immediately, not after the pipeline fails at run time.

Share

Keep reading

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.