Video transmission method, device, system, equipment and storage medium

文档序号:1524365 发布日期:2020-02-11 浏览:15次 中文

阅读说明:本技术 一种视频传输方法、装置、系统、设备及存储介质 (Video transmission method, device, system, equipment and storage medium ) 是由 陈松 赖学武 荣先海 于 2019-11-26 设计创作,主要内容包括:本申请提供了一种视频传输方法、装置、系统、设备及存储介质,其中,应用于发送端设备的视频传输方法包括:将目标视频中待传输的目标图像帧切分为优先级不同的多个区域;获取当前预测的带宽作为目标带宽;当目标带宽小于最大带宽时,根据目标带宽、各个区域的优先级以及各个区域分别对应的最大码率,为各个区域分配对应的目标码率;按各个区域分别对应的目标码率对对应的区域进行压缩编码,并将各个区域的压缩编码结果发送至接收端设备。本申请提供的视频传输方法,在网络变差时,既能保证目标图像帧中重要区域具有较好的视频质量,又能保证目标图像帧能够较快、较流畅、低延迟地传输至接收端设备。(The application provides a video transmission method, a device, a system, equipment and a storage medium, wherein the video transmission method applied to sending end equipment comprises the following steps: dividing a target image frame to be transmitted in a target video into a plurality of areas with different priorities; acquiring a current predicted bandwidth as a target bandwidth; when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for the regions according to the target bandwidth, the priority of the regions and the maximum code rates respectively corresponding to the regions; and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment. According to the video transmission method, when the network is degraded, the important area in the target image frame can be guaranteed to have better video quality, and the target image frame can be transmitted to the receiving terminal device more quickly, more smoothly and with low delay.)

1. A video transmission method is applied to sending end equipment and comprises the following steps:

segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

acquiring a current predicted bandwidth as a target bandwidth;

when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment.

2. The video transmission method according to claim 1, wherein transmitting the compression-coding result of each region to a receiving-end device comprises:

for the region with the highest priority, splitting the coding result of the region into a plurality of video data packets, generating an error correction data packet containing error correction information according to the plurality of video data packets, and sending the plurality of video data packets and the error correction data packet to receiving end equipment, wherein the code rate corresponding to the error correction information is determined according to the total code rate corresponding to the region with the highest priority and the target code rate corresponding to the region with the highest priority;

for the areas except the area with the highest priority, the coding result of each area is split into a plurality of video data packets, and the video data packets obtained by splitting the coding result of each area are sent to the receiving end equipment.

3. The video transmission method according to claim 2, wherein the data packets of the respective regions of the target image frame have uniform absolute time stamps.

4. The video transmission method according to claim 1, wherein the splitting of the target image frame in the target video into a plurality of regions comprises:

dividing a target image frame in the target video into three regions, wherein a first region in the three regions has higher priority than a second region, the second region has higher priority than a third region, the first region is a central region of the target image frame, the second region is a region outside the central region, and the third region is a region outside the second region.

5. The video transmission method according to claim 4, wherein the determining the target bitrate respectively corresponding to each region according to the target bandwidth, the priority of each region, and the maximum bitrate respectively corresponding to each region comprises:

determining a target code rate corresponding to the first region according to the target bandwidth and the maximum code rate corresponding to the first region;

determining a target code rate corresponding to the third region according to the target bandwidth and the maximum code rate corresponding to the third region;

determining a target code rate corresponding to the second region according to the target bandwidth, the target code rate corresponding to the first region and the target coding code rate corresponding to the third region;

the target code rate corresponding to the first region is reduced from the maximum code rate corresponding to the first region by a smaller amount than the target code rate corresponding to the second region is reduced from the maximum code rate corresponding to the second region, and the target code rate corresponding to the second region is reduced from the maximum code rate corresponding to the second region by a smaller amount than the target code rate corresponding to the third region is reduced from the maximum code rate corresponding to the third region.

6. A video transmission method, applied to a receiving end device, the method comprising:

receiving encoding results of a plurality of regions in a target image frame, wherein each region in the target image frame can constitute the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region;

and generating a complete image frame according to the decoding results of the regions.

7. The video transmission method according to claim 6, wherein the encoding result of the area with the highest priority includes a plurality of video data packets and error correction data packets, and the other areas each include only a plurality of video data packets;

the method further comprises the following steps:

if any video data packet in the area with the highest priority is lost in the transmission process, recovering the lost video data packet by using the error correction data packet;

if the lost video data packet cannot be recovered by using the error correction data packet, sending a retransmission request data packet to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted;

if the retransmission is wrong and the number of continuous retransmission errors reaches the preset number, initiating a request for refreshing the video coding key frame to the sending terminal equipment so that the sending terminal equipment refreshes the video coding key frame, wherein the retransmission error means that the receiving terminal receives a video data packet retransmitted by the sending terminal as an error data packet.

8. The video transmission method according to claim 6, further comprising:

for any area in other areas except the area with the highest priority, if any video data packet in the area is lost in the transmission process, sending a retransmission request data packet to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted;

if the video data packet retransmitted by the sending terminal equipment is not received within the maximum packet loss waiting time corresponding to the area, using the decoding result of the area in the previous image frame as the decoding result of the area in the target image frame;

and the maximum waiting time of packet loss corresponding to the high-priority area is longer than that corresponding to the low-priority area.

9. A video transmission apparatus, applied to a sending-end device, the apparatus comprising: the device comprises an image segmentation module, a bandwidth acquisition module, a code rate distribution module, a coding module and a sending module;

the image segmentation module is used for segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

the bandwidth obtaining module is used for obtaining the current predicted bandwidth as a target bandwidth;

the code rate allocation module is used for allocating corresponding target code rates to the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region when the target bandwidth is smaller than the maximum bandwidth, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

the coding module is used for carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions;

and the sending module is used for sending the compression coding result of each region to the receiving terminal equipment.

10. A video transmission apparatus, applied to a receiving end device, the apparatus comprising: the device comprises a receiving module, a decoding module and an image frame generating module;

the receiving module is used for receiving the coding results of a plurality of areas in a target image frame, wherein each area in the target image frame can form the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

