This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Runtime changes to omx_scaler gstreamer element

Hello All

In our application we are using omx_scaler and v4l2sink gstreamer elements  for video display. Application requires runtime changes to the scaling ratio but  omx_scaler does not have a property to change output height and width. so we are not able to use object_set_property( ) as we do for changing other parameters at runtime. Can anyone suggest some method for changing output height width for scaler dynamically. 

Thanks alot

Ravikant

  • Hello,

    I am facing almost the same problem. I tried to use g_object_set() function to change the video width and height in omx_scaler:

    GstElement *scaler = gst_element_factory_make ("omx_scaler", "myscaler");
    GstCaps *caps = gst_caps_new_simple("video/x-raw-yuv", "width", G_TYPE_INT, 1280, "height", G_TYPE_INT, 720, NULL);
    g_object_set(G_OBJECT(scaler), "caps", new_caps, NULL);

    I get the following run-time warning message, after running the above code:

    object class `GstOmxScaler' has no property named `caps'

    I use the same approach to set the caps of other elements such as udpsrc, and it works fine. In gst-inspect, I can see the width and height caps for omx_scaler. I wonder how we can change the caps of omx_scaler element.

    Thanks,
    Mohammad

  • Dear Mohammad:

    Did you solve your issue?

    I am facing the same problem now...

     

    Simon

  • Dear Smion,

    You should set the caps directly inside the g_object_set() function:

    g_object_set(G_OBJECT(scaler), "video/x-raw-yuv", "width", G_TYPE_INT, 1920, "height", G_TYPE_INT, 1080, "framerate", GST_TYPE_FRACTION, 30, 1, NULL);

    Regards,
    Mohammad