Measuring omxh264 enc latency

Sebastian Dröge sebastian at centricular.com
Mon Jun 6 06:28:05 UTC 2016


On Fr, 2016-06-03 at 21:25 +0000, Sankar,Aswin Pranav wrote:
> I am looking to profile my rather simple Gstreamer pipeline for a
> school project (Essentially videotestsrc ! omxh264enc ! rtph264pay,
> with a gst-rtsp-server wrapped around it). I wanted to resolve some
> questions regarding it:
> 1) The GstVideoEnc base class (http://code.metager.de/source/xref/fre
> edesktop/gstreamer/gst/plugins-base/gst-
> libs/gst/video/gstvideoencoder.c) says that the function which is
> registered as the callback to the base class's handle_frame() will
> run first. In the end, to transfer the frame to the downstream
> element, the derived class should call
> gst_video_encoder_finish_frame().
> 
> 2) However, GstVideoEnc does not talk about handle_output_frame(),
> which seems to be specific to GstOMXVideoEncClass (https://github.com
> /tjormola/gst-omx/blob/master/omx/gstomxvideoenc.h). A callback to
> this is registered by omxh264enc, and it is this function that
> finally calls _finish_frame().
> 
> 3) So what happens between _handle_frame and handle_output_frame?
> _handle_frame() does not call any other function. My intuition is
> that _handle_frame does something to offload the computation to the
> OMX API (not visible in the code) and stores the result in a buffer
> in memory and transfers control back to the parent class
> (GstOMXVideoEncClass) at which time the parent class calls
> handle_output_frame. Am I right? 

This passes the video frame to OMX:
https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideoenc.c#n1605

And this here (in another thread!) gets the encoded from back from OMX:
https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideoenc.c#n647

Note that frames might be reordered, you might get them in a different
order from OMX than the order in which you passed them there.

> 4) So is it right to measure the the time taken from the beginning of
> _handle_frame to when _finish_frame is called as the time the frame
> spends in the plugin? 

Yes, for that specific frame (the GstVideoCodecFrame).

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-openmax/attachments/20160606/32b3421f/attachment.sig>


More information about the gstreamer-openmax mailing list