gstreamer基础教程3-Dynamic pipelines

GStreamer 基础教程三: 动态管道 目标 我们可以在应用程序开始时定义整体管道,也可以在有足够信息时“动态”构建管道。 这篇教程的目标是搞清楚如下问题: 如何在链接元件时获得更精细的控制? 如何收到感兴趣事件的通知,并及时反应? 元件可能处于的哪些不同的状态? 介绍 这篇教程中的管道在设置为 “Playing” 状态之前并未完全构建好。 这没问题。如果我们不采取进一步的行动,数据将到达管道的尽头,管道将会产生一个错误消息并停止。... 阅读详情

索引:https://blog.youkuaiyun.com/knowledgebao/article/details/84621238

Goal

目标是动态创建管道,包括组件连接、消息及时获取以及组件的状态转换。

This tutorial shows the rest of the basic concepts required to use GStreamer, which allow building the pipeline "on the fly", as information becomes available, instead of having a monolithic(单一的) pipeline defined at the beginning of your application.

After this tutorial, you will have the necessary knowledge to start the Playback tutorials. The points reviewed here will be:

  • How to attain finer control when linking elements.

  • How to be notified of interesting events so you can react(反应) in time.

  • The various states in which an element can be.

Introduction

这里主要介绍衬垫(pad)的概念。source element只有source pad,sink element只有sink pad,filter element二者兼有。

As you are about to see, the pipeline in this tutorial is not completely built before it is set to the playing state. This is OK. If we did not take further action, data would reach the end of the pipeline and the pipeline would produce an error message and stop. But we are going to take further action...

In this example we are opening a file which is multiplexed (or muxed), this is, audio and video are stored together inside a container file. The elements responsible for opening such containers are called demuxers, and some examples of container formats are Matroska (MKV), Quick Time (QT, MOV), Ogg, or Advanced Systems Format (ASF, WMV, WMA).

If a container embeds multiple streams (one video and two audio tracks, for example), the demuxer will separate them and expose them through different output ports. In this way, different branches can be created in the pipeline, dealing with different types of data.

The ports through which GStreamer elements communicate with each other are called pads(衬垫) (GstPad). There exists sink pads, through which data enters an element, and source pads, through which data exits an element. It follows naturally that source elements only contain source pads, sink elements only contain sink pads, and filter elements contain both.

  

Figure 1. GStreamer elements with their pads.

A demuxer contains one sink pad, through which the muxed data arrives, and multiple source pads, one for each stream found in the container:

Figure 2. A demuxer with two source pads.

For completeness(完整), here you have a simplified pipeline containing a demuxer and two branches, one for audio and one for video. This is NOT the pipeline that will be built in this example:

Figure 3. Example pipeline with two branches.

只有数据正在到来的时候,才能知道需要创建多少个source pad,所以这里涉及动态创建source pad.

The main complexity when dealing with demuxers is that they cannot produce any information until they have received some data and have had a chance to look at the container to see what is inside. This is, demuxers start with no source pads to which other elements can link, and thus the pipeline must necessarily terminate at them.

The solution is to build the pipeline from the source down to the demuxer, and set it to run (play). When the demuxer has received enough information to know about the number and kind of streams in the container, it will start creating source pads. This is the right time for us to finish building the pipeline and attach it to the newly added demuxer pads.

For simplicity(简化), in this example, we will only link to the audio pad and ignore the video.

Dynamic Hello World

Copy this code into a text file named basic-tutorial-3.c (or find it in your GStreamer installation).

basic-tutorial-3.c

#include <gst/gst.h>

/* Structure to contain all our information, so we can pass it to callbacks */
typedef struct _CustomData {
  GstElement *pipeline;
  GstElement *source;
  GstElement *convert;
  GstElement *sink;
} CustomData;

/* Handler for the pad-added signal */
static void pad_added_handler (GstElement *src, GstPad *pad, CustomData *data);

