The Python binding is available for both Python2 (tested with version 2.7 only) and Python3 (tested with version 3.4). The examples on this page require that you first build and install the Python binding on your system.
An example is provided in
contrib/python/example.py. You may execute it to exercise the Python binding:
$ python ./contrib/python/example.py 10 create a stream of RTP packets 10 60-byte RTP packets created with 20-byte payload create ROHC compressor create ROHC decompressor .......... all 10 packets were successfully compressed 232 bytes (39%) saved by compression
The example program accepts additional options to make it more verbose:
$ python ./contrib/python/example.py 10 usage: example.py packets_number [verbose [verbose]]
If you specify
verbose once, the program prints more information for every packets it compresses then decompresses. If you specify
verbose twice, the program prints ROHC library traces for every packets it compresses then decompresses.
The non-regression was re-implemented in Python. It is useful to fully test the Python binding.
$ USE_PYTHON=2.7 make -C test/non_regression/ check # for Python 2.7 $ USE_PYTHON=3.4 make -C test/non_regression/ check # for Python 3.4