Unable to initialize Yolo with GST deepstream

Code:
/**
MIT License

Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
*/

#include
#include <glib.h>
#include <gst/gst.h>

#include “gstnvdsmeta.h”

/* As defined in the yolo plugins header*/

#define YOLO_UNIQUE_ID 15

gint frame_number = 0;

/* osd_sink_pad_buffer_probe will extract metadata received on OSD sink pad

  • and get a count of objects of interest */

static GstPadProbeReturn
osd_sink_pad_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{

GstMeta *gst_meta = NULL;
NvDsMeta *nvdsmeta = NULL;
gpointer state = NULL;
static GQuark _nvdsmeta_quark = 0;
GstBuffer *buf = (GstBuffer *) info->data;
NvDsFrameMeta *frame_meta = NULL;
guint num_rects = 0, rect_index = 0;
NvDsObjectParams *obj_meta = NULL;
guint car_count = 0;
guint person_count = 0;
guint bicycle_count = 0;
guint truck_count = 0;

if (!_nvdsmeta_quark)
_nvdsmeta_quark = g_quark_from_static_string (NVDS_META_STRING);

while ((gst_meta = gst_buffer_iterate_meta (buf, &state))) {
if (gst_meta_api_type_has_tag (gst_meta->info->api, _nvdsmeta_quark)) {

  nvdsmeta = (NvDsMeta *) gst_meta;

  /* We are interested only in intercepting Meta of type
   * "NVDS_META_FRAME_INFO" as they are from our infer elements. */
  if (nvdsmeta->meta_type == NVDS_META_FRAME_INFO) {
    frame_meta = (NvDsFrameMeta *) nvdsmeta->meta_data;
    if (frame_meta == NULL) {
      g_print ("NvDS Meta contained NULL meta \n");
      return GST_PAD_PROBE_OK;
    }

    num_rects = frame_meta->num_rects;

    /* This means we have num_rects in frame_meta->obj_params.
     * Now lets iterate through them and count the number of cars,
     * trucks, persons and bicycles in each frame */

    for (rect_index = 0; rect_index < num_rects; rect_index++) {
      obj_meta = (NvDsObjectParams *) & frame_meta->obj_params[rect_index];
      if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
              "car"))
        car_count++;
      else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
              "person"))
        person_count++;
      else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
              "bicycle"))
        bicycle_count++;
      else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
              "truck"))
        truck_count++;
    }
  }
}

}
g_print ("Frame Number = %d Number of objects = %d "
"Car Count = %d Person Count = %d "
“Bicycle Count = %d Truck Count = %d \n”,
frame_number, num_rects, car_count, person_count, bicycle_count,
truck_count);
frame_number++;

return GST_PAD_PROBE_OK;
}

static gboolean
bus_call (GstBus * bus, GstMessage * msg, gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print (“End of stream\n”);
g_main_loop_quit (loop);
break;
case GST_MESSAGE_ERROR:
{
gchar *debug;
GError *error;
gst_message_parse_error (msg, &error, &debug);
g_printerr (“ERROR from element %s: %s\n”, GST_OBJECT_NAME (msg->src),
error->message);
g_free (debug);
g_printerr (“Error: %s\n”, error->message);
g_error_free (error);
g_main_loop_quit (loop);
break;
}
default:
break;
}
return TRUE;
}

int
main (int argc, char *argv)
{
GMainLoop *loop = NULL;
GstElement *pipeline = NULL, *source = NULL, *h264parser = NULL, *decoder =
NULL, *sink = NULL, *nvvidconv = NULL, *nvosd = NULL, *filter1 =
NULL, *filter2 = NULL, *yolo = NULL;
GstBus *bus = NULL;
guint bus_watch_id;
GstCaps *caps1 = NULL, *caps2 = NULL;
gulong osd_probe_id = 0;
GstPad *osd_sink_pad = NULL;

/* Check input arguments */
if (argc != 3) {
g_printerr (“Usage: %s \n”, argv[0]);
return -1;
}

/* Standard GStreamer initialization */
std::cout<<“before init”<<std::endl;
gst_init (&argc, &argv);
std::cout<<“after init”<<std::endl;
loop = g_main_loop_new (NULL, FALSE);
std::cout<<“1”<<std::endl;

/* Create gstreamer elements /
/
Create Pipeline element that will form a connection of other elements */
pipeline = gst_pipeline_new (“dstest1-pipeline”);
std::cout<<“2”<<std::endl;

/* Source element for reading from the file */
source = gst_element_factory_make (“filesrc”, “file-source”);
std::cout<<“3”<<std::endl;

/* Since the data format in the input file is elementary h264 stream,

  • we need a h264parser */
    h264parser = gst_element_factory_make (“h264parse”, “h264-parser”);
    std::cout<<“current state”<current_state<<std::endl;
    std::cout<<“4”<<std::endl;

/* Use nvdec_h264 for hardware accelerated decode on GPU */
decoder = gst_element_factory_make (“nvdec_h264”, “nvh264-decoder”);
std::cout<<“5”<<std::endl;

/* Use convertor to convert from NV12 to RGBA as required by nvosd and yolo plugins */
nvvidconv = gst_element_factory_make (“nvvidconv”, “nvvideo-converter”);
std::cout<<“6”<<std::endl;

/* Use yolo to run inference instead of pgie */
yolo = gst_element_factory_make (“nvyolo”, “yolo-inference-engine”);
//std::cout<<“start time::”<start_time<<std::endl;
std::cout<<“7”<<std::endl;

/* Create OSD to draw on the converted RGBA buffer */
nvosd = gst_element_factory_make (“nvosd”, “nv-onscreendisplay”);
std::cout<<“8”<<std::endl;

/* Finally render the osd output */
sink = gst_element_factory_make (“nveglglessink”, “nvvideo-renderer”);
std::cout<<“9”<<std::endl;

/* caps filter for nvvidconv to convert NV12 to RGBA as nvosd expects input

  • in RGBA format */
    filter1 = gst_element_factory_make (“capsfilter”, “filter1”);
    std::cout<<“10”<<std::endl;
    filter2 = gst_element_factory_make (“capsfilter”, “filter2”);
    std::cout<<“11”<<std::endl;

std::cout<<!pipeline<<std::endl;
std::cout<<!source<<std::endl;
std::cout<<!h264parser<<std::endl;
std::cout<<!decoder<<std::endl;
std::cout<<!filter1<<std::endl;
std::cout<<!nvvidconv<<std::endl;
std::cout<<!filter2<<std::endl;
std::cout<<!nvosd<<std::endl;
std::cout<<!sink<<std::endl;
std::cout<<!yolo<<std::endl;

if (!pipeline || !source || !h264parser || !decoder || !filter1 || !nvvidconv
|| !filter2 || !nvosd || !sink || !yolo)
{
g_printerr (“One element could not be created. Exiting.\n”);
return -1;
}

/* we set the input filename to the source element */
g_object_set (G_OBJECT (source), “location”, argv[1], NULL);
g_object_set(G_OBJECT(yolo), “config-file-path”, argv[2], NULL);

/* we set the osd properties here */
g_object_set (G_OBJECT (nvosd), “font-size”, 15, NULL);

/* we add a message handler */
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
bus_watch_id = gst_bus_add_watch (bus, bus_call, loop);
gst_object_unref (bus);

/* Set up the pipeline /
/
we add all elements into the pipeline */
gst_bin_add_many (GST_BIN (pipeline), source, h264parser, decoder, filter1,
nvvidconv, filter2, yolo, nvosd, sink, NULL);
caps1 = gst_caps_from_string (“video/x-raw(memory:NVMM), format=NV12”);
g_object_set (G_OBJECT (filter1), “caps”, caps1, NULL);
gst_caps_unref (caps1);
caps2 = gst_caps_from_string (“video/x-raw(memory:NVMM), format=RGBA”);
g_object_set (G_OBJECT (filter2), “caps”, caps2, NULL);
gst_caps_unref (caps2);

/* we link the elements together /
/
file-source → h264-parser → nvh264-decoder →

  • filter1 → nvvidconv → filter2 → yolo → nvosd → video-renderer */
    gst_element_link_many (source, h264parser, decoder, filter1, nvvidconv,
    filter2, yolo, nvosd, sink, NULL);

/* Lets add probe to get informed of the meta data generated, we add probe to

  • the sink pad of the osd element, since by that time, the buffer would have
  • had got all the metadata. */
    osd_sink_pad = gst_element_get_static_pad (nvosd, “sink”);
    if (!osd_sink_pad)
    g_print (“Unable to get sink pad\n”);
    else
    osd_probe_id = gst_pad_add_probe (osd_sink_pad, GST_PAD_PROBE_TYPE_BUFFER,
    osd_sink_pad_buffer_probe, NULL, NULL);

/* Set the pipeline to “playing” state */
g_print (“Now playing: %s\n”, argv[1]);
gst_element_set_state (pipeline, GST_STATE_PLAYING);

/* Wait till pipeline encounters an error or EOS */
g_print (“Running…\n”);
g_main_loop_run (loop);

/* Out of the main loop, clean up nicely */
g_print (“Returned, stopping playback\n”);
gst_element_set_state (pipeline, GST_STATE_NULL);
g_print (“Deleting pipeline\n”);
gst_object_unref (GST_OBJECT (pipeline));
g_source_remove (bus_watch_id);
g_main_loop_unref (loop);
return 0;
}