int main(int argc, char *argv[]) {
  CustomData data;
  GstBus *bus;
  GstMessage *msg;
  GstStateChangeReturn ret;
  gboolean terminate = FALSE;

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

  /* Create the elements */
  data.source = gst_element_factory_make ("uridecodebin", "source");
  data.convert = gst_element_factory_make ("audioconvert", "convert");
  data.sink = gst_element_factory_make ("autoaudiosink", "sink");

  /* Create the empty pipeline */
  data.pipeline = gst_pipeline_new ("test-pipeline");

  if (!data.pipeline || !data.source || !data.convert || !data.sink) {
    g_printerr ("Not all elements could be created.\n");
    return -1;
  }

  /* Build the pipeline. Note that we are NOT linking the source at this
   * point. We will do it later. */
  gst_bin_add_many (GST_BIN (data.pipeline), data.source, data.convert , data.sink, NULL);
  if (!gst_element_link (data.convert, data.sink)) {
    g_printerr ("Elements could not be linked.\n");
    gst_object_unref (data.pipeline);
    return -1;
  }

  /* Set the URI to play */
  g_object_set (data.source, "uri", "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);

  /* Connect to the pad-added signal */
  g_signal_connect (data.source, "pad-added", G_CALLBACK (pad_added_handler), &data);

  /* Start playing */
  ret = gst_element_set_state (data.pipeline, GST_STATE_PLAYING);
  if (ret == GST_STATE_CHANGE_FAILURE) {
    g_printerr ("Unable to set the pipeline to the playing state.\n");
    gst_object_unref (data.pipeline);
    return -1;
  }

  /* Listen to the bus */
  bus = gst_element_get_bus (data.pipeline);
  do {
    msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
        GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

    /* Parse message */
    if (msg != NULL) {
      GError *err;
      gchar *debug_info;

      switch (GST_MESSAGE_TYPE (msg)) {
        case GST_MESSAGE_ERROR:
          gst_message_parse_error (msg, &err, &debug_info);
          g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
          g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
          g_clear_error (&err);
          g_free (debug_info);
          terminate = TRUE;
          break;
        case GST_MESSAGE_EOS:
          g_print ("End-Of-Stream reached.\n");
          terminate = TRUE;
          break;
        case GST_MESSAGE_STATE_CHANGED:
          /* We are only interested in state-changed messages from the pipeline */
          if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data.pipeline)) {
            GstState old_state, new_state, pending_state;
            gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
            g_print ("Pipeline state changed from %s to %s:\n",
                gst_element_state_get_name (old_state), gst_element_state_get_name (new_state));
          }
          break;
        default:
          /* We should not reach here */
          g_printerr ("Unexpected message received.\n");
          break;
      }
      gst_message_unref (msg);
    }
  } while (!terminate);

  /* Free resources */
  gst_object_unref (bus);
  gst_element_set_state (data.pipeline, GST_STATE_NULL);
  gst_object_unref (data.pipeline);
  return 0;
}

/* This function will be called by the pad-added signal */
static void pad_added_handler (GstElement *src, GstPad *new_pad, CustomData *data) {
  GstPad *sink_pad = gst_element_get_static_pad (data->convert, "sink");
  GstPadLinkReturn ret;
  GstCaps *new_pad_caps = NULL;
  GstStructure *new_pad_struct = NULL;
  const gchar *new_pad_type = NULL;

  g_print ("Received new pad '%s' from '%s':\n", GST_PAD_NAME (new_pad), GST_ELEMENT_NAME (src));

  /* If our converter is already linked, we have nothing to do here */
  if (gst_pad_is_linked (sink_pad)) {
    g_print ("We are already linked. Ignoring.\n");
    goto exit;
  }

  /* Check the new pad's type */
  new_pad_caps = gst_pad_get_current_caps (new_pad);
  new_pad_struct = gst_caps_get_structure (new_pad_caps, 0);
  new_pad_type = gst_structure_get_name (new_pad_struct);
  if (!g_str_has_prefix (new_pad_type, "audio/x-raw")) {
    g_print ("It has type '%s' which is not raw audio. Ignoring.\n", new_pad_type);
    goto exit;
  }

  /* Attempt the link */
  ret = gst_pad_link (new_pad, sink_pad);
  if (GST_PAD_LINK_FAILED (ret)) {
    g_print ("Type is '%s' but link failed.\n", new_pad_type);
  } else {
    g_print ("Link succeeded (type '%s').\n", new_pad_type);
  }

exit:
  /* Unreference the new pad's caps, if we got them */
  if (new_pad_caps != NULL)
    gst_caps_unref (new_pad_caps);

  /* Unreference the sink pad */
  gst_object_unref (sink_pad);
}

 