the decoding module is used for decoding the coding results of each region respectively to obtain the decoding results of each region if the coding results of each region do not lose data in the transmission process;

and the image frame generating module is used for generating a complete image frame according to the decoding result of each region.

11. A video transmission system, comprising: a sending end device and a receiving end device;

the sending end equipment is used for segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region; acquiring a current predicted bandwidth as a target bandwidth; when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth; compressing and coding the corresponding regions according to the code rates respectively corresponding to the regions, and sending the compressed and coded results of the regions to receiving end equipment;

the receiving end equipment is used for receiving the compression coding result of each area in the target image frame; if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region; and generating a complete image frame according to the decoding result of each region.

12. A transmitting-end device, comprising: a memory and a processor;

the memory is used for storing programs;

the processor is configured to execute the program to implement the steps of the video transmission method according to any one of claims 1 to 5.

13. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the video transmission method according to any one of claims 1 to 5.

14. A receiving-end device, comprising: a memory and a processor;

the memory is used for storing programs;

the processor, configured to execute the program, and implement the steps of the video transmission method according to any one of claims 6 to 8.

15. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the video transmission method according to any one of claims 6 to 8.

Technical Field

The present application relates to the field of video transmission technologies, and in particular, to a video transmission method, apparatus, system, device, and storage medium.

Background

In some application scenarios, the target video needs to be transmitted to a designated device through a wireless network, for example, a conference scenario, a teaching scenario, and the like all use a wireless screen projection, which is to transmit the target video to a receiving end device through the wireless network for display.

However, wireless networks have characteristics of instability, mutual interference, and the like, and therefore, it is not always possible to maintain a high transmission rate, and how to perform video transmission quickly, smoothly, and with low delay under a poor network condition is a problem that needs to be solved at present.

Disclosure of Invention

In view of the above, the present application provides a video transmission method, apparatus, system, device and storage medium, which are used to perform video transmission faster, smoother and with low delay under the condition of poor network, and the technical solution is as follows:

a video transmission method is applied to sending end equipment and comprises the following steps:

segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

acquiring a current predicted bandwidth as a target bandwidth;

when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment.

Optionally, the sending the compression encoding result of each region to the receiving end device includes:

for the region with the highest priority, splitting the coding result of the region into a plurality of video data packets, generating an error correction data packet containing error correction information according to the plurality of video data packets, and sending the plurality of video data packets and the error correction data packet to receiving end equipment, wherein the code rate corresponding to the error correction information is determined according to the total code rate corresponding to the region with the highest priority and the target code rate corresponding to the region with the highest priority;

for the areas except the area with the highest priority, the coding result of each area is split into a plurality of video data packets, and the data packets obtained by splitting the coding result of each area are sent to the receiving end equipment.

Optionally, the data packets of the respective regions of the target image frame have uniform absolute time stamps.

Optionally, the segmenting the target image frame in the target video into a plurality of regions includes:

dividing a target image frame in the target video into three regions, wherein a first region in the three regions has higher priority than a second region, the second region has higher priority than a third region, the first region is a central region of the target image frame, the second region is a region outside the central region, and the third region is a region outside the second region.

Optionally, the determining, according to the target bandwidth, the priority of each region, and the maximum code rate corresponding to each region, a target code rate corresponding to each region respectively includes:

determining a target code rate corresponding to the first region according to the target bandwidth and the maximum code rate corresponding to the first region;

determining a target code rate corresponding to the third region according to the target bandwidth and the maximum code rate corresponding to the third region;

determining a target code rate corresponding to the second region according to the target bandwidth, the target code rate corresponding to the first region and the target coding code rate corresponding to the third region;

the target code rate corresponding to the first region is reduced from the maximum code rate corresponding to the first region by a smaller amount than the target code rate corresponding to the second region is reduced from the maximum code rate corresponding to the second region, and the target code rate corresponding to the second region is reduced from the maximum code rate corresponding to the second region by a smaller amount than the target code rate corresponding to the third region is reduced from the maximum code rate corresponding to the third region.

A video transmission method is applied to a receiving end device, and comprises the following steps:

receiving encoding results of a plurality of regions in a target image frame, wherein each region in the target image frame can constitute the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region;

and generating a complete image frame according to the decoding results of the regions.

Optionally, the encoding result of the region with the highest priority includes a plurality of video data packets and error correction data packets, and the other regions include only a plurality of video data packets;

the video transmission method further includes:

if any video data packet in the area with the highest priority is lost in the transmission process, recovering the lost video data packet by using the error correction data packet;

if the lost video data packet cannot be recovered by using the error correction data packet, sending a retransmission request data packet to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted;

if the retransmission is wrong and the number of continuous retransmission errors reaches the preset number, initiating a request for refreshing the video coding key frame to the sending terminal equipment so that the sending terminal equipment refreshes the video coding key frame, wherein the retransmission error means that the receiving terminal receives a video data packet retransmitted by the sending terminal as an error data packet.

Optionally, the video transmission method further includes:

for any area in other areas except the area with the highest priority, if any video data packet in the area is lost in the transmission process, sending a retransmission request data packet to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted;

if the video data packet retransmitted by the sending terminal equipment is not received within the maximum packet loss waiting time corresponding to the area, using the decoding result of the area in the previous image frame as the decoding result of the area in the target image frame;

and the maximum waiting time of packet loss corresponding to the high-priority area is longer than that corresponding to the low-priority area.

A video transmission device is applied to sending-end equipment, and the device comprises: the device comprises an image segmentation module, a bandwidth acquisition module, a code rate distribution module, a coding module and a sending module;

the image segmentation module is used for segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

the bandwidth obtaining module is used for obtaining the current predicted bandwidth as a target bandwidth;

the code rate allocation module is used for allocating corresponding target code rates to the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region when the target bandwidth is smaller than the maximum bandwidth, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

the coding module is used for carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions;

and the sending module is used for sending the compression coding result of each region to the receiving terminal equipment.

A video transmission apparatus applied to a receiving end device, the apparatus comprising: the device comprises a receiving module, a decoding module and an image frame generating module;

the receiving module is used for receiving the coding results of a plurality of areas in a target image frame, wherein each area in the target image frame can form the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

