Gstreamer capsfilter works on cmd line but not in application

Hi,
You need to call gst_caps_features_new (). Please refer to

  caps =
      gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING,
      vidconv_format, NULL);
  feature = gst_caps_features_new ("memory:NVMM", NULL);
  gst_caps_set_features (caps, 0, feature);
  g_object_set (G_OBJECT (caps_filter), "caps", caps, NULL);

For more sample code, you may take a look at samples of DeepStream SDK in

/opt/nvidia/deepstream/deepstream-5.0/sources/apps/sample_apps

Or download source code of nvgstcapture-1.0.