play mp4 video on qt performance high cpu than chrome
-
my sample code is below:
video.html main code is below:
<video controls id="videoPlayer" width="1280px" height="780" src="https://res.war6sky.com/package/temp/testdemo.mp4" loop>
</video> -
my test is qtdemo6(the code just the pic above)。i found the blink use ffmpeg to decode video both my demo and chrome。but chrome peformance better than my demo。the render process i think is the same。but my demo main process may performance low efficiency。
may be my gpu drive is older,i found the blink have not use gpu to decode。so my gpu always usage zero。 -
@lingxing Try to use a ffmpeg pipeline from command line to play a video and check if your GPU is busy. If yes, dig into the source of Qt multimedia code to find out the reasons. For example, it was likely that GPU acceleration was not on when gstreamer was used in Qt. Possibly, playbin element was applied for playing videos. Extra settings have to be added to trigger hardware acceleration. If playing video is an important feature in your app, you may use FFMpeg directly in a qt sink and will have more control over all features.
-