【GStreamer】官网基本教程学习(basic-tutorial)

【目录】郭老二博文之:图像视频汇总

1、下载和编译

下载:

git clone https://gitlab.freedesktop.org/gstreamer/gst-docs

编译:
进入到gst-docs/examples/tutorials目录,以basic-tutorial-1.c文件为例编译使用

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

2、 basic-tutorial-1.c 直接创建管道播放视频

函数调用顺序:
初始化: gst_init
创建管道: gst_parse_launch
启动管道: gst_element_set_state (pipeline, GST_STATE_PLAYING);
获取bus: gst_element_get_bus
等待bus上的消息:gst_bus_timed_pop_filtered

释放资源:
gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);

你可能感兴趣的:(视频,gstreamer)