running command:
./deepstream-yolo /opt/nvidia/deepstream-plugins/video/sample_720p.h264 /opt/nvidia/deepstream-plugins/config/yolov3.txt

output:
before init
after init
1
2
3
current state1
4
5
6
7
8
9
10
11
0
0
0
0
0
0
0
0
0
1
One element could not be created. Exiting.


Yolo is not initializing … can you please confirm its not a bug ?

HI
Have you resolved this issue, you can do like this to check which element not created

if (!decoder)
{   
    g_printerr("decode could not be created. Exiting.\n");
    return -1;
}

if (!filter1)
{   
    g_printerr("filt1 could not be created. Exiting.\n");
    return -1;
}

similar like this, just one clip, please add all elements in this line
!pipeline || !source || !h264parser || !decoder || !filter1 || !nvvidconv || !filter2
|| !nvosd || !sink || !yolo

add them before this line: if (!pipeline || !source || !h264parser || !decoder || !filter1 || !nvvidconv
|| !filter2 || !nvosd || !sink || !yolo)
please make sure libraries needed like /path to ds package/usr/local/deepstream, TRT lib, CV lib, cudnn lib,
cuda lib, exported through export LD_LIBRARY_PATH=/path to the libs/, if you do not install them into system;
if you install into system, you do not necessarily do this.

@madhav.tidy Have you installed the yolo plugin before attempting to run the deepstream-yolo-app ?

Instructions are here [url]https://github.com/vat-nvidia/deepstream-plugins#setup[/url]

Hi,

I have a similar issue while running yolo-app. The issue was in the creation of sink. To circumvent that, I’m trying to write it to a file but see the following errors, please see below. Any feedback you could provide would be greatly appreciated!

I’m using tensorrt docker container (tensorrt:19.03-py3) and have installed deepstream3 sdk. I’ve a display and the xterm works from the container.

SNR

command: deepstream-yolo-app /garage/DeepStream_Release/samples/streams/sample_720p.h264 config/yolov2.txt

—output-----

(deepstream-yolo-app:375): GLib-GObject-CRITICAL **: g_object_set: assertion ‘G_IS_OBJECT (object)’ failed

(deepstream-yolo-app:375): GLib-GObject-CRITICAL **: g_object_set: assertion ‘G_IS_OBJECT (object)’ failed
Now playing: /garage/DeepStream_Release/samples/streams/sample_720p.h264
Loading pre-trained weights…

(deepstream-yolo-app:375): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion ‘IS_MUTABLE (structure)’ failed

(deepstream-yolo-app:375): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion ‘IS_MUTABLE (structure)’ failed
Frame Number = 0 Number of objects = 0 Car Count = 0 Person Count = 0 Bicycle Count = 0 Truck Count = 0
Loading complete!
Total Number of weights read : 50983561
layer inp_size out_size weightPtr
(1) conv-bn-leaky 3 x 608 x 608 32 x 608 x 608 992
(2) maxpool 32 x 608 x 608 32 x 304 x 304 992
(3) conv-bn-leaky 32 x 304 x 304 64 x 304 x 304 19680
(4) maxpool 64 x 304 x 304 64 x 152 x 152 19680
(5) conv-bn-leaky 64 x 152 x 152 128 x 152 x 152 93920
(6) conv-bn-leaky 128 x 152 x 152 64 x 152 x 152 102368
(7) conv-bn-leaky 64 x 152 x 152 128 x 152 x 152 176608
(8) maxpool 128 x 152 x 152 128 x 76 x 76 176608
(9) conv-bn-leaky 128 x 76 x 76 256 x 76 x 76 472544
(10) conv-bn-leaky 256 x 76 x 76 128 x 76 x 76 505824
(11) conv-bn-leaky 128 x 76 x 76 256 x 76 x 76 801760
(12) maxpool 256 x 76 x 76 256 x 38 x 38 801760
(13) conv-bn-leaky 256 x 38 x 38 512 x 38 x 38 1983456
(14) conv-bn-leaky 512 x 38 x 38 256 x 38 x 38 2115552
(15) conv-bn-leaky 256 x 38 x 38 512 x 38 x 38 3297248
(16) conv-bn-leaky 512 x 38 x 38 256 x 38 x 38 3429344
(17) conv-bn-leaky 256 x 38 x 38 512 x 38 x 38 4611040
(18) maxpool 512 x 38 x 38 512 x 19 x 19 4611040
(19) conv-bn-leaky 512 x 19 x 19 1024 x 19 x 19 9333728
(20) conv-bn-leaky 1024 x 19 x 19 512 x 19 x 19 9860064
(21) conv-bn-leaky 512 x 19 x 19 1024 x 19 x 19 14582752
(22) conv-bn-leaky 1024 x 19 x 19 512 x 19 x 19 15109088
(23) conv-bn-leaky 512 x 19 x 19 1024 x 19 x 19 19831776
(24) conv-bn-leaky 1024 x 19 x 19 1024 x 19 x 19 29273056
(25) conv-bn-leaky 1024 x 19 x 19 1024 x 19 x 19 38714336
(26) route - 512 x 38 x 38 38714336
(27) conv-bn-leaky 512 x 38 x 38 64 x 38 x 38 38747360
(28) reorg 64 x 38 x 38 256 x 19 x 19 38747360
(29) route - 1280 x 19 x 19 38747360
(30) conv-bn-leaky 1280 x 19 x 19 1024 x 19 x 19 50547936
(31) conv-linear 1024 x 19 x 19 425 x 19 x 19 50983561
(32) region 425 x 19 x 19 425 x 19 x 19 50983561
Anchors are being converted to network input resolution i.e. Anchors x 32 (stride)
Output blob names :
region_32
Using previously generated plan file located at data/yolov2-kFLOAT-kGPU-batch1.engine
Loading TRT Engine…
Loading Complete!
Running…
ERROR from element h264-parser: GStreamer encountered a general stream error.
Error: GStreamer encountered a general stream error.

Returned, stopping playback
Deleting pipeline

Hi,
Can you add GST_DEBUG=4 before the app and run again to get more log for analysis?

Thanks for the quick response! Please see below for the output after executing: GST_DEBUG=4 deepstream-yolo-app /garage/DeepStream_Release/samples/streams/sample_720p.h264 config/yolov2.txt

before init
0:00:00.000117736    73      0x191b600 INFO                GST_INIT gst.c:511:init_pre: Initializing GStreamer Core Library version 1.8.3
0:00:00.000233108    73      0x191b600 INFO                GST_INIT gst.c:512:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000269135    73      0x191b600 INFO                GST_INIT gst.c:523:init_pre: Linux cosmos 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64
0:00:00.000414277    73      0x191b600 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
0:00:00.000650776    73      0x191b600 INFO                GST_INIT gstcontext.c:83:_priv_gst_context_initialize: init contexts
0:00:00.000743401    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000807070    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000813647    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000825332    73      0x191b600 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /root/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.007759407    73      0x191b600 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /root/.cache/gstreamer-1.0/registry.x86_64.bin in 0.006925 seconds
0:00:00.007792144    73      0x191b600 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /root/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.008645975    73      0x191b600 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
0:00:00.008652837    73      0x191b600 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.008657243    73      0x191b600 INFO                GST_INIT gst.c:724:init_post: GLib runtime version: 2.48.2
0:00:00.008661860    73      0x191b600 INFO                GST_INIT gst.c:726:init_post: GLib headers version: 2.48.1
0:00:00.008665545    73      0x191b600 INFO                GST_INIT gst.c:727:init_post: initialized GStreamer successfully
after init
1
0:00:00.008689213    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "pipeline" named "dstest1-pipeline"
2
0:00:00.009059951    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so" loaded
0:00:00.009068446    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "filesrc" named "file-source"
0:00:00.009119409    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseSrc@0x1b00100> adding pad 'src'
3
0:00:00.009720603    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvideoparsersbad.so" loaded
0:00:00.009728501    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "h264parse" named "h264-parser"
0:00:00.009776365    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseParse@0x1b09670> adding pad 'sink'
0:00:00.009789402    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseParse@0x1b09670> adding pad 'src'
0:00:00.009809463    73      0x191b600 INFO               baseparse gstbaseparse.c:3942:gst_base_parse_set_pts_interpolation:<GstH264Parse@0x1b09670> PTS interpolation: no
current state1
4
0:00:00.011147246    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_videocodecs.so" loaded
0:00:00.011156828    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "nvdec_h264" named "nvh264-decoder"
0:00:00.011219322    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstVideoDecoder@0x1b13850> adding pad 'sink'
0:00:00.011230858    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstVideoDecoder@0x1b13850> adding pad 'src'
5
0:00:00.012378061    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_vidconv.so" loaded
0:00:00.012386749    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "nvvidconv" named "nvvideo-converter"
0:00:00.012448259    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1b7a510> adding pad 'sink'
0:00:00.012457726    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1b7a510> adding pad 'src'
6
0:00:00.042957137    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvyolo.so" loaded
0:00:00.042973039    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "nvyolo" named "yolo-inference-engine"
0:00:00.043031783    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e08ed0> adding pad 'sink'
0:00:00.043041578    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e08ed0> adding pad 'src'
7
0:00:00.044978707    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_osd.so" loaded
0:00:00.044987503    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "nvosd" named "nv-onscreendisplay"
0:00:00.045029038    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e1b960> adding pad 'sink'
0:00:00.045037658    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e1b960> adding pad 'src'
8
0:00:00.045049980    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "nvvidconv" named "nvvideo-converter1"
0:00:00.045061457    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e2a140> adding pad 'sink'
0:00:00.045070960    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e2a140> adding pad 'src'
0:00:00.045190573    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvideoconvert.so" loaded
0:00:00.045197733    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videoconvert" named "converter"
0:00:00.045313804    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e690d0> adding pad 'sink'
0:00:00.045322957    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e690d0> adding pad 'src'
0:00:00.045515139    73      0x191b600 INFO                 x264enc gstx264enc.c:2638:plugin_init: x264 build: 148
0:00:00.045533764    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstx264.so" loaded
0:00:00.045538825    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "x264enc" named "h264 encoder"
0:00:00.045656165    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstVideoEncoder@0x1e6f8f0> adding pad 'sink'
0:00:00.045666575    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstVideoEncoder@0x1e6f8f0> adding pad 'src'
0:00:00.046105109    73      0x191b600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstisomp4.so" loaded
0:00:00.046113534    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "qtmux" named "muxer"
0:00:00.046174449    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstQTMux@0x1e780f0> adding pad 'src'
0:00:00.046237489    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "filesink" named "filesink"
0:00:00.046284006    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseSink@0x1e7da10> adding pad 'sink'
9
0:00:00.046296794    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter1"
0:00:00.046333040    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e80130> adding pad 'sink'
0:00:00.046344847    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e80130> adding pad 'src'
10
0:00:00.046356747    73      0x191b600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter2"
0:00:00.046367033    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e80460> adding pad 'sink'
0:00:00.046376519    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseTransform@0x1e80460> adding pad 'src'
11
0
0
0
0
0
0
0
0
0
0
0:00:00.046413484    73      0x191b600 INFO                 filesrc gstfilesrc.c:262:gst_file_src_set_location: filename : /garage/DeepStream_Release/samples/streams/sample_720p.h264
0:00:00.046418775    73      0x191b600 INFO                 filesrc gstfilesrc.c:263:gst_file_src_set_location: uri      : file:///garage/DeepStream_Release/samples/streams/sample_720p.h264
0:00:00.046434648    73      0x191b600 INFO                filesink gstfilesink.c:301:gst_file_sink_set_location:<filesink> filename : out.mp4
0:00:00.046440863    73      0x191b600 INFO                filesink gstfilesink.c:302:gst_file_sink_set_location:<filesink> uri      : file:///garage/DeepStream_Release/sources/apps/sample_apps/deepstream_reference_apps/yolo/out.mp4
0:00:00.046491240    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.046503737    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event

