Building GStreamer 1.20 with Meson¶
Steps and build options for compiling GStreamer 1.20 from source with Meson.
This English edition preserves the original commands, configuration fragments, and diagrams so the steps can be reproduced directly.




Commands and configuration¶
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ meson configure | grep 264
libopenh264 auto [enabled, disabled, auto] libopenh264
libx264 auto [enabled, disabled, auto] libx264
openh264 auto [enabled, disabled, auto] H.264 video codec plugin
uvch264 auto [enabled, disabled, auto] UVC compliant H.264 camera source plugin
x264 auto [enabled, disabled, auto] H.264 video encoder plugin based on libx264 (GPL - only built if
x264_libraries Colon separated list of additional x264 library paths, e.g. for
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ cd build/
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer/build$ ls
build.ninja compile_commands.json GstDocumentedSubprojects GstPluginsPath.json meson-info meson-logs meson-private meson-uninstalled subprojects tests
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer/build$ ninja devenv
[0/1] Running external command devenv (wrapped by meson to set env)
[gst-1.20] pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer/build$
# 查看有哪些版本
ls /usr/bin/python*
# 设定:
alias python=/usr/bin/python3.8
alias python3=/usr/bin/python3.8
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ meson --version
0.45.1
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ pip3 install --user meson
Collecting meson
Downloading https://files.pythonhosted.org/packages/95/0a/c961c525cd1b2914fa9cc85692f25a44012759ca1f25a96bda3fec74aa09/meson-0.61.4-py3-none-any.whl (863kB)
100% |████████████████████████████████| 870kB 1.7MB/s
Installing collected packages: meson
Successfully installed meson-0.61.4
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ meson --version
0.45.1
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ export PATH=~/.local/bin:$PATH
pub@ubuntu64:/mnt/work/zheng/gstreamer/gstreamer$ meson --version
0.61.4
$ git clone -b 1.20 https://github.com/GStreamer/gst-rtsp-server.git
meson --reconfigure build --prefix=/home/mhpub/gstreamer/gst-rtsp-server/build/out
Notes¶
Use these examples as a starting point and adjust versions, device names, codecs, and network addresses for the target platform.