Video data transmission method and device, equipment and storage medium
By dividing the video data into multiple sub-regions and encoding independently, the network congestion problem when transmitting keyframe video data is solved, and the stability and smoothness of video transmission are achieved.
Patent Information
- Application Number
- CN202411800176.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-25
AI Technical Summary
In mobile video command application scenarios, transmitting keyframe video data is likely to cause network congestion, resulting in lag or delay in video transmission.
By dividing the original video data into multiple sub-regions, each sub-region is independently encoded, and the encoded data is encapsulated into data packet transmission, it is ensured that the number of keyframe data in each frame of encoded data is less than the number of sub-regions.
It effectively avoids network congestion, reduces the amount of encoded data of video data per frame, and avoids lag or increased delay in video transmission.
Smart Images

Figure CN119697391A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video transmission, and in particular to a method, device, equipment and storage medium for transmitting video data. Background Art
[0002] The audio-visual command and dispatch system is a system used in multiple industries such as emergency management, public safety, and transportation to achieve remote command, real-time communication, and collaborative work by integrating video, audio, and communication dispatch functions. The audio-visual command and dispatch system is usually deployed in a command center or control room, and is widely used in emergency command, public security, firefighting, medical rescue and other fields for rapid response and efficient management of complex events. In the application scenario of mobile video command, mobile communication networks such as satellite communication systems, scattering communication systems, microwave communication systems and other wireless communication networks are generally used for video transmission. The bandwidth resources of wireless networks are limited. When transmitting key frame video data (I frames), network congestion or performance degradation will occur, and video transmission will become stuck or delays will increase.
[0003] Therefore, how to avoid network congestion when transmitting key frame video data is a problem that needs to be solved by those skilled in the art. Summary of the invention
[0004] The present application provides a video data transmission method, apparatus, device and storage medium to avoid network congestion when transmitting key frame video data.
[0005] In a first aspect, the present application provides a method for transmitting video data, the transmission method being applied to a data sending end, the transmission method comprising:
[0006] Obtaining original video data to be transmitted;
[0007] Determine each sub-region corresponding to the original video data;
[0008] Dividing the original video data into regional data corresponding to each sub-region;
[0009] Independently encode the data of each region to generate the encoded data of each region; wherein each frame of encoded data includes the encoded data of each region, and the number of the region encoded data in each frame of encoded data that is key frame data is less than the number of sub-regions;
[0010] The coded data of each region is encapsulated into a data packet and transmitted to the data receiving end.
[0011] Optionally, the determining each sub-region corresponding to the original video data includes:
[0012] The video screen of the original video data is divided into sub-regions; wherein the areas of the sub-regions are the same and the sub-regions have different region identifiers.
[0013] Optionally, the independently encoding each region data to generate each region coded data includes:
[0014] Using a coding algorithm to independently encode each region data, to obtain region coding data of each region data;
[0015] Among them, only one area of coded data in each frame of coded data is key frame data.
[0016] Optionally, encapsulating the coded data of each region into a data packet and transmitting it to a data receiving end includes:
[0017] Encapsulating each region coding data into a data packet according to a predetermined protocol; wherein the predetermined protocol includes a region identifier corresponding to each region coding data;
[0018] The data packet is transmitted to a data receiving end via a wireless communication network.
[0019] In a second aspect, the present application provides a method for transmitting video data, the transmission method being applied to a data receiving end, the transmission method comprising:
[0020] Receive a data packet sent by a data sending end; wherein the data packet is a data packet sent by the above-mentioned transmission method;
[0021] The original video data is obtained after decoding the data packet.
[0022] Optionally, the decoding of the data packet to obtain original video data includes:
[0023] Parsing the data packet according to a predetermined protocol to obtain each frame of coded data; wherein each frame of coded data includes coded data of each region;
[0024] Decoding is performed according to the region identifier of each region coded data to obtain original video data.
[0025] Optionally, after decoding the data packet to obtain the original video data, the method further includes:
[0026] Play the original video data on the display device.
[0027] In a third aspect, the present application provides a video data transmission device, the transmission device is applied to a data sending end, and the transmission device includes:
[0028] An acquisition module, used for acquiring original video data to be transmitted;
[0029] A determination module, used to determine each sub-region corresponding to the original video data;
[0030] A division module, used for dividing the original video data into regional data corresponding to each sub-region;
[0031] The encoding module is used to independently encode the data of each region to generate the encoded data of each region; wherein each frame of encoded data includes the encoded data of each region, and the number of the region encoded data in each frame of encoded data that is key frame data is less than the number of sub-regions;
[0032] The transmission module is used to encapsulate the coded data of each region into a data packet and transmit it to the data receiving end.
[0033] In a fourth aspect, the present application further provides an electronic device, including:
[0034] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the video data transmission method of the present application through the computer program.
[0035] In a fifth aspect, the present application further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the steps of the above-mentioned video data transmission method of the present application.
[0036] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the present application provides a transmission scheme for video data, and the scheme obtains the original video data to be transmitted, and needs to divide the original video data into regional data corresponding to each sub-region, independently encode each regional data to generate each regional coded data, and encapsulate each regional coded data into a data packet and transmit it to the data receiving end; wherein, each frame of coded data includes each regional coded data, and the number of regional coded data in each frame of coded data that is key frame data is less than the number of sub-regions. It can be seen that when the present application encodes the original video data, each frame of original video data will not be encoded as a whole, but the original video data will be divided into each regional data and then encoded independently, so that as long as the number of regional coded data in each frame of coded data that is key frame data is less than the number of sub-regions, it can be avoided that all regional coded data are key frame data, thereby reducing the amount of data after encoding each frame of original video data, and thus avoiding network congestion when transmitting video data. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0040] Figure 1 A schematic diagram of a video data transmission method provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of video screen segmentation provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of another video data transmission method provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the relationship between video frames and data flow provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of frame distribution of each sub-area provided in an embodiment of the present application;
[0045] Figure 6 A protocol diagram of a data encapsulation header provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of a data unpacking and decoding display process provided in an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the structure of a video data transmission device provided in an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In video compression, each frame represents a still image. In actual compression, various algorithms are used to reduce the data capacity, among which IPB is the most common. IPB indicates that frame data includes three types: I frame, P frame, and B frame.
[0050] Among them: I frame is intra picture, which can be expressed as a key frame, which is a complete preservation of a frame; P frame is a forward predictive frame, also known as a prediction frame. P frame represents the difference between this frame and the previous I frame (or P frame). When decoding, it is necessary to superimpose the difference defined by this frame with the previously cached picture to generate the final picture; B frame is a bidirectional interpolated prediction frame, which uses the previous I or P frame and the following P frame as reference frames, "finds" the predicted value and two motion vectors of "a certain point" in the B frame, and takes the predicted difference and motion vector for transmission.
[0051] For network congestion caused by key frame data, the common solutions are:
[0052] The first solution: bit rate control and resolution reduction, adjust the bit rate and resolution of video encoding, reduce the bit rate to adapt to the network bandwidth limit, and reduce the video quality or resolution when sending I frames to avoid excessive bandwidth usage. However, this method of controlling the bit rate and reducing the resolution will greatly reduce the clarity of the image;
[0053] The second solution is to send in fragments and reduce the sending rate. The I-frame data with large data volume is divided into multiple smaller fragments, and the data is sent gradually with increasing intervals to avoid congestion caused by instantaneous bandwidth surges. The sending rate of the sender is controlled to adapt the data sending rate to the current network conditions to avoid sending too many data packets during congestion. However, this method of sending in fragments and reducing the sending rate increases the image delay and causes the image to display unsmoothly.
[0054] Therefore, the present application discloses a method, apparatus, device and storage medium for transmitting video data to avoid network congestion when transmitting key frame video data.
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0056] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0057] See also Figure 1 , Figure 1 A schematic flow chart of a video data transmission method provided in an embodiment of the present application, the transmission method is applied to a data sending end, and specifically includes the following steps:
[0058] S101, obtaining original video data to be transmitted;
[0059] The present application provides a video data transmission system, which includes a data transmitting end and a data receiving end. The data transmitting end is used to execute the transmission method in this embodiment, encapsulate the original video data into a data packet after partition encoding, and transmit it to the data receiving end; the data receiving end is used to receive the data packet, and obtain the original video data after decoding the data packet.
[0060] In the present application, the video data to be transmitted is referred to as original video data. The original video data may be real-time video data acquired through a video acquisition device. The real-time video data may be smoothly transmitted to the data receiving end through the present application, thereby avoiding network congestion when transmitting key frame video data, and thereby avoiding freezes in video transmission.
[0061] S102, determining each sub-region corresponding to the original video data;
[0062] After obtaining the original video data, this application needs to perform partition coding on the original video data. The partition coding refers to dividing the video screen into multiple sub-areas, and encoding the video data corresponding to each sub-area separately. Therefore, in this application, it is first necessary to determine each sub-area corresponding to the original video data. In this application, the number of sub-areas is not specifically limited, and can be customized according to actual needs. For example, the original video data can be divided into 25 sub-areas, or the original video data can be divided into 36 sub-areas, and so on.
[0063] S103, dividing the original video data into regional data corresponding to each sub-region;
[0064] After the application determines each sub-region, the original video data can be divided into each region data corresponding to each sub-region. Figure 2 , Figure 2A schematic diagram of video screen segmentation provided in an embodiment of the present application, through Figure 2 It can be seen that the present application divides a complete video screen into 25 sub-regions of 5*5, and each sub-region is assigned a unique region code. Therefore, the region data divided by the present application include: the region data corresponding to the sub-region with region code 0000, the region data corresponding to the sub-region with region code 0100, ..., the region data corresponding to the sub-region with region code 0404.
[0065] S104, independently encoding each region data to generate each region coded data; wherein each frame of coded data includes each region coded data, and the number of region coded data in each frame of coded data that is key frame data is less than the number of sub-regions;
[0066] In this application, each region needs to be treated as an independent coding region, that is, after dividing the regional data corresponding to each sub-region, the regional data of each sub-region is encoded separately to obtain the regional coding data of each sub-region. In this application, the H.265 coding method can be used to encode the data of each region, and the H.264 coding method can also be used to encode the data of each region, which is not specifically limited here. In addition, since this application divides the video screen into multiple sub-regions, each frame of coded data in this application is composed of the coded data of each region, such as Figure 2 As shown, each frame of coded data consists of regional coded data of 25 sub-regions.
[0067] In the prior art, each frame of coded data includes the coded data of the entire video screen. If the current frame is key frame video data, the key frame video data has a large data volume, which causes network congestion when transmitting the key frame video data. In the present application, in order to solve this problem, the video screen is divided into multiple sub-areas, and each sub-area is partitioned and coded. In this way, in each frame of coded data, as long as the number of regional coded data that is key frame data is less than the number of sub-areas, it can be avoided that all regional coded data are key frame data, thereby reducing the data volume of each frame of coded data.
[0068] For example: See Figure 2, a complete video screen is divided into 25 sub-regions of 5*5. In the prior art, each frame of original video data needs to be encoded as a whole. Therefore, if the current frame data is key frame data, the 25 sub-regions are all key frame data after encoding; in the present application, the 25 sub-regions are independently encoded, and the number of regional encoding data in each frame of encoded data is set to be less than the number of sub-regions, such as: in the 25 sub-regions, only one of the sub-regions is encoded as key frame data. It can be seen that after encoding by the present application, only one sub-region in each frame of video data has regional encoding data as key frame data, which greatly reduces the amount of encoded data compared with the prior art. Therefore, in the present application, as long as the number of regional encoding data in each frame of encoded data is set to be less than the number of sub-regions, it can be avoided that the regional encoding data of the 25 sub-regions are all key frame data, thereby reducing the amount of encoded data and avoiding network congestion when transmitting data.
[0069] S105: Encapsulate the coded data of each region into a data packet and transmit it to a data receiving end.
[0070] After obtaining the regional coding data corresponding to each sub-region, the present application needs to encapsulate each regional coding data into a data packet for real-time audio and video transmission so as to transmit it through the network.
[0071] From the above, it can be seen that when encoding the original video data, the present application does not encode each frame of original video data as a whole, but divides the original video data into each region data and then encodes them independently. In this way, as long as the number of region encoding data in each frame of encoded data is key frame data, which is less than the number of sub-regions, it can be avoided that all region encoding data are key frame data, thereby reducing the amount of data after encoding each frame of original video data, and further avoiding network congestion when transmitting video data.
[0072] See also Figure 3 , Figure 3 A schematic flow chart of another video data transmission method provided in an embodiment of the present application, wherein the transmission method is applied to a data sending end and specifically comprises the following steps:
[0073] S201, obtaining original video data to be transmitted;
[0074] S202, dividing the video screen of the original video data into sub-regions; wherein the areas of the sub-regions are the same and the sub-regions have different region identifiers;
[0075] S203, dividing the original video data into regional data corresponding to each sub-region;
[0076] S204, using a coding algorithm to independently encode each region data to obtain region coding data of each region data; wherein each frame of coding data includes each region coding data, and only one region coding data in each frame of coding data is key frame data;
[0077] S205: Encapsulate the coded data of each region into a data packet and transmit it to a data receiving end.
[0078] See also Figure 4 , Figure 4 A schematic diagram of the relationship between video frames and data flow provided in an embodiment of the present application, Figure 4 In the existing H.265 encoding method or H.264 encoding method, the frame distribution is an I frame, B frame, and P frame distribution mode with a frame interval of 25. The I frame bit rate is usually 5-10 times the B and P frame bit rates. When the I frame is transmitted, a data flow peak occurs. Therefore, in this application, a partitioned video encoding method is adopted to divide the video screen of the original video data into sub-regions, and the area of each sub-region is the same, and each sub-region has a different region identifier.
[0079] When performing partition coding, the present application uses a coding algorithm to independently encode each region data to obtain the region coding data of each region data; in the present application, in order to achieve video fixed bit rate coding, when performing partition coding, only one region coding data in each frame coding data is set as key frame data. In the present application, the example of dividing the video screen into 25 sub-regions is used for explanation. Figure 5 , Figure 5 A schematic diagram of frame distribution of each sub-region provided in an embodiment of the present application, in which each column of data is 1 frame of data, and each row of data is data of each sub-region, such as: the first row is the data of the first sub-region in different frames; Figure 5 It can be seen that each frame of data consists of 25 sub-areas of data. The distribution of I-frame, B-frame, and P-frame in each frame of data sub-area can be found in Figure 5 ,pass Figure 5 It can be seen that in each frame of data, only one area has an I frame, and the other 24 areas are B frames and P frames. Through this partition encoding method, only one sub-area in each frame of data is I frame data. Since the amount of data in each frame is roughly the same, the flow of a certain frame of data will not suddenly increase, thereby avoiding pulse peaks and achieving relatively uniform video fixed bit rate encoding.
[0080] In another embodiment of the present application, when each region coding data is encapsulated into a data packet and transmitted to a data receiving end, the process includes: encapsulating each region coding data into a data packet according to a predetermined protocol; wherein the predetermined protocol includes a region identifier corresponding to each region coding data; and transmitting the data packet to the data receiving end via a wireless communication network.
[0081] After the application generates the regional coding data corresponding to the multiple sub-regions, it is necessary to encapsulate the regional coding data of the multiple sub-regions according to a predetermined protocol to generate a data packet for real-time audio and video transmission so as to transmit it through the network. The predetermined protocol is an improved format encapsulation. The application can optimize and transform the RTP (Real-time Transport Protocol) so as to encapsulate the data through the improved protocol. Figure 6 , is a protocol diagram of a data encapsulation header provided in an embodiment of the present application, through Figure 6 It can be seen that the header of the data packet of the predetermined protocol is 12 bytes and contains the following fields:
[0082] 1) V (2 bits): protocol version number, length is 2 bits.
[0083] 2) P (1 bit): padding bit. If it is 1, it means there are additional padding bytes at the end of the data packet.
[0084] 3)X (1 bit): extension bit. If it is 1, it means there is an extension header after the header.
[0085] 4) CC (4 bits): identifies the number of video sources and is used during mixing.
[0086] 5) M (1 bit): Marker bit, used to mark the video frame.
[0087] 6) PT (7 bits): Data type, identifying the media format of the transmitted data, such as audio or video encoding.
[0088] 7) Sequence number (16 bits): detects packet loss and reordering.
[0089] 8) Timestamp (32 bits): indicates the sampling time of the data and is used for audio and video synchronization control.
[0090] 9) Video source identifier (32 bits): identifies the video source and is used to distinguish multiple video streams.
[0091] 10) Video coding area identifier (32 bits): Extended data header design to identify the coding area of the video source for synchronous display of frame data.
[0092] The video coding region identifier is used to identify different sub-regions, and the video coding region identifier may be the region code of different sub-regions in the present application, such as Figure 20000, 0100, etc. After the application sends the data packet to the data receiving end, the data receiving end first unpacks the data, parses and reassembles the real-time audio and video data packets, and the unpacked data includes the regional coding data of multiple sub-regions; then decodes and synchronously displays the coded data of each region, recovers the original video data, and synchronously displays the images of multiple sub-regions.
[0093] In summary, in order to avoid network congestion when transmitting key frame video data, the present application divides the complete video screen into multiple sub-areas, each sub-area is encoded independently, and a complete frame of data sent each time is composed of data from multiple sub-areas. The I frames of each sub-area are sent in staggered periods to achieve smooth video data traffic.
[0094] In another embodiment of the present application, another method for transmitting video data is provided. The method is applied to a data receiving end, and includes the following contents: receiving a data packet sent by a data sending end, and decoding the data packet to obtain original video data.
[0095] Among them, the data packet in this embodiment is a data packet sent by any of the above-mentioned transmission methods based on the data sending end, such as: the data sending end obtains the original video data to be transmitted, and determines the sub-regions corresponding to the original video data; divides the original video data into regional data corresponding to the sub-regions; independently encodes the regional data to generate regional coded data; wherein each frame of coded data includes regional coded data, and the number of regional coded data in each frame of coded data that is key frame data is less than the number of sub-regions, and the regional coded data is encapsulated as a data packet and transmitted to the data receiving end.
[0096] In summary, it can be seen that the data packet obtained by the data receiving end in the present application is a data packet generated after the data sending end performs partition encoding; wherein, before the data sending end encodes the original video data, it is necessary to divide the original video data into each region data and then encode it independently. In this way, as long as the number of region encoding data in each frame of encoded data is key frame data, which is less than the number of sub-regions, it can be avoided that all region encoding data are key frame data, thereby reducing the amount of data after encoding each frame of original video data, and thus avoiding network congestion when transmitting video data.
[0097] In another embodiment of the present application, when the original video data is obtained after decoding the data packet, the data packet can be parsed according to a predetermined protocol to obtain the encoded data of each frame; wherein each frame of the encoded data includes the encoded data of each region; the encoded data of each region is decoded according to the region identifier to obtain the original video data; and the original video data is played on the display device.
[0098] In this application, the decoding device at the data receiving end receives the UDP (User Datagram Protocol) video data packet, first unpacks the data, and reconstructs the video frame, so as to restore the data packet to a displayable image frame and play it on the display device, see Figure 7 , is a schematic diagram of a data unpacking and decoding display process provided by an embodiment of the present application, the process includes the following steps:
[0099] S301, receiving UDP data packets: receiving UDP data packets from the wireless communication network, and the unpacking process starts from the header information and audio and video data of the UDP data packet
[0100] S302, parsing the data packet header: extracting and parsing the header information of the data packet, and parsing the data packet header according to the encapsulation format;
[0101] S303, parsing audio and video coded data: extracting the valid audio and video data according to the data type in the data packet header. Different data types use different decoding methods;
[0102] S304, audio and video data caching: the parsed audio and video data are classified according to the video source identifiers and put into circular queues respectively, each queue storing one channel of audio and video data;
[0103] S305, time synchronization: data header information timestamp, to ensure that the audio or video frames between different data packets can be played in the correct time sequence;
[0104] S306, frame reconstruction video data: obtain audio and video data from the circular queue, each queue has only one channel of video data, and the video data of all regions of the frame data can be obtained through the region identifier and timestamp to achieve reconstruction of the frame video data; wherein the timestamp is used to indicate which frame of video data each sub-region belongs to, and the region identifier is used to determine which sub-region of each frame of video data belongs to, so as to splice the video data of different sub-regions into a complete video region to achieve reconstruction of each frame of video data. For example: see Figure 2, the region identifier of the first sub-region in the first row is 0000, the region identifier of the second sub-region is 0100, the region identifier of the third sub-region is 0200, the region identifier of the fourth sub-region is 0300, and the region identifier of the fifth sub-region is 0400. Therefore, when splicing the video data of the sub-regions in the first row, it is necessary to splice the video data with the region identifier of 0000, the video data with the region identifier of 0100, the video data with the region identifier of 0200, the video data with the region identifier of 0030, and the video data with the region identifier of 0040 in sequence, and so on. The video data of each sub-region in each row are spliced at the corresponding positions according to the region identifiers, and the reorganized complete video data can be obtained.
[0105] S307, frame reordering: Since there are B and P frames in the video encoding, the decoding module reorders the video frames according to the timestamp and frame number to ensure that the display order of the video frames is correct.
[0106] S308, YUV (color encoding method) conversion: converting the decoded YUV format image data into RGB (color standard) format;
[0107] S309, display rendering: pass the data frame in RGB format to the rendering device. In this application, rendering uses OpenGL (Open Graphics Library) and DirectX (Direct eXtension, multimedia programming interface): use GPU (graphics processing unit) for image rendering, and SDL (Simple DirectMedia Layer, cross-platform multimedia development library), Qt (application development framework) and other graphics libraries for rendering display.
[0108] From the above, it can be seen that when the data transmitter encodes the original video data, it does not encode each frame of the original video data as a whole, but divides the original video data into each region data and encodes it independently. In this way, as long as the number of key frame data in each frame of encoded data is less than the number of sub-regions, it can be avoided that all region encoding data are key frame data, thereby reducing the amount of data after encoding each frame of original video data, and thus avoiding network congestion when transmitting video data. The data receiver can receive the transmitted data packet in time to avoid freezes or delays when playing the video; and after receiving the data packet, the data receiver can reorganize the video data according to the region identifiers of each region to achieve complete display of the video data.
[0109] See also Figure 8 , Figure 8A schematic diagram of the structure of a video data transmission device provided in an embodiment of the present application, the transmission device is applied to a data sending end, and the device specifically includes:
[0110] An acquisition module 11 is used to acquire original video data to be transmitted;
[0111] A determination module 12, configured to determine each sub-region corresponding to the original video data;
[0112] A division module 13, used for dividing the original video data into regional data corresponding to each sub-region;
[0113] The encoding module 14 is used to independently encode the data of each region to generate the encoded data of each region; wherein each frame of encoded data includes the encoded data of each region, and the number of the region encoded data in each frame of encoded data that is key frame data is less than the number of sub-regions;
[0114] The transmission module 15 is used to encapsulate the coded data of each region into a data packet and transmit it to the data receiving end.
[0115] As an optional embodiment, the determination module is specifically used to: divide the video screen of the original video data into sub-regions; wherein the areas of the sub-regions are the same, and the sub-regions have different region identifiers.
[0116] As an optional embodiment, the encoding module is specifically used to: use an encoding algorithm to independently encode each region data to obtain region encoding data of each region data; wherein only one region encoding data in each frame of encoded data is key frame data.
[0117] As an optional embodiment, the transmission module includes:
[0118] An encapsulation unit, used to encapsulate each region coding data into a data packet according to a predetermined protocol; wherein the predetermined protocol includes a region identifier corresponding to each region coding data;
[0119] The transmission unit is used to transmit the data packet to the data receiving end through the wireless communication network.
[0120] In one embodiment of the present invention, a video data transmission device is disclosed. The transmission device is applied to a data receiving end. The transmission device includes:
[0121] A receiving module, used for receiving a data packet sent by a data sending end; wherein the data packet is a data packet sent by a transmission device based on the data sending end in the above embodiment;
[0122] The decoding module is used to decode the data packet to obtain original video data.
[0123] As an optional embodiment, the decoding module includes:
[0124] A parsing unit, used to parse the data packet according to a predetermined protocol to obtain each frame of coded data; wherein each frame of coded data includes coded data of each region;
[0125] The decoding unit is used to decode the region identifier of each region coded data to obtain original video data.
[0126] As an optional embodiment, the transmission device further includes:
[0127] The playback module is used to play the original video data on the display device.
[0128] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0129] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device specifically includes:
[0130] The processor 21, the memory 22 and the computer program stored in the memory 22 and executable on the processor 21, the processor 21 executes the steps of the video data transmission method described in any of the above method embodiments through the computer program.
[0131] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0132] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used to store the following computer program 221, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps in the video data transmission method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 22 may also include an operating system 222 and data 223, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 222 may include Windows, Unix, Linux, etc.
[0133] In some embodiments, the electronic device may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power source 27 , and a communication bus 28 .
[0134] certainly, Fig. 9 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include Fig. 9 More or fewer components than shown, or combinations of certain components.
[0135] In another exemplary embodiment, a computer storage medium is also provided, and when the program instructions are executed by a processor, the steps of the video data transmission method described in any of the above method embodiments are implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0136] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0137] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0138] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for transmitting video data, characterized in that: The transmission method is applied to a data transmitting end, and the transmission method comprises: Obtaining original video data to be transmitted; Determine each sub-region corresponding to the original video data; Dividing the original video data into regional data corresponding to each sub-region; Independently encode the data of each region to generate the encoded data of each region; wherein each frame of encoded data includes the encoded data of each region, and the number of the region encoded data in each frame of encoded data that is key frame data is less than the number of sub-regions; The coded data of each region is encapsulated into a data packet and transmitted to the data receiving end.
2. The transmission method according to claim 1, characterized in that: The determining of each sub-region corresponding to the original video data includes: The video screen of the original video data is divided into sub-regions; wherein the areas of the sub-regions are the same and the sub-regions have different region identifiers.
3. The transmission method according to claim 1, characterized in that: The step of independently encoding each region data to generate each region coded data comprises: Using a coding algorithm to independently encode each region data, to obtain region coding data of each region data; Among them, only one area of coded data in each frame of coded data is key frame data.
4. The transmission method according to any one of claims 1 to 3, characterized in that: The step of encapsulating the coded data of each region into a data packet and transmitting it to the data receiving end includes: Encapsulating each region coding data into a data packet according to a predetermined protocol; wherein the predetermined protocol includes a region identifier corresponding to each region coding data; The data packet is transmitted to a data receiving end via a wireless communication network.
5. A method for transmitting video data, characterized in that: The transmission method is applied to a data receiving end, and the transmission method includes: Receive a data packet sent by a data sending end; wherein the data packet is a data packet sent by the transmission method according to any one of claims 1 to 4; The original video data is obtained after decoding the data packet.
6. The transmission method according to claim 5, characterized in that: The decoding of the data packet to obtain the original video data includes: Parsing the data packet according to a predetermined protocol to obtain each frame of coded data; wherein each frame of coded data includes coded data of each region; Decoding is performed according to the region identifier of each region coded data to obtain original video data.
7. The transmission method according to claim 5, characterized in that: After decoding the data packet to obtain the original video data, the method further includes: Play the original video data on the display device.
8. A video data transmission device, characterized in that: The transmission device is applied to a data transmitting end, and the transmission device comprises: An acquisition module, used for acquiring original video data to be transmitted; A determination module, used to determine each sub-region corresponding to the original video data; A division module, used for dividing the original video data into regional data corresponding to each sub-region; The encoding module is used to independently encode the data of each region to generate the encoded data of each region; wherein each frame of encoded data includes the encoded data of each region, and the number of the region encoded data in each frame of encoded data that is key frame data is less than the number of sub-regions; The transmission module is used to encapsulate the coded data of each region into a data packet and transmit it to the data receiving end.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the transmission method described in any one of claims 1 to 4 of the present application, or the steps of the transmission method described in any one of claims 5 to 7 through the computer program.
10. A computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the transmission method described in any one of claims 1 to 4 of the present application, or the steps of the transmission method described in any one of claims 5 to 7.