Script designed to plot graphs out of SRT core statistics.
SRT stands for Secure Reliable Transport and is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet.
- python 3.6+
- PhantomJS 2.1 optional to export plots
To install the library dependencies run:
pip install -r requirements.txt
The main purpose of plot_srt_stats.py
script is to visualize SRT core statistics produced during experiments by one of the testing applications like srt-xtransmit and srt-live-transmit or third-party solutions supporting SRT protocol. Depending on whether this statistics is collected on sender or receiver side, the data plotted may vary.
SRT core statistics should be collected in a .csv
file. Usually, as a naming convention rule the file name ends either on "-snd" or "-rcv" depending on the side (sender or receiver) where the data was collected. Or, file name can just contain "snd" or "rcv" part in it.
Statistics filepath is passed as an argument to a script. Script usage
plot_srt_stats.py [OPTIONS] STATS_FILEPATH
Use --help
option in order to get the full list of options
--is-sender Should be set if sender statistics is provided. Otherwise, it
is assumed that receiver statistics is provided.
--is-fec Should be set if packet filter (FEC) stats is enabled.
--export-png Export plots to .png files.
--help Show this message and exit.
For the usage with srt-live-transmit, make sure that the export of SRT statistics is enabled in .csv format. This can be done by passing the following parameters:
-statspf:csv
to ensure the CSV format is used when exporting.-statsout:/path/to/desired/folder/filename-rcv.csv
to define where to write the statistics-stats-report-frequency:1000
to define how often to write statistics (per # of packets), this example sets it to once per thousand packets.
More information on srt-live-transmit's command line parameters can be found here.
Note: Megabytes and Rate plots correlation is determined by the following formula
Rate (Mbps) = MB / interval (s),
where interval is the interval indicating how frequently the statistics is collected (in seconds).
The script plots different charts from SRT statistics. Examples of .csv
files and corresponding .html
output can be found in the examples folder. For example, a chart to visualize statistics on the packets being sent, lost, retransmitted, dropped or on flight:
The legends are interactive. You can click, e.g., on Dropped
and On Flight
to disable the respective plots:
Another chart illustrates the sending rate in Mbps:
Available size of the sender's buffer helps to detect if there is enough space to store outgoing data, or the source generates data faster then SRT can transmit: