Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Grayscale conversion with gstreamer?

Grayscale conversion with gstreamer?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.0k Views
  • 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 Offline
    L Offline
    luca101
    wrote on last edited by
    #1

    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!

    jsulmJ 1 Reply Last reply
    0
    • L luca101

      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!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      0
      • L Offline
        L Offline
        luca101
        wrote on last edited by
        #3

        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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved