Results 1 to 7 of 7

Thread: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

  1. #1
    Join Date
    Jul 2016
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    I have bit of a complicated qt structure; some parts are made with designer, some part are made with code. Yet this is not very important.
    The point is:
    I have my main window, which contains different things, one of which is a widget (called centralWidget), which contains layouts and other widgets.
    Everything works fine till a simply add:

    QVideoWidget* videoWidget = new QVideoWidget(ui.centralWidget); // I can put nothing, or "this" inside the constructor...nothing changes
    QMediaPlayer player;

    TV_V_LAYOUT_MAIN_1->addWidget(videoWidget);
    player.setVideoOutput(videoWidget);

    This lines of code are inside a function which builds buttons inside the layout, and this function gets called inside the mainwindow constructor.

    As soon as I add this videowidget with videoplayer, everything within my application gets locked (buttons, scrollbars, comboboxes... some are in other layouts).
    Sometimes they are locked, sometimes they are really really slowed down. It's like those elements are either completely locking or dramatically slowing down the application.

    I saw another person asked this question in this forum a few years ago, yet nobody answered.



    This is very important to me, because its for my BA project for a very important company and I'm stuck with this problem since last month


    You can also see my question on stackoverflow http://stackoverflow.com/questions/3...application-or

    I'm using Visual Studio 2013 + Qt5 Add-In + gstreamer.

    Can anybody plase give me a hint? I don't know what to do anymore...

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    Have you tried not settnig minimum/maximum sizes and letting the layout handle that?

    Does the video widget work when it is the only widget?

    Cheers,
    _

  3. #3
    Join Date
    Jul 2016
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    As you can see in the example in this thread here, I'm not setting any minimum / maximum size.
    I deleted the QMediaPlayer and let only the QVideoWidget and the buttons and everything else is working. Yet nothing is appearing in the application.

    I don't know how to state whether or not the QVideoWidget was correctly initialized and positioned.

    I did this:

    Without initializing the videowidget the application looks like this: qtask_1.jpg

    By initializing the videowidget with the lines below:

    QVideoWidget* videoWidget = new QVideoWidget;
    videoWidget->setStyleSheet("background-color: #1f1f1f;");
    TV_V_LAYOUT_MAIN_1->addWidget(videoWidget);

    The result is:
    qtask_2.jpg


    As you can see the qlabel "Incoming streaming" moved left (it's in the same layout as the one in which the videowidget is inserted). So I guess it was correctly inserted.
    Any other advice??

    Thank you,

    marko

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    Have you tried the video widget on its own as I suggested in my previous comment?
    If that works, then maybe as a child of a plain QWidget with a box layout and a single button.

    Cheers,
    _

  5. #5
    Join Date
    Jul 2016
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    okey i made a new project and tried the tutorial for qt5: http://doc.qt.io/qt-5/qtmultimedia-m...t-example.html

    The player works fine, when I try to open a media (mp4 or mkv) file I get the following error:
    DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)

  6. #6
    Join Date
    Jul 2016
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    Okey I installed the necessary codecs pack and the tutorial's example works!


    I am able to play videos on my application with videowidget and mediaplayer


    Yet the buttons, comboboxes, tabs ecc are still extremely slowed down. It's like those qt elements extremely block my application
    Like clicking on the play/pause button, it does his job, but the button does not show the animation...

  7. #7
    Join Date
    Jul 2016
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QVideoWidget\QMediaPlayer doesn't show up and locks everything within application

    Solved it by moving all qt5 dll's into my project folder.

    Yet, I need to connect gstreamer sink's to Qt5 VideoWidgets

    My question is here: http://stackoverflow.com/questions/3...streamer-sinks

Similar Threads

  1. QVideoWidget , QMediaPlayer : missing video frames
    By vee_sivee in forum Qt Programming
    Replies: 0
    Last Post: 27th April 2015, 05:11
  2. Replies: 6
    Last Post: 24th November 2011, 10:54
  3. Replies: 3
    Last Post: 12th July 2011, 23:55
  4. Replies: 0
    Last Post: 8th April 2010, 12:08
  5. Application running but doesn't show up!!!
    By joandelason in forum Newbie
    Replies: 4
    Last Post: 21st March 2010, 10:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.