Hello,
I am creating a media player application that can play streams from the camera, local files (MP4, MKV), and online streams.
I have got NXP i.MX8M Plus EVK board, and decided to use the Qt framework to develop the application.
I referred to i.MX Yocto Project's User Guide, which guides through the process to create the Linux image using Yocto. I followed all the steps to create a full image (imx-image-full, to include Qt6) for the imx8mp-lpddr4-evk machine, using fsl-imx-wayland distro.
After flashing the image to the board, I ran the video widget sample application provided in Qt6 to play an MP4 file with a resolution of 1920x1080. In an ideal state (video not being played) the CPU consumption remains around 3-5%. However, as soon as the video is played, the CPU consumption shoots to around 50%.
Also, I verified the CPU consumption by playing the same video using a gstreamer pipeline as mentioned in i.MX8 GStreamer User Guide.
gst-launch-1.0 filesrc location=<filename.mp4> ! qtdemux name=d d.video_0 ! queue ! h264parse ! vpudec ! queue ! waylandsink
and
gst-launch-1.0 filesrc location=<filename.mp4> ! qtdemux name=d d.video_0 ! queue ! h264parse ! v4l2h264dec ! imxvideoconvert_g2d ! queue ! waylandsink
The CPU consumption with gstreamer, in both cases, remains around 5% which is 10th of the Qt application.
Here are the questions.
- Is this normal behavior with Qt multimedia applications on i.MX8M Plus board?
- If not then what could be the problem? If a single stream consumes around 50% then running 3 streams simultaneously from a single application can exhaust the core.
- Any pointers to verify the Yocto configuration? Maybe something related to Qt configuration.
- How to verify if the Qt application is using hardware decoders and the rendering system?
Looking forward to your response to resolve this problem.
Regards,
Aekam Parmar