Walkthrough

封装一个结构体,为了方便将来在回调中设置。

/* Structure to contain all our information, so we can pass it to callbacks */
typedef struct _CustomData {
  GstElement *pipeline;
  GstElement *source;
  GstElement *convert;
  GstElement *sink;
} CustomData;

So far we have kept all the information we needed (pointers to GstElements, basically) as local variables. Since this tutorial (and most real applications) involves callbacks, we will group all our data in a structure for easier handling.

下边这个接口是设置回调,稍后介绍。

/* Handler for the pad-added signal */
static void pad_added_handler (GstElement *src, GstPad *pad, CustomData *data);

This is a forward reference, to be used later.

/* Create the elements */
data.source = gst_element_factory_make ("uridecodebin", "source");
data.convert = gst_element_factory_make ("audioconvert", "convert");
data.sink = gst_element_factory_make ("autoaudiosink", "sink");

uridecodebin 类型会内部初始化必要的element,从uri地址中分离出音视频。audioconvert 是一个音频转换器,使音频转化为标准音频。autoaudiosink 是一个音频接收器,播放出声音。

We create the elements as usual. uridecodebin will internally instantiate(内部实例化) all the necessary elements (sources, demuxers and decoders) to turn a URI into raw audio and/or video streams. It does half the work that playbin does. Since it contains demuxers, its source pads are not initially(开头) available and we will need to link to them on the fly.

audioconvert is useful for converting between different audio formats, making sure that this example will work on any platform, since the format produced by the audio decoder might not be the same that the audio sink expects.

The autoaudiosink is the equivalent(相当于) of autovideosink seen in the previous tutorial, for audio. It will render the audio stream to the audio card.

将convert和sink连接起来,这二个element已经确定,source element还没有确定,需要分离器从uri中分离出来后再进行连接。

if (!gst_element_link (data.convert, data.sink)) {
  g_printerr ("Elements could not be linked.\n");
  gst_object_unref (data.pipeline);
  return -1;
}

Here we link the converter element to the sink, but we DO NOT link them with the source, since at this point it contains no source pads. We just leave this branch (converter + sink) unlinked, until later on.

