AnsweredAssumed Answered

VPU perfomance on i.MX6 Solo (1080p30 encode + loopback)

Question asked by Ivo Strasil on Jan 23, 2015
Latest reply on Jan 26, 2015 by igorpadykov

We would like to do 1080p30 video encoding (H.264 if possible) and preview (video loopback) at the same time on i.MX6. Is that possible?


We did some measurements and while we can do either 1080p30 encoding or video loopback, it seems that doing both things at same time seems problematic.




I did measurements of VPU video encoding performance with help of mxc_vpu_test.out unit test. Since it is not possible to encode live stream from camera while running mxc_v4l2_overlay.out or GStreamer pipeline with mfw_v4lsrc (two processes accessing one V4L device), I saved 100 frames from camera into ramdisk (/tmp) via filesink, which I use to measure video encoder performance. The input data are therefore always exactly the same.


In the table below you can see results (enc fps from mxc_vpu_test.out) from several different scenarios:

  • Only mxc_vpu_test.out running, so there is nothing else utilizing the VPU except the encoder test itself.
  • mxc_vpu_test.out running together with GStreamer pipeline consisting of mfw_v4lsrc and mfw_isink.
  • mxc_vpu_test.out running together with mxc_v4l2_overlay.out unit test, which passes data directly from camera to framebuffer.


We use 32bit framebuffer, because using 16 bits means less colors and ugly banding in the resulting image on the display. I have also included results measured with 16bits framebuffer, so you can compare the results.


only mxc_vpu_test.out runningonly mxc_vpu_test.out running
codec / gopsizegop = 1gop = 5gop = 10gop = 15codec / gopsizegop = 1gop = 5gop = 10gop = 15
mxc_vpu_test.out & gst-launch mfw_v4lsrc ! mfw_isinkmxc_vpu_test.out & gst-launch mfw_v4lsrc ! mfw_isink
codec / gopsizegop = 1gop = 5gop = 10gop = 15codec / gopsizegop = 1gop = 5gop = 10gop = 15
mxc_vpu_test.out & mxc_v4l2_overlay.out
codec / gopsizegop = 1gop = 5gop = 10gop = 15


As you can see, there is huge performance drop when using isink for video loopback. The performance is not sufficient for encoding the video stream in real time, so the resulting stream is missing some frames. Using mxc_v4l2_overlay.out seems to be much better alternative, unfortunately we are not sure if we can combine it with GStreamer.


Is it possible to use mxc_v4l2_overlay.out for video loopback and GStreamer for video saving at same time?


Thanks a lot for any answer.