the decoding module is used for decoding the coding results of each region respectively to obtain the decoding results of each region if the coding results of each region do not lose data in the transmission process;

and the image frame generating module is used for generating a complete image frame according to the decoding result of each region.

A video transmission system comprising: a sending end device and a receiving end device;

the sending end equipment is used for segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region; acquiring a current predicted bandwidth as a target bandwidth; when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for the regions according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with a high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with a low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth; compressing and coding the corresponding regions according to the code rates respectively corresponding to the regions, and sending the compressed and coded results of the regions to receiving end equipment;

the receiving end equipment is used for receiving the compression coding result of each area in the target image frame; if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region; and generating a complete image frame according to the decoding result of each region.

A transmitting end device, comprising: a memory and a processor;

the memory is used for storing programs;

the processor is configured to execute the program, and implement the steps of the video transmission method applied to any one of the sending-end devices.

A readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the video transmission method described above as applied to any one of the sending-end devices.

A receiving end device, comprising: a memory and a processor;

the memory is used for storing programs;

the processor is configured to execute the program to implement the steps of the video transmission method applied to any one of the receiving end devices.

A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the video transmission method described above as applied to any one of the receiving-end devices.

According to the scheme, the video transmission method, the video transmission device, the video transmission system, the video transmission equipment and the storage medium can divide a target image frame to be transmitted in a target video to be transmitted into a plurality of regions with different priorities, when a network is in a poor state, the target code rates corresponding to the regions can be respectively the target code rates corresponding to the regions according to the target bandwidth, the priority of the regions and the maximum code rate corresponding to the regions, and when the code rates are distributed to the regions, the reduction range of the code rate corresponding to the high-priority region compared with the maximum code rate corresponding to the high-priority region is smaller than the reduction range of the code rate corresponding to the region with the low priority compared with the maximum code rate corresponding to the high-priority region. Compared with the maximum code rate corresponding to the high-priority area, the code rate corresponding to the high-priority area is reduced by a small amount, so that the high-priority area can be guaranteed to have better video quality, and compared with the maximum code rate corresponding to the low-priority area, the code rate of the low-priority area is reduced by a large amount, so that the target image frame can be guaranteed to be transmitted to the receiving end equipment quickly, smoothly and with low delay.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

Fig. 1 is a schematic flowchart of a video transmission method applied to a sending-end device according to an embodiment of the present application;

fig. 2 is a schematic diagram of an example of segmenting a target image frame into a plurality of regions according to an embodiment of the present application;

fig. 3 is a schematic diagram of another two examples of segmenting a target image frame into a plurality of regions according to the embodiment of the present application;

fig. 4 is a schematic diagram of generating FEC data packets according to four video data packets according to an embodiment of the present application;

fig. 5 is a schematic diagram of recovering a lost video data packet by using an error correction data packet and an unrecessed video data packet according to an embodiment of the present application;

fig. 6 is a schematic flowchart of a specific example of a video transmission method applied to a sending-end device according to an embodiment of the present application;

fig. 7a and 7b are schematic diagrams of filling the second region and the third region according to an embodiment of the present application;

fig. 8 is a schematic flowchart of a video transmission method applied to a receiving end device according to an embodiment of the present application;

fig. 9 is a schematic diagram of a processing manner in which packet loss does not occur in the second area and a schematic diagram of processing manners in three cases in which packet loss occurs in the second area according to an embodiment of the present application;

fig. 10 is a schematic diagram of a processing manner in which packet loss does not occur in the third area and a schematic diagram of processing manners in three cases in which packet loss occurs in the third area according to an embodiment of the present application;

fig. 11 is a schematic structural diagram of a video transmission apparatus applied to a sending-end device according to an embodiment of the present application;

fig. 12 is a schematic structural diagram of a video transmission apparatus applied to a receiving end device according to an embodiment of the present application;

fig. 13 is a schematic structural diagram of a video transmission system according to an embodiment of the present application;

fig. 14 is a schematic structural diagram of a sending-end device according to an embodiment of the present application;

fig. 15 is a schematic structural diagram of a receiving end device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In order to transmit video faster, more smoothly and with low delay under the condition of poor network, the inventor of the present invention has conducted intensive research and finally provides a video transmission method with better effect, and the basic idea of the video transmission method is as follows:

the method comprises the steps of dividing an image frame to be transmitted of a video to be transmitted into a plurality of regions with different priorities, and when the network quality is poor, enabling the code rate of the high-priority region to have a smaller reduction range (ensuring the video quality of the high-priority region) than the corresponding maximum code rate thereof and enabling the code rate of the low-priority region to have a larger reduction range (ensuring the smooth transmission of the image frame to be transmitted) than the corresponding maximum code rate thereof in order to ensure that the image frame to be transmitted can be smoothly transmitted to receiving end equipment with low delay and simultaneously ensure the video quality of the high-priority region, namely, when the network quality is poor, the code rate corresponding to the low-priority region is mainly reduced to ensure the smooth transmission of the image frame to be transmitted with low delay.

The video transmission method is applied to sending end equipment for sending video data and receiving end equipment for receiving the video data. The following embodiments are provided to describe the video transmission method provided in the present application.

Referring to fig. 1, a schematic flowchart of a video transmission method provided in an embodiment of the present application is shown, where the method is applied to a sending-end device, such as a PC, a notebook, a PAD, a mobile phone, and the method may include:

step S101: and segmenting a target image frame to be transmitted in the target video into a plurality of areas.

The priority of each region obtained by segmentation is different, the priority of each region is determined according to the attention degree of a user to each region, the priority of the region with high attention degree of the user is high, and the priority of the region with low attention degree of the user is low. For example, the user may have a high degree of attention on the center region of the target image frame and a low degree of attention on the edge region of the target image frame, and based on this, the target image frame may be divided into three regions in the dividing manner as shown in fig. 2. Of course, the present application is not limited to the splitting method shown in fig. 2, and the splitting method may be performed in other manners, for example, the splitting method shown in fig. 3.

In this embodiment, the number of the segmentation regions, the segmentation mode, and the area ratio between each region and the target image frame may be preset, and when the target video is transmitted, the target image frame to be transmitted in the target video is segmented based on these areas. Preferably, the area of the region with the highest priority can be maximized.