(deepstream-yolo-app:73): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(deepstream-yolo-app:73): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
0:00:00.046549212    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element file-source:(any) to element h264-parser:(any)
0:00:00.046558371    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link file-source:src and h264-parser:sink
0:00:00.046570041    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<h264-parser:src> pad has no peer
0:00:00.046576688    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: file-source and h264-parser in same bin, no need for ghost pads
0:00:00.046587119    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link file-source:src and h264-parser:sink
0:00:00.046597781    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<h264-parser:src> pad has no peer
0:00:00.046607717    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked file-source:src and h264-parser:sink, successful
0:00:00.046614591    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.046620262    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<file-source:src> Received event on flushing pad. Discarding
0:00:00.046631116    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element h264-parser:(any) to element nvh264-decoder:(any)
0:00:00.046641026    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link h264-parser:src and nvh264-decoder:sink
0:00:00.046653804    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvh264-decoder:src> pad has no peer
0:00:00.046677813    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: h264-parser and nvh264-decoder in same bin, no need for ghost pads
0:00:00.046687611    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link h264-parser:src and nvh264-decoder:sink
0:00:00.046698347    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvh264-decoder:src> pad has no peer
0:00:00.046711749    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked h264-parser:src and nvh264-decoder:sink, successful
0:00:00.046716989    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.046722284    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<h264-parser:src> Received event on flushing pad. Discarding
0:00:00.046729669    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element nvh264-decoder:(any) to element filter1:(any)
0:00:00.046735470    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link nvh264-decoder:src and filter1:sink
0:00:00.046744105    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<filter1:src> pad has no peer
0:00:00.046752068    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: nvh264-decoder and filter1 in same bin, no need for ghost pads
0:00:00.046758499    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link nvh264-decoder:src and filter1:sink
0:00:00.046766958    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<filter1:src> pad has no peer
0:00:00.046772850    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked nvh264-decoder:src and filter1:sink, successful
0:00:00.046779725    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.046785636    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<nvh264-decoder:src> Received event on flushing pad. Discarding
0:00:00.046794292    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element filter1:(any) to element nvvideo-converter:(any)
0:00:00.046801468    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link filter1:src and nvvideo-converter:sink
0:00:00.046815866    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter:src> pad has no peer
0:00:00.046860006    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: filter1 and nvvideo-converter in same bin, no need for ghost pads
0:00:00.046867817    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link filter1:src and nvvideo-converter:sink
0:00:00.046884410    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter:src> pad has no peer
0:00:00.046924328    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked filter1:src and nvvideo-converter:sink, successful
0:00:00.046931113    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.046935064    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<filter1:src> Received event on flushing pad. Discarding
0:00:00.046941821    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element nvvideo-converter:(any) to element filter2:(any)
0:00:00.046950231    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link nvvideo-converter:src and filter2:sink
0:00:00.046985284    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<filter2:src> pad has no peer
0:00:00.046993100    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: nvvideo-converter and filter2 in same bin, no need for ghost pads
0:00:00.047000989    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link nvvideo-converter:src and filter2:sink
0:00:00.047042056    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<filter2:src> pad has no peer
0:00:00.047052695    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked nvvideo-converter:src and filter2:sink, successful
0:00:00.047060250    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.047065508    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<nvvideo-converter:src> Received event on flushing pad. Discarding
0:00:00.047071343    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element filter2:(any) to element nv-onscreendisplay:(any)
0:00:00.047079529    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link filter2:src and nv-onscreendisplay:sink
0:00:00.047120552    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nv-onscreendisplay:src> pad has no peer
0:00:00.047133280    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: filter2 and nv-onscreendisplay in same bin, no need for ghost pads
0:00:00.047140079    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link filter2:src and nv-onscreendisplay:sink
0:00:00.047188173    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nv-onscreendisplay:src> pad has no peer
0:00:00.047198177    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked filter2:src and nv-onscreendisplay:sink, successful
0:00:00.047203479    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.047207267    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<filter2:src> Received event on flushing pad. Discarding
0:00:00.047213057    73      0x191b600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element nv-onscreendisplay:(any) to element nvvideo-converter1:(any)
0:00:00.047220781    73      0x191b600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link nv-onscreendisplay:src and nvvideo-converter1:sink
0:00:00.047267695    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.047306395    73      0x191b600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: nv-onscreendisplay and nvvideo-converter1 in same bin, no need for ghost pads
0:00:00.047314479    73      0x191b600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link nv-onscreendisplay:src and nvvideo-converter1:sink
0:00:00.047354859    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.047390492    73      0x191b600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked nv-onscreendisplay:src and nvvideo-converter1:sink, successful
0:00:00.047396818    73      0x191b600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.047400489    73      0x191b600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<nv-onscreendisplay:src> Received event on flushing pad. Discarding
0:00:00.047407462    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad nv-onscreendisplay:sink
Now playing: /garage/DeepStream_Release/samples/streams/sample_720p.h264
0:00:00.047435771    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesink> current NULL pending VOID_PENDING, desired next READY
0:00:00.048006739    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filesink> completed state change to READY
0:00:00.048016210    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesink> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048034995    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filesink' changed state to 2(READY) successfully
0:00:00.048045667    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter1> current NULL pending VOID_PENDING, desired next READY
0:00:00.048053047    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter1> completed state change to READY
0:00:00.048058952    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter1> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048068154    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter1' changed state to 2(READY) successfully
0:00:00.048077423    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nv-onscreendisplay> current NULL pending VOID_PENDING, desired next READY
0:00:00.048085276    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nv-onscreendisplay> completed state change to READY
0:00:00.048091272    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nv-onscreendisplay> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048099707    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nv-onscreendisplay' changed state to 2(READY) successfully
0:00:00.048108329    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter2> current NULL pending VOID_PENDING, desired next READY
0:00:00.048116061    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter2> completed state change to READY
0:00:00.048121416    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter2> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048130246    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter2' changed state to 2(READY) successfully
0:00:00.048137910    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter> current NULL pending VOID_PENDING, desired next READY
0:00:00.048144956    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter> completed state change to READY
0:00:00.048151455    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048160136    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter' changed state to 2(READY) successfully
0:00:00.048168935    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter1> current NULL pending VOID_PENDING, desired next READY
0:00:00.048177099    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter1> completed state change to READY
0:00:00.048182504    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter1> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048191148    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter1' changed state to 2(READY) successfully
0:00:00.048199870    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvh264-decoder> current NULL pending VOID_PENDING, desired next READY
0:00:00.048207898    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvh264-decoder> completed state change to READY
0:00:00.048212997    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvh264-decoder> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048224051    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvh264-decoder' changed state to 2(READY) successfully
0:00:00.048233426    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<h264-parser> current NULL pending VOID_PENDING, desired next READY
0:00:00.048241562    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<h264-parser> completed state change to READY
0:00:00.048249136    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<h264-parser> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048258772    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'h264-parser' changed state to 2(READY) successfully
0:00:00.048268536    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<file-source> current NULL pending VOID_PENDING, desired next READY
0:00:00.048276089    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<file-source> completed state change to READY
0:00:00.048282070    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<file-source> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048291023    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'file-source' changed state to 2(READY) successfully
0:00:00.048299678    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<yolo-inference-engine> current NULL pending VOID_PENDING, desired next READY
0:00:00.048307203    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<yolo-inference-engine> completed state change to READY
0:00:00.048312530    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<yolo-inference-engine> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.048321121    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'yolo-inference-engine' changed state to 2(READY) successfully
0:00:00.048331650    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<dstest1-pipeline> committing state from NULL to READY, pending PLAYING, next PAUSED
0:00:00.048337268    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<dstest1-pipeline> notifying about state-changed NULL to READY (PLAYING pending)
0:00:00.048343740    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<dstest1-pipeline> continue state change READY to PAUSED, final PLAYING
0:00:00.048357840    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesink> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.048370804    73      0x191b600 INFO              GST_STATES gstbin.c:2770:gst_bin_change_state_func:<dstest1-pipeline> child 'filesink' is changing state asynchronously to PAUSED
0:00:00.048378809    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter1> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271404717    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter1> completed state change to PAUSED
0:00:00.271421596    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter1> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271439536    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter1' changed state to 3(PAUSED) successfully
0:00:00.271454666    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nv-onscreendisplay> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271468510    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nv-onscreendisplay> completed state change to PAUSED
0:00:00.271474729    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nv-onscreendisplay> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271484286    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nv-onscreendisplay' changed state to 3(PAUSED) successfully
0:00:00.271492668    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter2> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271501627    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter2> completed state change to PAUSED
0:00:00.271507500    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter2> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271515908    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter2' changed state to 3(PAUSED) successfully
0:00:00.271521727    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271566536    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter> completed state change to PAUSED
0:00:00.271573896    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271585553    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter' changed state to 3(PAUSED) successfully
0:00:00.271592682    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter1> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271601959    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter1> completed state change to PAUSED
0:00:00.271608508    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter1> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271617642    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter1' changed state to 3(PAUSED) successfully
0:00:00.271625185    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvh264-decoder> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271635590    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvh264-decoder> completed state change to PAUSED
0:00:00.271641506    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvh264-decoder> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271650466    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvh264-decoder' changed state to 3(PAUSED) successfully
0:00:00.271658888    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<h264-parser> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271717647    73      0x191b600 INFO                 filesrc gstfilesrc.c:465:gst_file_src_start:<file-source> opening file /garage/DeepStream_Release/samples/streams/sample_720p.h264
0:00:00.271741389    73      0x191b600 WARN                 basesrc gstbasesrc.c:3489:gst_base_src_start_complete:<file-source> pad not activated yet
0:00:00.271758241    73      0x191b600 INFO                 filesrc gstfilesrc.c:465:gst_file_src_start:<file-source> opening file /garage/DeepStream_Release/samples/streams/sample_720p.h264
0:00:00.271862092    73      0x191b600 INFO               GST_EVENT gstevent.c:760:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:00.271882611    73      0x191b600 INFO                    task gsttask.c:451:gst_task_set_lock: setting stream lock 0x1b02320 on task 0x8641050
0:00:00.271890011    73      0x191b600 INFO                GST_PADS gstpad.c:5980:gst_pad_start_task:<h264-parser:sink> created task 0x8641050
0:00:00.271928860    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<h264-parser> completed state change to PAUSED
0:00:00.271935166    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<h264-parser> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271944964    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'h264-parser' changed state to 3(PAUSED) successfully
0:00:00.271953999    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<file-source> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.271964539    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<file-source> completed state change to PAUSED
0:00:00.271969684    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<file-source> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.271963518    73      0x1e83770 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad h264-parser:sink
0:00:00.272001950    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'file-source' changed state to 3(PAUSED) successfully
0:00:00.272010073    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<yolo-inference-engine> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.272020226    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<yolo-inference-engine:sink> pad has no peer
0:00:00.272025540    73      0x191b600 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<yolo-inference-engine:src> pad has no peer
0:00:00.272135769    73      0x1e83770 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
Loading pre-trained weights...
0:00:00.272278438    73      0x1e83770 INFO               h264parse gsth264parse.c:1736:gst_h264_parse_update_src_caps:<h264-parser> resolution changed 1280x720
0:00:00.272350965    73      0x1e83770 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.272422487    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-h264, width=(int)1280, height=(int)720, framerate=(fraction)0/1, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, level=(string)3.1
0:00:00.272489248    73      0x1e83770 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.272970100    73      0x1e83770 INFO            videodecoder gstvideodecoder.c:1334:gst_video_decoder_sink_event_default:<nvh264-decoder> upstream tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", bitrate=(uint)11600880;
0:00:00.281146132    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)0/1
0:00:00.281196489    73      0x1e83770 INFO           basetransform gstbasetransform.c:1367:gst_base_transform_setcaps:<filter1> reuse caps
0:00:00.281202867    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)0/1
0:00:00.281271393    73      0x1e83770 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.281346338    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1280, height=(int)720, framerate=(fraction)0/1
0:00:00.281369436    73      0x1e83770 INFO           basetransform gstbasetransform.c:1367:gst_base_transform_setcaps:<filter2> reuse caps
0:00:00.281375189    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1280, height=(int)720, framerate=(fraction)0/1
0:00:00.281391616    73      0x1e83770 INFO           basetransform gstbasetransform.c:1367:gst_base_transform_setcaps:<nv-onscreendisplay> reuse caps
0:00:00.282216889    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1280, height=(int)720, framerate=(fraction)0/1

