2.2.1.3 RTP Payload Format Header

The RTP payload format header is inserted in front of each ASF data packet, or fragment thereof. Therefore, if the RTP packet contains multiple ASF data packets, the RTP payload format header will also be present multiple times.

The fields in the RTP payload format header are transmitted in big-endian byte order, also called network byte order. The syntax of the RTP payload format header is as follows:


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

S

L

R

D

I

RES

Length/Offset

Relative Timestamp (optional)

Duration (optional)

LocationId (optional)

S (1 bit): This field MUST be set to 1 if the ASF data packet contains a payload that is a key-frame. Otherwise, this field MUST be set to 0. In all RTP payload format headers that precede fragments of the same ASF data packet, the S field MUST be set to the same value. How to determine if an ASF payload contains a key-frame is specified in [ASF].

L (1 bit): This field MUST be set to 1 if the Length/Offset field specifies the size of the ASF data packet that follows this RTP payload format header. Otherwise, this field MUST be set to 0, and the Length/Offset field MUST specify an offset. The L field MUST be set to 1 in all RTP payload format headers that precede complete ASF data packets, and MUST be set to 0 in all headers that precede fragmented ASF data packets.

R (1 bit): This field MUST be set to 1 if the Relative Timestamp field is present in the RTP payload format header. Otherwise, this field MUST be set to 0. In all RTP payload format headers that precede fragments of the same ASF data packet, the R field MUST be set to the same value.

D (1 bit): This field MUST be set to 1 if the Duration field is present in the RTP payload format header. Otherwise, this field MUST be set to 0. In all RTP payload format headers that precede fragments of the same ASF data packet, the D field MUST be set to the same value.

I (1 bit): This field MUST be set to 1 if the LocationId field is present in the RTP payload format header. Otherwise, this field MUST be set to 0.

RES (3 bits): This field MUST be set to 0 and MUST be ignored by the receiver.

Length/Offset (3 bytes): If the L field is 0, the RTP payload contains a fragment of an ASF data packet, and the Length/Offset field MUST specify the byte offset of the fragment's first byte counted from the beginning of the complete ASF data packet. If the L field is 1, the Length/Offset field MUST specify the size of the ASF data packet that directly follows the RTP payload format header in bytes.

If the Length/Offset field specifies the size of an ASF data packet, and that size is less than the remaining bytes in the RTP packet, another RTP payload format header MUST follow directly after the end of the ASF data packet.

Relative Timestamp (4 bytes): Optional. If this field is present, it MUST be set to the signed difference between the Send Time field of the ASF data packet that follows this RTP payload format header and the Timestamp field in the RTP header. If this field is not present, it SHOULD be assumed that the difference between the two fields is zero. If the difference between the two fields is nonzero, the Relative Timestamp field MUST be present. Otherwise, the Relative Timestamp field SHOULD NOT be present. The time scale used for the Relative Timestamp field MUST be the same as is used for the Timestamp field in the RTP header.

Where to find the Send Time field of an ASF data packet is specified in [ASF] section 5.2.2.

Duration (4 bytes): Optional. If this field is present, it MUST specify the duration of the ASF data packet. The time scale used for the Duration field MUST be the same as that used for the Timestamp field in the RTP header. If this field is not present, the duration of the ASF data packet is unspecified, and a zero duration MUST NOT be assumed. In all RTP payload format headers that precede fragments of the same ASF data packet, the Duration field MUST be set to the same value.

How to assign a value for the Duration field is implementation-specific. For example, if duration information is available in the ASF data packet (some ASF data packets can have a Duration field), then that duration information can be used as the value of the Duration field in the RTP payload format header. Where to find the Duration field of an ASF data packet is specified in [ASF] section 5.2.2.

LocationId (4 bytes): Optional. If this field is present, it MUST specify the index number of the ASF data packet in the original content from which the ASF data packet is extracted. The first ASF packet in an ASF file MUST have LocationId 0x00000000, the second ASF packet in the file MUST have LocationId 0x00000001, and so on. Note that because a server can skip ASF packets, the value of the LocationId field might not be sequential from one RTP payload format header to the next. If the server does not have access to the ASF file (for example, in case of live content), the server MUST assume a virtual ASF file, incrementing LocationId (or decrementing it when rewinding the content) exactly as if a real ASF file existed. If the LocationId field is not present, the index number of the ASF data packet is unspecified, and the receiver SHOULD NOT make any assumptions about the value of the index number.