简体   繁体   English

从管道获取上限

[英]Get caps from pipeline

I am new to GStreamer and I try to get Caps property from pipeline in Java. 我是GStreamer的新手,我尝试从Java的管道中获取Caps属性。 If i try in command line this pipeline 如果我在命令行中尝试此管道

gst-launch-0.10 -v --gst-debug-level=2 filesrc location="C:/Dokumenty/Eclipse/rtsp_test/trailer.mp4" ! decodebin2 ! queue ! jpegenc ! rtpjpegpay ! udpsink host=::1 port=5000 sync=true

it works fine and return this caps, which I needed 它工作正常,并返回此上限,这是我需要的

/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, payload=(int)96, ssrc=(uint)3175930633, clock-base=(uint)3850186239, seqnum-base=(uint)8531

But I dont know, how to get this caps in Java from pipeline 但我不知道,如何从管道中获得Java的上限

pipe = Pipeline.launch("filesrc location="C:/Dokumenty/Eclipse/rtsp_test/trailer.mp4" ! decodebin2 ! queue ! jpegenc ! rtpjpegpay ! udpsink host=::1 port=5000 sync=true");

Are there any methods how to get udpsink0 from pipeline? 有什么方法可以从管道中获取udpsink0吗?

Thank you 谢谢

If you look at the documentation for Bin (the parent class of Pipeline ), you'll see there are a few ways to get individual elements. 如果查看Bin的文档( Pipeline的父类),则会发现有几种获取单个元素的方法。 The most simple way is to use: Bin.getElementByName("udpsink0") . 最简单的方法是使用: Bin.getElementByName("udpsink0")

A more generic way would be to call Bin.getSinks() and then grab the first result from the list. 一种更通用的方法是调用Bin.getSinks() ,然后从列表中获取第一个结果。 This way the code will still work even if you use a different type of sink. 这样,即使您使用其他类型的接收器,代码仍然可以正常工作。

Once you have the Element object you can get the pad using Element.getStaticPad("sink") and then finally you can get the Caps object with Pad.getNegotiatedCaps() . 一旦有了Element对象,就可以使用Element.getStaticPad("sink")获取填充,然后最终可以通过Pad.getNegotiatedCaps()获取Caps对象。

For more information check out the javadocs, which can be found at: https://code.google.com/p/gstreamer-java/downloads/list 有关更多信息,请查看javadocs,该文档可在以下网址找到: https : //code.google.com/p/gstreamer-java/downloads/list

In short: 简而言之:

Element sink = pipe.getElementByName("udpsink0");
Pad pad = sink.getStaticPad("sink");
Caps caps = pad.getNegotiatedCaps();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 计算在某些上限之间递增以获得目标值所需的数量 - Calculate amount needed to increment to get target value between certain caps 如何从管道内或管道运行之前获取数据流作业 ID? - How do I get a dataflow Job ID from within the pipeline or before the pipeline ran? 如何在 Jenkins Multibranch Pipeline 插件中从 pom 获取 artifactId 和 version - How to get artifactId and version from pom in a Jenkins Multibranch Pipeline plugin Gitlab 管道上的 TestContainers“JedisConnectionException:无法从池中获取资源” - TestContainers "JedisConnectionException: Could not get a resource from the pool" on Gitlab pipeline 如何获得 Caps Lock 状态并将其设置为开启(如果尚未开启)? - How can I get the Caps Lock state, and set it to on, if it isn't already? 从 pom.xml 从 Java Maven 项目在 Z3B06ADACCEC858ZEDEFBBC66 管道中获取版本 - Get the version from pom.xml from a Java Maven project in Bitbucket pipeline 将 Java 字符串从全部大写(由下划线分隔的单词)转换为 CamelCase(无单词分隔符)的最简单方法是什么? - What is the simplest way to convert a Java string from all caps (words separated by underscores) to CamelCase (no word separators)? Java Gate API。 成功创建管道,如何从处理的文档中获取注释集? - java gate api. Creating pipeline with success, how can i get the annotationsets from the docs processed? 在 Jenkins 管道中,如何从方法中获得返回值以在下一阶段使用? - In Jenkins pipeline how can I get the return from method to use in next stage? 是否可以从我的 Data Fusion Action 插件中的管道获取沿袭元数据? - Is it possible to get lineage metadata from the pipeline in my Data Fusion Action plugin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM