GStreamer入门-1
Ubuntu18.04-GStreamer入门-1
- Gstream安装
- 第一步 —— 在Ubuntu上安装GStreamer
- 第二步 —— 使用GStreamer构建应用程序
- 第三步 —— 获取教程的源代码
- 第四步 ——Building 教程
- 第五步 ——Running 教程
- 源码 basic-tutorial-1.c
- Conclusion
Gstream安装
参见官网:Installing on Linux
第一步 —— 在Ubuntu上安装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
第二步 —— 使用GStreamer构建应用程序
pkg-config --cflags --libs gstreamer-1.0
第三步 —— 获取教程的源代码
git clone https://gitlab.freedesktop.org/gstreamer/gst-docs
第四步 ——Building 教程
gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0`
提示:需要进入存放教程文件的文件夹内才能building
参考我的路径是:~/gst-docs/examples/tutorials
第五步 ——Running 教程
./basic-tutorial-1
源码 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("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/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(bus);gst_element_set_state(pipeline, GST_STATE_NULL);gst_object_unref(pipeline);return 0;
}
Conclusion
在GStream中
source
这个elements
可以看作生产者,sink
这个elemen
可以看作消费者,媒体数据从source出发,经过一系列的中间处理元素,最后到达sink。在这个过程中相互连接的元素的集合称之为“pipeline”gst_init()
这必须始终是第一个GStreamer命令
。
gst_init():
初始化所有内部结构
检查可用的插件
执行任何用于GStreamer的命令行选项gst_parse_launch()
This function takes a textual representation of a pipeline and turns it into an actual pipeline, which is very handy. In fact, this function is so handy there is a tool built completely around it which you will get very acquainted withgst_element_set_state()
设置pipeline
(这里的pipeline是由GstElement定义的变量)的状态,当这个函数的第二个变量为GST_STATE_PLAYING
,即是将媒体流的状态设置为playing
状态;当第二个变量为GST_STATE_NULL
,即释空gst_element_get_bus()
…gst_bus_timed_pop_filtered()
…
GStreamer入门-1相关推荐
- GStreamer 入门 - Hello,World
GStreamer 是一个用于构建媒体处理组件图(也可以称为 pipeline,或管道)的库.它支持的应用非常广泛,从简单的 Ogg/Vorbis 播放,音频/视频流到复杂的音频(混音)和视频(非线性 ...
- GStreamer入门概念(二)
众所周知,Microsoft's Windows和Apple's MacOS对多媒体设备.多媒体创作.播放和实时处理等方面都有很好的支持,而Linux对多媒体应用一直略显不足,所以为了解决Linux上 ...
- Gstreamer入门之Helloworld(一)
众所周知,Microsoft's Windows和Apple's MacOS对多媒体设备.多媒体创作.播放和实时处理等方面都有很好的支持,而Linux对多媒体应用一直略显不足,所以为了解决Linux上 ...
- DeepStream python接口探索
本文承接上文,记录对英伟达DeepStream python接口的初步探索. DeepStream-Python使用Gst-Python API操作构建操作管线(pipeline),并使用探针函数(p ...
- gstreamer(一)入门和概述
一.概述 在音视频领域接触最多实现的方案通常是通过ffmpeg(PC和sever端居多)或者硬件厂家的的SDK实现特定硬件的编解码功能(机顶盒,电视等嵌入式设备).这里我们介绍一个在国内不太常用的解决 ...
- GStreamer(二)
http://antkillerfarm.github.io/ GStreamer应用(续) TCP远程播放 除了本地播放之外,GStreamer亦支持远程播放.以下仅以TCP远程播放为例. TCP远 ...
- GStreamer开发介绍
https://blog.csdn.net/liu_xiao_cheng/article/details/43017491#section-bin-ghost-img 发Chat 转载 2015年01 ...
- NVIDIA Jetson: GStreamer 和 openMAX(gst-omx) 插件
Nvidia 的 GPU 产品的开发工具包叫做 DeepStream,是基于 GStreamer 开发.因此,掌握 DeepStream,必须从 GStreamer 入手.先看看这货如何安装的吧! 1 ...
- 【Linux入门学习之】Ubuntu常用软件
[Linux入门学习之]Ubuntu常用软件 速配指南之软件参考 本文定位:作为速配指南的补充,列出国内用户比较常用的软件.请将论坛软件推荐版块的内容逐步转移至wiki,而非本文. 本文作用:为新手指 ...
最新文章
- JAVA-Eclipse快捷键
- R语言dplyr包的mutate函数将列添加到dataframe中或者修改现有的数据列:使用na_if()函数将0值替换为NA值、负收入替换为NA值
- [LeetCode] Rotate List
- 编程珠玑 15.3生成文本
- 接口的抽象与实现(概述)
- SQL Server的复合索引学习【转载】
- 华为mate40搭载鸿蒙,华为mate40搭载鸿蒙还是EMUI11,答案来了
- c语言的详细编译过程
- CISCO基础之局域网交换机配置
- day4:单用户及救援模式及互相登录
- 认知电子战 (1.2):认知理论及其在无线电领域的应用
- 2021-09-30 拐点可能存在的地方总结, 关于弧微分的理解
- python中day_python day02
- jquery怎么读(jquery怎么读音英语)
- 因果推断what if
- 数字化改革是逼不得已,最后却帮我提高了20%生产效率
- 00.奇特的一生--序言(笔记)
- 该怎么去学UI设计?UI设计学习路线分享
- jsp高校教学资源管理系统
- Java中自己实现log2(N)