Ubuntu 18.04
$ gst-inspect-1.0 --gst-version
GStreamer Core Library version 1.19.0.1
我的 helloworld 程序有这些包括:
#include <gst/gst.h>
#include <glib.h>
#include <gst/sdp/sdp.h>
编译如下:
$ gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gstreamer-1.0)
helloworld.c:3:10: fatal error: gst/sdp/sdp.h: No such file or directory
#include <gst/sdp/sdp.h>
^~~~~~~~~~~~~~~
compilation terminated.
我遵循了这一点:https://www.collabora.com/news-and-blog/blog/2020/03/19/getting-started-with-gstreamer-gst-build/
$ locate gst/sdp
/home/.../work/gstreamer-setup/gst-build/builddir/subprojects/gst-plugins-bad/gst/sdp
/home/.../work/gstreamer-setup/gst-build/builddir/subprojects/gst-plugins-base/gst-libs/gst/sdp
/home/.../work/gstreamer-setup/gst-build/builddir/subprojects/gst-plugins-base/gst-libs/gst/sdp/libgstsdp-1.0.so
/home/.../work/gstreamer-setup/gst-build/builddir/subprojects/gst-plugins-base/gst-libs/gst/sdp/libgstsdp-1.0.so.0
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/gstsdpdemux.c
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/gstsdpdemux.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/gstsdpelem.c
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/gstsdpsrc.c
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/gstsdpsrc.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-bad/gst/sdp/meson.build
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.c
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdp.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/meson.build
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/sdp-prelude.h
/home/.../work/gstreamer-setup/gst-build/subprojects/gst-plugins-base/gst-libs/gst/sdp/sdp.h
尝试运行它:
$ GST_DEBUG=videotestsrc:1 gst-launch-1.0 videotestsrc num-buffers=1 ! fakevideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.033698197
Setting pipeline to NULL ...
Freeing pipeline ...
已安装libgstreamer-plugins-base1.0-dev
$sudo apt-get install libgstreamer-plugins-base1.0-dev
$locate gst/sdp
...
/usr/include/gstreamer-1.0/gst/sdp
/usr/include/gstreamer-1.0/gst/sdp/gstmikey.h
/usr/include/gstreamer-1.0/gst/sdp/gstsdp.h
/usr/include/gstreamer-1.0/gst/sdp/gstsdpmessage.h
/usr/include/gstreamer-1.0/gst/sdp/sdp-prelude.h
/usr/include/gstreamer-1.0/gst/sdp/sdp.h
[gst-master] xyz:~/.../work/gstreamer-setup/gst-build$ gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gstreamer-1.0)
helloworld.c:3:10: fatal error: gst/sdp/sdp.h: No such file or directory
#include <gst/sdp/sdp.h>
^~~~~~~~~~~~~~~
compilation terminated.
我应该在这里提供哪些信息以便您帮助我?
答案1
根据在 packages.ubuntu.com 上搜索您必须通过以下命令安装单个包:
sudo apt-get install libgstreamer-plugins-base1.0-dev
此外,我强烈建议使用官方存储库。