Ubuntu 16.04环境下gst-rstp-server编译构建求助
Hey, I’ve messed around with getting gst-rtsp-server up and running on Ubuntu 16.04 before—since this is an older system with a legacy GStreamer version (around 1.8.x), you can’t just grab the latest repo code and expect it to work. Here’s a step-by-step guide to get you past the build errors:
1. Install Required Dependencies First
Start by updating your package lists and installing all the build tools and GStreamer dev packages you’ll need:
sudo apt-get update sudo apt-get install build-essential git autoconf automake libtool pkg-config sudo apt-get install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-dev
Quick note: Ubuntu 16.04’s official repos already include a pre-built libgstrtspserver-1.0-dev package. If you just want to run the examples without compiling from source, you can stop here and skip to step 4—just run the examples from the system’s installed path. But if you specifically need the GitHub repo version, keep going.
2. Clone the Repo & Check Out a Compatible Branch
The latest gst-rtsp-server versions depend on newer GStreamer releases that aren’t available on 16.04. You’ll need to switch to a branch that matches your system’s GStreamer version:
git clone https://github.com/GStreamer/gst-rtsp-server.git cd gst-rtsp-server # Check out the 1.8 branch (matches Ubuntu 16.04's default GStreamer version) git checkout 1.8
If the 1.8 branch still gives you issues, try the 1.6 branch instead—it’s even more compatible with older setups.
3. Build & Install the Project
Use the autotools build system to compile the code:
./autogen.sh --prefix=/usr make sudo make install
If ./autogen.sh throws an error about missing packages, double-check step 1—you probably missed a dev package. Look at the error message to see exactly what’s missing, then install it with sudo apt-get install [missing-package].
4. Run the Example Programs
Once installation finishes, head to the examples directory to test things out. The simplest example is test-launch:
cd examples ./test-launch "videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96"
If you get a "library not found" error when running the example, run this command first to refresh your library path:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
Or just log out and back in—this will let the system recognize the newly installed libraries.
Common Fixes for Errors
- "No package 'gstreamer-1.0' found" during autogen: You forgot to install
libgstreamer1.0-dev—go back to step 1 and run the full dependency install. - Compile-time syntax errors: You picked a branch that’s too new for your GStreamer version. Switch to an older branch like 1.8 or 1.6.
- "No such element or property" when running examples: Missing GStreamer plugins. Make sure you installed all the plugin packages from step 1 (especially
gstreamer1.0-plugins-uglyforx264enc).
内容的提问来源于stack exchange,提问作者Ramosaurio

