joshdoe / gst-plugins-vision

GStreamer plugins related to the field of machine vision
Other
133 stars 50 forks source link

Can't modify properties on pylonsrc #35

Open willingtonvr opened 4 years ago

willingtonvr commented 4 years ago

Hello Everybody

Successfully create a pipeline, when try to change any parameter like exposure, withebalance, etc. nothing happens, see below (Camera Basler acA19200, pylon 6 API)

gst_parse_launch("pylonsrc name=source ! bayer2rgb ! videoconvert name=convert ! tee name=tee tee. ! xvimagesink name=sink",&error);

it is running fine, but when i try to change some parameter on the source noting happens:

src_element = gst_bin_get_by_name(GST_BIN(cur_capchan->pipeline), "source");

gdouble src_num=1000.0; gdouble exposure=15000.1; gchar *src_expo;

g_object_get(src_element,"autoexposure",&src_expo,NULL); g_print(" autoexposure: %s\n",src_expo);

/// gives autoexposure: off

g_object_get(src_element,"exposure",&src_num,NULL); g_print("exposure: %f\n",src_num);

// gives 0
g_print("setting exposure: %f\n",exposure); //// put t0 15000.1 g_object_set(src_element,"exposure",exposure,NULL);

g_object_get(src_element,"exposure",&src_num,NULL); g_print("exposure: %f\n",src_num);

// gives 15000.1 But nothing happens with the image

Does i need an extra "Apply" command ?

Thank you

zingmars commented 4 years ago

Can you set these parameters when running a pipeline using gst-launch-1.0?

joshdoe commented 4 years ago

I checked the code, and it looks like it only sets those properties at the start. This can be changed, I'd probably make it such that set_property() sets a flag to update exposure/gain/level, then in create() if that flag is set it will update the values on the camera. You can try this out, or I'll try at some point.