问题
I am trying to play *.avi file (~900MB) with this code:
QMediaPlayer* player = new QMediaPlayer(this);
player->setMedia(QUrl::fromLocalFile("mes1.avi"));
player->setVideoOutput(ui->videoWidget);
player->play();
where ui->videoWidget
is QVideoWidget
and every time I play it I am getting this error code (in Application Output console)
Since google doesn't help, this is my only choice...
DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)
EDIT1: I have installed K-Lite Codec Pack 12.2.6.
EDIT2: My application is 32bit, but it shouldn't be a problem since K-Lite include 32bit (source).
回答1:
Use vlc-qt, and you will find it is so easy to play all sorts of video on all platforms, even XP, which has been abandoned by qt long time ago.
来源:https://stackoverflow.com/questions/38572619/playing-avi-files-with-qt