A method for transmitting AVS3 video based on RTP protocol

By using the RTP protocol to pack and unpack the AVS3 video stream in AVS3 video transmission, the problem that AVS3 video cannot be transmitted through standard streaming media is solved, the effective transmission of AVS3 video is realized, and its application is promoted.

CN118338088BActive Publication Date: 2024-09-10JIANGSU BEIGONG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410774247.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-10
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Since the RTP protocol does not specify the RTP packaging of the AVS3 video encoding standard, AVS3 videos cannot be transmitted through the standard streaming media transmission protocol, which limits the promotion and use of AVS3.

Method used

Provides an AVS3 video transmission method based on the RTP protocol. The sender performs RTP packaging of the AVS3 video stream, and performs unpacking, decoding and playback on the receiving end to achieve standard streaming media transmission of AVS3 videos. Specific steps include receiving the original picture and encoding it into an AVS3 video stream, packaging and unpacking the stream according to RTP packaging rules, repairing the data packet, and decoding and playing it.

Benefits of technology

The RTP packaging and unpacking of AVS3 video stream is realized, ensuring the effective transmission of AVS3 video by the video transmission protocol based on RTP protocol, solving the technical bottleneck of AVS3 video transmission, and promoting its promotion and application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118338088B
    Figure CN118338088B
Patent Text Reader

Abstract

The present invention discloses an AVS3 video transmission method based on RTP protocol, the steps of which include: receiving an original picture, and then encoding the original picture into an AVS3 video code stream; performing RTP packaging on the AVS3 video code stream to obtain an RTP data packet containing an AVS3 payload type; sending the RTP data packet containing the AVS3 payload type to a receiving end; unpacking the RTP data packet according to an RTP packaging rule to obtain an AVS3 code stream; and decoding and playing the unpacked AVS3 code stream. The AVS3 video transmission method can realize RTP packaging and RTP unpacking of the AVS3 video code stream by setting an RTP packaging rule that satisfies the AVS3 video code stream, thereby realizing the transmission of the AVS3 video by a video transmission protocol based on the RTP protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a video transmission method, in particular to an AVS3 video transmission method based on RTP protocol. Background Art

[0002] The third generation of AVS standards refers to the series of national standards for "Intelligent Media Coding for Information Technology", referred to as AVS3, which has been formulated since 2017. AVS3 is mainly aimed at applications such as ultra-high-definition broadcasting and film, panoramic video, augmented reality / virtual reality, as well as autonomous driving, smart cities, smart medical care, and smart monitoring. It supports the application of ultra-high resolution (above 8K), panoramic video, three-dimensional video, screen mixed content video, intelligent compression of high dynamic range video, and immersive audio scenes.

[0003] Real-time Transport Protocol (RTP) is a network transmission protocol, which was published by the IETF Multimedia Transport Working Group in RFC 1889 in 1996. The RTP protocol specifies the standard data packet format for transmitting audio and video on the Internet. Currently, the mainstream streaming media transmission protocols are all based on the RTP protocol, such as RTSP, RTMP, WebRTC, etc.

[0004] Since the AVS3 video coding standard is relatively new and has not yet been widely used worldwide, the RTP protocol does not make provisions for the RTP packaging of the AVS3 video coding standard, resulting in the inability to transmit AVS3 videos through standard streaming media transmission protocols, thus limiting the promotion and use of AVS3. Therefore, designing a stable and practical AVS3 video transmission method based on the RTP protocol has become an urgent problem to be solved. Summary of the invention

[0005] The purpose of the invention is to provide an AVS3 video transmission method based on the RTP protocol, which can realize the packaging, sending, receiving, unpacking and decoding and playback of AVS3 video code streams, and provide a basis for transmitting AVS3 video code streams using a standard streaming media transmission protocol.

[0006] Technical solution: The AVS3 video transmission method based on the RTP protocol described in the present invention includes the following steps:

[0007] Step 1, the transmitting end receives the original picture, and then encodes the received original picture into an AVS3 video stream according to the AVS3 encoding standard;

[0008] Step 2, the sending end performs RTP packaging on the AVS3 video stream according to the RTP packaging rule to obtain an RTP data packet containing the AVS3 payload type;

[0009] Step 3, the sending end sends the RTP data packet containing the AVS3 payload type to the receiving end;

[0010] Step 4, the receiving end unpacks the RTP data packet according to the RTP packing rule of the AVS3 code stream formulated by the sending end to obtain the AVS3 code stream;

[0011] Step 5: The receiving end decodes and plays the AVS3 code stream obtained by unpacking.

[0012] Further, in step 2, the specific steps of performing RTP packaging on the AVS3 video stream according to the RTP packaging rule are:

