QVideoWidget: Video is cut off

qvideo widget
qt video widget
qt designer qmediaplayer
pyqt5 qmediaplayer
qmediaplayer videosurface
qt media player status
qmediaplayer duration

I want to play a video in a Qt Application. This is my code so far:

#include <QApplication>
#include <QWidget>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QUrl>

#include <iostream>

using namespace std;

const int WIDTH = 1280;
const int HEIGHT = 720;

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QWidget window;
    window.resize(WIDTH, HEIGHT);
    window.setWindowTitle("Video Test");
    window.show();

    QMediaPlayer *player = new QMediaPlayer();
    player->setMedia(QUrl::fromLocalFile("/Path/To/Video.mp4"));

    QVideoWidget *videoWidget = new QVideoWidget(&window);
    player->setVideoOutput(videoWidget);

    videoWidget->resize(WIDTH, HEIGHT);

    videoWidget->show();
    player->play();


    return app.exec();
}

The problem: The video is shown and plays back normally, but the video does not resize to fit in the QVideoWidget. The part of the video that is bigger than the widget is cut off.

Thanks in advance!

EDIT: I reduced the code and noticed, that when the application starts the video is cut off, but when I resize the window using the mouse it actually fits to the size:

#include <QApplication>
#include <QWidget>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QUrl>

#include <iostream>

using namespace std;

const int WIDTH = 1280;
const int HEIGHT = 720;

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QMediaPlayer *player = new QMediaPlayer();
    QVideoWidget *videoWidget = new QVideoWidget();

    player->setVideoOutput(videoWidget);

    player->setMedia(QUrl::fromLocalFile("/Path/To/Video.mp4"));
    player->play();

    videoWidget->resize(WIDTH/3, HEIGHT/3);

    videoWidget->show();

    return app.exec();
}

After many hours of looking for the error, I think this is a bug in Qt on OSX, as I watched this YouTube video https://www.youtube.com/watch?v=tGKmQy-VBX0 and tried out the code.

In the video scaling works fine, but on my machine not.

qt - QVideoWidget: Video is cut off, After many hours of looking for the error, I think this is a bug in Qt on OSX, as I watched this YouTube video https://www.youtube.com/watch?v=tGKmQy-VBX0  I am doing project on Qt 5.2 with display video. I had a problem with displaying, no movie but sound still works well. Please help me to fix it. Thanks in advance #include "mainwindow.h" #include "

For anyone in 2016, QVideoWidget is still busted. However, use a QGraphicsView widget, which holds a scene graph, and add a single QGraphicsVideoItem to the scene graph. Seems to work...

well, except that it's not exactly centered. and there's a 1px border on the left. and it hangs going into full screen most of the time. and I get errors like "updateVideoFrame called without AVPlayerLayer (which shouldn't happen". Progress!

.. oh, and it takes up about 10x the cpu too.

You know what does work, and works great? GStreamer. Thank you, gstreamer. Even integrating it in python/qt works fabulously.

QVideoWidget: Video is cut off - qt - iOS, I want to play a video in a Qt Application. This is my code so far: #include <​QApplication> #include <QWidget> #include <QMediaPlayer> #include  A QVideoWidget requires a native window handle for the video to be rendered onto it, and a QWidget inside a QGraphicsProxyWidget can't have a native window handle. If you need brightness/contrast adjustment, you will have to create a custom video graphics item and do the processing on the video frames yourself.".

I ran into a similar problem in PyQt5. I worked around it by setting the geometry of the QVideoWidget to its current geometry before playing the video. I am guessing something in the resizeEvent signal must handle the scaling of the media and isn't triggered when initialized.

qt - QVideoWidget: Video is cut off -, the problem: video shown , plays normally, video not resize fit in qvideowidget. part of video bigger widget cut off. thanks in advance! QVideoWidget: Video is cut off. Theme in user control. For Each Loop through DataGridViewColumn Headers. ssh2_scp_send() using php corrupts pdf. Goback Developer FAQ 1.

Usually the scale mode dictates how the video fills the widget. The scale mode FitInView will force the video to fill the view keeping aspect ratio.

However, this scale mode should be the default. You can try to set it manually:

QVideoWidget *videoWidget = new QVideoWidget(&window);
videoWidget->setScaleMode(Phonon::VideoWidget::FitInView);
player->setVideoOutput(videoWidget);

QVideoWidget: Video is cut off, QVideoWidget: Video is cut off. I want to play a video in a Qt Application. This is my code so far: #include <QApplication> #include <QWidget> #include  QVideoWidget: Video is cut off; Can a MEF application built on .NET 4 import types built against .NET 3.5? How dotnet build chooses the output name; How to create two column output from a single column; How can I get the choice “H2” back in the H2 consol? hide missing dates from x-axis ggplot2; Approximate Order-Preserving Huffman Code

After playing, I resized the QVideoWidget by 1 and then resized to original size. Definitely "fudge", but this works for me until I find a real solution: (working with PyQt5 and High Sierra)

s1 = self.MediaFrame.size() # QVideoWidget
s2 = s1 + QSize(1, 1)
self.MediaPlayer.play() # QMediaPlayer
self.MediaFrame.resize(s2) # enlarge by one pixel
self.MediaFrame.resize(s1) # return to original size

[#QTMOBILITY-1286] The video area displayed by QVideoWidget , I want to play a video in a Qt Application. This is my code so far: Cut your video. Your video is added, now you can choose the beginning and ending, and cut it. Then select an output format. Please pay attention that if you edit the video from your iPhone or Android, it is better to pick the MP4 format.

QVideoWidget Class, The video area displayed by QVideoWidget will be cut after orientation changed. Orientation from vertical to horizontal: Shot(18).png -> Shot(19).png Orientation  Forcible phallus removal is the arguably the ultimate insult—and maybe the ultimate negotiation tool. Manhoods have been mauled in homicidal rampages, severed in torture, self-mutilated, removed in acts of self-defense and revenge, lopped off in ritual sacrifice, and, occasionally, even fed to their owner. 10 Caged With A Madman

Detailed Description. Attaching a QVideoWidget to a QMediaObject allows it to display the video or image output of that media object. A QVideoWidget is  Prince Harry Is Feeling Homesick and 'Cut Off' From Family, Source Says By Liz Calvario‍ 2:14 PM PDT, April 15, 2020 This video is unavailable because we were unable to load a message from our

QVideoWidget: Video is cut off setWindowTitle("Video Test"); window.show(); QMediaPlayer *player = new QMediaPlayer();  MSNBC’s Ari Melber cuts off Monday's coronavirus task force briefing when President Donald Trump derails a medical press conference to play a video defending his reportedly late response to the

Comments
  • This (still) happens on os x and fedora 24. Sigh. And ubuntu? Their qtmultimedia package is so broken, it uses gstreamer 0.1 and they don't even ship that. Does anyone even use this shit?
  • Could you please tell me, how you are integrating GStreamer.
  • Thank you for your fast response, but I am not able to use Phonon, when i add phonon to QT (QT += phonon) I get the error: Unknown module(s) in QT: phonon. I am running OSX btw, what should I do to configure/install it?
  • Unfortuantely, I'm not familiar with using Qt/Phonon on OSX. There are quite a few questions on this topic here, maybe that helps.
  • Is there also an option without Phonon, as read that Phonon is no longer part of Qt5?
  • I updated my question to an alternative version without a parent widget