gstreamer&&deepstream 学习笔记(二)——gstreamer 一些 tips

1.fakesink

在使用fakesink 时 一定要注意 “enable-last-sample” 其默认是True,功能是:

enable-last-sample” property of fakesink will hold the last GstBuffer until new GstBuffer is available. The nvv4l2decoder and nvstreammux all work with buffer pool, so it is important to release GstBuffer ASAP to make the pipeline continue to work.

来自 <https://forums.developer.nvidia.com/t/the-deepstream-image-deocode-app-blocked-when-use-multisrc-element-as-source/164036/10>

而在deepstream 中好对元件的gstBuffer是从bufferPool中得到的,如果bufferPool已经用完,则需要等待。这时如果使用了 fakesink 且发生deepstream中的某一个原件发生了这样的情况那么极有可能造成pipeline卡死。所以最好将其设置为false

2.Rtspsrc

当rtsp建立连接时,元件会发出“select-stream” 信号 该信号的回调函数:select_stream_call_back,选择使用哪一路流(音频流 or 视频流)

官方解释:

 

代码可以参考 deepstream 官方demo。

 

3.使用probe 获取 gstBuffer的 pts(显示时间)/dts(解码时间)

 if ((info->type & GST_PAD_PROBE_TYPE_BUFFER)) {

        GST_BUFFER_PTS(GST_BUFFER(info->data)) 

....

4.从gstPipleline 中获取子element:

gst_bin_get_by_name(GST_BIN(pipeline), "file-source");

5.gistBuffer 补充:

5.1生成 bufferpool:

5.2 从gistbufferpool 中获取一个gistBuffer

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值