[0013] Step 2.1, the sending end divides the AVS3 video code stream into NALUs to obtain each NALU of the AVS3 video code stream;

[0014] Step 2.2, the sender classifies the RTP packetization mode of each NALU according to the NALU length and the RTP maximum payload length requirement to obtain the RTP packetization mode type;

[0015] Step 2.3, the sender performs RTP packaging on the NALU according to the RTP packaging mode type to obtain an RTP data packet.

[0016] Further, in step 2.1, when the AVS3 video stream is divided into NALUs, the Video_Sequence_Header, Picture_Header or the first Patch in each Picture is used as the beginning of each NALU, and each NALU is divided from the beginning of each NALU;

[0017] In step 2.2, when classifying the RTP packetization mode of each NALU:

[0018] If the NALU length is less than the RTP maximum payload length, the corresponding RTP data packet is packaged in AVS3 single NALU packet mode;

[0019] If the NALU length is greater than or equal to the RTP maximum payload length, the corresponding RTP data packet packaging mode is AVS3 fragment packet.

[0020] Furthermore, in step 2.3, when RTP packaging is performed on NALU:

[0021] If the packetization mode of the RTP data packet is AVS3 single NALU packet, set: the first byte Type of the RTP payload is the original frame type of the NALU, which occupies one byte;

[0022] If the packetization mode of the RTP data packet is AVS3 fragment packet, then set: the Type value of the first byte Fu of the RTP payload is 0x58, indicating that the RTP packetization mode is AVS3 fragment packet, which occupies one byte; the first bit S in the second byte of the RTP payload represents the start bit. If the value of S is 1, the AVS3 data in the RTP payload is the start packet of the AVS3 fragment packet; the second bit E in the second byte of the RTP payload represents the end bit. If the value of E is 1, the AVS3 data in the RTP payload is the end packet of the AVS3 fragment packet; the other bits R in the second byte of the RTP payload represent reserved bits, which are used to fill in to form a complete byte; the third byte Type of the RTP payload represents the original frame type of the NALU, which occupies one byte.

[0023] Further, in step 4, the specific steps of unpacking the RTP data packet are:

[0024] Step 4.1, the receiving end receives the first byte of the RTP payload, determines the packetization mode of the RTP data packet based on the first byte, and parses the original frame type of the NALU in the RTP data packet:

[0025] If the first byte of the RTP payload is 0x58, the RTP data packet is an AVS3 fragment packet, and the original frame type of the NALU is the third byte of the RTP payload;

[0026] If the first byte of the RTP payload is not 0x58, the RTP data packet is an AVS3 single NALU packet, and the original frame type of the NALU is the first byte of the RTP payload;

[0027] Step 4.2, the receiving end parses the RTP data packet into an AVS3 payload data packet according to the packetization mode of the RTP data packet;

[0028] In step 4.3, the receiving end repairs the AVS3 payload data packet.

[0029] Furthermore, in step 4.2, when parsing the RTP data packet into an AVS3 payload data packet:

[0030] If the RTP data packet is an AVS3 fragment packet, the AVS3 payload data packet is the fourth byte of the RTP payload and all payload data after the fourth byte, and when the first bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the start packet of the NALU, when the second bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the end packet of the NALU, and when the first bit and the second bit of the second byte of the RTP payload are not 1, the AVS3 payload data packet is the middle packet of the NALU;

[0031] If the RTP packet is an AVS3 single NALU packet, the AVS3 payload data packet is the second byte of the RTP payload and all subsequent payload data, and the AVS3 payload data packet is both the start packet of the NALU and the end packet of the NALU.

[0032] Furthermore, in step 4.3, when repairing the AVS3 payload data packet:

[0033] If the current AVS3 payload data packet is the start packet of NALU, it is necessary to repair the NALU start code for the current AVS3 payload data packet, that is, it is necessary to add the start code of NALU at the start position of the current AVS3 payload data packet.

[0034] Furthermore, in step 5, the specific steps of decoding and playing the AVS3 code stream obtained by unpacking are:

[0035] Step 5.1, the receiving end caches each repaired AVS3 payload data packet to obtain each cached data packet;

[0036] Step 5.2, the receiving end assembles the cached data packets that meet the assembly conditions into a complete data frame;

[0037] Step 5.3, the receiving end determines whether the current complete data frame is decodable. If it is decodable, it is decoded and played; otherwise, it returns to step 5.1.

[0038] Furthermore, in step 5.2, when each cached data packet that meets the composition condition is composed into a complete data frame:

[0039] First, each cached data packet in the cache is obtained, and each cached data packet is sorted according to the cache time sequence;

