Acquaintance RTP protocol (b)

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/yuewen2008/article/details/90415768

A, H264 transmission network structure

H264 in the network transmission is NALU, NALU structures are:
the NAL header + RBSP (encoded video data), the actual data transmission stream shown as:

Here Insert Picture Description

Here Insert Picture Description

Second, the sub-structure

Defined in the document RFC 3984 RTP packet carries several ways of H264: STAP (STAP-A / B ) carries a plurality of RTP packet NALU units, which are consistent NALU timestamp. MTAP RTP packet carries a plurality of units NALU, these inconsistencies NALU timestamp. FU (FU-A / B) carried by a plurality of RTP packets NALU.
Sub-object: image generated through the NALU encoder, the data which is likely to be greater than the maximum load can carry UDP length (limited by the MTU size), so that NALU would be assigned to a plurality of RTP packets carries.

Here Insert Picture Description

(1) a single NAL unit packet, nalType> = 1 && nalType < = 23. H264 stream only i.e. loads a NAL unit.
(2) Polymerization package:
 A, single-time aggregation packet type A (STAP-A), nalType  == 24.
 b, single-time aggregation packet type B (STAP-B), nalType  == 25.
 c, multi-time aggregation packet type 16-bit displacement (MTAP16), nalType == 26.
 d, multi-time aggregation packet type displacement 24 (MTAP24), nalType == 27.
 e, H264 stream i.e. the load of a plurality of NAL units.
(3) slicing units, FU-A, FU-B , 28, 29 identified with the NAL unit type. I.e., for a single slice NAL unit to a plurality of RTP packets.

Three, NALU header structure analysis

H264 protocol rtp charge stream is removed after the packet header rtp H264 NALU stream that is a unit in which the first word of the NALU header
NALU header structure
length 1byte
Forbidden_bit (1bit) + nal_reference_bit (2bit) + nal_unit_type (5bit)

Here Insert Picture Description
F: 1 bit indicates whether the NALU errors. Disable bit, initially 0, when the network discovery NAL unit may be provided with a bit error of the bit is 1, so that the receiver, error correction or discard the cell.

NRI: 2 bits indicate the importance of the NALU. NAL importance indication, underlines the importance of the NAL unit, the larger the value, the more important, the decoder in the decoding process, however, they can lose the importance of the NALU 0

Type: 5 bits indicate the sub-mode of the NALU which is 1-23 framgment type package for a single packet NALU
FU-A value of 28. NALU type indication of the type of concern: 5 IDR, 6 confidence decoded video sequence (SEI) 7 sequence parameter set (SPS), 8 picture parameter set (PPS)

Following NALU type single type of catch 7 (SPS, Sequence Parameter Set) packets
Here Insert Picture Description

Following NALU type single type of catch 8 (PPS, Picture Parameter Set) data

Here Insert Picture Description

Here Insert Picture Description
Indicator FU:
F.: Indicates whether the error NALU
NRI: indicates the importance of the NALU
Type: indicates that the sub-mode of the NALU, FU-A value of 28

Header FU:
S: 1 'bit when set to 1, indicating the start of the start bit slice NAL unit.
When the load is not followed FU NAL unit partition sheet loading begins, the start bit is set to 0.
E: 1 bit when set to 1, the end bit indicating the end of the slice NAL units,
i.e., loads the last byte is the last byte sub-slice NAL unit. When the load is not followed FU slice NAL units in the final fragment, the end bit is set to 0.
R: 1-bit reserved bit, setting bit 0
the Type: NALU. 5 bits indicate the type
\

The following is caught h264 framgemnt type of data packet 28
Here Insert Picture Description

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/yuewen2008/article/details/90415768
RTP