/* Set the URI to play */
g_object_set (data.source, "uri", "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);

We set the URI of the file to play via a property, just like we did in the previous tutorial.给source element设置uri地址。

Signals

/* Connect to the pad-added signal */
g_signal_connect (data.source, "pad-added", G_CALLBACK (pad_added_handler), &data);

我们可以对指定的element元素添加一个信号,当element有信号是,会触发我们设置的回调pad_added_handler,通知我们去处理。第二个参数pad_added是一个信号名称(表示有pad产生)。信号名称可以通过对应elemnt的文档或者通过工具gst-inspect-1.0获取。

GSignals are a crucial(重要的) point in GStreamer. They allow you to be notified (by means of a callback) when something interesting has happened. Signals are identified by a name, and each GObject has its own signals.

In this line, we are attaching to the “pad-added” signal of our source (an uridecodebin element). To do so, we use g_signal_connect() and provide the callback function to be used (pad_added_handler) and a data pointer. GStreamer does nothing with this data pointer, it just forwards it to the callback so we can share information with it. In this case, we pass a pointer to the CustomData structure we built specially for this purpose.

The signals that a GstElement generates can be found in its documentation or using the gst-inspect-1.0 tool as described in Basic tutorial 10: GStreamer tools.

We are now ready to go! Just set the pipeline to the PLAYING state and start listening to the bus for interesting messages (like ERROR or EOS), just like in the previous tutorials.

The callback

当uridecodebin类型的element分理处音视频数据的时候,就会触发pad_added_handler回调,这个回调有三个参数,第一个参数就是产生这个回调的element,第二个参数,是新增的pad,第三个参数是之前设置的上下文。

When our source element finally has enough information to start producing data, it will create source pads, and trigger the “pad-added” signal. At this point our callback will be called:

static void pad_added_handler (GstElement *src, GstPad *new_pad, CustomData *data) {

src is the GstElement which triggered the signal. In this example, it can only be the uridecodebin, since it is the only signal to which we have attached. The first parameter of a signal handler is always the object that has triggered it.

new_pad is the GstPad that has just been added to the src element. This is usually the pad to which we want to link.

data is the pointer we provided when attaching to the signal. In this example, we use it to pass the CustomDatapointer.

通过上下文以及gst_element_get_static_pad 函数,可以获取convert这个element的sinkpad,这里我们需要将我们source pad和sink pad连接起来,和之前介绍的element直接连接一样。可以通过函数gst_pad_is_linked判断一个pad是否已经连接。

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "sink");

From CustomData we extract the converter element, and then retrieve its sink pad using gst_element_get_static_pad (). This is the pad to which we want to link new_pad. In the previous tutorial we linked element against element, and let GStreamer choose the appropriate pads. Now we are going to link the pads directly.

/* If our converter is already linked, we have nothing to do here */
if (gst_pad_is_linked (sink_pad)) {
  g_print ("We are already linked. Ignoring.\n");
  goto exit;
}

可以通过new_pad_caps = gst_pad_get_current_caps,gst_caps_get_structure,gst_structure_get_name获取pad的名称,通过名称可以过滤是否是关心的pad。
uridecodebin can create as many pads as it sees fit, and for each one, this callback will be called. These lines of code will prevent us from trying to link to a new pad once we are already linked.

/* Check the new pad's type */
new_pad_caps = gst_pad_get_current_caps (new_pad, NULL);
new_pad_struct = gst_caps_get_structure (new_pad_caps, 0);
new_pad_type = gst_structure_get_name (new_pad_struct);
if (!g_str_has_prefix (new_pad_type, "audio/x-raw")) {
  g_print ("It has type '%s' which is not raw audio. Ignoring.\n", new_pad_type);
  goto exit;
}

Now we will check the type of data this new pad is going to output, because we are only interested in pads producing audio. We have previously created a piece of pipeline which deals with audio (an audioconvert linked with an autoaudiosink), and we will not be able to link it to a pad producing video, for example.

gst_pad_get_current_caps() retrieves the current capabilities of the pad (that is, the kind of data it currently outputs), wrapped in a GstCaps structure. All possible caps a pad can support can be queried withgst_pad_query_caps(). A pad can offer many capabilities, and hence GstCaps can contain many GstStructure, each representing a different capability. The current caps on a pad will always have a single GstStructure and represent a single media format, or if there are no current caps yet NULL will be returned.

Since, in this case, we know that the pad we want only had one capability (audio), we retrieve the first  GstStructure  with  gst_caps_get_structure().

Finally, with gst_structure_get_name() we recover the name of the structure, which contains the main description of the format (its media type, actually).

If the name is not audio/x-raw, this is not a decoded audio pad, and we are not interested in it.

Otherwise, attempt the link:可以通过gst_pad_link将两个合适的pad进行连接(当然前提是在同一个bin里)。

/* Attempt the link */
ret = gst_pad_link (new_pad, sink_pad);
if (GST_PAD_LINK_FAILED (ret)) {
  g_print ("Type is '%s' but link failed.\n", new_pad_type);
} else {
  g_print ("Link succeeded (type '%s').\n", new_pad_type);
}

gst_pad_link() tries to link two pads. As it was the case with gst_element_link(), the link must be specified from source to sink, and both pads must be owned by elements residing in(位于0 the same bin (or pipeline).

And we are done! When a pad of the right kind appears, it will be linked to the rest of the audio-processing pipeline and execution will continue until ERROR or EOS. However, we will squeeze(榨取,获得) a bit more content from this tutorial by also introducing the concept of State.

GStreamer States

We already talked a bit about states when we said that playback does not start until you bring the pipeline to the PLAYING state. We will introduce here the rest of states and their meaning. There are 4 states in GStreamer:

| State     | Description |
|-----------|--------------------|
| `NULL`    | the NULL state or initial state of an element. |
| `READY`   | the element is ready to go to PAUSED. |
| `PAUSED`  | the element is PAUSED, it is ready to accept and process data. Sink elements however only accept one buffer and then block. |
| `PLAYING` | the element is PLAYING, the clock is running and the data is flowing. |

You can only move between adjacent(相邻的) ones, this is, you can't go from NULL to PLAYING, you have to go through the intermediate READY and PAUSED states. If you set the pipeline to PLAYING, though, GStreamer will make the intermediate(中间的) transitions for you.

case GST_MESSAGE_STATE_CHANGED:
  /* We are only interested in state-changed messages from the pipeline */
  if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data.pipeline)) {
    GstState old_state, new_state, pending_state;
    gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
    g_print ("Pipeline state changed from %s to %s:\n",
        gst_element_state_get_name (old_state), gst_element_state_get_name (new_state));
  }
  break;