[0040] Then determine whether the AVS3 payload data packet corresponding to the cached data packet is both the start packet of NALU and the end packet of NALU. If it is both the start packet of NALU and the end packet of NALU, the current cached data is used as a complete data frame. Otherwise, further determine whether the cached data packet meets the composition condition. If it meets the composition condition, the complete data frame is formed in the order of the start packet, each intermediate packet and the end packet. Otherwise, return to step 5.1;

[0041] In step 5.3, when judging whether the current complete data frame is decodable:

[0042] First, determine whether the type of the current complete data frame is a key frame. If the type is Video_Sequence_Header, the current complete data frame is a key frame; otherwise, the current complete data frame is a normal frame.

[0043] Then determine whether the current complete data frame is decodable. If the current complete data frame is a key frame or the three complete data frames before the current complete data frame have been decoded, the current complete data frame is decodable; otherwise, the current complete data frame is not decodable.

[0044] Furthermore, the specific steps of determining whether the cached data packet meets the composition condition are as follows:

[0045] First, the termination packet is searched for each of the sorted cached data packets in turn. If the termination packet is found, all the cached data packets before the termination packet are transferred to the queue to be combined. If the termination packet is not found, the termination packet is searched for each of the sorted cached data packets until the termination packet is found, and then all the cached data packets before the termination packet are transferred to the queue to be combined.

[0046] Then, the first buffered data packet in the queue to be combined is judged. If the first buffered data packet is a starting packet, the intermediate packet identification step is entered; otherwise, the queue arrangement step is entered;

[0047] The intermediate packet identification step is: identifying and judging each cached data packet between the start packet and the end packet. If they are all intermediate packets and each intermediate packet is in a continuous state, it indicates that the AVS3 payload data packet is complete, and it is determined that each cached data packet in the queue to be combined meets the composition conditions, otherwise it enters the secondary queue sorting step;

[0048] The steps of a queue sorting are: find the start packet in each cached data packet before the termination packet:

[0049] If the start packet is not found, it indicates that the AVS3 payload data packet is incomplete, and it is determined that each cached data packet in the queue to be combined does not meet the composition conditions, and the queue to be combined is cleared;

[0050] If only one starting packet is found, determine whether all the intermediate packets except the starting packet in the queue to be combined are continuous: if all the intermediate packets are continuous, move the starting packet to the head of the queue to be combined, and determine whether each cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets are discontinuous, determine whether all the intermediate packets between the starting packet and the ending packet in the queue to be combined are continuous; if all the intermediate packets between the two are continuous, delete the intermediate packets before the starting packet, and determine whether each remaining cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets between the two are discontinuous, determine that each cached data packet in the queue to be combined does not meet the composition condition, and clear the queue to be combined;

[0051] If multiple starting packets are found, determine whether all the intermediate packets except the starting packets in the queue to be combined are continuous: if all the intermediate packets are in a continuous state, move the first starting packet to the head of the queue to be combined, delete the remaining starting packets, and determine whether the cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets are in a discontinuous state, determine whether all the intermediate packets between the starting packets and the terminating packets are continuous in order from far to near in terms of distance from the terminating packet; if all the intermediate packets between the current starting packet and the terminating packet are in a continuous state, delete the cached data packets before the current starting packet in the queue to be combined and the starting packets after it, and determine whether the remaining cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets between the starting packets and the terminating packets are in a discontinuous state, determine that the cached data packets in the queue to be combined do not meet the composition conditions, and clear the queue to be combined;

[0052] The secondary queue arrangement step is: copy each cached data packet between the start packet at the head of the queue to be combined and the end packet at the tail of the queue to be combined into the secondary arrangement queue, and then judge each cached data packet in the secondary arrangement queue:

[0053] If all the packets in the secondary sorting queue are intermediate packets, it means that the intermediate packets are discontinuous and the AVS3 payload data packet is incomplete. It is determined that the cached data packets in the queue to be combined do not meet the composition conditions, and the queue to be combined and the secondary sorting queue are cleared;

[0054] If there are both intermediate packets and starting packets in the secondary sorting queue, then determine whether the intermediate packets except the starting packet in the secondary sorting queue are in a continuous state. If the intermediate packets in the secondary sorting queue are in a continuous state, retain the starting packet at the head of the queue to be combined, delete the remaining starting packets, and determine whether the cached data packets in the queue to be combined meet the composition conditions, and then clear the secondary sorting queue. If the intermediate packets in the secondary sorting queue are in a discontinuous state, then in the secondary sorting queue, determine whether all the intermediate packets from the starting packet to the end of the queue are continuous in order from far to near. If all the intermediate packets from the current starting packet to the end of the queue are in a continuous state, delete the cached data packets before the current starting packet in the queue to be combined and the starting packets after it, and determine whether the remaining cached data packets in the queue to be combined meet the composition conditions, and then clear the secondary sorting queue. If all the intermediate packets from the starting packet to the end of the queue in the secondary sorting queue are in a discontinuous state, then determine that the cached data packets in the queue to be combined do not meet the composition conditions, and clear the queue to be combined and the secondary sorting queue;

