对deep stream各个元件属性和函数功能的注解
int
main (int argc, char *argv[])
{
GMainLoop *loop = NULL;
//它是组成管道的基本构件,也是框架中所有可用组件的基础
//可以描述为一个具有特定属性的黑盒子,它通过连接点(link point)与外界进行交互,向框架中的其余部分表征自己的特性或者功能.
GstElement *pipeline = NULL, *streammux = NULL, *sink = NULL, *pgie = NULL,
*queue1, *queue2, *queue3, *queue4, *queue5, *nvvidconv = NULL,
*nvosd = NULL, *tiler = NULL;
#ifdef PLATFORM_TEGRA
GstElement *transform = NULL;
#endif
GstBus *bus = NULL;
guint bus_watch_id;
GstPad *tiler_src_pad = NULL;
guint i, num_sources;
guint tiler_rows, tiler_columns;
guint pgie_batch_size;
/* Check input arguments */
if (argc < 2) {
g_printerr ("Usage: %s <uri1> [uri2] ... [uriN] \n", argv[0]);
return -1;
}
num_sources = argc - 1;
/* Standard GStreamer initialization */
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE); //创建一个main loop对象,一个main loop对象只能被一个线程使用,但一个线程可以有多个main loop对象
/* Create gstreamer elements */
/* Create Pipeline element that will form a connection of other elements */
pipeline = gst_pipeline_new ("dstest3-pipeline"); //Pipeline通过gst_pipeline_new创建
/* Create nvstreammux instance to form batches from one or more sources. */
//gst_element_factory_make(): 这个函数使用一个已存在的工厂对象和一个新的元件名来创建元件
//"nvstreammux": 可从多个输入源组成一批缓冲区
streammux = gst_element_factory_make ("nvstreammux", "stream-muxer");
if (!pipeline || !streammux) {
g_printerr ("One element could not be created. Exiting.\n");
return -1;
}
//gst_bin_add(): 在pipeline中加入element。这个方法会接受一个element作为输入参数,最后由NULL来终止
//gst_bin_add_many(): 这个方法会接受一系列的element作为输入参数
//将streammux元件加入到pipeline
gst_bin_add (GST_BIN (pipeline), streammux);
for (i = 0; i < num_sources; i++) {
GstPad *

本文介绍如何使用DeepStream SDK搭建一个完整的视频分析管道,包括多个视频源的接入、视频流批处理、目标检测与识别等关键步骤。
最低0.47元/天 解锁文章
117

被折叠的 条评论
为什么被折叠?