We added this piece of code that listens to bus messages regarding state changes and prints them on screen to help you understand the transitions. Every element puts messages on the bus regarding its current state, so we filter them out and only listen to messages coming from the pipeline.

Most applications only need to worry about going to PLAYING to start playback, then to PAUSED to perform a pause, and then back to NULL at program exit to free all resources.

Exercise

Dynamic pad linking has traditionally been a difficult topic for a lot of programmers. Prove that you have achieved its mastery by instantiating an autovideosink (probably with an videoconvert in front) and link it to the demuxer when the right pad appears. Hint: You are already printing on screen the type of the video pads.

You should now see (and hear) the same movie as in Basic tutorial 1: Hello world!. In that tutorial you used playbin, which is a handy element that automatically takes care of all the demuxing and pad linking for you. Most of the Playback tutorials are devoted to playbin.

Conclusion

In this tutorial, you learned:

  • How to be notified of events using GSignals
  • How to connect GstPads directly instead of their parent elements.
  • The various states of a GStreamer element.

You also combined these items to build a dynamic pipeline, which was not defined at program start, but was created as information regarding the media was available.

You can now continue with the basic tutorials and learn about performing seeks and time-related queries in Basic tutorial 4: Time management or move to the Playback tutorials, and gain more insight about the playbin element.

Remember that attached to this page you should find the complete source code of the tutorial and any accessory files needed to build it. It has been a pleasure having you here, and see you soon!

gst-launch-1.0详细说明 是GStreamer库提供的命令行工具,用于构建和运行基于GStreamer的多媒体处理管道。它接受一个管道描述作为输入,可以从各种来源中捕获音视频数据,并将其转换、编解码、过滤、传输和显示等。 阅读详情

相关推荐

【Aseprite】制作Unity2D瓦片地图素材(平台游戏)

本文章用于记录用Aseprite软件制作2D平台游戏的瓦片地图的方法。

凡心所向,素履以往 5546

GStream常用类及其类间关系

1. GstElement GstElement 是GStreamer管道(pipeline)中构建组件的抽象基类。GstElement子类的更多信息,请参考插件编写者指南。 gst_element_get_name:获取组件名称; gst_element_set_name:设置组件名称。为了提高速度,使用适当的锁定时,可以在内核中使用GST_ELEMENT_NAME。请勿在插件...

