How to solve the problem of high CPU usage of 1080p video playback on db410c Debian system

Hello.
Now I have a problem. I hope to get your help in video playing;
When playing 1080p video with MPV or VLC tools, there is a jam and the CPU usage is very high. What is the reason and how to solve it?

The Debian release version of this test is 19.01, 17.09
https://releases.linaro.org/96boards/dragonboard410c/linaro/debian/19.01/

The screenshot of CPU utilization is as follows,
cpuusage

Thanks
Feng

Probably because the tools you’re using decode the video in software, which is heavy task. The dragonboard has a hardware video decoder exposed via v4l2 interface but it does not seem supported by vlc or mpv (https://github.com/mpv-player/mpv/issues/4677).

The solution could be to either use gstreamer or ffmpeg using the commands provided in the release note: https://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/

ffplay -sync video -an -autoexit -vcodec h264_v4l2m2m -i <an h264 video clip>

or

 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=<path to file> ! qtdemux name=m m.video_0 ! h264parse ! v4l2h264dec capture-io-mode=dmabuf ! glimagesink

Yeah, what @loic said. If you had a more powerful SBC, it would be able to handle the decoding in software a lot better. Basically, for that resolution in software decoding, you would need one of the boards with Cortex-A7x or Kryo cores, which includes Dragonboard 8xx, Hikey9x0, Rock960.

Hi,Loic

Thank you very much for your reply,
According to your suggestion, we did two tests on version 19.01,

one:
The command used is: ffplay - sync Video - an - autoexit - vcodec H264 ﹣ v4l2m2m - i bgzc.mkv
It can be seen that the CPU utilization has decreased a little, but it still feels high, as shown in the following figure:
At the same time, when playing, there is no sound. What’s the reason?


two:

GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=bgzc.mkv ! qtdemux name=m m.video_0 ! h264parse ! v4l2h264dec capture-io-modee=dmabuf ! glimagesink

The playback failed. log as below;
Setting pipeline to PAUSED …
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is PREROLLING …
Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(Gstt
GLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:m: This file is invalid and cannot be played.
Additional debug info:
qtdemux.c(747): gst_qtdemux_pull_atom (): /GstPipeline:pipeline0/GstQTDemux:m:
atom has bogus size 440786851
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …

Regards
Feng

Try the following instead:

ffplay -vcodec h264_v4l2m2m -i big_buck_bunny.mp4

For gstreamer you can use the following pipeline for mp4 (with audio):

GST_GL_PLATFORM=egl gst-launch-1.0 \
	filesrc location=./big_buck_bunny.mp4 ! qtdemux name=m \
	m.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink \
	m.video_0 ! queue ! h264parse ! v4l2h264dec capture-io-mode=dmabuf ! glimagesink

or for mkv (with audio):

GST_GL_PLATFORM=egl gst-launch-1.0 \
	filesrc location=./Panasonic_HDC_TM_700_P_50i.mkv ! matroskademux name=m \
	m.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink \
	m.video_0 ! queue ! h264parse ! v4l2h264dec capture-io-mode=dmabuf ! glimagesink

The GST_GL_PLATFORM=egl is supposed to also contribute to reducing cpu usage, but if it causes some strange rendering actifacts, just remove it. Moreover the mkv version does not work on release 20.02, I need to check that.

Hi,Loic
Thanks for your help,
we will test it ,soon,

thanks
Feng