Fix rtp_analyzer tool

- Make rtp_analyzer work with a single SSRC
- Simplify rtp_analyzer.sh (it allows to run the python script
  from any directory)
- Update README.md (simplified, added missing dependency)

Bug: webrtc:10829
Change-Id: Idb82e7228918a973778762a39b732ce3b26b6bbc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146711
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28668}
This commit is contained in:
Alessio Bazzica 2019-07-24 16:33:01 +02:00 committed by Commit Bot
parent 7db19e0b02
commit 418f0c5ff9
4 changed files with 30 additions and 43 deletions

View file

@ -1,32 +0,0 @@
This file describes how to set up and use the RTP log analyzer.
First build the tool with
ninja -C out/my_build webrtc:rtp_analyzer
The tool is built by default, so
ninja -C out/my_build
is enough.
After building, run the tool as follows:
./out/my_build/rtp_analyzer.sh [options] <rtc event log>
where <rtc event log> is a recorded RTC event log, which is stored in
protobuf format. Such logs are generated in multiple ways, e.g. by
Chrome through the chrome://webrtc-internals page.
Options:
-h, --help show this help message and exit
--dump_header_to_stdout
print header info to stdout; similar to rtp_analyze
--query_sample_rate always query user for real sample rate
The script has been tested to work in python versions 3.4.1 and 2.7.6,
but should work in all python versions.
Working versions of NumPy (http://www.numpy.org/) and matplotlib
(http://matplotlib.org/) are needed to run this tool. See this link
with installation instructions (http://www.scipy.org/install.html).

View file

@ -0,0 +1,26 @@
# RTP log analyzer
This file describes how to set up and use the RTP log analyzer.
## Build
```shell
$ autoninja -C out/my_build webrtc:rtp_analyzer
```
## Usage
```shell
./out/my_build/rtp_analyzer.sh [options] /path/to/rtc_event.log
```
where `/path/to/rtc_event.log` is a recorded RTC event log, which is stored in
protobuf format. Such logs are generated in multiple ways, e.g. by Chrome
through the chrome://webrtc-internals page.
Use `--help` for the options.
The script requires Python (2.7 or 3+) and it has the following dependencies:
Dependencies (available on pip):
- matplotlib (http://matplotlib.org/)
- numpy (http://www.numpy.org/)
- protobuf (https://pypi.org/project/protobuf/)

View file

@ -90,7 +90,7 @@ class RTPStatistics(object):
"""Queries user for SSRC."""
if len(self.ssrc_frequencies) == 1:
chosen_ssrc = self.ssrc_frequencies[0][-1]
chosen_ssrc = self.ssrc_frequencies.keys()[0]
self.PrintSsrcInfo("", chosen_ssrc)
return chosen_ssrc

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
@ -6,12 +6,5 @@
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
set -e
WORKING_DIR=$(pwd)
cd $(dirname $0)
PYTHONPATH="../../third_party/protobuf/python/"
if [ -z ${PYTHON_EXECUTABLE+x} ]
then
PYTHON_EXECUTABLE=python3
fi
exec $PYTHON_EXECUTABLE "rtp_analyzer.py" $@ --working_dir $WORKING_DIR
BASE_DIR=`dirname $0`
python "${BASE_DIR}/rtp_analyzer.py" $@ --working_dir $BASE_DIR