Step S102: and acquiring the current predicted bandwidth as a target bandwidth.

Optionally, a kalman filter bandwidth prediction algorithm, a BBR congestion algorithm, and the like may be used to predict the future bandwidth, where the predicted bandwidth is used as the target bandwidth.

Step S103: and when the target bandwidth is smaller than the maximum bandwidth, distributing the corresponding target code rate for each region according to the target bandwidth, the priority of each region and the corresponding maximum code rate of each region.

It can be understood that, the target bandwidth is smaller than the maximum bandwidth, which indicates that the network condition is not optimal, and in order to ensure the video quality of the high-priority region and ensure the smooth transmission of the target image frame at the same time, the principle of allocating the corresponding target bitrate to each region in this embodiment is as follows: the reduction range of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the reduction range of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate.

And if the target bandwidth is the maximum bandwidth, the target code rate allocated to each region is the maximum code rate corresponding to the corresponding region.

The maximum code rate corresponding to one region is the code rate when the network is optimal (that is, the bandwidth of the network is the maximum bandwidth), and may be determined according to the maximum bandwidth and the area ratio of the region to the target image frame, specifically, the maximum bandwidth is multiplied by the area ratio of the region to the target image frame, so as to obtain the target code rate corresponding to the region.

Step S104: and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment.

Specifically, a video encoder may be used to perform compression encoding on the corresponding regions at the target code rates corresponding to the respective regions.

The video transmission method provided in this embodiment may divide a target image frame to be transmitted into a plurality of regions with different priorities, and when a network is degraded, may set a target bitrate corresponding to each region according to a target bandwidth, a priority of each region, and a maximum bitrate corresponding to each region, and when allocating a bitrate to each region, decrease of a bitrate corresponding to a high-priority region from its corresponding maximum bitrate is smaller than decrease of a bitrate corresponding to a low-priority region from its corresponding maximum bitrate. Compared with the maximum code rate corresponding to the high-priority area, the code rate corresponding to the high-priority area is reduced by a small amount, so that the high-priority area can be guaranteed to have better video quality, and compared with the maximum code rate corresponding to the low-priority area, the code rate corresponding to the low-priority area is reduced by a large amount, so that the target image frame can be guaranteed to be smoothly transmitted to the receiving end equipment.

In addition, considering that the size of the video coding frame output by the encoder is often higher than the size of the maximum transmission unit MTU of the UDP network, based on this, the present embodiment may slice the coding result of each region by the size of MTU to obtain a plurality of video data packets of each region.

It can be understood that, in the process of transmitting video data packets in each area, if a network is degraded, packet loss is likely to occur, and since the area with the highest priority is important, when the area with the highest priority has packet loss, in order to recover the lost data packet, in the embodiment of the present application, a data protection mechanism may be introduced, that is, when the data packet in the area with the highest priority is transmitted, an error correction data packet containing error correction information is introduced, so that when the area with the highest priority has packet loss, the receiving end device may recover the lost data packet by using the error correction data packet.

That is to say, in the embodiment of the present application, for a region with the highest priority, a coding result of the region is split into a plurality of video data packets, an error correction data packet containing error correction information is generated according to the plurality of video data packets, and the plurality of video data packets and the error correction data packet in the region with the highest priority are sent to a receiving end device, where a code rate corresponding to the error correction information is determined according to a total code rate corresponding to the region with the highest priority and a target code rate corresponding to the region with the highest priority; for the areas except the area with the highest priority, the coding result of each area is split into a plurality of video data packets, and the split data packets are sent to the receiving end equipment.

Optionally, the data protection mechanism used in this embodiment may be, but is not limited to, a forward error correction FEC mechanism, that is, an FEC data Packet is generated according to a plurality of video data packets in an area with the highest priority, optionally, an XOR redundancy method may be used to generate the FEC data Packet, assuming that there are four video data packets, please refer to fig. 4, which shows a process of generating the FEC data Packet according to four video data packets, as shown in fig. 4, data in a video data Packet1 and data in a video data Packet2 are XOR to obtain an FEC1, data in the FEC1 and data in the video data Packet3 are XOR to obtain an FEC2, data in the FEC2 and data in the video data Packet4 are XOR to obtain an FEC3, and a data Packet containing the FEC3 is used as an error correction data Packet sent to the receiving end device together with the packets 1 to Packet 4.

Assuming that Packet2 is lost in the process of transmitting the video data packets from Packet1 to Packet4 and the error correction data Packet, the receiving end device may recover Packet2 by using the error correction data Packet, Packet1, Packet3 and Packet4, please refer to fig. 5, which shows a process of recovering Packet2 by using the error correction information (i.e., FEC3), Packet1, Packet3 and Packet4 in the error correction data Packet, as shown in fig. 5, data in FEC3 and Packet4 are XOR to obtain 2, data in FEC2 and Packet3 are XOR to obtain FEC1, and data in FEC1 and Packet1 are XOR to obtain data in Packet 2.

It should be noted that the redundancy of the error correction information is inversely related to the network bandwidth, that is, the larger the network bandwidth is, the smaller the redundancy of the error correction data is, and conversely, the smaller the network bandwidth is, the larger the redundancy of the error correction data is. Assuming that the network bandwidth a is smaller than the network bandwidth b, and both a and b are smaller than the maximum bandwidth, the redundancy rate at the bandwidth a is greater than that at the bandwidth b, for example, at the bandwidth a, one error correction data packet may be added every two video data packets, if 12 data packets are added in total, 6 error correction data packets are required, and at the bandwidth b, one error correction data packet is added every four video data packets, 3 error correction data packets are required.

In addition, it should be noted that, in order to enable the receiving end device to correctly merge the regions belonging to the same image frame, the data packets of the regions of the target image frame should have uniform absolute timestamps.

On the basis of the above embodiments, the following describes a video transmission method provided by the present application by using a specific example.

Referring to fig. 6, a flowchart of a specific example of a video transmission method applied to a sending-end device provided in the present application is shown, where the method may include:

step S601: and dividing a target image frame to be transmitted in the target video into three areas.