(deepstream-yolo-app:73): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed

(deepstream-yolo-app:73): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed
0:00:00.282297640    73      0x1e83770 INFO           basetransform gstbasetransform.c:1367:gst_base_transform_setcaps:<nvvideo-converter1> reuse caps
0:00:00.282312056    73      0x1e83770 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1280, height=(int)720, framerate=(fraction)0/1
0:00:00.282329928    73      0x1e83770 INFO                GST_PADS gstpad.c:4098:gst_pad_peer_query:<nvvideo-converter1:src> pad has no peer
0:00:00.282407174    73      0x1e83770 WARN               structure gststructure.c:1935:priv_gst_structure_append_to_gstring: No value transform to serialize field 'device' of type 'gpointer'
0:00:00.282414104    73      0x1e83770 WARN               structure gststructure.c:1935:priv_gst_structure_append_to_gstring: No value transform to serialize field 'name' of type 'gpointer'
0:00:00.282400860    73      0x1e83770 INFO               structure gststructure.c:3049:gst_structure_get_valist: Expected field 'free-func' in structure: buf-pool/config0, width=(uint)1280, height=(uint)720, max-buffers=(uint)4, num-batched-buffers=(uint)1, gpu_id=(uint)0, size=(uint)3686400, memtype=(uint)1, device=(gpointer)NULL, name=(gpointer)NULL;
Frame Number = 0 Number of objects = 0 Car Count = 0 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
0:00:00.284314336    73      0x1e83770 WARN               baseparse gstbaseparse.c:3599:gst_base_parse_loop:<h264-parser> error: streaming stopped, reason not-linked
0:00:00.284336496    73      0x1e83770 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<h264-parser> posting message: GStreamer encountered a general stream error.
0:00:00.284354851    73      0x1e83770 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<h264-parser> posted error message: GStreamer encountered a general stream error.
0:00:00.284381096    73      0x1e83770 INFO                    task gsttask.c:316:gst_task_func:<h264-parser:sink> Task going to paused
Loading complete!
Total Number of weights read : 50983561
      layer               inp_size            out_size       weightPtr
