我目前正在尝试设置一个 Ubuntu 服务器来重新分发来自网络摄像机的 rtsp 提要。
我看到 gstreamer 的gst-rtsp-server 库可以帮助我解决这个问题。
我安装了以下软件包:
sudo apt-get install libgstrtspserver-1.0-dev
sudo apt-get install gstreamer1.0-rtsp
sudo apt-get install libglib2.0-dev
然后我在我的桌面上克隆了 gst-rtsp-server 库 repo:
git clone https://github.com/GStreamer/gst-rtsp-server.git
但是,当我尝试编译gst-rtsp-server/examples/test-launch.c
作为如何使用 gcc 使用库的示例给出的 C 文件 () 时:
gcc test-launch.c -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
我收到以下错误:
/tmp/ccM7e45N.o: In function `main':
test-launch.c:(.text+0x2e): undefined reference to `g_option_context_new'
test-launch.c:(.text+0x4a): undefined reference to `g_option_context_add_main_entries'
test-launch.c:(.text+0x4f): undefined reference to `gst_init_get_option_group'
test-launch.c:(.text+0x61): undefined reference to `g_option_context_add_group'
test-launch.c:(.text+0x79): undefined reference to `g_option_context_parse'
test-launch.c:(.text+0x99): undefined reference to `g_printerr'
test-launch.c:(.text+0xa5): undefined reference to `g_option_context_free'
test-launch.c:(.text+0xb1): undefined reference to `g_clear_error'
test-launch.c:(.text+0xc7): undefined reference to `g_option_context_free'
test-launch.c:(.text+0xd6): undefined reference to `g_main_loop_new'
test-launch.c:(.text+0xdf): undefined reference to `gst_rtsp_server_new'
test-launch.c:(.text+0x107): undefined reference to `g_object_set'
test-launch.c:(.text+0x113): undefined reference to `gst_rtsp_server_get_mount_points'
test-launch.c:(.text+0x11c): undefined reference to `gst_rtsp_media_factory_new'
test-launch.c:(.text+0x13a): undefined reference to `gst_rtsp_media_factory_set_launch'
test-launch.c:(.text+0x14b): undefined reference to `gst_rtsp_media_factory_set_shared'
test-launch.c:(.text+0x162): undefined reference to `gst_rtsp_mount_points_add_factory'
test-launch.c:(.text+0x16e): undefined reference to `g_object_unref'
test-launch.c:(.text+0x17f): undefined reference to `gst_rtsp_server_attach'
test-launch.c:(.text+0x19a): undefined reference to `g_print'
test-launch.c:(.text+0x1a6): undefined reference to `g_main_loop_run'
collect2: error: ld returned 1 exit status
有些东西我错过了,但我不知道是什么...><'
该错误显然来自缺少的标头,但是我在哪里可以得到它?
一如既往,感谢您的帮助/提示!
如果这为您返回了一些东西:
(对我来说,它返回
1.14.1
)您可以使用以下 gcc 命令编译所需的示例:
PS 在命令中,确保使用反引号 ` 而不是撇号 '
来源: https ://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html#hello-world