Specifically, the target image frame may be segmented into three regions according to the segmentation method shown in fig. 2, where the three regions are, from inside to outside, a first region, a second region and a third region in sequence, that is, the first region is a central region of the target image frame, the second region is a region outside the first region, and the third region is a region outside the second region.

Since the user has the highest attention to the first area, the second area, and the third area, the priority of the first area is set to be the highest, the priority of the second area, and the priority of the third area is set to be the lowest.

Optionally, the area of the first region may be about 0.4 to 0.5, for example, 0.44, of the total area of the target image frame, and if the area of the first region is 0.44 of the total area of the target image frame, the area of the second region may be 0.2 of the total area of the target image frame, and the area of the third region may be 0.36 of the total area of the target image frame. The proportion of the area of each region to the total area of the target image frame can be set according to specific application conditions.

It should be noted that, since the data of the second region and the third region cannot be changed into a matrix, and therefore cannot be encoded, for this reason, the second region and the third region may be respectively filled, as shown in fig. 7a and 7b, the shaded region in fig. 7a and 7b is a filled region, and optionally, the green data may be filled, that is, YUV is 0.

Step S602: and acquiring the current predicted bandwidth as a target bandwidth.

Optionally, any bandwidth estimation algorithm may be used to estimate the bandwidth, for example, a kalman filter bandwidth estimation algorithm, a BBR congestion algorithm, and the like.

Step S603: and when the target bandwidth is smaller than the maximum bandwidth, distributing the corresponding target code rates for the three regions according to the target bandwidth, the priorities of the three regions and the maximum code rates corresponding to the three regions respectively.

It should be noted that, if the target bandwidth is the maximum bandwidth, the target code rate allocated to each region is the maximum code rate corresponding to the corresponding region.

Illustratively, the maximum bandwidth is 4mbps, the area of the first region is 0.44 of the total area of the target image frame, the area of the second region is 0.2 of the total area of the target image frame, and the area of the third region is 0.36 of the total area of the target image frame, then the maximum bitrate corresponding to the first region is 0.44 × maximum bandwidth (i.e., 0.44 × 4) and is about 1.7mbps, similarly, the maximum bitrate corresponding to the second region is 0.2 × maximum bandwidth (i.e., 0.2 × 4) and is 0.8mbps, and the maximum bitrate corresponding to the third region is 0.36 × maximum bandwidth (i.e., 0.36 × 4) and is 1.44 mbps.

If the target bandwidth is smaller than the maximum bandwidth, it indicates that the network is in a bad condition, i.e. the current total code rate of the network is smaller than the maximum total code rate of the network, which means that the code rate allocated to each region is reduced compared with the maximum code rate corresponding to the region.

In order to ensure that the target image frame is transmitted smoothly and the region with the highest priority (i.e., the first region) has better video quality when the network condition is not good, the principle of allocating the code rate to each region in this embodiment is as follows: and the reduction amplitude of the target code rate corresponding to the first region compared with the corresponding maximum code rate is smaller than that of the target code rate corresponding to the second region compared with the corresponding maximum code rate, and the reduction amplitude of the target code rate corresponding to the second region compared with the corresponding maximum code rate is smaller than that of the target code rate corresponding to the third region compared with the corresponding maximum code rate.

In a possible implementation manner, a function is respectively set for the first region, the second region and the third region, the function set for any region can reflect the relationship between the target bandwidth and the target code rate corresponding to the region, the function set for each region is used for enabling the reduction range of the target code rate corresponding to the first region compared with the corresponding maximum code rate to be smaller than the reduction range of the target code rate corresponding to the second region compared with the corresponding maximum code rate when the network condition is not good, and the reduction range of the target code rate corresponding to the second region compared with the corresponding maximum code rate to be smaller than the reduction range of the target code rate corresponding to the third region compared with the corresponding maximum code rate.

Optionally, the function that is set for the first region and can reflect the relationship between the target bandwidth X and the target code rate b11 corresponding to the region is b11 ═ X/4) × 1.7, and it should be noted that when the network is degraded, since error correction information is introduced, a code rate needs to be allocated to the error correction information, and therefore, the function b1 that can reflect the relationship between the total code rate b1 corresponding to the first region and the target bandwidth X is set for the first region and is (X +4)/8 × 1.7, and the code rate b12 that is allocated to the error correction information is b1-b 11; a function set for the third region and capable of reflecting the relationship between the target bandwidth X and the target bitrate b3 corresponding to the region is b3 ═ X/4 × (X/4) × 1.44; the function set for the second region and reflecting the relationship between the target bandwidth X and the target bitrate b2 corresponding to the region is b2 — X-b1-b 3.

Assuming that the target bandwidth X is the minimum bandwidth of the network, for example, the minimum bandwidth is 2, the total code rate b1 corresponding to the first region is (X +4)/8 × 1.7 ═ 2+4)/8 ═ 1.7 ═ 1.275mbps, the target code rate b11 corresponding to the first region is (X/4) × 1.7 ═ 2/4) ═ 1.7 ═ 0.85mbps, and the code rate of the error correction information is b12 ═ b1-b11 ═ 1.275-0.85 ═ 0.475 mbps; the target code rate b3 corresponding to the third region is (X/4) × 1.44 ═ 2/4) × (2/4) × 1.44 ═ 0.35 mbps; the target code rate corresponding to the second region is b 2-X-b 1-b 3-2-1.275-0.35-0.375 mbps.

Step S604: and carrying out compression coding on the corresponding areas according to the target code rates respectively corresponding to the three areas, and sending the compression coding result of each area to the receiving terminal equipment.

When the first region is encoded, the quantization parameter should be set to be small, and the quality is higher as the quantization parameter is smaller, and since the area of the first region occupies only 0.4 to 0.5 of the area of the target image frame, the encoding speed is higher even if the quantization parameter is small.

In the video transmission method provided in this embodiment, the target image frame to be transmitted may be divided into three regions with different priorities, and when the network is degraded, the target code rates corresponding to the three regions may be set according to the target bandwidth, the priorities of the three regions, and the maximum code rates corresponding to the three regions, respectively, so that the reduction range of the code rate corresponding to the high-priority region from the maximum code rate corresponding to the high-priority region is smaller than the reduction range of the code rate corresponding to the low-priority region from the maximum code rate corresponding to the low-priority region. In summary, the video transmission method provided by the embodiment of the present application can ensure that an important region in a target image frame has better video quality and can ensure that the target image frame can be transmitted to a receiving end device faster, smoother and with low delay when a network is degraded.