(1)   conv-bn-leaky     3 x 608 x 608      32 x 608 x 608    992   
(2)   maxpool          32 x 608 x 608      32 x 304 x 304    992   
(3)   conv-bn-leaky    32 x 304 x 304      64 x 304 x 304    19680 
(4)   maxpool          64 x 304 x 304      64 x 152 x 152    19680 
(5)   conv-bn-leaky    64 x 152 x 152     128 x 152 x 152    93920 
(6)   conv-bn-leaky   128 x 152 x 152      64 x 152 x 152    102368
(7)   conv-bn-leaky    64 x 152 x 152     128 x 152 x 152    176608
(8)   maxpool         128 x 152 x 152     128 x  76 x  76    176608
(9)   conv-bn-leaky   128 x  76 x  76     256 x  76 x  76    472544
(10)  conv-bn-leaky   256 x  76 x  76     128 x  76 x  76    505824
(11)  conv-bn-leaky   128 x  76 x  76     256 x  76 x  76    801760
(12)  maxpool         256 x  76 x  76     256 x  38 x  38    801760
(13)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    1983456
(14)  conv-bn-leaky   512 x  38 x  38     256 x  38 x  38    2115552
(15)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    3297248
(16)  conv-bn-leaky   512 x  38 x  38     256 x  38 x  38    3429344
(17)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    4611040
(18)  maxpool         512 x  38 x  38     512 x  19 x  19    4611040
(19)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    9333728
(20)  conv-bn-leaky  1024 x  19 x  19     512 x  19 x  19    9860064
(21)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    14582752
(22)  conv-bn-leaky  1024 x  19 x  19     512 x  19 x  19    15109088
(23)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    19831776
(24)  conv-bn-leaky  1024 x  19 x  19    1024 x  19 x  19    29273056
(25)  conv-bn-leaky  1024 x  19 x  19    1024 x  19 x  19    38714336
(26)  route                  -            512 x  38 x  38    38714336
(27)  conv-bn-leaky   512 x  38 x  38      64 x  38 x  38    38747360
(28)  reorg            64 x  38 x  38     256 x  19 x  19    38747360
(29)  route                  -           1280 x  19 x  19    38747360
(30)  conv-bn-leaky  1280 x  19 x  19    1024 x  19 x  19    50547936
(31)  conv-linear    1024 x  19 x  19     425 x  19 x  19    50983561
(32)  region          425 x  19 x  19     425 x  19 x  19    50983561
Anchors are being converted to network input resolution i.e. Anchors x 32 (stride)
Output blob names :
region_32
Using previously generated plan file located at data/yolov2-kFLOAT-kGPU-batch1.engine
Loading TRT Engine...
Loading Complete!
0:00:02.714629816    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<yolo-inference-engine> completed state change to PAUSED
0:00:02.714646524    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<yolo-inference-engine> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:02.714658841    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'yolo-inference-engine' changed state to 3(PAUSED) successfully
Running...
ERROR from element h264-parser: GStreamer encountered a general stream error.
Error: GStreamer encountered a general stream error.
Returned, stopping playback
0:00:02.714765860    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesink> current READY pending PAUSED, desired next NULL
0:00:02.714779271    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<filesink> committing state from READY to READY, pending NULL, next NULL
0:00:02.714785015    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesink> notifying about state-changed READY to READY (NULL pending)
0:00:02.714790256    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<filesink> continue state change READY to NULL, final NULL
0:00:02.714799071    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filesink> completed state change to NULL
0:00:02.714802842    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesink> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.714807814    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filesink' changed state to 1(NULL) successfully
0:00:02.714813225    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter1> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.714841574    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<nvvideo-converter1> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.714849578    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter1> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.714856898    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<nvvideo-converter1> continue state change READY to NULL, final NULL
0:00:02.714863950    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter1> completed state change to NULL
0:00:02.714868390    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter1> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.714875388    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter1' changed state to 1(NULL) successfully
0:00:02.714883444    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nv-onscreendisplay> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.715388201    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<nv-onscreendisplay> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.715396978    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nv-onscreendisplay> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.715403356    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<nv-onscreendisplay> continue state change READY to NULL, final NULL
0:00:02.715408871    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nv-onscreendisplay> completed state change to NULL
0:00:02.715412825    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nv-onscreendisplay> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.715418744    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nv-onscreendisplay' changed state to 1(NULL) successfully
0:00:02.715427402    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter2> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.715440257    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<filter2> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.715448453    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter2> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.715457906    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<filter2> continue state change READY to NULL, final NULL
0:00:02.715465006    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter2> completed state change to NULL
0:00:02.715470977    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter2> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.715479728    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter2' changed state to 1(NULL) successfully
0:00:02.715488099    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvvideo-converter> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.716087735    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<nvvideo-converter> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.716096429    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.716102941    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<nvvideo-converter> continue state change READY to NULL, final NULL
0:00:02.716110952    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvvideo-converter> completed state change to NULL
0:00:02.716117046    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvvideo-converter> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.716125470    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvvideo-converter' changed state to 1(NULL) successfully
0:00:02.716134520    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filter1> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.716148322    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<filter1> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.716155917    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter1> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.716164514    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<filter1> continue state change READY to NULL, final NULL
0:00:02.716171420    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filter1> completed state change to NULL
0:00:02.716175896    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filter1> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.716185058    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'filter1' changed state to 1(NULL) successfully
0:00:02.716193697    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<nvh264-decoder> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.721946796    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<nvh264-decoder> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.721958525    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvh264-decoder> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.721965308    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<nvh264-decoder> continue state change READY to NULL, final NULL
0:00:02.721971287    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<nvh264-decoder> completed state change to NULL
0:00:02.721975403    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<nvh264-decoder> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.721983320    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'nvh264-decoder' changed state to 1(NULL) successfully
0:00:02.721992777    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<h264-parser> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.722045173    73      0x1e83770 INFO                    task gsttask.c:318:gst_task_func:<h264-parser:sink> Task resume from paused
0:00:02.722069518    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<h264-parser> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.722076680    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<h264-parser> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.722082895    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<h264-parser> continue state change READY to NULL, final NULL
0:00:02.722089725    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<h264-parser> completed state change to NULL
0:00:02.722094340    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<h264-parser> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.722100729    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'h264-parser' changed state to 1(NULL) successfully
0:00:02.722105941    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<file-source> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.722111663    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<file-source> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.722117963    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<file-source> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.722125207    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<file-source> continue state change READY to NULL, final NULL
0:00:02.722131702    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<file-source> completed state change to NULL
0:00:02.722135089    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<file-source> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.722140106    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'file-source' changed state to 1(NULL) successfully
0:00:02.722145052    73      0x191b600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<yolo-inference-engine> current PAUSED pending VOID_PENDING, desired next NULL
0:00:02.732721476    73      0x191b600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<yolo-inference-engine> committing state from PAUSED to READY, pending NULL, next NULL
0:00:02.732735349    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<yolo-inference-engine> notifying about state-changed PAUSED to READY (NULL pending)
0:00:02.732742904    73      0x191b600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<yolo-inference-engine> continue state change READY to NULL, final NULL
0:00:02.732748975    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<yolo-inference-engine> completed state change to NULL
0:00:02.732752386    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<yolo-inference-engine> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:02.732758341    73      0x191b600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<dstest1-pipeline> child 'yolo-inference-engine' changed state to 1(NULL) successfully
0:00:02.732789422    73      0x191b600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<dstest1-pipeline> completed state change to NULL
0:00:02.732794688    73      0x191b600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<dstest1-pipeline> notifying about state-changed READY to NULL (VOID_PENDING pending)
Deleting pipeline
0:00:02.732820176    73      0x191b600 INFO           GST_PARENTAGE gstbin.c:1630:gst_bin_remove_func:<dstest1-pipeline> removed child "filesink"
0:00:02.732830914    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:2947:gst_element_dispose:<filesink> dispose
0:00:02.732836853    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:776:gst_element_remove_pad:<filesink> removing pad 'sink'
0:00:02.732847471    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:2992:gst_element_dispose:<filesink> parent class dispose
0:00:02.732854626    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:3023:gst_element_finalize:<filesink> finalize
0:00:02.732860088    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:3028:gst_element_finalize:<filesink> finalize parent
0:00:02.732867854    73      0x191b600 INFO        GST_ELEMENT_PADS gstpad.c:2071:gst_pad_unlink: unlinking nv-onscreendisplay:src(0x1b036f0) and nvvideo-converter1:sink(0x1b03930)
0:00:02.732879842    73      0x191b600 INFO        GST_ELEMENT_PADS gstpad.c:2125:gst_pad_unlink: unlinked nv-onscreendisplay:src and nvvideo-converter1:sink
0:00:02.732891009    73      0x191b600 INFO           GST_PARENTAGE gstbin.c:1630:gst_bin_remove_func:<dstest1-pipeline> removed child "nvvideo-converter1"
0:00:02.732899512    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:2947:gst_element_dispose:<nvvideo-converter1> dispose
0:00:02.732905204    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:776:gst_element_remove_pad:<nvvideo-converter1> removing pad 'sink'
0:00:02.732913072    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:776:gst_element_remove_pad:<nvvideo-converter1> removing pad 'src'
0:00:02.732919967    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:2992:gst_element_dispose:<nvvideo-converter1> parent class dispose
0:00:02.732926881    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:3023:gst_element_finalize:<nvvideo-converter1> finalize
0:00:02.732933396    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:3028:gst_element_finalize:<nvvideo-converter1> finalize parent
0:00:02.732941918    73      0x191b600 INFO        GST_ELEMENT_PADS gstpad.c:2071:gst_pad_unlink: unlinking filter2:src(0x1e61270) and nv-onscreendisplay:sink(0x1b034b0)
0:00:02.732952375    73      0x191b600 INFO        GST_ELEMENT_PADS gstpad.c:2125:gst_pad_unlink: unlinked filter2:src and nv-onscreendisplay:sink
0:00:02.732959392    73      0x191b600 INFO           GST_PARENTAGE gstbin.c:1630:gst_bin_remove_func:<dstest1-pipeline> removed child "nv-onscreendisplay"
0:00:02.732963861    73      0x191b600 INFO         GST_REFCOUNTING gstelement.c:2947:gst_element_dispose:<nv-onscreendisplay> dispose
0:00:02.732968498    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:776:gst_element_remove_pad:<nv-onscreendisplay> removing pad 'sink'
0:00:02.732975942    73      0x191b600 INFO        GST_ELEMENT_PADS gstelement.c:776:gst_element_remove_pad:<nv-onscreendisplay> removing pad 'src'
0:00:02.73

Hi,
You should make some changes, right? Can you send one patch for the modification you made?

Please see below. Thank you!

/**
MIT License

Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
*/

