Last Updated on 2020-10-14 by Clay
Introduction
Today when I using PyQt5 framework to build a video player service, I got an error message at QMediaPlayer:
DirectShowPlayerService::doRender: Unresolved error code 0x8040266 (IDisspatch error #102)
After searching some website, I found an useful discussion: https://stackoverflow.com/questions/53328979/directshowplayerservicedorender-unresolved-error-code-0x80040266
They proposed a possibility: the backend of QMediaPlayer only supports avi format, not mp4 format.
In order to solve the problrm, we must download the supported decoder and install it. We can choose K-lite codecs or LAV Filters, I will demonstrate the installation of K-lite in here.
Install K-lite
First we go to the website of K-lite codecs.
Choose Normal installer.
Choose Download Basic.
Download Mirror 1.
After downloading, double click to execute the program. As long as you keep selecting Next, the installation process will be completed.
Then we run the program that failed.
Looks like it can be played normally.
I followed these steps and it works however when I build the exe using pyisntaller and run the exe on my computer I still get back the same error, however the error does not persist when running the appliaction from python itself.