GStreamer element latency benchmarking

GStreamer element latency benchmarking

The following C++ application allows to measure the latency of the Video encoder by probing corresponding GStreamer element outputs.

The example has been prepared for RZ/V2H and a connected MIPI-CSI2 camera (e-CAM22). main.cpp contains the GStreamer pipe in string format and can easily be adapted.

Probes are taken at GStreamer element outputs.
These elements get a “name=” attribute. probe.attach_to_element_pad() is used to add the probing for the element output.

The example probes the data of 50 seconds runtime to collect more than 1000 probes per element.

The cross-compilation of the application is straight forward.
Source the SDK and start cmake and make:

unset LD_LIBRARY_PATH source /opt/rz-vlp/5.0.6/environment-setup-cortexa55-poky-linux rm -rf build; mkdir -p build cd build cmake .. make


The application “encoder_latency_recorder” writes out a .csv file (latency_stages.csv) with the measured latencies.

Finally, the Python script “encoder_latency_analyzer.py” is used to summarize the result with a bit statistics.

python3 encoder_latency_analyzer.py latency_stages.csv > latency_benchmark.txt

 

Latency results encoder latency (encoder_out - vspmfilter_out): samples : 1662 avg : 56.614 ms min : 35.424 ms P50 : 56.523 ms P90 : 56.716 ms P95 : 57.639 ms P99 : 57.795 ms max : 77.401 ms stddev : 0.801 ms