MoL的博客 1325

深度学习PyTorch代码模板——模型训练框架、数据处理、绘图…

个人用深度学习代码模板:模型训练框架、数据处理、绘图等。待补充。

https://www.hyperplasma.top 1908

【无标题】

***参考:***Gstreamer应用开发手册5:构建一个应用 注意 1:gst_pad_link (pad, sinkpad);//将两个pad 进行链接 2:g_object_set (G_OBJECT (source), “location”, argv[1], NULL); //设置播放源 3:当碰见动态创建 pad 的 element 需要特殊对待。   只能上面的方法 gst_element_link (source, demuxer); gst_element_link_many (deco

aningxiaoxixi的博客 379

vSphere环境证书更新/续订案例及注意事项

早期VMware的用户随后“十年之期”已到,陆陆续续出现各种登录问题,证书报错告警等,主要包含6.5到7.0的版本,VMware服务器虚拟化环境涉及的证书及类型较多,在实际更新中会出现各种奇怪的问题,有些坑耗费了大量的troubleshooting时间,极端情况下一天能看到十多遍如下报错😂本文整理了一个近期的更新案例,以及之前处理过的一些问题,仅作参考CA根证书颁发机构,用于签发其他组件的证书,其他证书的有效期不会超过根证书。

RaySun的技术Blog 3207

洛谷 P5736 【深基7.例2】质数筛

题目描述 输入 n(n\le100)n(n≤100) 个不大于 100000 的整数。要求全部储存在数组中,去除掉不是质数的数字,依次输出剩余的质数。 输入格式 无 输出格式 无 输入输出样例 输入 #1 复制 5 3 4 5 6 7 输出 #1 复制 3 5 7 板子题,使用一下线性筛 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using n

qq_37978559的博客 1117

GStreamer常用命令总结

最近开始做GStreamer相关项目了,网上搜了一下,相关资料并不多,所以一边查阅一边记录总结一下,方便后期使用。 1. 播放视频、音频操作命令 音频: gst-launch-1.0 filesrc loaction=123.mp3 ! mad ! autoaudiosink   autoaudiosink可换成pulsesink或alsasink,需要使用gst-inspect查询是否存在这些sink插件,其实autoaudiosink是个壳,最终还是选择使...

程序猿老樊的博客 3039