#include <iostream>
#include <glib.h>
#include <gst/gst.h>

#include "gstnvdsmeta.h"

/* As defined in the yolo plugins header*/

#define YOLO_UNIQUE_ID 15

gint frame_number = 0;

/* osd_sink_pad_buffer_probe will extract metadata received on OSD sink pad
* and get a count of objects of interest */

static GstPadProbeReturn
osd_sink_pad_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{

GstMeta *gst_meta = NULL;
NvDsMeta *nvdsmeta = NULL;
gpointer state = NULL;
static GQuark _nvdsmeta_quark = 0;
GstBuffer *buf = (GstBuffer *) info->data;
NvDsFrameMeta *frame_meta = NULL;
guint num_rects = 0, rect_index = 0;
NvDsObjectParams *obj_meta = NULL;
guint car_count = 0;
guint person_count = 0;
guint bicycle_count = 0;
guint truck_count = 0;

if (!_nvdsmeta_quark)
_nvdsmeta_quark = g_quark_from_static_string (NVDS_META_STRING);

while ((gst_meta = gst_buffer_iterate_meta (buf, &state))) {
if (gst_meta_api_type_has_tag (gst_meta->info->api, _nvdsmeta_quark)) {

nvdsmeta = (NvDsMeta *) gst_meta;

/* We are interested only in intercepting Meta of type
* "NVDS_META_FRAME_INFO" as they are from our infer elements. */
if (nvdsmeta->meta_type == NVDS_META_FRAME_INFO) {
frame_meta = (NvDsFrameMeta *) nvdsmeta->meta_data;
if (frame_meta == NULL) {
g_print ("NvDS Meta contained NULL meta \n");
return GST_PAD_PROBE_OK;
}

num_rects = frame_meta->num_rects;

/* This means we have num_rects in frame_meta->obj_params.
* Now lets iterate through them and count the number of cars,
* trucks, persons and bicycles in each frame */

for (rect_index = 0; rect_index < num_rects; rect_index++) {
obj_meta = (NvDsObjectParams *) & frame_meta->obj_params[rect_index];
if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"car"))
car_count++;
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"person"))
person_count++;
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"bicycle"))
bicycle_count++;
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"truck"))
truck_count++;
}
}
}
}
g_print ("Frame Number = %d Number of objects = %d "
"Car Count = %d Person Count = %d "
"Bicycle Count = %d Truck Count = %d \n",
frame_number, num_rects, car_count, person_count, bicycle_count,
truck_count);
frame_number++;

return GST_PAD_PROBE_OK;
}

static gboolean
bus_call (GstBus * bus, GstMessage * msg, gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print ("End of stream\n");
g_main_loop_quit (loop);
break;
case GST_MESSAGE_ERROR:
{
gchar *debug;
GError *error;
gst_message_parse_error (msg, &error, &debug);
g_printerr ("ERROR from element %s: %s\n", GST_OBJECT_NAME (msg->src),
error->message);
g_free (debug);
g_printerr ("Error: %s\n", error->message);
g_error_free (error);
g_main_loop_quit (loop);
break;
}
default:
break;
}
return TRUE;
}

int
main (int argc, char *argv[])
{
GMainLoop *loop = NULL;
GstElement *pipeline = NULL, *source = NULL, *h264parser = NULL, *decoder =
NULL, *sink = NULL, *nvvidconv = NULL, *nvosd = NULL, *filter1 =
NULL, *filter2 = NULL, *yolo = NULL;
GstBus *bus = NULL;
guint bus_watch_id;
GstCaps *caps1 = NULL, *caps2 = NULL;
gulong osd_probe_id = 0;
GstPad *osd_sink_pad = NULL;
GstElement *nvvidconv1 = NULL,
             *filter3 = NULL,
             *videoconvert = NULL,
             *filter4 = NULL,
             *x264enc = NULL,
             *qtmux = NULL;
  GstCaps *caps3 = NULL, *caps4 = NULL;

/* Check input arguments */
if (argc != 3) {
g_printerr ("Usage: %s <H264 filename> <yolo-plugin config file> \n", argv[0]);
return -1;
}

/* Standard GStreamer initialization */
std::cout<<"before init"<<std::endl;
gst_init (&argc, &argv);
std::cout<<"after init"<<std::endl;
loop = g_main_loop_new (NULL, FALSE);
std::cout<<"1"<<std::endl;

/* Create gstreamer elements */
/* Create Pipeline element that will form a connection of other elements */
pipeline = gst_pipeline_new ("dstest1-pipeline");
std::cout<<"2"<<std::endl;

/* Source element for reading from the file */
source = gst_element_factory_make ("filesrc", "file-source");
std::cout<<"3"<<std::endl;

/* Since the data format in the input file is elementary h264 stream,
* we need a h264parser */
h264parser = gst_element_factory_make ("h264parse", "h264-parser");
std::cout<<"current state"<<h264parser->current_state<<std::endl;
std::cout<<"4"<<std::endl;

/* Use nvdec_h264 for hardware accelerated decode on GPU */
decoder = gst_element_factory_make ("nvdec_h264", "nvh264-decoder");
std::cout<<"5"<<std::endl;

/* Use convertor to convert from NV12 to RGBA as required by nvosd and yolo plugins */
nvvidconv = gst_element_factory_make ("nvvidconv", "nvvideo-converter");
std::cout<<"6"<<std::endl;

/* Use yolo to run inference instead of pgie */
yolo = gst_element_factory_make ("nvyolo", "yolo-inference-engine");
//std::cout<<"start time::"<<yolo->start_time<<std::endl;
std::cout<<"7"<<std::endl;

/* Create OSD to draw on the converted RGBA buffer */
nvosd = gst_element_factory_make ("nvosd", "nv-onscreendisplay");
std::cout<<"8"<<std::endl;

/* Finally render the osd output */
nvvidconv1 = gst_element_factory_make ("nvvidconv", "nvvideo-converter1");
videoconvert = gst_element_factory_make ("videoconvert", "converter");
x264enc = gst_element_factory_make ("x264enc", "h264 encoder");
qtmux = gst_element_factory_make ("qtmux", "muxer");
sink = gst_element_factory_make ("filesink", "filesink");
//sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
std::cout<<"9"<<std::endl;

/* caps filter for nvvidconv to convert NV12 to RGBA as nvosd expects input
* in RGBA format */
filter1 = gst_element_factory_make ("capsfilter", "filter1");
std::cout<<"10"<<std::endl;
filter2 = gst_element_factory_make ("capsfilter", "filter2");
std::cout<<"11"<<std::endl;

std::cout<<!pipeline<<std::endl;
std::cout<<!source<<std::endl;
std::cout<<!h264parser<<std::endl;
std::cout<<!decoder<<std::endl;
std::cout<<!filter1<<std::endl;
std::cout<<!nvvidconv<<std::endl;
std::cout<<!filter2<<std::endl;
std::cout<<!nvosd<<std::endl;
std::cout<<!sink<<std::endl;
std::cout<<!yolo<<std::endl;

if (!decoder)
{
g_printerr("decode could not be created. Exiting.\n");
return -1;
}

if (!filter1)
{
g_printerr("filt1 could not be created. Exiting.\n");
return -1;
}

if (!pipeline)
{
g_printerr("pipeline could not be created. Exiting.\n");
return -1;
}

if (!source)
{
g_printerr("source could not be created. Exiting.\n");
return -1;
}


if (!h264parser)
{
g_printerr("h264parser could not be created. Exiting.\n");
return -1;
}


if (!decoder)
{
g_printerr("decoder could not be created. Exiting.\n");
return -1;
}


if (!nvvidconv)
{
g_printerr("nvvidconv could not be created. Exiting.\n");
return -1;
}

if (!filter2)
{
g_printerr("filter2 could not be created. Exiting.\n");
return -1;
}

if (!nvosd)
{
g_printerr("nvosd could not be created. Exiting.\n");
return -1;
}

if (!sink)
{
g_printerr("sink could not be created. Exiting.\n");
return -1;
}

if (!yolo)
{
g_printerr("yolo could not be created. Exiting.\n");
return -1;
}



if (!pipeline || !source || !h264parser || !decoder || !filter1 || !nvvidconv
|| !filter2 || !nvosd || !sink || !yolo)
{
g_printerr ("One element could not be created. Exiting.\n");
return -1;
}

/* we set the input filename to the source element */
g_object_set (G_OBJECT (source), "location", argv[1], NULL);
g_object_set (G_OBJECT (sink), "location", "out.mp4", NULL);
g_object_set(G_OBJECT(yolo), "config-file-path", argv[2], NULL);

/* we set the osd properties here */
g_object_set (G_OBJECT (nvosd), "font-size", 15, NULL);

/* we add a message handler */
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
bus_watch_id = gst_bus_add_watch (bus, bus_call, loop);
gst_object_unref (bus);

/* Set up the pipeline */
/* we add all elements into the pipeline */
gst_bin_add_many (GST_BIN (pipeline), source, h264parser, decoder, filter1,
nvvidconv, filter2, yolo, nvosd, nvvidconv1, sink, filter3,videoconvert, filter4, x264enc, qtmux, NULL);
caps1 = gst_caps_from_string ("video/x-raw(memory:NVMM), format=NV12");
g_object_set (G_OBJECT (filter1), "caps", caps1, NULL);
gst_caps_unref (caps1);
caps2 = gst_caps_from_string ("video/x-raw(memory:NVMM), format=RGBA");
g_object_set (G_OBJECT (filter2), "caps", caps2, NULL);
gst_caps_unref (caps2);
caps3 = gst_caps_from_string ("video/x-raw, format=RGBA");
g_object_set (G_OBJECT (filter3), "caps", caps3, NULL);
gst_caps_unref (caps3);
caps4 = gst_caps_from_string ("video/x-raw, format=NV12");
g_object_set (G_OBJECT (filter4), "caps", caps4, NULL);
gst_caps_unref (caps4);

/* we link the elements together */
/* file-source -> h264-parser -> nvh264-decoder ->
* filter1 -> nvvidconv -> filter2 -> yolo -> nvosd -> video-renderer */
gst_element_link_many (source, h264parser, decoder, filter1,nvvidconv, filter2, nvosd, nvvidconv1, filter3,
  videoconvert, filter4, x264enc, qtmux, sink, NULL);

/* Lets add probe to get informed of the meta data generated, we add probe to
* the sink pad of the osd element, since by that time, the buffer would have
* had got all the metadata. */
osd_sink_pad = gst_element_get_static_pad (nvosd, "sink");
if (!osd_sink_pad)
g_print ("Unable to get sink pad\n");
else
osd_probe_id = gst_pad_add_probe (osd_sink_pad, GST_PAD_PROBE_TYPE_BUFFER,
osd_sink_pad_buffer_probe, NULL, NULL);

/* Set the pipeline to "playing" state */
g_print ("Now playing: %s\n", argv[1]);
gst_element_set_state (pipeline, GST_STATE_PLAYING);

/* Wait till pipeline encounters an error or EOS */
g_print ("Running...\n");
g_main_loop_run (loop);

/* Out of the main loop, clean up nicely */
g_print ("Returned, stopping playback\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
g_print ("Deleting pipeline\n");
gst_object_unref (GST_OBJECT (pipeline));
g_source_remove (bus_watch_id);
g_main_loop_unref (loop);
return 0;
}

Hi,
Can you point where you changed or generate one patch? the format gone, hard to compare with original

Hi, Please see below for the code changes (key blocks) tracked between // SNR begin, code block, // SNR end.

/**
MIT License

Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*
*/

#include <iostream>
#include <glib.h>
#include <gst/gst.h>

#include "gstnvdsmeta.h"

/* As defined in the yolo plugins header*/

#define YOLO_UNIQUE_ID 15

gint frame_number = 0;

/* osd_sink_pad_buffer_probe will extract metadata received on OSD sink pad
* and get a count of objects of interest */

static GstPadProbeReturn
osd_sink_pad_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{

    GstMeta *gst_meta = NULL;
    NvDsMeta *nvdsmeta = NULL;
    gpointer state = NULL;
    static GQuark _nvdsmeta_quark = 0;
    GstBuffer *buf = (GstBuffer *) info->data;
    NvDsFrameMeta *frame_meta = NULL;
    guint num_rects = 0, rect_index = 0;
    NvDsObjectParams *obj_meta = NULL;
    guint car_count = 0;
    guint person_count = 0;
    guint bicycle_count = 0;
    guint truck_count = 0;

    if (!_nvdsmeta_quark)
        _nvdsmeta_quark = g_quark_from_static_string (NVDS_META_STRING);

    while ((gst_meta = gst_buffer_iterate_meta (buf, &state))) {
        if (gst_meta_api_type_has_tag (gst_meta->info->api, _nvdsmeta_quark)) {

            nvdsmeta = (NvDsMeta *) gst_meta;

            /* We are interested only in intercepting Meta of type
            * "NVDS_META_FRAME_INFO" as they are from our infer elements. */
            if (nvdsmeta->meta_type == NVDS_META_FRAME_INFO) {
                frame_meta = (NvDsFrameMeta *) nvdsmeta->meta_data;
                if (frame_meta == NULL) {
                    g_print ("NvDS Meta contained NULL meta \n");
                    return GST_PAD_PROBE_OK;
                }

                num_rects = frame_meta->num_rects;

                /* This means we have num_rects in frame_meta->obj_params.
                * Now lets iterate through them and count the number of cars,
                * trucks, persons and bicycles in each frame */

                for (rect_index = 0; rect_index < num_rects; rect_index++) {
                    obj_meta = (NvDsObjectParams *) & frame_meta->obj_params[rect_index];
                    if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
                    "car"))
                    car_count++;
                    else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
                    "person"))
                    person_count++;
                    else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
                    "bicycle"))
                    bicycle_count++;
                    else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
                    "truck"))
                    truck_count++;
                }
            }
        }
    }
    g_print ("Frame Number = %d Number of objects = %d "
    "Car Count = %d Person Count = %d "
    "Bicycle Count = %d Truck Count = %d \n",
    frame_number, num_rects, car_count, person_count, bicycle_count,
    truck_count);
    frame_number++;

    return GST_PAD_PROBE_OK;
}

