Error getting sample apps to run

I’m getting errors when trying to run the samples apps. Right now none of the sample apps with DS4.0 is running for me. I’ve cleaned out my system of older versions of CUDA, TensorRT, cuDNN, and GStreamer.

These are the errors I’m seeing.

For “deepstream-test1”:

(deepstream-test1-app:25776): GLib-GObject-WARNING **: 22:25:20.895: g_object_set_is_valid_property: object class 'nvv4l2decoder' has no property named 'bufapi-version'

For “deepstream-test2”:

(deepstream-test2-app:26090): GLib-GObject-WARNING **: 22:27:04.254: g_object_set_is_valid_property: object class 'nvv4l2decoder' has no property named 'bufapi-version'

For “deepstream-app”:

** ERROR: <main:607>: Failed to set pipeline to PAUSED
Quitting
ERROR from src_bin_muxer: Output width not set
Debug info: gstnvstreammux.c(1838): gst_nvstreammux_change_state (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
App run failed

My system is as follows:

  • OS: Ubuntu 18.04 LTS
  • GPU: GTX 1050ti (I understand this isn't "officially" supported, but this is for testing and has worked for all the previous DS versions)
  • Driver: 418.67
  • CUDA: 10.1
  • TensorRT: 5.1.5.0
  • cuDNN: 7.6.1
  • GStreamer 1.14.4

I’ve tried with both the included videos as well as my own videos that have worked on DS3.0.

Edit: I’ve split out the null check for the gst_elements in the deepstream-test1 app into individual statements and I’m now getting this:

(deepstream-test1-app:20522): GLib-GObject-WARNING **: 17:29:14.991: g_object_set_is_valid_property: object class 'nvv4l2decoder' has no property named 'bufapi-version'
source element could not be created. Exiting.

Hi, Have you made some changes to the app, if not, Can you remove the cache, rm ~/.cache/gstreamer-1.0/ -rf
and try one app with GST_DEBUG=4 at the beginning of the app, either will be ok, and paste the whole log?
if you made some modification, this is the error from the app ERROR from src_bin_muxer: Output width not set. Some properties on the nvstreammux have not been set.

Please ignore warning about “bufapi-version”. It does not affect result.

“source element could not be created. Exiting.” There is no this print in test1. Do you change the code?
Can you check which element can’t be created? For example you can check like this “gst-inspect-1.0 nvv4l2decoder”

@amycao I tried clearing the gstreamer cache before but no change. Here’s the output with GST_DEBUG=4 for deepstream-test1 after clearing the gstreamer cache again:

0:00:00.000138449 28069 0x5621ff57a800 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.4
0:00:00.000230522 28069 0x5621ff57a800 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000259586 28069 0x5621ff57a800 INFO                GST_INIT gst.c:607:init_pre: Linux Chris-PC 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64
0:00:00.000806645 28069 0x5621ff57a800 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.001911806 28069 0x5621ff57a800 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.002371479 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.002563793 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.002593454 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.002647068 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: /home/chris/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.002850822 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistrybinary.c:539:priv_gst_registry_binary_read_cache: Unable to mmap file /home/chris/.cache/gstreamer-1.0/registry.x86_64.bin : Failed to open file “/home/chris/.cache/gstreamer-1.0/registry.x86_64.bin”: open() failed: No such file or directory
0:00:00.002894996 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistrybinary.c:549:priv_gst_registry_binary_read_cache: Unable to read file /home/chris/.cache/gstreamer-1.0/registry.x86_64.bin : Failed to open file “/home/chris/.cache/gstreamer-1.0/registry.x86_64.bin”: No such file or directory
0:00:00.002915498 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: /home/chris/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.000157857 28070 0x562138b0d800 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.4
0:00:00.000264515 28070 0x562138b0d800 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000304440 28070 0x562138b0d800 INFO                GST_INIT gst.c:607:init_pre: Linux Chris-PC 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64
0:00:00.000773150 28070 0x562138b0d800 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.001906514 28070 0x562138b0d800 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.002370497 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.002588696 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.002620818 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.002672670 28070 0x562138b0d800 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.002695833 28070 0x562138b0d800 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.56.4
0:00:00.002716077 28070 0x562138b0d800 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.4
0:00:00.002732411 28070 0x562138b0d800 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.012655028 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so" loaded
0:00:00.018019446 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_dewarper.so" loaded
0:00:00.024883962 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_osd.so" loaded
0:00:00.025492802 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_msgbroker.so" loaded
0:00:00.057899434 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvvideoconvert.so" loaded
0:00:00.058967089 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_msgconv.so" loaded
0:00:00.059138417 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_ofvisual.so" loaded
0:00:00.059724736 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_tracker.so" loaded
0:00:00.060196165 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_jpegdec.so" loaded
0:00:00.060520495 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_dsexample.so" loaded
0:00:00.060748782 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_multistream.so" loaded
0:00:00.061351780 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_eglglessink.so" loaded
0:00:00.061498261 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_segvisual.so" loaded
0:00:00.061676318 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_of.so" loaded
0:00:00.076552353 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_infer.so" loaded
0:00:00.076897530 28070 0x562138b0d800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_multistreamtiler.so" loaded
0:00:00.095455152 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistry.c:1694:scan_and_update_registry: Registry cache changed. Writing new registry cache
0:00:00.095480987 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistrybinary.c:369:priv_gst_registry_binary_write_cache: Building binary registry cache image
0:00:00.095658553 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistrybinary.c:401:priv_gst_registry_binary_write_cache: Writing binary registry cache
0:00:00.098486158 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistrybinary.c:262:gst_registry_binary_cache_finish: Wrote binary registry cache
0:00:00.098496404 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistry.c:1703:scan_and_update_registry: Registry cache written successfully
0:00:00.098502237 28069 0x5621ff57a800 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.098508141 28069 0x5621ff57a800 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.56.4
0:00:00.098513496 28069 0x5621ff57a800 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.4
0:00:00.098517439 28069 0x5621ff57a800 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.098562614 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "pipeline" named "dstest1-pipeline"
0:00:00.098620322 28069 0x5621ff57a800 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "filesrc"!
0:00:00.098625941 28069 0x5621ff57a800 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "h264parse"!
0:00:00.101019387 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so" loaded
0:00:00.101028808 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nvv4l2decoder" named "nvv4l2-decoder"
0:00:00.101229478 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstVideoDecoder@0x5621ff5d81c0> adding pad 'sink'
0:00:00.101241308 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstVideoDecoder@0x5621ff5d81c0> adding pad 'src'
0:00:00.123463282 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_multistream.so" loaded
0:00:00.123477642 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nvstreammux" named "stream-muxer"
0:00:00.123579000 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstNvStreamMux@0x5621ff666010> adding pad 'src'
0:00:00.137657600 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_infer.so" loaded
0:00:00.137672692 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nvinfer" named "primary-nvinference-engine"
0:00:00.137780357 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff965370> adding pad 'sink'
0:00:00.137790518 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff965370> adding pad 'src'
0:00:00.138013662 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvvideoconvert.so" loaded
0:00:00.138021589 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nvvideoconvert" named "nvvideo-converter"
0:00:00.138098719 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff97b2e0> adding pad 'sink'
0:00:00.138107182 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff97b2e0> adding pad 'src'
0:00:00.139853261 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_osd.so" loaded
0:00:00.139862500 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nvdsosd" named "nv-onscreendisplay"
0:00:00.139935451 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff9960d0> adding pad 'sink'
0:00:00.139947390 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0x5621ff9960d0> adding pad 'src'
0:00:00.140500228 28069 0x5621ff57a800 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_eglglessink.so" loaded
0:00:00.140509202 28069 0x5621ff57a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "nveglglessink" named "nvvideo-renderer"
0:00:00.140617944 28069 0x5621ff57a800 INFO        GST_ELEMENT_PADS gstelement.c:670:gst_element_add_pad:<GstBaseSink@0x5621ff9ef9f0> adding pad 'sink'
source element could not be created. Exiting.

@ChrisDing yes, I changed the code to show the result of each gst element. Originally it was just a single IF statement that checked all of them and the output was “One element could not be created”. This way I can see which element is causing the issue. It’s more verbose but it’s a bit more precise.

if (!source) {
    g_printerr ("source element could not be created. Exiting.\n");
    return -1;
  }
  if (!h264parser) {
    g_printerr ("h264parser element could not be created. Exiting.\n");
    return -1;
  }
  if (!decoder) {
    g_printerr ("decoder element could not be created. Exiting.\n");
    return -1;
  }
  if (!pgie) {
    g_printerr ("pgie element could not be created. Exiting.\n");
    return -1;
  }
  if (!nvvidconv) {
    g_printerr ("nvvidconv element could not be created. Exiting.\n");
    return -1;
  }
  if (!nvosd) {
    g_printerr ("nvosd element could not be created. Exiting.\n");
    return -1;
  }
  if (!sink) {
    g_printerr ("sink element could not be created. Exiting.\n");
    return -1;
  }

Here is the output for “gst-inspect-1.0 nvv4l2decoder”:

(gst-plugin-scanner:26765): GStreamer-WARNING **: 12:55:07.430: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_osd.so': /home/chris/anaconda3/libexec/gstreamer-1.0/../../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations
Factory Details:
  Rank                     primary + 11 (267)
  Long-name                NVIDIA v4l2 video decoder
  Klass                    Codec/Decoder/Video
  Description              Decode video streams via V4L2 API
  Author                   Nicolas Dufresne <nicolas.dufresne@collabora.com>, Viranjan Pagar <vpagar@nvidia.com>

Plugin Details:
  Name                     nvvideo4linux2
  Description              Nvidia elements for Video 4 Linux
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so
  Version                  1.14.0
  License                  LGPL
  Source module            nvvideo4linux2
  Binary package           nvvideo4linux2
  Origin URL               http://nvidia.com/

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstVideoDecoder
                         +----GstNvV4l2VideoDec
                               +----nvv4l2decoder

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
  
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      image/jpeg
      video/x-h264
          stream-format: { (string)byte-stream }
              alignment: { (string)au }
      video/x-h265
          stream-format: { (string)byte-stream }
              alignment: { (string)au }
      video/mpeg
            mpegversion: 4
           systemstream: false
                 parsed: true
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/mpeg
            mpegversion: [ 1, 2 ]
           systemstream: false
                 parsed: true
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-divx
            divxversion: [ 4, 5 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-vp8
      video/x-vp9
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "nvv4l2decoder0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  device              : Device location
                        flags: readable
                        String. Default: "/dev/nvhost-nvdec"
  device-name         : Name of the device
                        flags: readable
                        String. Default: ""
  device-fd           : File descriptor of the device
                        flags: readable
                        Integer. Range: -1 - 2147483647 Default: -1 
  output-io-mode      : Output side I/O mode (matches sink pad)
                        flags: readable, writable
                        Enum "GstNvV4l2IOMode" Default: 0, "auto"
                           (0): auto             - GST_V4L2_IO_AUTO
                           (2): mmap             - GST_V4L2_IO_MMAP
                           (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
  capture-io-mode     : Capture I/O mode (matches src pad)
                        flags: readable, writable
                        Enum "GstNvV4l2IOMode" Default: 0, "auto"
                           (0): auto             - GST_V4L2_IO_AUTO
                           (2): mmap             - GST_V4L2_IO_MMAP
                           (5): dmabuf-import    - GST_V4L2_IO_DMABUF_IMPORT
  extra-controls      : Extra v4l2 controls (CIDs) for the device
                        flags: readable, writable
                        Boxed pointer of type "GstStructure"
  skip-frames         : Type of frames to skip during decoding
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Enum "SkipFrame" Default: 0, "decode_all"
                           (0): decode_all       - Decode all frames
                           (1): decode_non_ref   - Decode non-ref frames
                           (2): decode_key       - decode key frames
  drop-frame-interval : Interval to drop the frames,ex: value of 5 means every 5th frame will be given by decoder, rest all dropped
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 1 - 30 Default: 0 
  num-extra-surfaces  : Additional number of surfaces in addition to min decode surfaces given by the v4l2 driver
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 1 - 24 Default: 0 
  cudadec-memtype     : Set to specify memory type for cuda decoder buffers
                        flags: readable, writable, changeable only in NULL or READY state
                        Enum "CudaDecMemType" Default: 2, "memtype_unified"
                           (0): memtype_device   - Memory type Device
                           (1): memtype_pinned   - Memory type Host Pinned
                           (2): memtype_unified  - Memory type Unified
  gpu-id              : Set to GPU Device ID for decoder 
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0

What’s the result “gst-inspect-1.0 filesrc” ?

Did you do this:

Installing Pre-requisites:

Packages to be installed:
$ sudo apt-get install
libssl1.0.0
libgstreamer1.0-0
gstreamer1.0-tools
gstreamer1.0-plugins-good
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-ugly
gstreamer1.0-libav
libgstrtspserver-1.0-0
libjansson4

@ChrisDing

Yes, I installed all the prerequisites:

sudo apt-get install \
> libssl1.0.0 \
> libgstreamer1.0-0 \
> gstreamer1.0-tools \
> gstreamer1.0-plugins-good \
> gstreamer1.0-plugins-bad \
> gstreamer1.0-plugins-ugly \
> gstreamer1.0-libav \
> libgstrtspserver-1.0-0 \
> libjansson4
[sudo] password for chris: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjansson4 is already the newest version (2.11-1).
gstreamer1.0-plugins-good is already the newest version (1.14.4-1ubuntu1~ubuntu18.04.1).
gstreamer1.0-tools is already the newest version (1.14.4-1~ubuntu18.04.1).
libgstreamer1.0-0 is already the newest version (1.14.4-1~ubuntu18.04.1).
libssl1.0.0 is already the newest version (1.0.2n-1ubuntu5.3).
gstreamer1.0-libav is already the newest version (1.14.4-0ubuntu1~ubuntu18.04.1).
gstreamer1.0-plugins-bad is already the newest version (1.14.4-1ubuntu1~ubuntu18.04.1).
gstreamer1.0-plugins-ugly is already the newest version (1.14.4-1~ubuntu18.04.1).
libgstrtspserver-1.0-0 is already the newest version (1.14.4-1~ubuntu18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 114 not upgraded.

Output from gst-inspect-1.0 filesrc:

(gst-plugin-scanner:20518): GStreamer-WARNING **: 22:02:50.302: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst_osd.so': /home/chris/anaconda3/libexec/gstreamer-1.0/../../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations
Factory Details:
  Rank                     primary (256)
  Long-name                File Source
  Klass                    Source/File
  Description              Read from arbitrary point in a file
  Author                   Erik Walthinsen <omega@cse.ogi.edu>

Plugin Details:
  Name                     coreelements
  Description              GStreamer core elements
  Filename                 /home/chris/anaconda3/lib/gstreamer-1.0/libgstcoreelements.so
  Version                  1.14.0
  License                  LGPL
  Source module            gstreamer
  Source release date      2018-03-19
  Binary package           GStreamer source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstFileSrc

Implemented Interfaces:
  GstURIHandler

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY

Element has no clocking capabilities.

URI handling capabilities:
  Element can act as source.
  Supported URI protocols:
    file

Pads:
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "filesrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating (deprecated, non-functional)
                        flags: readable, writable, deprecated
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: false
  location            : Location of the file to read
                        flags: readable, writable, changeable only in NULL or READY state
                        String. Default: null

Filename /home/chris/anaconda3/lib/gstreamer-1.0/libgstcoreelements.so

from your output, seems you install the gstreamer into your user local space, that’s why it can not find this element when running test1 app since it find system path, you can export GST_PLUGIN_PATH=/home/chris/anaconda3/lib/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:
or you can install gstreamer into system path, then you do not need to add this config.

I have same error:

stiv@gaidar:/opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/deepstream-test3$ ./deepstream-test3-app file:///opt/nvidia/deepstream/deepstream-4.0/samples/streams/sample_720p.h264 
Now playing: file:///opt/nvidia/deepstream/deepstream-4.0/samples/streams/sample_720p.h264,
Creating LL OSD context new
0:00:01.167684950 15605 0x556243ca7150 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:08.376450122 15605 0x556243ca7150 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /opt/nvidia/deepstream/deepstream-4.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_int8.engine
create_params.width=640
create_params.height=368
create_params.layout=0
create_params.memType=0
inferallocator->batch_size=1
create_params.width=640
create_params.height=368
create_params.layout=0
create_params.memType=0
inferallocator->batch_size=1
create_params.width=640
create_params.height=368
create_params.layout=0
create_params.memType=0
inferallocator->batch_size=1
Decodebin child added: source
Decodebin child added: decodebin0
Running...
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0
Seting bufapi_version

(deepstream-test3-app:15605): GLib-GObject-WARNING **: 15:01:24.252: g_object_set_is_valid_property: object class 'nvv4l2decoder' has no property named 'bufapi-version'
In cb_newpad
Creating LL OSD context new
cuCtxCreate failed with error(2) gst_eglglessink_cuda_init
Frame Number = 0 Number of objects = 5 Vehicle Count = 3 Person Count = 2
0:00:08.936185657 15605 0x5562438ac4a0 WARN                 nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop:<primary-nvinference-engine> error: Internal data stream error.
0:00:08.936238657 15605 0x5562438ac4a0 WARN                 nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop:<primary-nvinference-engine> error: streaming stopped, reason not-negotiated (-4)
ERROR from element primary-nvinference-engine: Internal data stream error.
Error details: gstnvinfer.cpp(1830): gst_nvinfer_output_loop (): /GstPipeline:dstest3-pipeline/GstNvInfer:primary-nvinference-engine:
streaming stopped, reason not-negotiated (-4)
Returned, stopping playback
Frame Number = 1 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 2 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 3 Number of objects = 6 Vehicle Count = 4 Person Count = 2
Frame Number = 4 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 5 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Frame Number = 6 Number of objects = 5 Vehicle Count = 3 Person Count = 2
Deleting pipeline
sudo apt-get install libssl1.0.0 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjansson4 is already the newest version (2.11-1).
gstreamer1.0-plugins-good is already the newest version (1.14.5-0ubuntu1~18.04.1).
gstreamer1.0-tools is already the newest version (1.14.5-0ubuntu1~18.04.1).
libgstreamer1.0-0 is already the newest version (1.14.5-0ubuntu1~18.04.1).
libssl1.0.0 is already the newest version (1.0.2n-1ubuntu5.3).
gstreamer1.0-libav is already the newest version (1.14.5-0ubuntu1~18.04.1).
gstreamer1.0-plugins-bad is already the newest version (1.14.5-0ubuntu1~18.04.1).
gstreamer1.0-plugins-ugly is already the newest version (1.14.5-0ubuntu1~18.04.1).
libgstrtspserver-1.0-0 is already the newest version (1.14.5-0ubuntu1~18.04.1).
The following packages were automatically installed and are no longer required:
  cuda-cudart-10-1 cuda-cudart-dev-10-1 cuda-driver-dev-10-1 cuda-license-10-1 cuda-npp-10-1 cuda-npp-dev-10-1 libaccinj64-9.1 libcublas-dev
  libcublas10 libcublas9.1 libcufft9.1 libcufftw9.1 libcuinj64-9.1 libcurand9.1 libcusolver9.1 libcusparse9.1 libnppc9.1 libnppial9.1
  libnppicc9.1 libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1 libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1 libnvblas9.1
  libnvgraph9.1 libnvinfer-dev libnvinfer5 libnvrtc9.1 libnvtoolsext1 libnvvm3 libthrust-dev libvdpau-dev nvidia-opencl-dev nvidia-profiler
  nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 116 not upgraded.
stiv@gaidar:/opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/deepstream-test3$ gst-inspect-1.0 filesrc
Factory Details:
  Rank                     primary (256)
  Long-name                File Source
  Klass                    Source/File
  Description              Read from arbitrary point in a file
  Author                   Erik Walthinsen <omega@cse.ogi.edu>

Plugin Details:
  Name                     coreelements
  Description              GStreamer core elements
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so
  Version                  1.14.5
  License                  LGPL
  Source module            gstreamer
  Source release date      2019-05-29
  Binary package           GStreamer (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstFileSrc

Implemented Interfaces:
  GstURIHandler

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY

Clearing cache folder doesn’t help. Video is not played, only few frames is show, then its closed.

samilar to the same problem

cuCtxCreate failed with error(2) gst_eglglessink_cuda_init
your display driver environments have setup issue, which GPU you used? if you use Tesla card, you may follow this to setup virtual display, Deepstream/FAQ - eLinux.org 5A, or you can change sink to fakesink in the
source code.

I’m also having it with the python sample:

    if name.find("nvv4l2decoder") != -1:
        Object.set_property("bufapi-version", True)

leads to:

  TypeError: object of type `nvv4l2decoder' does not have property `bufapi-version'

Please help to open a new topic if it’s still an issue. Thanks

No, this is solved. I think I found on another thread that I can omit the bufapi-version thing in later versions.