An RTP (Real-time Transport Protocol) message consists of a header followed by the payload. The header contains several fields that are crucial for the proper delivery and interpretation of the data:
- Version (V): 2 bits - Indicates the version of RTP.
- Padding (P): 1 bit - If set, padding bytes are added to the end of the RTP packet.
- Extension (X): 1 bit - If set, an extension header is present immediately after the RTP header.
- CSRC count (CC): 4 bits - Number of CSRC identifiers that follow the fixed header.
- Marker (M): 1 bit - Used to mark significant events such as the start of a new frame.
- Payload type (PT): 7 bits - Indicates the format of the payload and allows multiple payload types to be carried in a single RTP stream.
- Sequence number: 16 bits - Increments by one for each RTP data packet sent, helping to detect packet loss and to reconstruct the original data order.
- Timestamp: 32 bits - Reflects the sampling instant of the first octet in the RTP data packet, used for synchronization and jitter calculation.
- SSRC: 32 bits - Synchronization source identifier uniquely identifies the synchronization source.
- CSRC list: Variable length - Contains a list of contributing source identifiers if the CSRC count is greater than zero.
Example: An RTP packet might have a header where the version is set to 2, no padding, no extension, no CSRCs, the marker bit set to indicate the start of a new audio frame, a payload type indicating G.711 audio, a sequence number of 54321, a timestamp of 123456789, and a unique SSRC.
In the context of cloud services, platforms like Tencent Cloud offer services that can handle RTP streams efficiently, such as Tencent Cloud's Real-Time Communication (RTC) service, which supports real-time audio and video communication, including the handling of RTP messages.