[0055] If there is no intermediate packet in the secondary sorting queue, it is determined that each cached data packet in the queue to be combined does not meet the composition condition, and the queue to be combined and the secondary sorting queue are cleared.

[0056] Compared with the prior art, the present invention has the following beneficial effects: by setting RTP packaging rules that meet the AVS3 video code stream, the RTP packaging and RTP unpacking of the AVS3 video code stream can be realized, thereby realizing the transmission of AVS3 video by a video transmission protocol based on the RTP protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is a flow chart of the method of the present invention;

[0058] Figure 2 A schematic diagram of the RTP payload format of a single NALU of the present invention;

[0059] Figure 3 It is a schematic diagram of the RTP payload format of the slice unit of the present invention. DETAILED DESCRIPTION

[0060] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.

[0061] like Figure 1 As shown, the AVS3 video transmission method based on the RTP protocol disclosed in the present invention includes the following steps:

[0062] Step 1, the transmitting end receives the original picture, and then encodes the received original picture into an AVS3 video stream according to the AVS3 encoding standard;

[0063] Step 2, the sending end performs RTP packaging on the AVS3 video stream according to the RTP packaging rule to obtain an RTP data packet containing the AVS3 payload type;

[0064] Step 3, the sending end sends the RTP data packet containing the AVS3 payload type to the receiving end;

[0065] Step 4, the receiving end unpacks the RTP data packet according to the RTP packing rule of the AVS3 code stream formulated by the sending end to obtain the AVS3 code stream;

[0066] Step 5: The receiving end decodes and plays the AVS3 code stream obtained by unpacking.

[0067] By setting the RTP packaging rules that meet the AVS3 video code stream, the RTP packaging and RTP depacketization of the AVS3 video code stream can be realized, thereby realizing the transmission of the AVS3 video based on the video transmission protocol of the RTP protocol.

[0068] Further, in step 2, the specific steps of performing RTP packaging on the AVS3 video stream according to the RTP packaging rule are:

[0069] Step 2.1, the sending end divides the AVS3 video code stream into NALU (Network Abstraction Layer Unit) to obtain each NALU of the AVS3 video code stream;

[0070] Step 2.2, the sender classifies the RTP packetization mode of each NALU according to the NALU length and the RTP maximum payload length requirement to obtain the RTP packetization mode type;

[0071] Step 2.3, the sender performs RTP packaging on the NALU according to the RTP packaging mode type to obtain an RTP data packet.

[0072] Further, in step 2.1, when the AVS3 video stream is divided into NALUs, Video_Sequence_Header, Picture_Header or the first Patch in each Picture is used as the beginning of each NALU, and each NALU is divided from the beginning of each NALU to obtain each NALU, thereby quickly dividing each NALU;

[0073] In step 2.2, when classifying the RTP packetization mode of each NALU, the NALU length is compared with the RTP maximum payload length, so as to quickly determine the packetization mode type of the RTP data packet:

[0074] If the NALU length is less than the RTP maximum payload length, the corresponding RTP data packet's packetization mode type is AVS3 single NALU packet;

[0075] If the NALU length is greater than or equal to the RTP maximum payload length, the corresponding RTP data packet packet mode type is AVS3 fragment packet.

[0076] Furthermore, in step 2.3, when RTP packaging is performed on NALU according to the RTP packaging mode type:

[0077] If the RTP data packet is packaged in AVS3 single NALU packet mode, set the first byte Type of the RTP payload to the original frame type of NALU, which occupies one byte, such as Figure 2 As shown;

[0078] If the packetization mode of the RTP data packet is AVS3 fragmentation packet, then set: the Type value of the first byte Fu (Fragmentation Unit) of the RTP payload is 0x58, indicating that the RTP packetization mode is AVS3 fragmentation packet, which occupies one byte; the first bit S in the second byte of the RTP payload represents the start bit. If the value of S is 1, the AVS3 data in the RTP payload is the start packet of the AVS3 fragmentation packet; the second bit E in the second byte of the RTP payload represents the end bit. If the value of E is 1, the AVS3 data in the RTP payload is the end packet of the AVS3 fragmentation packet; the other bits R in the second byte of the RTP payload represent reserved bits, which are used to fill in a complete byte; the third byte Type of the RTP payload represents the original frame type of the NALU, which occupies one byte, such as Figure 3 shown.

[0079] Further, in step 4, the specific steps of unpacking the RTP data packet are:

[0080] Step 4.1, the receiving end receives the first byte of the RTP payload, determines the packetization mode of the RTP data packet based on the first byte, and parses the original frame type of the NALU in the RTP data packet:

