【Gstreamer】GStreamer编译环境搭建

在Ubuntu环境上安装gstreamer

apt安装gstreamer

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

通过pkg-config工具添加gstreamer库到gcc中

pkg-config --cflags --libs gstreamer-1.0

获取源代码

git clone https://gitlab.freedesktop.org/gstreamer/gstreamer

demo存放在 subprojects/gst-docs/examples/tutorials路径下

编译demo

进入demo路径下,执行

gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0`

编译生成basic-tutorial-1可执行程序

运行demo

./basic-tutorial-1
posted @ 2023-01-27 18:07  Emma1111  阅读(558)  评论(0编辑  收藏  举报