How to get gstreamer element value at pipeline runtime?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Orin NX
• DeepStream Version 6.3
• JetPack Version (valid for Jetson only) 5.1.2
• TensorRT Version 8.5.2.2
• NVIDIA GPU Driver Version (valid for GPU only) Orin NX
• Issue Type( questions, new requirements, bugs) questions
When I set gstreamer properties like
g_object_set (G_OBJECT (nvvidconv2), "gpu-id", config->gpu_id, "src-crop", "0:0:416:416", "nvbuf-memory-type", config->nvbuf_memory_type, NULL); in deepstream_source_bin.c, how can I validate this in deepstream_app_main.c? Can I get the element through some api?

you can use g_object_get to get the value. for example,

  g_object_get (G_OBJECT (pgie), "batch-size", &pgie_batch_size, NULL);

When I use g_object_get to get the value, I get 0:0:0:0, which is expected to be 0:0:416:416.
What should I modify, here is the code I am using.

gchar *src_crop;
g_object_get (G_OBJECT (nvvidconv2), “src-crop”, &src_crop, NULL);
printf(“output object get %s”, src_crop);

Or maybe I should use g_object_get_property, and how do I output the gvalue result?

gvalue src_crop;
g_object_get_property(G_OBJECT (nvvidconv2), “src-crop”, &src_crop);

please refer to the following code:
gchar src_crop=“0:0:300:300”;
g_object_set (G_OBJECT (nvvidconv), “src-crop”, src_crop, NULL);
GValue a;
g_object_get_property(G_OBJECT (nvvidconv), “src-crop”, &a);
gchar
p = g_value_get_string(&a);
printf(p);

Can I access this setting while the pipeline is running? Or can I only get the setting before g_main_loop_run(main_loop)?

By the way, I do all my testing on the deepstream-app.

after creating the plugin, you can set and get the property.

I try to read the value of the src-crop, when create_multi_source_bin is executed, via g_object_get(G_OBJECT(pipeline->multi_src_bin.nvmultiurisrcbin), "src-crop", &src_crop, NULL);. This is done in the create_pipeline function of deepstream_app.c.

However, I got the following results:

GLib-GObject-CRITICAL **: 16:26:48.728: g_object_get: assertion ‘G_IS_OBJECT (object)’ failed

I also tried g_object_get_property(G_OBJECT (pipeline->multi_src_bin.nvmultiurisrcbin), "src-crop", &src_crop); this method, and got the following result:

GLib-GObject-CRITICAL **: 15:56:09.900: g_object_get_property: assertion ‘G_IS_OBJECT (object)’ failed

Is there anything that needs to be changed, and if so, please help me with an example for reference. Or is there no way to get the src-crop attribute in here?

nvmultiurisrcbin has no src-crop property, nvvideoconvert has this property.

Where within the deepstream-app example can I access the desired value using this property?

yes, after creating nvvideoconvert plugin, you can set and get the property “src-crop”.