[0081] If the first byte of the RTP payload is 0x58, the RTP data packet is an AVS3 fragment packet, and the original frame type of the NALU is the third byte of the RTP payload;

[0082] If the first byte of the RTP payload is not 0x58, the RTP data packet is an AVS3 single NALU packet, and the original frame type of the NALU is the first byte of the RTP payload;

[0083] Therefore, the type of RTP data packet can be quickly determined based on the first byte, and then the original frame type of NALU can be quickly determined;

[0084] Step 4.2, the receiving end parses the RTP data packet into an AVS3 payload data packet according to the packetization mode of the RTP data packet;

[0085] In step 4.3, the receiving end repairs the AVS3 payload data packet.

[0086] Furthermore, in step 4.2, when parsing the RTP data packet into an AVS3 payload data packet:

[0087] If the RTP data packet is an AVS3 fragment packet, the AVS3 payload data packet is the fourth byte of the RTP payload and all payload data after the fourth byte, and when the first bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the start packet of the NALU, when the second bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the end packet of the NALU, and when the first bit and the second bit of the second byte of the RTP payload are not 1, the AVS3 payload data packet is the middle packet of the NALU;

[0088] If the RTP packet is an AVS3 single NALU packet, the AVS3 payload data packet is the second byte of the RTP payload and all subsequent payload data, and the AVS3 payload data packet is both the start packet of the NALU and the end packet of the NALU.

[0089] Furthermore, in step 4.3, when repairing the AVS3 payload data packet:

[0090] If the current AVS3 payload data packet is the start packet of NALU, it is necessary to repair the NALU start code for the current AVS3 payload data packet, that is, it is necessary to add the start code of NALU at the starting position of the current AVS3 payload data packet, and the added start code is hexadecimal 0x00 0x00 0x01.

[0091] Furthermore, in step 5, the specific steps of decoding and playing the AVS3 code stream obtained by unpacking are:

[0092] Step 5.1, the receiving end caches each repaired AVS3 payload data packet to obtain each cached data packet;

[0093] Step 5.2, the receiving end assembles the cached data packets that meet the assembly conditions into a complete data frame;

[0094] Step 5.3, the receiving end determines whether the current complete data frame is decodable. If it is decodable, it is decoded and played; otherwise, it returns to step 5.1.

[0095] Furthermore, in step 5.2, when each cached data packet that meets the composition condition is composed into a complete data frame:

[0096] First, each cached data packet in the cache is obtained, and each cached data packet is sorted according to the cache time sequence;

[0097] Then determine whether the AVS3 payload data packet corresponding to the cached data packet is both the start packet of NALU and the end packet of NALU. If it is both the start packet of NALU and the end packet of NALU, the current cached data is used as a complete data frame. Otherwise, further determine whether the cached data packet meets the composition condition. If it meets the composition condition, the complete data frame is formed in the order of the start packet, each intermediate packet and the end packet. Otherwise, return to step 5.1;

[0098] In step 5.3, when judging whether the current complete data frame is decodable:

[0099] First, determine whether the type of the current complete data frame is a key frame. If the type is Video_Sequence_Header, the current complete data frame is a key frame; otherwise, the current complete data frame is a normal frame.

[0100] Then determine whether the current complete data frame is decodable. If the current complete data frame is a key frame or the three complete data frames before the current complete data frame have been decoded, the current complete data frame is decodable; otherwise, the current complete data frame is not decodable.

[0101] Furthermore, the specific steps of determining whether the cached data packet meets the composition condition are as follows:

[0102] First, the termination packet is searched for each of the sorted cached data packets in turn. If the termination packet is found, all the cached data packets before the termination packet are transferred to the queue to be combined. If the termination packet is not found, the termination packet is searched for each of the sorted cached data packets until the termination packet is found, and then all the cached data packets before the termination packet are transferred to the queue to be combined.

[0103] Then, the first buffered data packet in the queue to be combined is judged. If the first buffered data packet is a starting packet, the intermediate packet identification step is entered; otherwise, the queue arrangement step is entered;

[0104] The intermediate packet identification step is: identifying and judging each cached data packet between the start packet and the end packet. If they are all intermediate packets and each intermediate packet is in a continuous state, it indicates that the AVS3 payload data packet is complete, and it is determined that each cached data packet in the queue to be combined meets the composition conditions, otherwise it enters the secondary queue sorting step;

[0105] The steps of a queue sorting are: find the start packet in each cached data packet before the termination packet:

[0106] If the start packet is not found, it indicates that the AVS3 payload data packet is incomplete, and it is determined that each cached data packet in the queue to be combined does not meet the composition conditions, and the queue to be combined is cleared;

