Hi,
I’ve tested the two qt multimedia examples (see below) but only the QGraphicsVideoItem example works not QVideoWidget example.
I’ve installed all the necessary libraries and plugins. I’m not suspecting that i’m still missing some plugins because one of the examples works.
So my question is : why the QGraphicsVideoItem example works but not QVideoWidget example ?
QVideoWidget example : (doesn’t work, got “Internal data stream error”)
QMediaPlayer * player = new QMediaPlayer;
player->setMedia(QUrl::fromLocalFile(fileName));
QVideoWidget * videoWidget = new QVideoWidget;
videoWidget->show();
player->setVideoOutput(videoWidget);
player->play();
QGraphicsVideoItem example : (works)
QGraphicsView * graphicsView = new QGraphicsView;
QMediaPlayer * player = new QMediaPlayer;
QGraphicsScene * scene = new QGraphicsScene;
graphicsView->setScene(scene);
QGraphicsVideoItem *item = new QGraphicsVideoItem;
player->setVideoOutput(item);
graphicsView->scene()->addItem(item);
graphicsView->show();
player->setMedia(QUrl::fromLocalFile(fileName));
player->play();
Thanks.
↧