Search code examples
gstreamer-1.0imx6

1080p @ 60fps for the iMX 6 Quad or iMX 8?


I am attempting to do video encoding and streaming simultaneously on the iMX 6 Quad. Currently, this is the pipeline that I am using:

gst-launch-1.0 -v videotestsrc num-buffers=300 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=60/1! videoconvert ! video/x-raw,format=I420 ! \
   tee name=t \
   t. ! queue ! imxvpuenc_h264 ! h264parse ! mp4mux ! filesink location="test-3.mp4" \
   t. ! queue ! imxipuvideosink

Note that the videotestsrc is to simulate a camera that has a YUY2 output format.

I can't go beyond 720p @ 60fps [this includes any frame-rate for 1080p as well]. Is this a performance bottleneck due to the hardware or the pipeline that I have setup? Because I am getting warning messages like this:

   WARNING: from element /GstPipeline:pipeline0/GstImxIpuVideoSink:imxipuvideosink0: A lot of buffers are being dropped.
   Additional debug info:
   gstbasesink.c(2902): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstImxIpuVideoSink:imxipuvideosink0:
   There may be a timestamping problem, or this computer is too slow.

Also, if anyone has an iMX 8 board, could you attempt to run 1080p @ 60fps and see whether this pipeline has any performance issues?

gst-launch-1.0 -v videotestsrc num-buffers=300 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=60/1! videoconvert ! video/x-raw,format=I420 ! \
   tee name=t \
   t. ! queue ! imxvpuenc_h264 ! h264parse ! mp4mux ! filesink location="test-3.mp4" \
   t. ! queue ! imxipuvideosink

Solution

  • There are several bottlenecks in your pipeline:

    1. First of all, having videotestsrc generate a 1080 stream is way too much. I recommend using a camera if possible or, at least, changing the pattern property to black.
    2. Don't use videoconvert, that is software based. In the imx6 you may use imxipuvideotransform or imxg2dvideotransform which are HW based.