[0107] If only one starting packet is found, then determine whether all the intermediate packets except the starting packet in the queue to be combined have data continuity: if all the intermediate packets are in a data continuity state, move the starting packet to the head of the queue to be combined, and determine whether each cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets are in a data discontinuous state, then determine whether all the intermediate packets between the starting packet and the ending packet in the queue to be combined have data continuity; if all the intermediate packets between the two are in a data continuity state, delete the intermediate packets before the starting packet, and determine whether each remaining cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets between the two are in a data discontinuous state, then determine that each cached data packet in the queue to be combined does not meet the composition condition, and clear the queue to be combined;

[0108] If multiple starting packets are found, determine whether all the intermediate packets except the starting packets in the queue to be combined have data continuity: if all the intermediate packets are in a data continuity state, move the first starting packet to the head of the queue to be combined, delete the remaining starting packets, and determine whether the cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets are in a data discontinuous state, determine whether all the intermediate packets between each starting packet and the termination packet have data continuity in order from far to near in terms of distance from the termination packet; if all the intermediate packets between the current starting packet and the termination packet are in a data continuity state, delete the cached data packets before the current starting packet in the queue to be combined and the starting packets after it, and determine whether the remaining cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets between each starting packet and the termination packet are in a data discontinuous state, determine that the cached data packets in the queue to be combined do not meet the composition conditions, and clear the queue to be combined;

[0109] The secondary queue arrangement step is: copy each cached data packet between the start packet at the head of the queue to be combined and the end packet at the tail of the queue to be combined into the secondary arrangement queue, and then judge each cached data packet in the secondary arrangement queue:

[0110] If all the packets in the secondary sorting queue are intermediate packets, it means that the intermediate packets are in a discontinuous data state and the AVS3 payload data packet is incomplete. It is determined that the cached data packets in the queue to be combined do not meet the composition conditions, and the queue to be combined and the secondary sorting queue are cleared;

[0111] If there are both intermediate packets and starting packets in the secondary sorting queue, then determine whether each intermediate packet except the starting packet in the secondary sorting queue is in a data continuity state; if each intermediate packet in the secondary sorting queue is in a data continuity state, retain the starting packet at the head of the queue to be combined, delete the remaining starting packets, and determine whether each cached data packet in the queue to be combined meets the composition condition, and then clear the secondary sorting queue; if each intermediate packet in the secondary sorting queue is in a data discontinuous state, then in the secondary sorting queue, determine whether all the intermediate packets from each starting packet to the end of the queue are data continuous in order from far to near; if all the intermediate packets from the current starting packet to the end of the queue are data continuous, then delete each cached data packet before the current starting packet in the queue to be combined and each starting packet after it, and determine whether each remaining cached data packet in the queue to be combined meets the composition condition, and then clear the secondary sorting queue; if all the intermediate packets from each starting packet to the end of the queue in the secondary sorting queue are in a data discontinuous state, then determine that each cached data packet in the queue to be combined does not meet the composition condition, and clear the queue to be combined and the secondary sorting queue;

[0112] If there is no intermediate packet in the secondary sorting queue, it is determined that each cached data packet in the queue to be combined does not meet the composition condition, and the queue to be combined and the secondary sorting queue are cleared.

[0113] The intermediate packet identification step and the queue sorting step can effectively avoid the problem of duplicate storage of the initial packet, thereby ensuring that all data frames are retained to the greatest extent and effectively reducing the data frame loss rate.

