This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

need help benchmarking H264 compression

Other Parts Discussed in Thread: DM3730

I'm trying to benchmark H264 encoding performance on an OMAP3. The goal
is to do real time live network streaming with low latency for a video
conferincing type application.

I'm running on an DM3730.

I'm using Linux kernel version 2.6.32 with gstreamer 0.10.36
and the gstreamer-ti_svn.bb recipe from openembedded
classic (0b667441e530865a5b93b0b412b7fdd9be48ba63 from
git://github.com/openembedded/openembedded.git) (which uses svn srcrev
822 from svn://gforge.ti.com/svn/gstreamer_ti/trunk)

My gstreamer pipeline is "v4l2src ! queue ! dmaienc_h264 ! fakesink"

To do benchmarking, I've inserted an identity filter before and after
the dmaienc_h264, and have connected to the "handoff" signal. This way,
I can tell how much time dmaienc_h264 spends processing a buffer.

My v4l2src is a real camera, with a real world scene that is relatively
static. The camera always produces frames at 30fps, UYVY.

When running at 320x240 (v4l2src ! video/x-raw-yuv,width=320,height=240
! ... ), things go well, and dmaienc_h264 takes anywhere from 3.7ms to
15.5 ms per frame.

When running at 640x480, however, things don't go so well. dmaienc_h264
takes anywhere from 30ms to 52ms per frame, and cannot keep up with real
time encoding requirements. If I omit the queue, frames get dropped,
which violates other requirements for this project.

My baseline encoding settings are "dmaienc_h264 intraframeinterval=4
ratecontrol=1 encodingpreset=0 targetbitrate=700000", although I have
tried a number of variations to get that encoding time to come down,
without success.

So here are my questions:

Is this behavior expected? If it is not expected, what am I doing wrong?
How can I get real time low latency H264 encoding at 640x480?

  • Someone pointed me to the metrics in dvsdk-4_03_00_06/codecs-omap3530_4_02_00_00/packages/ti/sdo/codecs/h264enc/docs 

    I have to confess, I'm not certain I understand their metrics.

    I can confirm I'm ARM@1GHz (via cpufreq-info) and IVA2@800MHz (via /sys/kernel/debug/clock/virt_26m_ck/osc_sys_ck/sys_ck/dpll2_ck/dpll2_m2_ck/iva2_ck/rate) and DDR@200MHz (via x-load inspection).

    In table 2 they give some test cases and peak and average ratings in "MCPS". Earlier versions of the SDK have documents with similar numbers in "Mega cycles". I'm assuming "MCPS" is "mega cycles per second", measured at an ARM rate of 1GHZ, so anything less than 1000 would be "better than real time".

    Reading the table for 352x288@30fps (close to my 320x240 test case), I see 125/190 average/peak MCPS. I'd interpret this as 4.15ms/6.33ms average/peak per frame.

    Similar for the 720x480@30fps (close to my 640x480 test case), I see 340/440, or 5.66ms/7.33ms average/peak per frame.

    Does this sound right?