Important: Please read the Qt Code of Conduct -

Grayscale conversion with gstreamer?

  • Hello there,

    I implemented a gstreamer pipeline to change the camera video to grayscale:

    gst_bin_add_many (GST_BIN (mpPipeline), mpSource, videoconvert1, grayscale_caps, videoconvert2, mpSink, NULL);

    The streaming part works but the grayscale filter doesn't work, I get this message:
    gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed

    The error points to the definition of the grayscale caps, can you help me identify the problem:

     GstCaps *grayscale_caps = gst_caps_new_simple( "video/x-raw",
                    "format", G_TYPE_STRING, "GRAY8",

    Thank you!

  • Lifetime Qt Champion

    @luca101 How is this related to Qt?
    You should ask Gstreamer community.

  • I asked in this forum because I thought that the Qt library for gstreamer (Qt5GStreamer-1.0) was supported by the Qt community. My gstreamer pipeline works fine when it runs from the terminal (native gstreamer) but fails when it runs from Qt.

    Thanks anyway...

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I'm a bit rusty with QtGStreamer, but IIRC, if you can write down that pipeline in the console, one thing you can try is:

    QGst::PipelinePtr pipeline = QGst::Parse::launch(pipelineDescription).dynamicCast<QGst::Pipeline>();

    with pipelineDescription being the string containing the pipeline description as you use it on the console. If you name the elements you can then retrieve them and configured them as you need.

    Hope it helps

Log in to reply