问题描述
我得到了https://github.com/GStreamer/gst-rtsp-server,的源代码形式 然后我按照https://mesonbuild.com/Getting-meson.html的步骤使用MSI安装程序安装Meson和Ninja。 但是当我运行build时,似乎不正确。
D:\>cd gst-rtsp-server-master
D:\gst-rtsp-server-master>meson build
The Meson build system
Version: 0.56.0
Source dir: D:\gst-rtsp-server-master
Build dir: D:\gst-rtsp-server-master\build
Build type: native build
Project name: gst-rtsp-server
Project version: 1.19.0.1
C compiler for the host machine: clang (clang 8.0.0 "clang version 8.0.0 (tags/RELEASE_800/final)")
C linker for the host machine: clang link 14.16.27042.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports link arguments -Wl,-Bsymbolic-functions: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Message: disabling deprecated GLib API
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wredundant-decls: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wwrite-strings: YES
Compiler for C supports arguments -Wformat: YES
Compiler for C supports arguments -Wformat-nonliteral: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wold-style-deFinition: YES
Compiler for C supports arguments -Waggregate-return: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Waddress: YES
Compiler for C supports arguments -Wno-multichar: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C supports arguments -Wvla: YES
Compiler for C supports arguments -Wpointer-arith: YES
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency glib-2.0 found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency glib-2.0
meson.build:136:0: ERROR: Neither a subproject directory nor a glib.wrap file was found.
A full log can be found at D:\gst-rtsp-server-master\build\meson-logs\meson-log.txt
我完全感到困惑。请帮助...
解决方法
这在 Windows 上并不是微不足道的。我执行了以下步骤来解决这个问题:
- 安装 Visual Studio 2019
- 使用开发者标头安装 gstreamer vs2019 版
- 安装 Ninja-build
- 安装介子:
python -m pip install meson
- 打开 x64 Visual Studio 命令外壳
- 在此 shell 中更新您的路径变量:
set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
(注意pkg-config
包含在 gstreamer 的安装中)。 -
cd
到您克隆gst-rtsp-server
的路径 - 运行介子设置:
meson setup build
- 编译rtsp代码
meson compile -C build
- 运行
build\examples\test-readme.exe
- 使用 VLC 连接到 rtsp 流