Gstreamer官方教程汇总1---Hello World

Posted 毛毛虫的爹

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Gstreamer官方教程汇总1---Hello World相关的知识,希望对你有一定的参考价值。

这个教程是建立在已经安装并配置好gstreamer sdk的基础上的,如果没有安装好gstreamer sdk,请参看:

http://docs.gstreamer.com/display/GstSDK/Installing+the+SDK

代码及操作示例
将下面代码copy到一个命名为basic-tutorial-1.c的文件中。

#include <gst/gst.h>

int main(int argc, char *argv[]) {
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;

/* Initialize GStreamer */
gst_init (&argc, &argv);

/* Build the pipeline */
pipeline = gst_parse_launch (“playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm”, NULL);

/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);

/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

/* Free resources */
if (msg != NULL)
gst_message_unref (msg);
gst_object_unref (

以上是关于Gstreamer官方教程汇总1---Hello World的主要内容,如果未能解决你的问题,请参考以下文章

gStreamer 官方教程资源大全

gStreamer 官方教程资源大全

gStreamer 官方教程资源大全

官方教程中的GStreamer示例不能使用GStreamer 1.14.1在Ubuntu 18.04上运行

详细的GStreamer开发教程

详细的GStreamer开发教程