I have encountered issue of high latency and CPU usage when using vpudec (Gstreamer plugin) to decode h.264 video stream from an IP camera using i.MX8MP board.
the gstreamer script I used to run the application is as follows:
$ gst-launch-1.0 rtspsrc location=<rtsp_source> latency=0 ! rtph264depay ! h264parse ! vpudec ! fakesink
I have used the GST_DEBUG tool to print out the interlatency and cpuusage between each event and the figures below are the results I obtained.
When using vpudec:

When using v4l2h264dec:

When using avdec_h264:

As you can see from the pictures, when using vpudec, the cpu usage is still very high (20 - 48%), and the latency is about 600ms. When using v4l2h264dec, the cpu usage is between (11 - 41%), the latency is about 500ms. While using avdec_h264, the cpu usage is between (14 - 32%), and the latency is about 80ms.
Based on my testing, the avdec_h264 has the lowest latency to decode the video, while vpudec has the highest cpuusage and latency which is abnormal.
May I know, is there anything that I need to configure in the meta-layer before building the Yocto image for the vpu to work? For this application, I have built my own custom image using imx-image-core as the base. Thanks in advance!