Example of H264 data transmission via RTP shards

Source: Internet
Author: User
Tags rfc

When using RTP to transmit H264 data, when the length of the Nalu is too long to subcontract, here is an example, if you want to know more detailed protocol description can refer to the end of the connection.

Within live555, receive a piece of data at the beginning of each package as follows

7c Bayi E1 42
7c 1 D 8f
7c 1 A7 C8
7c 1 2d
。。。
7c 1 6b FB
7c 1 2b
7c 3b


live555 the above data processing, the resulting data is returned to the user as follows

E1, 7f, 8b, 3, 5c,, FF

This is a 264 P-frame


The first byte of data 7c is FU indicator

The second byte 81, 1, 41, etc. is the FU header

The FU indicator octet has the following format:

+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
| F|  nri| Type |
+---------------+

The FU header has the following format:

+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
| s| e|  r| Type |
+---------------+


Fu:fragmentation Units


7c write for binary is 01111100, that is:

0 11 11100

F prohibit bit is 0 (0)

NRI importance Indication bit is 3 (11)

Nalu type is (11100), fu-a-type shard unit

81 Write for binary is 10000001, that is:

1 0 0 00001

S: Set to 1 is a nalu start package, here is 1, description is the starter package

E: Set to 1 is a Nalu end package, here is 0, the description is not the end package

R: Reserved bit

Type: Types of loads, here is 1, because it is a sub-package of 264, so is the description of the load is 264 non-IDR image of the slice

41 Write for binary is 01000001, that is:

0 1 0 00001

S: Set to 1 is a nalu start package, here is 0, the description is not the starter package

E: Set to 1 is a Nalu end package, here is 1, the description is the end of the package

Type: Types of loads, here is 1, because it is a sub-package of 264, so is the description of the load is 264 non-IDR image of the slice


After receiving a packet of data after the package, get 264 Nalu header 61, written as binary is 01100001, that is:

0 11 00001

Prohibition of a bit with FU indicator

Importance indicator bit with FU indicator importance indicator bit

Type description of the type of the same FU header


The above is the example of subcontracting, the data received when not subcontracting is directly:

E1, 7f, 8b, 3, 5c,, FF





Stap-b and fu-b structures include DON

don:decoding Order Number

Http://www.rfc-editor.org/rfc/rfc3984.txt

http://blog.csdn.net/yaorongzhen123/article/details/8453174

Http://www.cppblog.com/czanyou/archive/2009/12/25/67940.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.