体系结构学习-6-超标量处理器

 MIPS32-5段流水线采用了指令级并行方式(5个流水段同时运行5条指令)提升系统吞吐率,是一种标量处理器(CPI≥1CPI \ge 1CPI≥1),但是一个周期一条指令以及无法满足现代计算机需求了。 超标量处理器(Superscalar) 1、基本思想:增强指令集并行,让每个周期执行更多指令,实现 CPI<1CPI<1CPI<1 。(IPC=1/CPIIPC = 1...

qq_40891899的博客 1214

GStreamer——教程——基础教程3:Dynamic pipelines

正如您将要看到的,本教程中的管道在设置为播放状态之前尚未完全构建。这没关系。如果我们不采取进一步行动,数据将到达管道末端,管道将生成错误消息并停止。但我们将采取进一步行动.....在这个例子中我们将打开一个多路复用的文件,音频和视频被存储在同一个容器文件中。负责打开此类容器的element称为解复用器,容器格式的一些示例有Matroska(MKV)、Quick Time(QT、MOV)、Ogg或Advanced Systems Format(ASF、WMV、WMA)。

FREEDOM_X的专栏 1500

别急着编译!修复银河麒麟OpenSSH漏洞前,先搞懂ssh、sshd版本与apt仓库的“爱恨情仇”

本文深度解析银河麒麟OpenSSH漏洞(CVE-2023-38408)修复策略,揭示版本差异背后的企业级维护逻辑,提供从APT升级到源码编译的多维度方案评估。特别针对路径隔离方案和离线环境处理给出技术细节,帮助企业制定兼顾安全与稳定的升级决策框架。

weixin_26642481的博客 455

爬虫反爬:一文掌握 BotBrowser 的原理和使用(能绕过很多验证码的指纹浏览器)

BotBrowser是使用经过修改的Chromium内核(修改Chromium的C++源代码)的隐形浏览器,可靠地绕过Cloudflare、Shape、PerimeterX、Datadome、Akamai、Kasada、hCaptcha和reCAPTCHA。BotBrowser是一个跨平台的自动化工具,它重新定义了web自动化。专为爬虫、RPA(机器人流程自动化)和 Web 测试设计。与 Puppeteer/Selenium 不同,它通过无头模式(Headless)和API 级控制。

数据知道的博客 1万+

GStreamer开发实例 3: Dynamic pipelines

可以看到这篇教程的pipeline在设置为PLAYING状态之前都没有完成构建,这种行为是允许的。但是假如在播放之前没有完成,那么数据在到达pipeline的某个节点将上报一个错误信息并停止运行。在这个例子中我们将打开一个多路复用的文件,音频和视频被存储在同一个容器文件中。负责响应打开多路复用文件的element被叫做解复用器,可以处理MKV、QT、MOV、Ogg、WMV等格式的容器文件。

浩瀚之水的专栏 397

基于Simulink雷达系统建模仿真(附源码)

此示例显示如何设置由发射器、带目标的信道和接收器组成的雷达系统仿真。一、系统架构该系统包括:雷达脉冲发生器,以 2% 占空比(导通时间 = 2 ms,周期 = 100 ms)输出功率为 1 mW 的啁啾声。RF发射器部分由滤波器和组成,使用RF模块集电路包络库模块实现。由于滤波器是线性器件,放大器是非线性器件,因此它们被分成两个独立的子系统。这种分离允许在每个子系统中使用不同的仿真频率集。这种分离还允许在更快的仿真速度和级联链中可用的级间负载效应损失之间进行权衡。

珞瑜的博客 4583

【GStreamer 】Basic tutorials-Basic tutorial 3: Dynamic pipelines

正如您将要看到的,本教程中的管道在设置为播放状态之前并未完全构建。这是可以的。如果我们不采取进一步的行动,数据将到达管道的末端,管道将产生错误消息并停止。但我们要采取进一步的行动……在这个例子中,我们打开一个多路复用(或多路复用)的文件,也就是说,音频和视频一起存储在一个容器文件中。负责打开此类容器的元素称为解复用器,容器格式的一些示例包括 Matroska (MKV)、Quick Time (QT、MOV)、Ogg 或高级系统格式 (ASF、WMV、WMA)。

qq_43298381的博客 776

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

GStreamer笔记 -- 3.Dynamic pipelines

动态管道1. 目标2. 介绍3. 代码4. 代码解读4.1. 信号4.2. 回调函数4.3. GStream 的管道的状态 1. 目标 这个教程将展示GStreamer的基本应用,就是怎么动态的建立一个pipeline,而不是在应用的开始就搭建好pipeline。 在这个教程之后,你将获得开始 Playback tutorials教程的必要知识,这里我们将学习以下几点: 怎样在链接元素的时候实现更细致的控制 怎样即使获取感兴趣的事件,以便即使做出相应的动作 元素的各种状态 2. 介绍 正如你所见的,这个

xf1234的博客 434

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

GStreamer官方教程系列——Basic tutorial 3: Dynamic pipelines

GStreamer官方教程系列 Basic tutorial 3: Dynamic pipelines 原文:https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c 目标   本教程会展示前两个教程余下的使用GStreamer需要的基本概念,“动态”构建管道,当信息变得可用时,而不是在一开始就定义一个完整的管道。   在学习本教程之后,你就有了足够的知识储备来开始

SaberZXL520的博客 433

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

GStreamer Tutorial 中文翻译:Basic tutorial 3: Dynamic pipelines

GStreamer Tutorial 3中文翻译 文章目录GStreamer Tutorial 3中文翻译前言[Basic tutorial 3: Dynamic pipelines](https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c)目的简介动态Hello World代码走读结论 前言 由于工作原因,用的GStreamer的图像解码库,所以记录GStr

wuchangwen0216的博客 397

GStreamer 基础教程学习 3 - 动态管道 (Basic tutorial 3: Dynamic pipelines)

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c 本节进一步扩展了上一节的管道, 在运行过程中(on the fly)创建管道,而不是在运行前创建一个指定的管道。 可以想象,将一个没有完全创建的管道设置为播放状态,那么在什么都不做的情况下,数据...

gsymichael的专栏 521

Gstreamer官方教程汇总基本教程3---Dynamic pipelines

https://my.oschina.net/u/735973/blog/202365 摘要: 将gstreamer的官方教程做了一下整理,分享给需要的人们。 Goal 本教程介绍剩下的的使用GStreamer的所需的基本概念,它允许随时地建立管道,作为信息变得可用,而不必在你的应用程序的开头定义一个全局的管道。 本教程后,您将具备必要的知识,开始 Playback

STN_LCD的专栏 1134

gstreamer笔记

gstreamer官方教程、gstreamer中文教程、gstreamer插件文档 常用插件:Platform-specific elements、Handy elements 本文内容全部来自于上面这些教程,仅作为个人学习记录。 pipeline pipeline是gst从输入到输出的一条处理管线,pipeline由element组成,element必须加入pipeline,并按次序首尾相接才能工作。pipeline构建好以后有各种state,包括NULL,READY,PAUSE,PLAYING,

qq_41263444的博客 2318

gstreamer之gst_pad_link/gst_element_link源码剖析

(1)如果GST_PAD_PEER (srcpad)/GST_PAD_PEER (sinkpad)已经存在了,则GST_PAD_LINK_WAS_LINKED,说明pad already linked.a)GST_PAD_LINK_CHECK_CAPS是默认值,通过gst_pad_query_caps查询srcpad和sinkpad的caps。(2)prepare pad link实现函数gst_pad_link_prepare。相关的回调函数类型。2.函数gst_pad_link_prepare。