static gboolean
bus_call (GstBus * bus, GstMessage * msg, gpointer data)
{
    GMainLoop *loop = (GMainLoop *) data;
    switch (GST_MESSAGE_TYPE (msg)) {
        case GST_MESSAGE_EOS:
            g_print ("End of stream\n");
            g_main_loop_quit (loop);
            break;
        case GST_MESSAGE_ERROR:
        {
            gchar *debug;
            GError *error;
            gst_message_parse_error (msg, &error, &debug);
            g_printerr ("ERROR from element %s: %s\n", GST_OBJECT_NAME (msg->src),
            error->message);
            g_free (debug);
            g_printerr ("Error: %s\n", error->message);
            g_error_free (error);
            g_main_loop_quit (loop);
            break;
        }
        default:
            break;
    }
    return TRUE;
}

int
main (int argc, char *argv[])
{
    GMainLoop *loop = NULL;
    GstElement *pipeline = NULL, *source = NULL, *h264parser = NULL, *decoder =
    NULL, *sink = NULL, *nvvidconv = NULL, *nvosd = NULL, *filter1 =
    NULL, *filter2 = NULL, *yolo = NULL;
    GstBus *bus = NULL;
    guint bus_watch_id;
    GstCaps *caps1 = NULL, *caps2 = NULL;
    gulong osd_probe_id = 0;
    GstPad *osd_sink_pad = NULL;
    // SNR begin
    GstElement *nvvidconv1 = NULL,
                 *filter3 = NULL,
                 *videoconvert = NULL,
                 *filter4 = NULL,
                 *x264enc = NULL,
                 *qtmux = NULL;
    GstCaps *caps3 = NULL, *caps4 = NULL;
    // SNR end

    /* Check input arguments */
    if (argc != 3) {
        g_printerr ("Usage: %s <H264 filename> <yolo-plugin config file> \n", argv[0]);
        return -1;
    }

    /* Standard GStreamer initialization */
    std::cout<<"before init"<<std::endl;
    gst_init (&argc, &argv);
    std::cout<<"after init"<<std::endl;
    loop = g_main_loop_new (NULL, FALSE);
    std::cout<<"1"<<std::endl;

    /* Create gstreamer elements */
    /* Create Pipeline element that will form a connection of other elements */
    pipeline = gst_pipeline_new ("dstest1-pipeline");
    std::cout<<"2"<<std::endl;

    /* Source element for reading from the file */
    source = gst_element_factory_make ("filesrc", "file-source");
    std::cout<<"3"<<std::endl;

    /* Since the data format in the input file is elementary h264 stream,
    * we need a h264parser */
    h264parser = gst_element_factory_make ("h264parse", "h264-parser");
    std::cout<<"current state"<<h264parser->current_state<<std::endl;
    std::cout<<"4"<<std::endl;

    /* Use nvdec_h264 for hardware accelerated decode on GPU */
    decoder = gst_element_factory_make ("nvdec_h264", "nvh264-decoder");
    std::cout<<"5"<<std::endl;

    /* Use convertor to convert from NV12 to RGBA as required by nvosd and yolo plugins */
    nvvidconv = gst_element_factory_make ("nvvidconv", "nvvideo-converter");
    std::cout<<"6"<<std::endl;

    /* Use yolo to run inference instead of pgie */
    yolo = gst_element_factory_make ("nvyolo", "yolo-inference-engine");
    //std::cout<<"start time::"<<yolo->start_time<<std::endl;
    std::cout<<"7"<<std::endl;

    /* Create OSD to draw on the converted RGBA buffer */
    nvosd = gst_element_factory_make ("nvosd", "nv-onscreendisplay");
    std::cout<<"8"<<std::endl;

    // SNR begin
    /* Finally render the osd output */
    nvvidconv1 = gst_element_factory_make ("nvvidconv", "nvvideo-converter1");
    videoconvert = gst_element_factory_make ("videoconvert", "converter");
    x264enc = gst_element_factory_make ("x264enc", "h264 encoder");
    qtmux = gst_element_factory_make ("qtmux", "muxer");
    sink = gst_element_factory_make ("filesink", "filesink");
    //sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
    std::cout<<"9"<<std::endl;
    // SNR end
    /* caps filter for nvvidconv to convert NV12 to RGBA as nvosd expects input
    * in RGBA format */
    filter1 = gst_element_factory_make ("capsfilter", "filter1");
    std::cout<<"10"<<std::endl;
    filter2 = gst_element_factory_make ("capsfilter", "filter2");
    std::cout<<"11"<<std::endl;

    std::cout<<!pipeline<<std::endl;
    std::cout<<!source<<std::endl;
    std::cout<<!h264parser<<std::endl;
    std::cout<<!decoder<<std::endl;
    std::cout<<!filter1<<std::endl;
    std::cout<<!nvvidconv<<std::endl;
    std::cout<<!filter2<<std::endl;
    std::cout<<!nvosd<<std::endl;
    std::cout<<!sink<<std::endl;
    std::cout<<!yolo<<std::endl;

    if (!decoder)
    {
        g_printerr("decode could not be created. Exiting.\n");
        return -1;
    }

    if (!filter1)
    {
        g_printerr("filt1 could not be created. Exiting.\n");
        return -1;
    }

    if (!pipeline)
    {
        g_printerr("pipeline could not be created. Exiting.\n");
        return -1;
    }

    if (!source)
    {
        g_printerr("source could not be created. Exiting.\n");
        return -1;
    }


    if (!h264parser)
    {
        g_printerr("h264parser could not be created. Exiting.\n");
        return -1;
    }


    if (!decoder)
    {
        g_printerr("decoder could not be created. Exiting.\n");
        return -1;
    }


    if (!nvvidconv)
    {
        g_printerr("nvvidconv could not be created. Exiting.\n");
        return -1;
    }

    if (!filter2)
    {
        g_printerr("filter2 could not be created. Exiting.\n");
        return -1;
    }

    if (!nvosd)
    {
        g_printerr("nvosd could not be created. Exiting.\n");
        return -1;
    }

    if (!sink)
    {
        g_printerr("sink could not be created. Exiting.\n");
        return -1;
    }

    if (!yolo)
    {
        g_printerr("yolo could not be created. Exiting.\n");
        return -1;
    }



    if (!pipeline || !source || !h264parser || !decoder || !filter1 || !nvvidconv
    || !filter2 || !nvosd || !sink || !yolo)
    {
        g_printerr ("One element could not be created. Exiting.\n");
        return -1;
    }

    /* we set the input filename to the source element */
    g_object_set (G_OBJECT (source), "location", argv[1], NULL);
    g_object_set (G_OBJECT (sink), "location", "out.mp4", NULL);
    g_object_set(G_OBJECT(yolo), "config-file-path", argv[2], NULL);

    /* we set the osd properties here */
    g_object_set (G_OBJECT (nvosd), "font-size", 15, NULL);

    /* we add a message handler */
    bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
    bus_watch_id = gst_bus_add_watch (bus, bus_call, loop);
    gst_object_unref (bus);

    /* Set up the pipeline */
    /* we add all elements into the pipeline */
    gst_bin_add_many (GST_BIN (pipeline), source, h264parser, decoder, filter1,
    nvvidconv, filter2, yolo, nvosd, nvvidconv1, sink, filter3,videoconvert, filter4, x264enc, qtmux, NULL);
    caps1 = gst_caps_from_string ("video/x-raw(memory:NVMM), format=NV12");
    g_object_set (G_OBJECT (filter1), "caps", caps1, NULL);
    gst_caps_unref (caps1);
    caps2 = gst_caps_from_string ("video/x-raw(memory:NVMM), format=RGBA");
    g_object_set (G_OBJECT (filter2), "caps", caps2, NULL);
    gst_caps_unref (caps2);
    // SNR begin
    caps3 = gst_caps_from_string ("video/x-raw, format=RGBA");
    g_object_set (G_OBJECT (filter3), "caps", caps3, NULL);
    gst_caps_unref (caps3);
    caps4 = gst_caps_from_string ("video/x-raw, format=NV12");
    g_object_set (G_OBJECT (filter4), "caps", caps4, NULL);
    gst_caps_unref (caps4);
    // SNR end

    /* we link the elements together */
    /* file-source -> h264-parser -> nvh264-decoder ->
    * filter1 -> nvvidconv -> filter2 -> yolo -> nvosd -> video-renderer */
    gst_element_link_many (source, h264parser, decoder, filter1,nvvidconv, filter2, nvosd, nvvidconv1, filter3,
      videoconvert, filter4, x264enc, qtmux, sink, NULL);

    /* Lets add probe to get informed of the meta data generated, we add probe to
    * the sink pad of the osd element, since by that time, the buffer would have
    * had got all the metadata. */
    osd_sink_pad = gst_element_get_static_pad (nvosd, "sink");
    if (!osd_sink_pad)
        g_print ("Unable to get sink pad\n");
    else
        osd_probe_id = gst_pad_add_probe (osd_sink_pad, GST_PAD_PROBE_TYPE_BUFFER,
        osd_sink_pad_buffer_probe, NULL, NULL);

    /* Set the pipeline to "playing" state */
    g_print ("Now playing: %s\n", argv[1]);
    gst_element_set_state (pipeline, GST_STATE_PLAYING);

    /* Wait till pipeline encounters an error or EOS */
    g_print ("Running...\n");
    g_main_loop_run (loop);

    /* Out of the main loop, clean up nicely */
    g_print ("Returned, stopping playback\n");
    gst_element_set_state (pipeline, GST_STATE_NULL);
    g_print ("Deleting pipeline\n");
    gst_object_unref (GST_OBJECT (pipeline));
    g_source_remove (bus_watch_id);
    g_main_loop_unref (loop);
    return 0;
}

