AnsweredAssumed Answered

i.MX6 Video Latency

Question asked by Allan Matthew on Mar 7, 2014
Latest reply on Mar 10, 2014 by Allan Matthew

I'm working with the i.MX6Q on a Boundary Devices BD-SL-i.MX6 and I'm having some interesting results using Gstreamer and mfw_v4lsrc/mfw_v4lsink and the hardware encoder.  I'm running Ubuntu 12.04 on Boundary's 3.0.35 kernel.

 

I'm testing latency by pointing the Boundary Devices OV camera module(s) (parallel and MIPI, same results) at a stopwatch and placing the output display next to the stopwatch.  I take a picture and the delta in the displayed stopwatch value vs the actual stopwatch value I'm calling my latency.

 

When outputting directly from the camera to an HDMI screen connected to the BD-SL-i.MX6 using the command

gst-launch-0.10 mfw_v4lsrc capture-mode=4 ! mfw_v4lsink --disp-width=1280 --disp-height=720 sync=false -v

I get a latency of 117ms (which seems very high to me).

 

I want to stream this over a network, so I'm using the vpuenc, h264 payloader and udp sink:

gst-launch-0.10 mfw_v4lsrc capture-mode=4 ! vpuenc codec=6 bitrate=$BITRATE! rtph264pay ! udpsink host=$HOST port=5000 sync=false -v

And on the receiver side (also BD-SL-i.MX6)

gst-launch-0.10 udpsrc port=5000 caps=(caps from source) ! rtph264depay ! vpudec low-latency=true ! ffmpegcolorspace ! mfw_v4lsink sync=false -v

 

This transmits the h.264 video nicely, but when I measure the latency I get the exact same latency (117ms) as if there was no network!  What is going on here?!  I would imagine the network connection (ethernet->router->wifi) and encode/decode should introduce at least a couple milliseconds, and probably quite a few more.

 

Is there some buffering or delay in the first command (camera->HDMI out) that I'm unaware of?  I'm hoping to reduce this latency as much as possible, down to the limit of what the encode/transmit/decode is capable of.

 

Thanks!

Outcomes