我的博客 1097

GStreamer 简明教程(三):动态调整 Pipeline

本章来了解 GStreamer 动态调整 Pipeline 的流程,这章代码略长,略微有些复杂,各位看官稍稍耐心些。在src参数表示触发信号的 GstElement,在本例中通常为 uridecodebin,因为它是唯一附加了该信号的元素。信号处理函数的第一个参数始终是触发信号的对象。new_pad参数表示刚刚添加到src元素的 GstPad。通常,我们希望连接的就是这个 pad。第一次,添加的 pad 负责输出视频数据第二次,添加的 pad 负责输出音频数据data。

记录学习的过程 2225

GStreamer学习笔记(四)——基础教程3:动态pipeline

正如你即将看到的,本教程中的pipeline在设置为播放状态之前并没有完全构建。这没问题。如果我们不采取进一步的行动,数据将到达pipeline的末端,pipeline将产生错误消息并停止。但我们将采取进一步行动……在这个例子中,我们正在打开一个多路复用(或muxed)的文件,也就是说,音频和视频一起存储在容器文件中。

bestworker的博客 2209

【GStreamer 】1-扫盲介绍

GStreamer是一个非常强大和通用的用于开发流媒体应用程序的框架。GStreamer框架的许多优点都来自于它的模块化:GStreamer可以无缝地合并新的插件模块,但是由于模块化和强大的功能往往以更大的复杂度为代价,开发新的应用程序并不总是简单。

cau_weiyuhu的博客 4091

GStreamer教程-基础教程3:动态管道

这是第三个GStreamer的基础教程,讲解如何动态构建管道。

tangyzh的博客 1405
上一篇: gstreamer基础教程2-GStreamer concepts
下一篇: gstreamer基础教程4-Time management
knowledgebao
博客等级 码龄15年 401粉丝 198原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值