qt 播放视频没有图像


    QMediaPlaylist * playlist;
    QMediaPlayer * player;
    QVideoWidget * videoWidget;



   playlist = new QMediaPlaylist;
    player = new QMediaPlayer;
    videoWidget = new QVideoWidget;

    setCentralWidget(videoWidget);
    //"D:/Users/Qt_project/Video_Try/3.avi
    playlist->addMedia(QUrl::fromLocalFile("C:/Users/tclxa/Desktop/fire.mp4"));
    playlist->setCurrentIndex(0);
    player->setPlaylist(playlist);
    player->setVideoOutput(videoWidget);

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



出现 下面error

DirectShowPlayerService::doRender: Unresolved error code 80040266



解决方法:

电脑安装 LAV Filter


https://www.fosshub.com/LAV-Filters.html

你可能感兴趣的:(QT)