@amycao, any feedback on the errors observed while writing the output to a file?

“your app” > log 2>&1

Please see below, the output of the code that I posted above. Any help in debugging the issue will help. Instead of writing the output to a .mp4 file can I write the metadata to a file? If so, do you have a reference code/app? Please share.

before init
after init
1
2
3
current state1
4
5
6
7
8
9
10
11
0
0
0
0
0
0
0
0
0
0

(deepstream-yolo-app:200): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(deepstream-yolo-app:200): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
Now playing: /garage/DeepStream_Release/samples/streams/sample_720p.h264
Loading pre-trained weights...

(deepstream-yolo-app:200): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed

(deepstream-yolo-app:200): GStreamer-CRITICAL **: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed
Frame Number = 0 Number of objects = 0 Car Count = 0 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
Loading complete!
Total Number of weights read : 50983561
      layer               inp_size            out_size       weightPtr
(1)   conv-bn-leaky     3 x 608 x 608      32 x 608 x 608    992   
(2)   maxpool          32 x 608 x 608      32 x 304 x 304    992   
(3)   conv-bn-leaky    32 x 304 x 304      64 x 304 x 304    19680 
(4)   maxpool          64 x 304 x 304      64 x 152 x 152    19680 
(5)   conv-bn-leaky    64 x 152 x 152     128 x 152 x 152    93920 
(6)   conv-bn-leaky   128 x 152 x 152      64 x 152 x 152    102368
(7)   conv-bn-leaky    64 x 152 x 152     128 x 152 x 152    176608
(8)   maxpool         128 x 152 x 152     128 x  76 x  76    176608
(9)   conv-bn-leaky   128 x  76 x  76     256 x  76 x  76    472544
(10)  conv-bn-leaky   256 x  76 x  76     128 x  76 x  76    505824
(11)  conv-bn-leaky   128 x  76 x  76     256 x  76 x  76    801760
(12)  maxpool         256 x  76 x  76     256 x  38 x  38    801760
(13)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    1983456
(14)  conv-bn-leaky   512 x  38 x  38     256 x  38 x  38    2115552
(15)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    3297248
(16)  conv-bn-leaky   512 x  38 x  38     256 x  38 x  38    3429344
(17)  conv-bn-leaky   256 x  38 x  38     512 x  38 x  38    4611040
(18)  maxpool         512 x  38 x  38     512 x  19 x  19    4611040
(19)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    9333728
(20)  conv-bn-leaky  1024 x  19 x  19     512 x  19 x  19    9860064
(21)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    14582752
(22)  conv-bn-leaky  1024 x  19 x  19     512 x  19 x  19    15109088
(23)  conv-bn-leaky   512 x  19 x  19    1024 x  19 x  19    19831776
(24)  conv-bn-leaky  1024 x  19 x  19    1024 x  19 x  19    29273056
(25)  conv-bn-leaky  1024 x  19 x  19    1024 x  19 x  19    38714336
(26)  route                  -            512 x  38 x  38    38714336
(27)  conv-bn-leaky   512 x  38 x  38      64 x  38 x  38    38747360
(28)  reorg            64 x  38 x  38     256 x  19 x  19    38747360
(29)  route                  -           1280 x  19 x  19    38747360
(30)  conv-bn-leaky  1280 x  19 x  19    1024 x  19 x  19    50547936
(31)  conv-linear    1024 x  19 x  19     425 x  19 x  19    50983561
(32)  region          425 x  19 x  19     425 x  19 x  19    50983561
Anchors are being converted to network input resolution i.e. Anchors x 32 (stride)
Output blob names :
region_32
Using previously generated plan file located at data/yolov2-kFLOAT-kGPU-batch1.engine
Loading TRT Engine...
Loading Complete!
Running...
ERROR from element h264-parser: GStreamer encountered a general stream error.
Error: GStreamer encountered a general stream error.
Returned, stopping playback
Deleting pipeline

Can you add below after line 220 and try again?
filter3 = gst_element_factory_make (“capsfilter”, “filter3”);
filter4 = gst_element_factory_make (“capsfilter”, “filter4”);

Thank you! This resolved the issue that I was facing.