Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete pipeline and create a new one in C #91

Open
rbnrtg opened this issue Feb 8, 2024 · 0 comments
Open

Delete pipeline and create a new one in C #91

rbnrtg opened this issue Feb 8, 2024 · 0 comments

Comments

@rbnrtg
Copy link

rbnrtg commented Feb 8, 2024

Hi @thiesmoeller

My camera is Basler daA3840-45uc (USB Model).

In my code, I create the pipeline correctly using GStreamer with the pylonsrc source, but I have implemented that when a parameter is modified in a txt, the pipeline is closed and a new one is created with the modified parameters and with the same pylonsrc source of the camera.

But when I release the necessary resources and try to start the second pipeline:

    if (pipeline != NULL) {

            gst_element_set_state(pipeline, GST_STATE_NULL);

           gst_bin_remove(GST_BIN(pipeline), src);

           gst_object_unref (blockpad);

           gst_object_unref (GST_OBJECT(pipeline));

           pipeline = NULL;
    }
    gst_bin_add_many(GST_BIN(pipeline), src, filter, conv, q1, encoder, filter_h264, sink, NULL);

   gst_element_link_many(src, filter, conv, q1, encoder, filter_h264, sink, NULL);

   if (gst_element_set_state (pipeline,
           GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
           g_error ("Error starting pipeline");
   }

When trying to change the pipeline status to PLAYING, the following error appears in basler logs:

gstpylonsrc.cpp:820:gst_pylon_src_start:ESC[00m error: Failed to start camera.

gstpylonsrc.cpp:820:gst_pylon_src_start:ESC[00m error: TLFactory not instanciated, you must call PylonInitialize()

GST_ERROR_SYSTEM gstelement.c:2271:gst_element_message_full_with_details:ESC[00m posting message: Failed to start camera.

What could I do to solve this problem?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant