A library for transmitting/receiving TTML documents over RTP as per RFC 8759.
This library is very minimal. It takes documents as strings, encodes them as an RTP payload, and sends them over UDP. It's doesn't currently implement any of the RTP control mechanisms, SDP, FEC, document validation, document rendering etc. PRs welcome if you want to add these features!
This library makes use of RTP and rtpPayload_ttml for encoding/decoding the payload bitstreams.
pip install rtpTTML
There are fully functional transmitter and receiver examples in the examples directory. The bare minimum usage is as follows.
from rtpTTML import TTMLReceiver
def processDoc(doc, timestamp):
print("{}\n".format(doc))
port = 12345
client = TTMLReceiver(port, processDoc)
client.run()
from time import sleep
from datetime import datetime
from rtpTTML import TTMLTransmitter
address = "127.0.0.1"
port = 12345
with TTMLTransmitter(address, port) as tx:
while True:
docStr = generateDoc(tx.nextSeqNum)
nowTime = datetime.now()
tx.sendDoc(docStr, nowTime)
sleep(1)
If you are looking to debug RTP TTML packets on the wire, you might be interested in the wireshark disector available here.
We desire that contributors of pull requests have signed, and submitted via email, a Contributor Licence Agreement (CLA), which is based on the Apache CLA.
The purpose of this agreement is to clearly define the terms under which intellectual property has been contributed to the BBC and thereby allow us to defend the project should there be a legal dispute regarding the software at some future time.
If you haven't signed and emailed the agreement yet then the project owners will contact you using the contact info with the pull request.
See LICENSE.
- James Sandford
For further information, contact cloudfit-opensource@rd.bbc.co.uk