ui->graphicsView Error: "Internal data stream error."
-
i use graphicsView to get video stream that codes work fine!! but if i use tab widget or stacked widget when i click another tab i take Error: "Internal data stream error." and stream closed.
if i used qvideowidget i never take an error everything works fine!!! but i dont want to use videowidget!!
i hope u will understand my english
whats the problem for graphicView??
QMediaPlayer *player1 = new QMediaPlayer; QGraphicsVideoItem *item = new QGraphicsVideoItem; QGraphicsScene *scene = new QGraphicsScene(this); QSizeF size(280,160); item->setSize(size); ui->graphicsView->setScene(scene); scene->addItem(item); const QUrl url1 =QUrl("http://xxx.xx.x.xx:80/mjpg/video.mjpg"); const QNetworkRequest requsetRstp1(url1); player1->setMedia(requsetRstp1); player1->setVideoOutput(item); player1->play();
AND THIS IS THE WORKING CODE WITH NO PROBLEM BUT I DONT WANT TO USE
QVideoWidget *vw1 = new QVideoWidget; QMediaPlayer *player1 = new QMediaPlayer; ui->gridLayout->addWidget(vw1,0,0); player1->setVideoOutput(vw1); const QUrl url1 =QUrl("http://XX.XXX.XX.XX:8084/mjpg/video.mjpg"); const QNetworkRequest requsetRstp1(url1); player1->setMedia(requsetRstp1); player1->play();
thanks.
-
Hi and welcome to devnet,
What version of Qt are you using ?
On what platform ? -
Hi
You get the error when you put the graphicsView into a stacked or tabbed and switch "page" ?
Is that correctly understood ? -
its a simple i do it for explane...
first video is videowidget and the second video is graphicsview okay.. when i swich another page and turn back ...
second one graphicview stoped but video widget still running..
and the code simple u can copy paste url will work for u too...//player 1 videowidget QVideoWidget *vw1 = new QVideoWidget; QMediaPlayer *player1 = new QMediaPlayer; ui->gridLayout->addWidget(vw1,0,0); player1->setVideoOutput(vw1); const QUrl url1 =QUrl("http://131.95.3.162:80/mjpg/video.mjpg"); const QNetworkRequest requsetRstp1(url1); player1->setMedia(requsetRstp1); player1->play(); //player 2 graphicview QMediaPlayer *player2 = new QMediaPlayer; QGraphicsVideoItem *item = new QGraphicsVideoItem; QGraphicsScene *scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); scene->addItem(item); const QUrl url2 =QUrl("http://131.95.3.162:80/mjpg/video.mjpg"); const QNetworkRequest requsetRstp2(url2); player2->setMedia(requsetRstp2); player2->setVideoOutput(item); player2->play();
-
Hi
Good with the test code. And the video worked! :)
Took some seconds then it showed.
However, i could not get any errors on Windows 10 using stackedwidget.
So i think it gstreamer / linux related.Also from the error PaintEngive: should no longer be called it really seems like something goes bad internally.