NVIDIA Jetson AGX Thor - GstShark benchmarks and profiling tools for GStreamer
Overview
GstShark is an open-source project from Ridgerun that provides benchmarks and profiling tools for GStreamer 1.7.1 (and above). It includes tracers for generating debug information plus some tools to analyze the debug information. GstShark provides easy-to-use and useful tracers, paired with analysis tools to enable straightforward optimizations.
GstShark leverages GStreamer's tracing hooks and open-source and standard tracing and plotting tools to simplify the process of understanding the bottlenecks in your pipeline.
Promo/Demo Video
Features
GstShark is a set of data acquisition tools that yield some intermediate results and some data analysis tools that process those results.
Tracers
GstShark currently includes nine different tracers. They are described in detail in the tracers section later in this documentation.
| Tracer | Description |
|---|---|
| InterLatency | Measures the latency time at different points in the pipeline. |
| ProcTime | Measures the time an element takes to produce an output given the corresponding input. |
| Framerate | Measures the number of frames that go through a src pad every second. |
| ScheduleTime | Measures the amount of time between two consecutive buffers in a sink pad. T |
| CPUUsage | Measures the CPU usage every second. In multiprocessor systems, these measurements are presented per core. |
| Graphic | Records a graphical representation of the current pipeline. |
| Bitrate | Measures the current stream bitrate in bits per second. |
| Queue Level | Measures the amount of data queued in every queue element in the pipeline. |
| Buffer | Prints information of every buffer that passes through every sink pad in the pipeline. This information contains PTS and DTS, duration, size, flags, and even refcount. |
Results generated
GstShark outputs two sets of data that are relevant for the debugging of the pipelines.
| Data | Description |
|---|---|
| CTF trace files | Trace files that comply with the standard Common Trace File format. |
| Pipeline diagram | Useful visualization of the pipeline generated by the graphic tracer. |
Analysis tools
GstShark provides some analysis tools that will help in parsing and extracting useful information from the trace data.
| Tool | Description |
|---|---|
| GstShark plot | Octave scripts that process the trace files into easy-to-understand charts. |
| Eclipse plugins | Experimental support for loading trace files into Eclipse and providing charts. |
Examples
The following section provides example usages of various GStreamer tracers:
- CPU Usage.
- Framerate
- Processing time
- Scheduling time
- Interlatency
CPU Usage
GST_DEBUG="GST_TRACER:7" GST_TRACERS="cpuusage" gst-launch-1.0 videotestsrc is-live=true num-buffers=10000 ! \ nvvidconv ! "video/x-raw(memory:NVMM)" ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=test.mp4 -e
Framerate
GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc num-buffers=1800 ! tee name=tee0 ! queue ! videorate ! video/x-raw,framerate=60/1 ! fakesink sync=true tee0. ! queue ! videorate ! video/x-raw,framerate=30/1 ! fakesink sync=true tee0. ! queue ! videorate ! video/x-raw,framerate=15/1 ! fakesink sync=true
Processing time
GST_DEBUG="GST_TRACER:7" GST_TRACERS="proctime" gst-launch-1.0 videotestsrc num-buffers=60 ! \ tee name=tee0 \ tee0. ! queue ! identity sleep-time=10000 ! fakesink \ tee0. ! queue ! identity sleep-time=30000 ! fakesink \ tee0. ! queue ! identity sleep-time=50000 ! fakesink
Scheduling time
GST_DEBUG="GST_TRACER:7" GST_TRACERS="scheduletime" gst-launch-1.0 \ videotestsrc is-live=true do-timestamp=true num-buffers=50 ! \ 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1' ! \ nvvidconv ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=test.mp4 -e
Interlatency
GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency" gst-launch-1.0 \ videotestsrc is-live=true do-timestamp=true num-buffers=50 ! \ 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1' ! \ nvvidconv ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=test.mp4 -e
Getting Started
To know more about the extension, please refer to the GstShark Getting Started wiki page.
Contact Us
For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.
Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.