[0114] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. An AVS3 video transmission method based on RTP protocol, characterized in that: The following steps are included: Step 1, the transmitting end receives the original picture, and then encodes the received original picture into an AVS3 video stream according to the AVS3 encoding standard; Step 2, the sending end performs RTP packaging on the AVS3 video stream according to the RTP packaging rule to obtain an RTP data packet containing the AVS3 payload type; Step 3, the sending end sends the RTP data packet containing the AVS3 payload type to the receiving end; Step 4, the receiving end unpacks the RTP data packet according to the RTP packing rule of the AVS3 code stream formulated by the sending end to obtain the AVS3 code stream; Step 5: The receiving end decodes and plays the AVS3 code stream obtained by unpacking; In step 5, the specific steps for decoding and playing the AVS3 code stream obtained by unpacking are: Step 5.1, the receiving end caches each repaired AVS3 payload data packet to obtain each cached data packet; Step 5.2, the receiving end assembles the cached data packets that meet the assembly conditions into a complete data frame; Step 5.3, the receiving end determines whether the current complete data frame is decodable, and if so, decodes and plays it; otherwise, returns to step 5.1; In step 5.2, when the cached data packets that meet the composition conditions are combined into a complete data frame: First, each cached data packet in the cache is obtained, and each cached data packet is sorted according to the cache time sequence; Then determine whether the AVS3 payload data packet corresponding to the cached data packet is both the start packet of NALU and the end packet of NALU. If it is both the start packet of NALU and the end packet of NALU, the current cached data is used as a complete data frame. Otherwise, further determine whether the cached data packet meets the composition condition. If it meets the composition condition, the complete data frame is formed in the order of the start packet, each intermediate packet and the end packet. Otherwise, return to step 5.1; In step 5.3, when judging whether the current complete data frame is decodable: First, determine whether the type of the current complete data frame is a key frame. If the type is Video_Sequence_Header, the current complete data frame is a key frame; otherwise, the current complete data frame is a normal frame. Then determine whether the current complete data frame is decodable. If the current complete data frame is a key frame or the three complete data frames before the current complete data frame have been decoded, the current complete data frame is decodable; otherwise, the current complete data frame is not decodable; The specific steps for determining whether a cached data packet meets the composition conditions are: First, the termination packet is searched for each of the sorted cached data packets in turn. If the termination packet is found, all the cached data packets before the termination packet are transferred to the queue to be combined. If the termination packet is not found, the termination packet is searched for each of the sorted cached data packets until the termination packet is found, and then all the cached data packets before the termination packet are transferred to the queue to be combined. Then, the first buffered data packet in the queue to be combined is judged. If the first buffered data packet is a starting packet, the intermediate packet identification step is entered; otherwise, the queue arrangement step is entered; The intermediate packet identification step is: identifying and judging each cached data packet between the start packet and the end packet. If they are all intermediate packets and each intermediate packet is in a continuous state, it indicates that the AVS3 payload data packet is complete, and it is determined that each cached data packet in the queue to be combined meets the composition conditions, otherwise it enters the secondary queue sorting step; The steps of a queue sorting are: find the start packet in each cached data packet before the termination packet: If the start packet is not found, it indicates that the AVS3 payload data packet is incomplete, and it is determined that each cached data packet in the queue to be combined does not meet the composition conditions, and the queue to be combined is cleared; If only one starting packet is found, determine whether all the intermediate packets except the starting packet in the queue to be combined are continuous: if all the intermediate packets are continuous, move the starting packet to the head of the queue to be combined, and determine whether each cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets are discontinuous, determine whether all the intermediate packets between the starting packet and the ending packet in the queue to be combined are continuous; if all the intermediate packets between the two are continuous, delete the intermediate packets before the starting packet, and determine whether each remaining cached data packet in the queue to be combined meets the composition condition; if all the intermediate packets between the two are discontinuous, determine that each cached data packet in the queue to be combined does not meet the composition condition, and clear the queue to be combined; If multiple starting packets are found, determine whether all the intermediate packets except the starting packets in the queue to be combined are continuous: if all the intermediate packets are in a continuous state, move the first starting packet to the head of the queue to be combined, delete the remaining starting packets, and determine whether the cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets are in a discontinuous state, determine whether all the intermediate packets between the starting packets and the terminating packets are continuous in order from far to near in terms of distance from the terminating packet; if all the intermediate packets between the current starting packet and the terminating packet are in a continuous state, delete the cached data packets before the current starting packet in the queue to be combined and the starting packets after it, and determine whether the remaining cached data packets in the queue to be combined meet the composition conditions; if all the intermediate packets between the starting packets and the terminating packets are in a discontinuous state, determine that the cached data packets in the queue to be combined do not meet the composition conditions, and clear the queue to be combined; The secondary queue arrangement step is: copy each cached data packet between the start packet at the head of the queue to be combined and the end packet at the tail of the queue to be combined into the secondary arrangement queue, and then judge each cached data packet in the secondary arrangement queue: If all the packets in the secondary sorting queue are intermediate packets, it means that the intermediate packets are discontinuous and the AVS3 payload data packet is incomplete. It is determined that the cached data packets in the queue to be combined do not meet the composition conditions, and the queue to be combined and the secondary sorting queue are cleared; If there are both intermediate packets and starting packets in the secondary sorting queue, then determine whether the intermediate packets except the starting packet in the secondary sorting queue are in a continuous state. If the intermediate packets in the secondary sorting queue are in a continuous state, retain the starting packet at the head of the queue to be combined, delete the remaining starting packets, and determine whether the cached data packets in the queue to be combined meet the composition conditions, and then clear the secondary sorting queue. If the intermediate packets in the secondary sorting queue are in a discontinuous state, then in the secondary sorting queue, determine whether all the intermediate packets from the starting packet to the end of the queue are continuous in order from far to near. If all the intermediate packets from the current starting packet to the end of the queue are in a continuous state, delete the cached data packets before the current starting packet in the queue to be combined and the starting packets after it, and determine whether the remaining cached data packets in the queue to be combined meet the composition conditions, and then clear the secondary sorting queue. If all the intermediate packets from the starting packet to the end of the queue in the secondary sorting queue are in a discontinuous state, then determine that the cached data packets in the queue to be combined do not meet the composition conditions, and clear the queue to be combined and the secondary sorting queue; If there is no intermediate packet in the secondary sorting queue, it is determined that each cached data packet in the queue to be combined does not meet the composition condition, and the queue to be combined and the secondary sorting queue are cleared.

