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. Loading a .mov file results in an automatically zoom from the QMediaPlayer
Forum Updated to NodeBB v4.3 + New Features

Loading a .mov file results in an automatically zoom from the QMediaPlayer

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.6k 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.
  • Q Offline
    Q Offline
    QtDeveloping94
    wrote on last edited by
    #1

    Hi,

    I am heading a problem at my program. Normaly I am developing on a Windows Computer, but right now I am on a Mac.
    If I set a .mov File, the File automaticaly zoom into the video, so it does not keep it size.
    Did somebody handle the problem already?

    Example Code:

    videoWidgetTransform     = new QVideoWidget(_pMainWindow);
    videoWidgetTransform->setParent(_pMainUi->videowidget);
    
     _videoPlayer =  new QMediaPlayer();
     _videoPlayer->setVideoOutput(videoWidgetTransform);
    
      setMedia(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/myData/Videos/Wildlife.mov");
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the looks of it you are re-parenting your QVideoWidget to what seems to be another video widget instance. What exactly are you trying to achieve ?

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

      Q 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        From the looks of it you are re-parenting your QVideoWidget to what seems to be another video widget instance. What exactly are you trying to achieve ?

        Q Offline
        Q Offline
        QtDeveloping94
        wrote on last edited by QtDeveloping94
        #3

        @SGaist

        _pMainUi->videowidget is a normal widget in my Ui. I am working with the designer, so I can not insert a QVideoWidget directly... Next time I gonna hard code my Ui.

         mMediaPlayer = new QMediaPlayer(this);
         mVideoWidget = new QVideoWidget(this);
         mMediaPlayer->setVideoOutput(mVideoWidget);
        
         ui->stackedWidget->insertWidget(0,mVideoWidget);
         ui->stackedWidget->setCurrentIndex(0);
        
         mMediaPlayer->setMedia(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/HEGData/Videos/Wildlife.mov"));
        
         mMediaPlayer->play();
        

        ... works properly

        I found the reason, I implemented a video ratio function to get rid of the black borders. Is there a function to stop the .mov video from scaling itself, on my Windows, the .wmv videos did not do that. If I am changing my splitter, which is resulting in a smaller or bigger video, it changes itself to the correct size and then, after 0.5 seconds it zooms in again.
        Any idea anyone?

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

          Nothing forbids you to add a layout to that widget and then add the video widget to it.

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

          Q 1 Reply Last reply
          0
          • SGaistS SGaist

            Nothing forbids you to add a layout to that widget and then add the video widget to it.

            Q Offline
            Q Offline
            QtDeveloping94
            wrote on last edited by
            #5

            @SGaist

            But it makes it more complicated?
            I am still facing this issue, on my windows computer everything is working fine. But I want to deploy the program for ios as well. I guess I will face this error there as well.

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

              Why more complicated ? In your designer UI you can set a layout on _pMainUi->videowidget and then in your code you retrieve that layout and add videoWidgetTransform.

              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
              1

              • Login

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