Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Query on video rendering with gstreamer and UI repaint
Forum Updated to NodeBB v4.3 + New Features

Query on video rendering with gstreamer and UI repaint

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 3.5k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Sanchayan Maity
    wrote on last edited by
    #1

    Hello,

    I am using Qt 4.8 on Embedded Linux and trying to do a video/audio player with Qt for GUI and gstreamer for media playback in backend.

    I have a main window with six push buttons at bottom and a QGraphicsView widget in the centre above the push buttons. I run the gstreamer pipeline and render the video to this QGraphicsScene using code as below. I had two queries.

    @
    QApplication::syncX();
    setCentralWidget(ui->graphicsView);
    gst_x_overlay_set_window_handle (GST_X_OVERLAY(video_sink), ui->graphicsView->winId());
    @

    1. I can render the video if i set the window handle to centralWidget's winId. If i set the window handle to graphicsview's window Id without doing setCentralWidget(ui->graphicsView); i can't display the video and i get a "EGL couldn't create window" error. Can someone just clarify this?

    2. Once the video starts playing, the push buttons disappear. Something to do with the video playback but i can't figure out. I thought i will do a repaint() and update(), but it doesn't help. Can someone point me in the right direction.

    I am a newbie to Qt.

    I am using a Toradex Colibri T20 module and running a pipeline utilising Nvidia gstreamer elements.

    @
    gst-launch filesrc location=file.mp4 ! qtdemux name=demux demux.video_00 ! nv_omx_h264dec ! nv_gl_eglimagesink demux.audio_00 ! nv_omx_aacdec ! alsasink device=hw:0,0
    @

    This is the pipeline i am running.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Not the answer you are waiting but since you are using a custom pipeline you might be interested by the "QtGstreamer":http://cgit.freedesktop.org/gstreamer/qt-gstreamer/ library, it might suite your need better.

      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
      • A Offline
        A Offline
        andreyc
        wrote on last edited by
        #3

        [quote author="Sanchayan Maity" date="1409142082"]

        1. I can render the video if i set the window handle to centralWidget's winId. If i set the window handle to graphicsview's window Id without doing setCentralWidget(ui->graphicsView); i can't display the video and i get a "EGL couldn't create window" error. Can someone just clarify this?[/quote]

        Without adding your widget to MainWindow or without calling show() on a widget Qt does not know what to draw. That is why you getting the error.

        [quote author="Sanchayan Maity" date="1409142082"]
        2. Once the video starts playing, the push buttons disappear. Something to do with the video playback but i can't figure out. I thought i will do a repaint() and update(), but it doesn't help. Can someone point me in the right direction.[/quote]

        When you send winId to gstreamer it will paint the frames on a whole window. And since graphicsview is a central widget all buttons belong to the same window. So gstreamer over-paint them.

        You need to create a central widget as QWidget, add buttons to the central widget and add graphicsview to the same widget lay them out using Qt layouts and then play video.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sanchayan Maity
          wrote on last edited by
          #4

          The graphicsview is already a part of the main window and is enabled. So calling show() is not required. Also, it's not Qt that's giving the error i believe, but, the video sink element in the gstreamer pipeline.

          "When you send winId to gstreamer it will paint the frames on a whole window. And since graphicsview is a central widget all buttons belong to the same window. So gstreamer over-paint them."

          I thought so, that's why i did setCentralWidget(ui->graphicsView) to only display it in garphicsview part of the mainwindow. The mainwindow has the central widget and everything is in the central widget.

          With setCentralWidget(ui->graphicsView) the video is displayed only in the graphicsview window, but, still the buttons do not show once the video playback starts.

          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