Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Grayscale conversion with gstreamer?

    General and Desktop
    3
    4
    1540
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      luca101 last edited by

      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",
                      NULL);
      

      Thank you!

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @luca101 last edited by

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

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • L
          luca101 last edited by

          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...

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post