The video transmission method provided by the embodiment can transmit the encoding result of the target image frame in the target video to the receiving end device. The following describes a process of restoring an image frame from received data by a receiving end device.

Referring to fig. 8, a flow chart of a video transmission method applied to a receiving end device is shown, where the method may include:

step S801: and receiving the coding results of the areas in the target image frame.

The target image frame comprises a target image frame, wherein each region in the target image frame can form the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate corresponding to each region, the target code rate corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate corresponding to each region, the reduction amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the reduction amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth.

Step S802: and if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region.

When a video transmission method of a sending end device is introduced, it is mentioned that an encoding result of each region is divided into a plurality of video data packets, and when a network condition is not good, an error correction information is also added to a region with the highest priority, that is, when the network condition is not good, an encoding result of the region with the highest priority includes a plurality of video data packets and error correction data packets, and other regions include only a plurality of video data packets.

Step S803: and generating a complete image frame according to the decoding results of the regions.

Specifically, the decoding results of the regions are combined, two adjacent regions in the directly combined image frame have a boundary effect, in order to obtain an image frame with better quality, the directly combined image frame may be subjected to filtering processing to eliminate the boundary effect, and optionally, the directly combined image frame may be subjected to filtering processing using a block filtering algorithm.

According to the video transmission method provided by the embodiment of the application, when the coding result of each region in the target image frame is received, if the coding result of each region does not lose data in the transmission process, the coding result of each region is decoded respectively, and a complete image frame is generated according to the coding result of each region. When the network condition is not good, because the rate corresponding to the high priority region in the target image frame is reduced by a small amount compared with the maximum rate corresponding to the high priority region, the high priority region can be ensured to have better video quality, and the rate corresponding to the low priority region is reduced by a large amount compared with the maximum rate corresponding to the low priority region, the target image frame can be ensured to be transmitted to the receiving end device faster, more smoothly and with low delay, so that the receiving end device can quickly receive the coding result of each region, and can generate an image frame with better quality according to the decoding result of each region (the region with higher user attention degree has better video quality).

It can be understood that if the network condition is not good, the video data packets in each area are likely to be lost in the transmission process, and in consideration of different priorities of each area, that is, different importance degrees of each area, the embodiment adopts different packet loss processing strategies for different areas with different priorities.

For the region with the highest priority, if any video data packet in the region is lost in the transmission process, recovering the lost video data packet by using an error correction data packet, and if the lost video data packet cannot be recovered by using the error correction data packet, sending a retransmission request data packet (such as RTCP NACK) to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted; if the retransmission is wrong and the number of continuous retransmission errors reaches a preset number (for example, 10), initiating a request for refreshing the video coding key frame to the sending end device so that the sending end device refreshes the video coding key frame, wherein the retransmission error means that the receiving end receives a video data packet retransmitted by the sending end as an error data packet.

For any area in other areas except the area with the highest priority, if any video data packet in the area is lost in the transmission process, sending a retransmission request data packet (such as RTCP NACK) to sending end equipment to enable the sending end equipment to retransmit the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted; and if the video data packet retransmitted by the sending terminal equipment is not received within the maximum packet loss waiting time corresponding to the area, using the decoding result of the area in the previous image frame as the decoding result of the area in the target image frame.

It should be noted that, in other areas except for the area with the highest priority, the maximum waiting time for packet loss corresponding to the high-priority area is longer than the maximum waiting time for packet loss corresponding to the low-priority area.

Assume that three regions in the target image frame are a first region, a second region, and a third region shown in fig. 2:

if the video data packet in the first region is lost in the transmission process, the lost video data packet is recovered by using the error correction data packet in the first region, if the lost video data packet cannot be recovered, a retransmission request data packet (such as RTCPCNACK) is sent to the sending end equipment so that the sending end equipment retransmits the lost video data packet, and if the sending end equipment retransmits the error data packet for 10 times continuously, a key frame refreshing request (such as RTCP PLI) is sent to the sending end equipment so that the sending end equipment refreshes the key frame.

If the video data packet in the second region is lost in the transmission process, sending a retransmission request data packet (such as RTCP NACK) to the sending end device, so that the sending end device retransmits the lost video data packet; and if the video data packet retransmitted by the sending terminal equipment is not received within 200ms, using the decoding result of the area in the previous image frame as the decoding result of the area in the target image frame. Referring to fig. 9(a) to 9(d), fig. 9(a) shows a case that a video data packet in each region is not lost during transmission, a receiving end device generates an image frame according to a decoding result of each region, fig. 9(b) shows a case that a video data packet in a second region is lost during transmission, the receiving end device initiates retransmission to the sending end device and the retransmission is successful, after the retransmission is successful, the receiving end device generates an image frame according to the decoding result of each region, fig. 9(c) shows a case that a video data packet in the second region is lost during transmission, the receiving end device initiates retransmission to the sending end device but the retransmission is failed, the retransmission failure refers to a case that the receiving end device does not receive the data packet retransmitted by the sending end device, and at this time, a decoding result of the second region in a previous image frame is used as a decoding result of the second region in a target image frame, to generate an image frame according to the decoding result of each region, fig. 9(d) shows a case where the video data packet of the second region is lost during transmission, and the receiving end device initiates retransmission to the sending end device, but the receiving end device does not receive the retransmitted data packet within 200ms (i.e., retransmission is overtime), and at this time, the decoding result of the second region in the previous image frame is also used as the decoding result of the second region in the target image frame, so as to generate an image frame according to the decoding result of each region. It should be noted that fig. 9c is a case shown in fig. 9d, that is, the retransmission failure is a case of the retransmission timeout, and the retransmission timeout includes two cases, one is that the retransmission data packet is not received all the time, and the other is that the retransmission data packet is received, but the time of receiving the retransmission data packet exceeds 200 ms.

