Disclosure of Invention
The invention aims to provide a video coding method based on a remote desktop protocol, which can automatically select corresponding coding modes according to different network conditions and improve user watching experience.
In order to achieve the above purpose, the technical scheme provided by the invention is as follows:
in a first aspect, the present invention provides a video encoding method based on a remote desktop protocol, including:
the protocol server establishes a connection of a display channel with the client; the protocol server monitors the network condition in the display channel and the total data change amount of the video stream in the display channel, and dynamically selects a coding mode to code the video stream according to the network condition and the total data change amount.
In one or more embodiments, the protocol server monitors a network condition in the display channel and a total amount of data change of a video stream in the display channel, and dynamically selects a coding mode to code the video stream according to the network condition and the total amount of data change, including:
The protocol server periodically monitors the network condition in the display channel and the total data change amount of the video stream in the display channel, wherein each monitoring period is defined as Tn (n is more than or equal to 1), and the protocol server optionally codes the video stream in one of a lossless coding mode, a high-quality coding mode and a low-quality coding mode in the monitoring period T1; and dynamically selecting a video coding mode in a monitoring period Tm (m is more than or equal to 2) according to the network condition in the previous monitoring period and the total data change amount of the video stream in the display channel to code the video stream.
In one or more embodiments, when the monitoring result in the monitoring period Tn is that the network condition is good, the protocol server selects a lossless coding mode or a high-quality coding mode to code the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel; when the monitoring result in the monitoring period Tn is that the network condition is general, the protocol server selects a high-quality coding mode or a low-quality coding mode to code the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel; when the monitoring result in the monitoring period Tn is that the network condition is poor, the protocol server directly selects a low-quality coding mode to code the video stream in the next monitoring period Tn+1.
In one or more embodiments, the total amount of data change in the display channel is the sum of the lengths of the rectangular areas of each frame of data change in the display channel in a single monitoring period Tn.
In one or more embodiments, the rectangular area length of each frame data change in the monitoring period Tn is defined as s, which is expressed by the following formula:
s=(right-left)×(bottom-top)×d
Wherein left and top are point coordinates of the upper left corner of each frame of data; right and bottom are the point coordinates of the lower right corner, d is the color depth; the monitoring period Tn shows the total amount of data change Sn=s1+s2+s3+......+sp (p.gtoreq.1) within the channel.
In one or more embodiments, when the monitoring result in the monitoring period Tn is that the network condition is good, the protocol server selects a lossless coding mode or a high quality coding mode to code the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel, including:
If the monitoring result in the monitoring period Tn is that the network condition is good and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is greater than the first threshold value Q1, Then a high quality coding mode is selected in the next monitoring period Tn+1; If the monitoring result in the monitoring period Tn is that the network condition is good and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is smaller than the second threshold value Q2, then a lossless coding mode is selected in the next monitoring period Tn+1; If the monitoring result in the monitoring period Tn is that the network condition is good, the low quality coding mode or the high quality coding mode is adopted in the monitoring period Tn, and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is not less than the second threshold Q2, Then switching or maintaining the high quality coding mode for the next monitoring period Tn+1; Wherein Q1=P1×R,Q2=P2 ×r, r= (width×height)/resolution, and p×resolution×d > P1>P2 > resolution×d; p1 is a preset threshold value for switching from a lossless coding mode to a high-quality coding mode, P2 is a threshold value for switching from a high-quality coding mode to a lossless coding mode, R is a threshold value factor, the resolution is the resolution of a video stream in a display channel, and width and height are the highest resolution which can be supported by a display screen.
In one or more embodiments, when the monitoring result in the monitoring period Tn is that the network condition is general, the protocol service end selects a low quality coding mode or a high quality coding mode to code the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel, including:
If the monitoring result in the monitoring period Tn is that the network condition is general and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is greater than the third threshold value Q3, then a low quality coding mode is selected in the next monitoring period Tn+1; If the monitoring result in the monitoring period Tn is that the network condition is general and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is smaller than the fourth threshold value Q4, Then a high quality coding mode is selected in the next monitoring period Tn+1; If the monitoring result in the monitoring period Tn is that the network condition is general, the lossless coding mode or the high quality coding mode is adopted in the monitoring period Tn, and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is not less than the fourth threshold Q4, Switching to a low quality coding mode in the next monitoring period Tn+1; Wherein Q3=P3×R,Q4=P4 ×r, r= (width×height)/resolution, p×resolution×d > P3>P4 > resolution×d; p3 is a preset threshold for switching from a high quality coding mode to a low quality coding mode, P4 is a threshold for switching from a low quality coding mode to a high quality coding mode, the resolution is the resolution of the video stream in the display channel, R is a threshold factor, and width and height are the highest resolution that can be supported by the display screen.
In one or more embodiments, the evaluation indicators of the network condition include a network packet loss rate, a round trip delay, and a network jitter.
In one or more embodiments, an upper limit and a lower limit of a network packet loss rate, a round trip delay and a network jitter are preset; when the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn are not higher than the lower limit, judging that the network condition is good; when the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn are not lower than the upper limit, judging that the network condition is poor; and when any judgment index of the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn is between the lower limit and the upper limit, judging the network condition as normal.
In a second aspect, the present invention provides a video encoding device based on a remote desktop protocol, comprising: the device comprises a communication module, a monitoring module, a selection module and a coding module; the communication module is used for establishing connection of a display channel between the protocol server and the client; the monitoring module is used for monitoring the network condition in the display channel and the total data change amount of the video stream in the display channel by the protocol server; the selection module is used for dynamically selecting a coding mode by the protocol server according to the network condition and the total data change amount of the video stream in the display channel; the coding module is used for coding the video stream according to the coding mode selected by the selecting module.
In a third aspect, the present invention provides an electronic device comprising: at least one processor and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform a remote desktop protocol based video encoding method as described above.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a remote desktop protocol based video encoding method as described above.
Compared with the prior art, the video coding method based on the remote desktop protocol can dynamically select the coding mode of the video stream according to the current network condition and the total data change amount in the display channel, and automatically select the low-quality coding mode of the high-compression image when the network condition is poor so as to reduce the occupation of network resources as much as possible; when the network condition is general, the low-quality coding mode and the high-quality coding mode can be dynamically switched according to the total data change amount in the display channel so as to ensure smooth watching experience of a user; when the network condition is good, the lossless coding mode and the high-quality coding mode can be dynamically switched according to the total data change amount in the display channel, so that a user can obtain higher image quality viewing experience under the condition that the network is not limited.
Detailed Description
The following detailed description of embodiments of the invention is, therefore, to be taken in conjunction with the accompanying drawings, and it is to be understood that the scope of the invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the term "comprise" or variations thereof such as "comprises" or "comprising", etc. will be understood to include the stated element or component without excluding other elements or components.
A flow chart of an embodiment of a video coding method based on a remote desktop protocol of the present invention is shown in FIG. 1, and the method comprises the following steps:
s101: and the protocol server establishes connection of the display channel with the client.
Before video encoding based on the remote desktop protocol, a remote desktop protocol environment needs to be deployed and prepared to establish connection between a protocol server and a client display channel. The display channel is one of a plurality of channels after the remote desktop protocol is connected and is mainly responsible for processing graphic commands and transmitting image and video data. The remote desktop protocol processes different events by establishing different channels, and when the protocol server and the protocol client are connected, the display channels are successfully established, so that details are not repeated here.
The remote desktop protocol may be selected from existing remote desktop protocols according to actual needs, and is not particularly limited herein.
S102: the protocol server monitors the network condition in the display channel and the total data change amount of the video stream in the display channel, and dynamically selects a coding mode to code the video stream according to the network condition and the total data change amount in the display channel.
Step S102 specifically includes the protocol server periodically monitoring the network condition in the display channel and the total amount of data change of the video stream in the display channel. Each monitoring period is defined as Tn (n is more than or equal to 1), and in the monitoring period T1, the protocol service end optionally encodes the video stream in one of a lossless encoding mode, a high-quality encoding mode and a low-quality encoding mode. Wherein, the high quality coding mode and the low quality coding mode are both lossy coding, and the high quality coding has higher image quality than the low quality coding.
The video coding mode in the monitoring period Tm (m is more than or equal to 2) dynamically selects the coding mode to code the video stream according to the network condition in the previous monitoring period and the total data change amount of the video stream in the display channel.
In an exemplary embodiment, the evaluation indicators of the network condition mainly include the network packet loss rate, the round trip delay and the network jitter, so the protocol server needs to monitor the evaluation indicators of the network condition. And the current network condition can be rated according to the evaluation index of the network condition monitored by the protocol server. In practical application, other indexes for judging the network state can be added, and specific index setting can be selected in actual need.
Specifically, the network condition can be divided into three levels of good, general and bad according to the network packet loss rate, round trip delay and network jitter monitored by the protocol server, and corresponding different coding modes are formulated according to the network conditions of different levels.
Specifically, an upper limit and a lower limit of a network packet loss rate, a round trip delay and a network jitter can be preset; when the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn are not higher than the lower limit, judging that the network condition is good; when the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn are not lower than the upper limit, judging that the network condition is poor; and when any judgment index of the network packet loss rate, the round trip delay and the network jitter which are monitored in the monitoring period Tn is between the lower limit and the upper limit, judging the network condition as normal.
For example, when the network bandwidth is 50-100 gbps/s, the upper limit and the lower limit of the network packet loss rate can be set to 0.1% and 0.01%, the upper limit and the lower limit of the round trip delay are set to 100ms and 30ms, respectively, and the upper limit and the lower limit of the network jitter are set to 40ms and 10ms, respectively. Different upper and lower limits may be preset based on different network bandwidths.
When the network packet loss rate monitored by the protocol server is less than or equal to 0.01%, the round trip delay is less than or equal to 30ms, and the network jitter is less than or equal to 10ms, the network condition is judged to be good. When the network packet loss rate monitored by the protocol server is greater than or equal to 0.1%, the round trip delay is greater than or equal to 100ms, and the network jitter is greater than or equal to 40ms, the network condition is judged to be poor. When the network packet loss rate monitored by the protocol server is between 0.01 and 0.1 percent, and/or the round trip delay is between 30 and 100ms, and/or the network jitter is between 10 and 40ms, the network condition is judged to be bad.
In the invention, the threshold value of the evaluation index of the network condition can be preset according to different actual use environments (such as the size of the whole bandwidth), and the threshold value of the evaluation index of the network condition can be changed according to the change of the actual use environments. Therefore, it can be understood that the thresholds used to evaluate the criteria of different levels of network conditions can be changed according to actual usage.
In other embodiments, the network conditions may be ranked more or less, and may be selected according to actual needs. For example, where selection of more network condition based coding modes is involved, network conditions may be classified into more levels. The threshold value of each index for dividing the network condition level may be adjusted according to the actual situation, and is not particularly limited here. In this embodiment, the total amount of data change in the display channel refers to the sum of the rectangular area lengths of each frame of data change in the display channel in a single monitoring period Tn.
Assuming that p frames of data are shared in the display channel in the monitoring period Tn (the period duration can be set according to the actual requirement, for example, can be any value in 1-3 s), the area length of the rectangular area of each frame of data is defined as s, and s can be expressed by the following formula:
s=(right-left)×(bottom-top)×d
Wherein left and top are point coordinates of the upper left corner; right and bottom are the point coordinates in the lower right corner; d is the color depth.
Then the first frame data change rectangle area length in the display channel is s1, the second frame data change rectangle area length is s2, the third frame data change rectangle area length is s3. Then, the total amount of data change Sn=s1+s2+s3+......+sp of the p-frame data in the channel is displayed in the monitoring period Tn.
In an exemplary embodiment, when the monitoring result in the monitoring period Tn is that the network condition is good, the protocol server selects a lossless coding mode or a high-quality coding mode to code the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel. In the case of good network conditions, two coding modes, namely a lossless coding mode and a high quality coding mode, are available for selection so that the user can obtain a high quality video experience.
Specifically, if the network condition is good as a result of the monitoring in the monitoring period Tn, and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is greater than the first threshold Q1, a high quality encoding mode is selected in the next monitoring period Tn+1.
If the monitoring result in the monitoring period Tn is that the network condition is good and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is smaller than the second threshold value Q2, a lossless coding mode is selected in the next monitoring period Tn+1.
If the monitoring result in the monitoring period Tn is that the network condition is good, the low quality coding mode or the high quality coding mode is adopted in the monitoring period Tn, and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is not less than the second threshold Q2, the high quality coding mode is switched or maintained in the next monitoring period Tn+1.
Wherein Q1=P1×R,Q2=P2 ×r, r= (width×height)/resolution, and p×resolution×d > P1>P2 > resolution×d; p1 is a preset threshold value for switching from a lossless coding mode to a high-quality coding mode, P2 is a threshold value for switching from a high-quality coding mode to a lossless coding mode, R is a threshold value factor, the resolution is the resolution of a video stream in a display channel, and width and height are the highest resolution which can be supported by a display screen. The first threshold Q1 and the second threshold Q2 may be set according to actual situations, and are set in combination with actual network quality factors such as monitoring time, resolution, and network downlink bandwidth. For example, the longer the monitoring period duration corresponding to the total amount of data change in the display channel is set, the larger the corresponding frame number is, and the first threshold Q1 and the second threshold Q2 need to be correspondingly turned up; conversely, the first threshold Q1 and the second threshold Q2 need to be correspondingly turned down. For another example, the greater the resolution, the higher the first threshold Q1 and the second threshold Q2 need to be correspondingly adjusted; conversely, the first threshold Q1 and the second threshold Q2 need to be correspondingly turned down. If the network condition is better, the first threshold Q1 and the second threshold Q2 need to be correspondingly increased; Conversely, the first threshold Q1 and the second threshold Q2 need to be correspondingly turned down.
In an exemplary embodiment, when the monitoring result in the monitoring period Tn is that the network condition is general, the protocol server selects the high-quality encoding mode or the low-quality encoding mode to encode the video stream in the next monitoring period Tn+1 according to the total data change amount of the video stream in the display channel. In the general case of network conditions, two coding modes, a high quality coding mode and a low quality coding mode, are available for selection.
Specifically, if the monitoring result in the monitoring period Tn is that the network condition is general and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is greater than the third threshold Q3, a low quality encoding mode is selected in the next monitoring period Tn+1.
If the monitoring result in the monitoring period Tn is that the network condition is general and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is smaller than the fourth threshold Q4, a high quality encoding mode is selected in the next monitoring period Tn+1.
If the monitoring result in the monitoring period Tn is that the network condition is general, the lossless coding mode or the high quality coding mode is adopted in the monitoring period Tn, and the total data change amount Sn of the video stream in the display channel in the monitoring period Tn is not less than the fourth threshold Q4, the next monitoring period Tn+1 is switched to the low quality coding mode.
Wherein Q3=P3×R,Q4=P4 ×r, r= (width×height)/resolution, p×resolution×d > P3>P4 > resolution×d; p3 is a preset threshold for switching from a high quality coding mode to a low quality coding mode, P4 is a threshold for switching from a low quality coding mode to a high quality coding mode, the resolution is the resolution of the video stream in the display channel, R is a threshold factor, and width and height are the highest resolution that can be supported by the display screen.
The third threshold Q3 and the fourth threshold Q3 may be set according to actual situations, and are set in combination with actual network quality factors such as monitoring time, resolution, and network downlink bandwidth. For example, the longer the time T corresponding to the total amount of data change in the display channel is set, the larger the corresponding frame number is, and the third threshold Q3 and the fourth threshold Q4 need to be correspondingly turned up; conversely, the third threshold Q3 and the fourth threshold Q4 need to be correspondingly turned down. For another example, the greater the resolution, the higher the third threshold Q3 and the fourth threshold Q4 are required to be correspondingly turned up; conversely, the third threshold Q3 and the fourth threshold Q4 need to be correspondingly turned down. If the network condition is better, the third threshold Q3 and the fourth threshold Q4 need to be correspondingly increased; conversely, the third threshold Q3 and the fourth threshold Q4 need to be correspondingly turned down.
In an exemplary embodiment, when the monitoring result in the monitoring period Tn is that the network condition is poor, the protocol server directly selects the low quality coding mode to code the video stream in the next monitoring period Tn+1. In the case of poor network conditions, to ensure that the user has a smooth viewing experience, a low quality encoding mode may be selected to encode the video stream to accommodate the poor network conditions.
Specifically, the coding modes may be coding modes based on coding standards such as H.263, H.263+, H.263++, H.264/AVC, H.265/HEVC, H.266/VVC, MPEG4, etc.
Among them, MPEG (Moving Picture Experts Group, moving picture expert group) is a working group established by ISO (International Organization for Standardization ) and specially responsible for formulating a compression coding standard for moving pictures, and the MPEG standard formulated is an international general standard composed of three parts of video, audio and system. MPEG4 is one of the compression standards of network video images, and is characterized by high compression ratio and clear imaging. The MPEG4 video compression algorithm can provide extremely high compression ratios, up to 200:1, and more importantly, MPEG4 provides high compression ratios with little loss of data.
H.263 is a standard draft of ITU (International Telecommunication Union, international union) designed for low-code stream communications. But in practice this standard can be used over a wide range of code streams, not just for low code streams, and has a higher performance and error correction capability. Motion compensation of h.263 uses half-pel precision, some parts of the data stream hierarchy are optional in h.263 so that the codec can be configured for lower data rates or better error correction capability, h.263 contains four negotiable options to improve performance, h.263 employs unrestricted motion vectors and syntax-based arithmetic coding, and h.263 supports 5 resolutions.
The video encoding method based on the remote desktop protocol of the present invention is further described below with reference to a specific embodiment scenario.
Example 1
The deployment prepares a remote desktop protocol environment, and sets a first threshold value Q1, a second threshold value Q2, a third threshold value Q3 and a fourth threshold value Q4 according to the network environment, the resolution and other factors. Wherein the first threshold Q1 is greater than the second threshold Q2, and the third threshold Q3 is greater than the fourth threshold Q4. The upper limit and the lower limit of the network packet loss rate are set to 0.1% and 0.01% respectively, the upper limit and the lower limit of the round trip delay are set to 100ms and 30ms respectively, and the upper limit and the lower limit of the network jitter are set to 40ms and 10ms respectively.
Starting the virtual machine, and establishing connection (including connection of display channels) between the protocol server and the client. The protocol server periodically monitors the network condition in the display channel and the total data change amount of the video stream in the display channel.
The network condition is determined to be good, assuming that the monitored network packet loss rate is 0.01% or less, the round trip delay is 30ms or less, and the network jitter is 10ms or less in the monitoring period Tn.
The protocol server monitors the total amount of data change in the display channel as Sn in the monitoring period Tn. The total amount of data change Sn in the display channel is compared with a first threshold Q1 and a second threshold Q2. There are several cases:
If the total data change amount Sn of the video stream in the display channel is greater than the first threshold Q1, that is, the total data change amount Sn in the monitoring period Tn is greater, that is, the video stream transmission in the monitoring period Tn is unstable, and the lossless coding mode is not satisfied, then the high quality coding mode needs to be selected in the next monitoring period Tn+1.
If the total data change amount Sn of the video stream in the display channel is smaller than the second threshold Q2, that is, the total data change amount Sn in the monitoring period Tn is smaller, that means that the video stream transmission in the monitoring period Tn is more stable, and the lossless coding mode is satisfied, the lossless coding mode can be selected in the next monitoring period Tn+1.
If the total amount of data change Sn of the video stream in the display channel is not less than the second threshold Q2 and the coding mode in the monitoring period Tn is the low quality coding mode or the high quality coding mode, the high quality coding mode is switched or maintained in the next monitoring period Tn+1.
In the present embodiment, the description is mainly directed to dynamic selection of a video encoding mode in a case where a network condition is good.
Example 2
The deployment prepares a remote desktop protocol environment, and sets a first threshold value Q1, a second threshold value Q2, a third threshold value Q3 and a fourth threshold value Q4 according to the network environment, the resolution and other factors. Wherein the first threshold Q1 is greater than the second threshold Q2, and the third threshold Q3 is greater than the fourth threshold Q4. The upper limit and the lower limit of the network packet loss rate are set to 0.1% and 0.01% respectively, the upper limit and the lower limit of the round trip delay are set to 100ms and 30ms respectively, and the upper limit and the lower limit of the network jitter are set to 40ms and 10ms respectively.
Starting the virtual machine, and establishing connection (including connection of display channels) between the protocol server and the client. The protocol server periodically monitors the network condition in the display channel and the total data change amount of the video stream in the display channel.
Assuming that the monitored network packet loss rate is between 0.01 and 0.1%, the round trip delay is between 30 and 100ms, and the network jitter is between 10 and 40ms in the monitoring period Tn, the network condition is judged to be normal.
The protocol server monitors the total amount of data change in the display channel as Sn in the monitoring period Tn. The total amount of data change Sn in the display channel is compared with the third threshold Q3 and the fourth threshold Q4. There are several cases:
If the total data change amount Sn of the video stream in the display channel is greater than the third threshold Q3, that is, the total data change amount Sn in the monitoring period Tn is greater, that is, the video stream transmission in the monitoring period Tn is unstable, and the high quality coding mode is not satisfied, then the low quality coding mode is selected in the next monitoring period Tn+1.
If the total data change amount Sn of the video stream in the display channel is smaller than the fourth threshold Q4, that is, the total data change amount Sn in the monitoring period Tn is smaller, that means that the video stream transmission in the monitoring period Tn is more stable, and the high coding mode is satisfied, the high coding mode can be selected in the next monitoring period Tn+1.
If the total amount of data change Sn of the video stream in the display channel is not less than the second threshold Q2 and the coding mode in the monitoring period Tn is the low quality coding mode or the high quality coding mode, the high quality coding mode is switched or maintained in the next monitoring period Tn+1.
In the present embodiment, the description is mainly directed to dynamic selection of a video coding mode in a case where a network condition is general.
Example 3
The deployment prepares a remote desktop protocol environment, and sets a first threshold value Q1, a second threshold value Q2, a third threshold value Q3 and a fourth threshold value Q4 according to the network environment, the resolution and other factors. Wherein the first threshold Q1 is greater than the second threshold Q2, and the third threshold Q3 is greater than the fourth threshold Q4. The upper limit and the lower limit of the network packet loss rate are set to 0.1% and 0.01% respectively, the upper limit and the lower limit of the round trip delay are set to 100ms and 30ms respectively, and the upper limit and the lower limit of the network jitter are set to 40ms and 10ms respectively.
Starting the virtual machine, and establishing connection (including connection of display channels) between the protocol server and the client. The protocol server periodically monitors the network condition in the display channel and the total data change amount of the video stream in the display channel.
Assuming that the monitored network packet loss rate is greater than 0.1% and the round trip delay is greater than 100ms and the network jitter is greater than 40ms during the monitoring period Tn, the network condition is determined to be poor. At this time, the network is stuck, and the protocol server directly selects a low quality encoding mode to encode the video stream in the next monitoring period Tn+1. By adopting the low-quality coding mode, the smooth watching experience of the user can be ensured under the condition of poor network conditions.
Based on the same inventive concept, a structural frame of a video encoding apparatus 2 based on a remote desktop protocol according to an embodiment of the present invention is shown in fig. 2, and the video encoding apparatus based on the remote desktop protocol includes: a communication module 21, a monitoring module 22, a selection module 23 and an encoding module 24.
The communication module 21 is configured to establish a connection between the protocol server and the client. The monitoring module 22 is used for monitoring the network condition in the display channel and the total data change amount of the video stream in the display channel by the protocol server. The selection module 23 is used for dynamically selecting the coding mode by the protocol server according to the network condition and the total data change amount of the video stream in the display channel. The encoding module 24 is configured to encode the video stream according to the encoding mode selected by the selecting module.
The communication module 21 may implement a communication connection between the protocol server and the client, and the communication module 21 may be a wireless communication module or a wired communication module.
As shown in fig. 3, an embodiment of the present invention also provides a computing device 3, the computing device 3 including at least one processor 31, a memory 32 (e.g., a non-volatile memory), a memory 33, and a communication interface 34, and the at least one processor 31, the memory 32, the memory 33, and the communication interface 34 being connected together via a bus 35. The at least one processor 31 is configured to invoke the at least one program instruction stored or encoded in the memory 32 to cause the at least one processor 31 to perform the various operations and functions of the remote desktop protocol based video encoding method described in various embodiments of the present specification.
In embodiments of the present description, computing device 3 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal Digital Assistants (PDAs), handsets, messaging devices, wearable computing devices, consumer electronic devices, and the like.
An embodiment of the present invention further provides a computer readable storage medium, where computer program instructions are stored on the computer readable storage medium, where the computer program instructions are configured to cause a computer to perform the video encoding method based on the remote desktop protocol.
The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including, but not limited to, magnetic storage (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), and semiconductor storage (e.g., ROM, EPROM, EEPROM, non-volatile storage (NAND FLASH), solid State Disk (SSD), etc.).
In summary, the video coding method based on the remote desktop protocol provided by the invention can dynamically select the coding mode of the video stream according to the current network condition and the total data change amount in the display channel, and automatically select the low-quality coding mode of the high-compression image when the network condition is poor so as to reduce the occupation of network resources as much as possible; when the network condition is general, the low-quality coding mode and the high-quality coding mode can be dynamically switched according to the total data change amount in the display channel so as to ensure smooth watching experience of a user; when the network condition is good, the lossless coding mode and the high-quality coding mode can be dynamically switched according to the total data change amount in the display channel, so that a user can obtain higher image quality viewing experience under the condition that the network is not limited.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing descriptions of specific exemplary embodiments of the present invention are presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application to thereby enable one skilled in the art to make and utilize the invention in various exemplary embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.