Playing *.avi files with Qt

瘦欲@ 提交于 2021-01-29 07:46:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!