If the video data packet in the third area is lost in the transmission process, sending a retransmission request data packet (such as RTCP NACK) to the sending end device, so that the sending end device retransmits the lost video data packet; and if the video data packet retransmitted by the sending terminal equipment is not received within 150ms, using the decoding result of the third area in the previous image frame as the decoding result of the third area in the target image frame. Referring to fig. 10(a) to 10(d), fig. 10(a) shows a case that a video data packet in each region is not lost during transmission, a receiving end device generates an image frame according to a decoding result of each region, fig. 10(b) shows a case that a video data packet in a third region is lost during transmission, the receiving end device initiates retransmission to the sending end device and the retransmission is successful, after the retransmission is successful, the receiving end device generates an image frame according to a decoding result of each region, fig. 10(c) shows a case that a video data packet in a third region is lost during transmission, the receiving end device initiates retransmission to the sending end device but the retransmission is failed, the retransmission failure refers to a case that the receiving end device does not receive the data packet retransmitted by the sending end device, and at this time, a decoding result of the third region in a previous image frame is used as a decoding result of the third region in a target image, in order to generate an image frame according to the decoding result of each region, fig. 10(d) shows a case where the video data packet of the third region is lost during transmission, the receiving end device initiates retransmission to the sending end device, but the receiving end device does not receive the retransmitted data packet within 150ms (i.e., retransmission is overtime), at this time, the decoding result of the third region in the previous image frame is also used as the decoding result of the third region in the target image frame, so as to generate an image frame according to the decoding result of each region. Likewise, retransmission failure is a case of retransmission timeout.

It should be noted that, since the priority of the second area is higher than that of the third area, the maximum packet loss waiting time of the second area is set to be longer than that of the third area. In addition, for the lost data packet in the second area, the receiving end device only needs to initiate a retransmission request once, and the same is true for the third area.

In addition, the second area and the second area both have the maximum waiting time for packet loss, so the sending end device and the receiving end device need to make time synchronization.

Corresponding to the video transmission method applied to the sending end device, an embodiment of the present application further provides a video transmission apparatus applied to the sending end device, please refer to fig. 11, which shows a schematic structural diagram of the apparatus, and may include: the image segmentation module 1101, the bandwidth acquisition module 1102, the code rate allocation module 1103, the encoding module 1104 and the sending module 1105.

The image segmentation module 1101 is configured to segment a target image frame to be transmitted in a target video into a plurality of regions.

The priority of each area is different, and the priority of each area is determined according to the attention degree of the user to each area.

A bandwidth obtaining module 1102, configured to obtain a currently predicted bandwidth as a target bandwidth;

a code rate allocating module 1103, configured to allocate, when the target bandwidth is smaller than the maximum bandwidth, a corresponding target code rate to each region according to the target bandwidth, the priority of each region, and the maximum code rate corresponding to each region.

The target code rate corresponding to the region with high priority is reduced by a smaller amount than the maximum code rate corresponding to the region with low priority, and the maximum code rate corresponding to one region is determined according to the area ratio and the maximum bandwidth of the region and the target image frame.

And the encoding module 1104 is configured to perform compression encoding on the corresponding regions according to the target code rates respectively corresponding to the regions.

A sending module 1105, configured to send the compression coding result of each region to the receiving end device.

The video transmission device provided by the embodiment of the application can ensure that the important area in the target image frame has better video quality and can also ensure that the target image frame can be transmitted to the receiving terminal equipment faster, more smoothly and with low delay when the network becomes poor.

In a possible implementation manner, the sending module 1105 in the foregoing embodiment includes: a data slicing submodule, an error correction data packet generating submodule and a sending submodule.

And the data slicing submodule is used for splitting the coding result of each region into a plurality of video data packets.

And the error correction data packet generation submodule is used for generating an error correction data packet containing error correction information according to the plurality of video data packets in the area with the highest priority.

And the sending submodule is used for sending the video data packets and the error correction data packets of the area with the highest priority to the receiving end equipment, and sending the video data packets of each area except the area with the highest priority to the receiving end equipment.

In one possible implementation, the data packets of the respective regions of the target image frame have uniform absolute time stamps.

In a possible implementation manner, the image segmentation module 1101 in the foregoing embodiment is specifically configured to segment a target image frame in a target video into three regions, where a first region is higher in priority than a second region, the second region is higher in priority than a third region, the first region is a central region of the target image frame, the second region is a region outside the central region, and the third region is a region outside the second region.

In a possible implementation manner, the code rate allocating module 1103 in the foregoing embodiment is specifically configured to determine a target code rate corresponding to the first region according to the target bandwidth and a maximum code rate corresponding to the first region; determining a target code rate corresponding to the third area according to the target bandwidth and the maximum code rate corresponding to the third area; and determining the target code rate corresponding to the second area according to the target bandwidth, the target code rate corresponding to the first area and the target coding code rate corresponding to the third area.

The reduction amplitude of the target code rate corresponding to the third region compared with the corresponding maximum code rate is smaller than that of the target code rate corresponding to the second region compared with the corresponding maximum code rate, and the reduction amplitude of the target code rate corresponding to the second region compared with the corresponding maximum code rate is smaller than that of the target code rate corresponding to the third region compared with the corresponding maximum code rate.

Corresponding to the video transmission method applied to the receiving end device, an embodiment of the present application further provides a video transmission apparatus applied to the receiving end device, please refer to fig. 12, which shows a schematic structural diagram of the apparatus, and the method may include: a receiving module 1201, a decoding module 1202 and an image frame generating module 1203.

A receiving module 1201, configured to receive encoding results of a plurality of regions in a target image frame.

The target image frame comprises a target image frame, wherein each region in the target image frame can form the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate corresponding to each region, the target code rate corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate corresponding to each region, the reduction amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the reduction amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth.

The decoding module 1202 is configured to, if the encoding result of each region does not lose data in the transmission process, decode the encoding result of each region respectively to obtain a decoding result of each region.

The image frame generating module 1203 is configured to generate a complete image frame according to the decoding results of the regions.

The receiving end device in the video transmission device provided by the embodiment of the application can quickly receive the coding result of each region, and can generate the image frame with better quality according to the decoding result of each region (the region with high user attention degree has better video quality).

