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.
而在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