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