In the above embodiment, the encoding result of the region with the highest priority includes a plurality of video data packets and error correction data packets, and the other regions each include only a plurality of video data packets.

In a possible implementation manner, the apparatus provided in the foregoing embodiment may further include: a first packet loss processing module.

The first packet loss processing module is used for recovering a lost video data packet by using an error correction data packet if any video data packet in an area with the highest priority is lost in the transmission process; if the lost video data packet cannot be recovered by using the error correction data packet, sending a retransmission request data packet to the sending end equipment so that the sending end equipment retransmits the lost video data packet, wherein the retransmission request data packet comprises information of the video data packet requested to be retransmitted; if the retransmission is wrong and the number of continuous retransmission errors reaches the preset number, initiating a request for refreshing the video coding key frame to the sending terminal equipment so that the sending terminal equipment refreshes the video coding key frame, wherein the retransmission error means that the receiving terminal receives a video data packet retransmitted by the sending terminal as an error data packet.

In a possible implementation manner, the apparatus provided in the foregoing embodiment may further include: and a second packet loss processing module.

A second packet loss processing module, configured to send, to any one of the other areas except the area with the highest priority, a retransmission request packet to the sending end device if any one of the video data packets in the area is lost in the transmission process, so that the sending end device retransmits the lost video data packet, where the retransmission request packet includes information of the video data packet requested to be retransmitted; and if the video data packet retransmitted by the sending terminal equipment is not received within the maximum packet loss waiting time corresponding to the area, using the decoding result of the area in the previous image frame as the decoding result of the area in the target image frame.

And the maximum waiting time of packet loss corresponding to the high-priority area is longer than that corresponding to the low-priority area.

An embodiment of the present application further provides a video transmission system, please refer to fig. 13, which shows a schematic structural diagram of the system, and the system may include: a transmitting side device 1301 and a receiving side device 1302.

The sending end device 1301 is configured to segment a target image frame to be transmitted in a target video into multiple regions, where priorities of the regions are different, and the priorities of the regions are determined according to attention degrees of users to the regions; acquiring a current predicted bandwidth as a target bandwidth; when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for each region according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth; and carrying out compression coding on the corresponding regions according to the code rates respectively corresponding to the regions, and sending the compression coding results of the regions to receiving end equipment.

A receiving end device 1302, configured to receive compression encoding results of each region in a target image frame; if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region; and generating a complete image frame according to the decoding result of each region.

The video transmission system provided by the embodiment of the application enables the target image frame to be transmitted to the receiving end device in a fast, smooth and low-delay mode, and enables the receiving end device to obtain the image frame with better quality.

An embodiment of the present application further provides a sending end device, please refer to fig. 14, which shows a schematic structural diagram of the sending end device, where the sending end device may include: at least one processor 1401, at least one communication interface 1402, at least one memory 1403, and at least one communication bus 1404;

in the embodiment of the present application, the number of the processor 1401, the communication interface 1402, the memory 1403 and the communication bus 1404 is at least one, and the processor 1401, the communication interface 1402 and the memory 1403 are communicated with each other through the communication bus 1404;

processor 1401 may be a central processing unit CPU, or an application specific Integrated circuit asic (application specific Integrated circuit), or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;

memory 1403 may include high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), etc., such as at least one disk memory;

wherein the memory stores a program and the processor can call the program stored in the memory, the program for:

segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

acquiring a current predicted bandwidth as a target bandwidth;

when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for each region according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment.

Alternatively, the detailed function and the extended function of the program may be as described above.

Embodiments of the present application further provide a readable storage medium, where a program suitable for being executed by a processor may be stored, where the program is configured to:

segmenting a target image frame to be transmitted in a target video into a plurality of regions, wherein the priority of each region is different, and the priority of each region is determined according to the attention degree of a user to each region;

acquiring a current predicted bandwidth as a target bandwidth;

when the target bandwidth is smaller than the maximum bandwidth, distributing corresponding target code rates for each region according to the target bandwidth, the priority of each region and the maximum code rate corresponding to each region, wherein the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

and carrying out compression coding on the corresponding regions according to the target code rates respectively corresponding to the regions, and sending the compression coding results of the regions to the receiving terminal equipment.

An embodiment of the present application further provides a receiving end device, please refer to fig. 15, which shows a schematic structural diagram of the receiving end device, where the receiving end device may include: at least one processor 1501, at least one communication interface 1502, at least one memory 1503, and at least one communication bus 1504;

in the embodiment of the present application, the number of the processor 1501, the communication interface 1502, the memory 1503 and the communication bus 1504 is at least one, and the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504;

the processor 1501 may be a central processing unit CPU, or an application specific Integrated circuit asic (application specific Integrated circuit), or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;

the memory 1503 may include a high-speed RAM memory, a non-volatile memory (non-volatile memory), and the like, such as at least one disk memory;

wherein the memory stores a program and the processor can call the program stored in the memory, the program for:

receiving encoding results of a plurality of regions in a target image frame, wherein each region in the target image frame can constitute the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region;

and generating a complete image frame according to the decoding results of the regions.

Alternatively, the detailed function and the extended function of the program may be as described above.

Embodiments of the present application further provide a readable storage medium, where a program suitable for being executed by a processor may be stored, where the program is configured to:

receiving encoding results of a plurality of regions in a target image frame, wherein each region in the target image frame can constitute the target image frame, the priority of each region in the target image frame is different, the coding result of each region is obtained by coding the corresponding region by sending end equipment according to the target code rate respectively corresponding to each region, the target code rate respectively corresponding to each region is determined according to the predicted network bandwidth, the priority of each region and the maximum code rate respectively corresponding to each region, the descending amplitude of the target code rate corresponding to the region with high priority compared with the corresponding maximum code rate is smaller than the descending amplitude of the target code rate corresponding to the region with low priority compared with the corresponding maximum code rate, and the maximum code rate corresponding to one region is determined according to the area ratio of the region to the target image frame and the maximum bandwidth;

if the coding result of each region does not lose data in the transmission process, decoding the coding result of each region respectively to obtain the decoding result of each region;

and generating a complete image frame according to the decoding results of the regions.

Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

28页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于VR与脑电生物反馈技术的脑认知能力AI训练系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类