没有插件报错:DirectShowPlayerService::doRender: Unresolved error code 0x80040266

如果文件路径不对或者文件名是中文的,则会显示如下错误:

DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x80004005 ()

参考博客:https://blog.csdn.net/qqwangfan/article/details/52469859

 

在工程中添加 :QT += multimedia multimediawidgets

头文件:

#include <QVideoWidget>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVBoxLayout>
#include <QFileDialog>
#include <QDebug>

下载并安装  LAVFilters:https://github.com/Nevcairiel/LAVFilters/releases

installer方式直接按步骤安装

压缩包方式解压右键以管理员运行 install_video.bat 文件

切记:需要重启电脑

 

完美,没毛病。。。。。。

Qt播放视频报错 DirectShowPlayerService::doRender: Unresolved error code 0x80040266

测试代码:



void MainWindow::player()
{

    QString fileName=QFileDialog::getOpenFileName(this,"Open Videos");
    QVideoWidget *videoWidget=new QVideoWidget();
    this->setCentralWidget(videoWidget);
    QMediaPlayer *player=new QMediaPlayer;
    player->setVideoOutput(videoWidget);
    player->setMedia(QUrl::fromLocalFile(fileName));

    player->play();

    qDebug()<<fileName;



}

 

相关文章:

  • 2021-10-22
  • 2022-02-14
  • 2021-12-30
  • 2021-06-05
  • 2022-01-12
  • 2022-01-03
  • 2021-11-09
猜你喜欢
  • 2021-08-25
  • 2021-05-05
  • 2021-05-26
  • 2021-12-16
  • 2021-05-26
  • 2021-11-11
  • 2022-03-01
相关资源
相似解决方案