The data in the live555 is sent in the end to be sent using the RTP protocol, which describes the RTP package format.
RTP Packet
RTP is based on the UDP protocol, and the RTP server passes the UDP protocol, typically sending an RTP packet each time. The client reads the data and then plays it by parsing the RTP packet.
The structure of the RTP packet is as follows:
- The head of the RTP HEADER:RTP packet
- Contributing sources: The number is 0-n, so it can be empty. Specific definition Reference rfc3550
- RTP payload: That is, the data to be transferred by RTP
RTP Header
This is the head of the RTP stream, search the RTP format on the net, will search many articles to introduce this head definition. Here we refer to the definition of rfc3550, in verse 5.1 (http://tools.ietf.org/html/rfc3550#section-5.1).
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| v=2| p| X| CC | m| PT | Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| Contributing Source (CSRC) identifiers |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each line is a count of bits, which gives you a visual view of the number of bits that each representation part occupies. Simply introduce:
V (Version): Version 2 BITS,RTP, here Unified for 2
P (padding): 1 bit, if set 1, is filled at the end of packet, padding is sometimes convenient for some packages for fixed-length algorithms
X (extension): 1 bit, if placed 1, the RTP header will follow a header extension
CC (CSRC count): 4 bits, indicating the number of contributing sources after the head
M (marker): 1 bit, specifically this definition will be in a profile
PT (playload type): 7 bits, indicating the type of multimedia being transmitted, the corresponding number is listed in another document RFC3551 (http://tools.ietf.org/html/rfc3551)
Sequence number:16 bits, sequence number per RTP packet is automatically added to the receiver to detect packet loss
Timestamp:32 bits, timestamp
Ssrc:32 bits, the ID of the synchronization source, the ID of no two sync sources cannot be the same
CSRC: As mentioned above, the number is specified by CC with a range of 0-15
RTP Packet
RTP is based on the UDP protocol, and the RTP server passes the UDP protocol, typically sending an RTP packet each time. The client reads the data and then plays it by parsing the RTP packet.
The structure of the RTP packet is as follows:
- The head of the RTP HEADER:RTP packet
- Contributing sources: The number is 0-n, so it can be empty. Specific definition Reference rfc3550
- RTP payload: That is, the data to be transferred by RTP
RTP Header
This is the head of the RTP stream, search the RTP format on the net, will search many articles to introduce this head definition. Here we refer to the definition of rfc3550, in verse 5.1 (http://tools.ietf.org/html/rfc3550#section-5.1).
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| v=2| p| X| CC | m| PT | Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| Contributing Source (CSRC) identifiers |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each line is a count of bits, which gives you a visual view of the number of bits that each representation part occupies. Simply introduce:
V (Version): Version 2 BITS,RTP, here Unified for 2
P (padding): 1 bit, if set 1, is filled at the end of packet, padding is sometimes convenient for some packages for fixed-length algorithms
X (extension): 1 bit, if placed 1, the RTP header will follow a header extension
CC (CSRC count): 4 bits, indicating the number of contributing sources after the head
M (marker): 1 bit, specifically this definition will be in a profile
PT (playload type): 7 bits, indicating the type of multimedia being transmitted, the corresponding number is listed in another document RFC3551 (http://tools.ietf.org/html/rfc3551)
Sequence number:16 bits, sequence number per RTP packet is automatically added to the receiver to detect packet loss
Timestamp:32 bits, timestamp
Ssrc:32 bits, the ID of the synchronization source, the ID of no two sync sources cannot be the same
CSRC: As mentioned above, the number is specified by CC with a range of 0-15
Structure of the RTP package