2. The AVS3 video transmission method based on the RTP protocol according to claim 1, characterized in that: In step 2, the specific steps of RTP packaging of the AVS3 video stream according to the RTP packaging rules are as follows: Step 2.1, the sending end divides the AVS3 video code stream into NALUs to obtain each NALU of the AVS3 video code stream; Step 2.2, the sender classifies the RTP packetization mode of each NALU according to the NALU length and the RTP maximum payload length requirement to obtain the RTP packetization mode type; Step 2.3, the sender performs RTP packaging on the NALU according to the RTP packaging mode type to obtain an RTP data packet.

3. The AVS3 video transmission method based on the RTP protocol according to claim 2, characterized in that: In step 2.1, when dividing the AVS3 video stream into NALUs, the Video_Sequence_Header, Picture_Header or the first Patch in each Picture is used as the beginning of each NALU, and each NALU is divided from the beginning of each NALU; In step 2.2, when classifying the RTP packetization mode of each NALU: If the NALU length is less than the RTP maximum payload length, the corresponding RTP data packet is packaged in AVS3 single NALU packet mode; If the NALU length is greater than or equal to the RTP maximum payload length, the corresponding RTP data packet packaging mode is AVS3 fragment packet.

4. The AVS3 video transmission method based on the RTP protocol according to claim 3 is characterized in that: In step 2.3, when RTP packaging of NALU is performed: If the packetization mode of the RTP data packet is AVS3 single NALU packet, set: the first byte Type of the RTP payload is the original frame type of the NALU, which occupies one byte; If the packetization mode of the RTP data packet is AVS3 fragment packet, then set: the Type value of the first byte Fu of the RTP payload is 0x58, indicating that the RTP packetization mode is AVS3 fragment packet, which occupies one byte; the first bit S in the second byte of the RTP payload represents the start bit. If the value of S is 1, the AVS3 data in the RTP payload is the start packet of the AVS3 fragment packet; the second bit E in the second byte of the RTP payload represents the end bit. If the value of E is 1, the AVS3 data in the RTP payload is the end packet of the AVS3 fragment packet; the other bits R in the second byte of the RTP payload represent reserved bits, which are used to fill in to form a complete byte; the third byte Type of the RTP payload represents the original frame type of the NALU, which occupies one byte.

5. The AVS3 video transmission method based on RTP protocol according to claim 4 is characterized in that: In step 4, the specific steps of unpacking the RTP data packet are: Step 4.1, the receiving end receives the first byte of the RTP payload, determines the packetization mode of the RTP data packet based on the first byte, and parses the original frame type of the NALU in the RTP data packet: If the first byte of the RTP payload is 0x58, the RTP data packet is an AVS3 fragment packet, and the original frame type of the NALU is the third byte of the RTP payload; If the first byte of the RTP payload is not 0x58, the RTP data packet is an AVS3 single NALU packet, and the original frame type of the NALU is the first byte of the RTP payload; Step 4.2, the receiving end parses the RTP data packet into an AVS3 payload data packet according to the packetization mode of the RTP data packet; In step 4.3, the receiving end repairs the AVS3 payload data packet.

6. The AVS3 video transmission method based on the RTP protocol according to claim 5, characterized in that: In step 4.2, when parsing the RTP data packet into an AVS3 payload data packet: If the RTP data packet is an AVS3 fragment packet, the AVS3 payload data packet is the fourth byte of the RTP payload and all payload data after the fourth byte, and when the first bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the start packet of the NALU, when the second bit of the second byte of the RTP payload is 1, the AVS3 payload data packet is the end packet of the NALU, and when the first bit and the second bit of the second byte of the RTP payload are not 1, the AVS3 payload data packet is the middle packet of the NALU; If the RTP packet is an AVS3 single NALU packet, the AVS3 payload data packet is the second byte of the RTP payload and all subsequent payload data, and the AVS3 payload data packet is both the start packet of the NALU and the end packet of the NALU.

7. The AVS3 video transmission method based on the RTP protocol according to claim 6, characterized in that: In step 4.3, when repairing the AVS3 payload data packet: If the current AVS3 payload data packet is the start packet of NALU, it is necessary to repair the NALU start code for the current AVS3 payload data packet, that is, it is necessary to add the start code of NALU at the start position of the current AVS3 payload data packet.