Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are you using ?
    On what platform ?



  • @SGaist said in ui->graphicsView Error: "Internal data stream error.":

    What version of Qt

    5.13.1
    kubuntu 19.10


  • Lifetime Qt Champion

    Hi
    You get the error when you put the graphicsView into a stacked or tabbed and switch "page" ?
    Is that correctly understood ?



  • graphicsView working fine but when i click another page i take the error.
    if i use videowidget i dont take an error when i swiching pages .But i want to use graphicsview not videowidget



  • its a simple i do it for explane...
    1.png
    first video is videowidget and the second video is graphicsview okay.. when i swich another page and turn back ...
    2.png
    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();
    
    
    
    

  • Lifetime Qt Champion

    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.



  • thanks alot :)


Log in to reply