gstreamer
Abstract
Ogg Vorbis is a
completely open, patent-free, professional audio encoding and streaming
technology
Copy-on-write (COW), sometimes referred to as implicit sharing
or shadowing,is a resource-management technique used in computer programming to
efficiently implement a "duplicate" or "copy" operation
on modifiable resources. If a resource is duplicated but not modified, it
is not necessary to create a new resource; the resource can be shared between
the copy and the original.
Modifications must still create a copy, hence the technique: the copy operation
is deferred to the first write. By sharing resources in this way, it is
possible to significantly reduce the resource consumption of
unmodified copies, while adding a small overhead to resource-modifying
operations.
A GstElement object is created from a factory.Element factories are the basic types retrieved from the GStreamer registry, they describe all plugins and elements that GStreamer can create.
Pads are element's input and output, where you can connect other elements. Pads have specific data handling capabilities,Data types are negotiated between pads using a process called caps negotiation
A bin is
a container for a collection of elements
A pipeline is a top-level
bin. It provides a bus for the application and manages the synchronization for
its children
buffers are objects for
passing streaming data between elements in the pipeline.
events are objects sent
between elements or from the application to elements, such as EOS, Seek
messages are
objects posted by elements on the pipeline's message bus
queries allow
applications to request information such as duration or current playback
position from the pipeline
Probing is best envisioned as a pad listener. Technically, a probe is nothing more than a callback that can be attached to a pad;The probe notifies you of any activity that happens on the pad, like buffers,events and queries. You can add the probe to a pad.Blocking probes are used to temporarily block pads because they are unlinked or because you are going to unlink them. If the dataflow is not blocked, the pipeline would go into an error state if data is pushed on an unlinked pad.
gst_init has to be called from the main application. This call will perform the necessary initialization of the library
tags: the first type is stream tags, which describe the content of a stream in a non-technical way. Examples include the author of a song, the title of that very same song or the album it is a part of.
The other type of metadata is stream-info, which is a somewhat technical
description of the properties of a stream. This can include video size, audio
samplerate, codecs used and so on(read though Caps).
Tag reading is done through a bus in GStreamer,listen for GST_MESSAGE_TAG
messages and handle them as you wish
adding an element to a bin will disconnect any already existing links. Also, you cannot directly link elements that are not in the same bin or pipeline;When you set a bin or pipeline to a certain target state,
it will usually
propagate the state change to all elements within the bin or pipeline
automatically;add an element to will take ownership of that element.
If you destroy the bin,
the element will be dereferenced with it.
A bus is a simple system that takes care of forwarding messages from the streaming threads to an application in its own thread context
streaming threads, that is GstTask, which A GstPad will typically create to
push or pull data to/from the peer pads
A typical stream starts with a stream start event that marks the start of the stream, followed by a segment event that marks the buffer timestamp range. After that buffers are sent one after the other. After the last buffer an EOS marks the end of the stream.
+-----+-------+ +-++-+ +-+ +---+
|START|SEGMENT| |B||B| ... |B| |EOS|
+-----+-------+ +-++-+ +-+ +---+
pipeline: gstreamer will create at least one thread FOR Bus to pass message to appication
Caps are called simple caps when they contain only one structure, and fixed caps when they contain only one structure and have no variable field types
Synchronization is to make sure that a buffer with a certain running-time is played when the clock reaches the same running-time.
GStreamer uses a GstClock object, buffer timestamps and a SEGMENT event to
synchronize streams in a pipeline
Latency compensation
Before the pipeline goes to the PLAYING state, it will, in addition to
selecting a clock and calculating a base-time, calculate the latency in the
pipeline.
It does this by doing a LATENCY query on all the sinks in the pipeline. The
pipeline then selects the maximum latency in the pipeline and configures this
with a LATENCY event.
All sink elements will delay playback by the value in the LATENCY event. Since
all sinks delay with the same amount of time, they will be relative in sync
buffering is used to accumulate enough data in a pipeline so that playback can occur smoothly and without interruptions
In the buffering state, the application should keep the pipeline in the PAUSED
state
"Appsrc” (an imaginary source) and “appsink” (an imaginary sink) can be used to inject data into or grab the output from a pipeline
Playbin is the recommended solution for everything related to simple playback of media that should just work
decodebin is a more flexible autoplugger ,which is is the actual autoplugger
backend of playbin
uridecodebin element is very similar to decodebin, only that it automatically
plugs a source plugin based on the protocol of the URI given.
The playsink element is a powerful sink element. It has request pads for raw
decoded audio, video and text and it will configure itself to play the media
streams
GST_STATE_PAUSED is the state in which an element is ready to accept and handle data. For most elements this state is the same as PLAYING. The only exception to this rule are sink elements. Sink elements only accept one single buffer of data and then block. At this point the pipeline is 'prerolled' and ready to render data immediately
Pad works in push-mode/pull-mode:
Gstreamer lib organizaiton:
usefule tips for coding with gstreamer:
gst-launch -v src ! decodebin ! sink
// this is very useful when try to find out the elements your need!
gst-inspect plugin/element
Elements will write output to GStreamer debugging system to log what they're doing
GStreamer-based applications accept the commandline option --gst-debug=LIST
gstreamer的更多相关文章
- GStreamer 记录
GStreamer 是一个新的多媒体框架,大大简化了多媒体工具的开发流程,比如,这里有一个 IBM 的文档,介绍了一个 MP3 播放器. http://www.ibm.com/developerwor ...
- Linux No volume control GStreamer plugins and/or devices found
案例环境:Oracle Linux Server release 5.7 进入Oracle Linux系统后,在右上角点击声音图标时,则会弹出如下报错窗口: The volume control di ...
- [quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming
[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming http://blog.pi3g.com/2013/08/ffmp ...
- ubuntu系统下安装gstreamer的ffmpeg支持
当您在安装gstreamer到您的ubuntu系统中时,为了更好地进行流媒体开发,需要安装ffmpeg支持,但一般情况下,直接使用 sudo apt-get install gstreamer0.10 ...
- Gstreamer基本概念介绍(开发前必读)
1. 元件(Elements) 元件(element)是GStreamer中最重要的概念.你可以通过创建一系列的元件(Elements),并把它们连接起来,从而让数据流在这个被连接的各个元件(Elem ...
- vlc/ffmepg/mplayer/gstreamer/openmax/mpc/ffdshow/directshow
一些应该学习的开源框架与库用途和差别 一.播放器层次 这个层次上,是直接可以用的软件,已经做完了一切工作,如果我们需要用他们,是不需要写一行代码的,编译通过就可以拿来使用了,对于国内这些山寨公司来说, ...
- Gstreamer 数据流线程(GstTask / GstTaskPool)分析
作者:fengcc 原创文章 转载请注明出处 GStreamer 是一个基于流水线的多媒体框架,基于 GObject,以 C 语言写成. 凭借 GStreamer,程序员可以很容易地创建各种多媒体功能 ...
- gstreamer让playbin能够播放rtp over udp流数据
最近一段时间在研究传屏低延迟传输相关的一些东西.本来想使用gstreamer来验证下rtp over udp传送h264 nal数据相关 的,结果发现竟然不能用playbin来播放rtp的数据!诚然, ...
- Gstreamer 中的playback插件
1. PLAYBACK插件基本介绍 在早期的版本中同时存在playbin和playbin2,但是在最新的版本中,playbin2已经稳定,取代了playbin, playbin不再进行维护.下面是官网 ...
- GStreamer Plugin: Embedded video playback halted; module decodebin20 reported: Your GStreamer installation is missing a plug-in.
标题是在Linux下使用系统yum install 的opencv库来获取视频帧的时候抛出来的错误消息.opencv调用了Gstream的API来处理了视频.错误抛出的代码如下图: http://ub ...
随机推荐
- html(常用标签,标签分类),页面模板, CSS(css的三种引入方式),三种引入方式优先级
HTML 标记语言为非编程语言负责完成页面的结构 组成: 标签:被<>包裹的由字母开头,可以结合合法字符( -|数字 ),能被浏览器解析的特殊符号,标签有头有尾 指令:被<>包 ...
- tomcat自动重新加载应用
前言 当应用配置文件发生变化时,无需重启tomcat,可以使tomcat重新加载应用. 场景 假设存在一个J2EE应用A,对应war文件名称为A.war,部署在tomcat的webapps目录下,即: ...
- jquery.easing 和 jquery.transit 动画插件的使用
从jQuery API 文档中可以知道,jQuery自定义动画的函数.animate( properties [, duration] [, easing] [, complete] )有四个参数: ...
- ****** 三十四 ******、软设笔记【存储器系统】-Cache存储器
Cache存储器 Cache(高速缓冲存储器) 高速缓冲存储器是位于主存与CPU之间的一级存储器,有静态存储芯片(SRAM)组成,容量比较小,速度比主存高得多,接近于CPU的速度,单位成本比内存高.C ...
- redis整合Spring集群搭建及业务中的使用
1.redis安装 Redis是c语言开发的. 安装redis需要c语言的编译环境.如果没有gcc需要在线安装.yum install gcc-c++ 安装步骤: 第一步:redis的源码包上传到li ...
- Kali Linux之web安全扫描器skipfish使用
0x00.skipfish简介 谷歌公司出品的开源web程序评估软件. skipfish特点:CPU资源占用低,扫描速度快,每秒可以轻松处理2000个请求,误报率低. 1x00.skipfish使用 ...
- Django基础自测
6.如何在URLconf中给URL命名?在视图和模板中如何使用URL反向解析?写出所有情况 13.请写出使用jQuery发送ajax请求,能通过Django的CSRF校验的两种方法 14.请使用Dja ...
- webpack学习笔记——打包js
1.新建一个入口js文件,如entry.js,代码如下: document.write("It works.") 2.然后编译 entry.js 并打包到 bundle.js(会自 ...
- 第25月第15天 udacity cs253
1.cs253 https://classroom.udacity.com/courses/cs253 webapp2 Install WebOb, Paste and webapp2¶ We nee ...
- actionsheet(操作表)
推荐使用锚点方式显示.隐藏actionsheet: 若要使用js代码动态显示.隐藏actionsheet,同样在popover插件的构造方法中传入"toggle"参数即可 //传入 ...