CN110769271B - Method and device for adjusting code rate of multi-path code stream - Google Patents

Method and device for adjusting code rate of multi-path code stream Download PDF

Info

Publication number
CN110769271B
CN110769271B CN201911096746.6A CN201911096746A CN110769271B CN 110769271 B CN110769271 B CN 110769271B CN 201911096746 A CN201911096746 A CN 201911096746A CN 110769271 B CN110769271 B CN 110769271B
Authority
CN
China
Prior art keywords
code
path
code rate
stream
rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911096746.6A
Other languages
Chinese (zh)
Other versions
CN110769271A (en
Inventor
梁衍鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911096746.6A priority Critical patent/CN110769271B/en
Publication of CN110769271A publication Critical patent/CN110769271A/en
Application granted granted Critical
Publication of CN110769271B publication Critical patent/CN110769271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2405Monitoring of the internal components or processes of the server, e.g. server load
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities

Abstract

The application discloses a method and a device for adjusting code rates of multiple paths of code streams, and belongs to the technical field of communication. The method comprises the following steps: when the total code rate of the multi-path code stream is detected to be not matched with the network environment, determining a target total code rate matched with the network environment; determining the target code rate of each path of code stream based on the set weight of each path of code stream and the target total code rate; and adjusting the code rate of each path of code stream to the corresponding target code rate. By adopting the method provided by the application, the technical problems that in the related technology, the video watched by the user on the playing terminal is not smooth and the watching experience of the user is influenced can be effectively solved.

Description

Method and device for adjusting code rate of multi-path code stream
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for adjusting code rates of multiple code streams.
Background
Nowadays, when watching some live programs (such as sports events), the spectators can select multiple angles to watch on the playing terminal, thereby improving the watching experience of the users.
In order to realize that a user can select multiple angles for watching, the shooting terminal can comprise multiple cameras when shooting, and the multiple cameras shoot videos at different angles. And then, the shooting terminal encodes the shot videos according to a set code rate to obtain a plurality of paths of code streams, and then the paths of code streams are sent to the stream server. And finally, the stream server can send the corresponding code stream to the playing terminal according to the selection of the user at the playing terminal.
In the course of implementing the present application, the inventors found that the related art has at least the following problems:
when the network environment where the shooting terminal is located is poor, jamming can occur in the process of sending the multi-path code stream to the stream server, and the jamming can occur when the stream server sends the code stream to the playing terminal. Finally, the video watched by the user on the playing terminal is not smooth, and the watching experience of the user is influenced.
Disclosure of Invention
The embodiment of the application provides a method and a device for adjusting code rates of multiple paths of code streams, which can solve the technical problems in the related art. The technical scheme of the method and the device for adjusting the code rate of the multi-path code stream is as follows:
in a first aspect, a method for adjusting a code rate of a multi-path code stream is provided, where the method includes:
when the total code rate of the multi-path code stream is detected to be not matched with the network environment, determining a target total code rate matched with the network environment;
determining the target code rate of each path of code stream based on the set weight of each path of code stream and the target total code rate;
and adjusting the code rate of each path of code stream to the corresponding target code rate.
In a possible implementation manner, the determining, when it is detected that the total code rate of the multi-path code stream does not match the network environment, a target total code rate matching the network environment includes:
when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams of all paths are sequentially reduced;
for any path of code stream, if the code rate of the code stream is reduced and no jamming occurs in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, continuously reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced;
if the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
In a possible implementation manner, the sequentially reducing the code rate of each path of code stream includes:
and sequentially reducing the code rate of each path of code stream according to the set order of the important priority of each path of code stream from low to high.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the reducing the code rate of each path of code stream includes:
and adjusting the code rate of each path of code stream to the next low-level code rate.
In a possible implementation manner, the determining, when it is detected that the total code rate of the multi-path code stream does not match the network environment, a target total code rate matching the network environment includes:
when jamming does not occur in the process of sending the multi-path code streams within a second set time length and the code streams which do not reach the highest code rate exist in the current multi-path code streams, sequentially increasing the code rates of the code streams which do not reach the highest code rate;
for any one path of code stream which does not reach the highest code rate, if jamming occurs in the process of sending the multi-path code stream within a third set time length after the code rate of the code stream is increased, determining the total code rate of the multi-path code stream before the code rate of the code stream is increased as a target total code rate; if jamming does not occur in the process of sending the multi-path code streams within a third set time length after the code rates of the code streams are increased, and the code streams which do not reach the highest code rate still exist in the current multi-path code streams, increasing the code rate of the next path of code streams which do not reach the highest code rate until the code rates of all the code streams which do not reach the highest code rate are increased too much;
if the code rates of all the code streams which do not reach the highest code rate are increased, in a third set time length, jamming still does not exist in the process of sending the multi-path code streams, and when the code streams which do not reach the highest code rate still exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate are increased again.
In a possible implementation manner, the sequentially increasing the code rates of the code streams that do not reach the highest code rate includes:
and sequentially increasing the code rate of the code stream which does not reach the highest code rate according to the set order of the important priority of each path of code stream from high to low.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the raising of the code rate of the code stream which does not reach the highest code rate includes:
and adjusting the code rate of the code stream which does not reach the highest code rate to a code rate of a higher level.
In a possible implementation manner, the multi-path code stream is two paths of code streams, code rates of the two paths of code streams are both smaller than a corresponding highest code rate, and the code stream which does not reach the highest code rate is adjusted to a higher level code rate, including:
adjusting the code rate of the code stream with higher important priority to be the code rate of the minimum integer level which is more than or equal to (M + N)/2, wherein M represents the level of the current code rate of the code stream with higher important priority, and N represents the level of the highest code rate of the code stream with higher important priority;
and adjusting the code rate of the code stream with lower important priority to the code rate of the previous high level.
In a second aspect, an apparatus for adjusting a code rate of a multi-path code stream is provided, where the apparatus includes:
the matching module is used for determining a target total code rate matched with the network environment when the total code rate of the multi-path code stream is not matched with the network environment;
the determining module is used for determining the target code rate of each path of code stream based on the set weight of each path of code stream and the target total code rate;
and the adjusting module is used for adjusting the code rate of each path of code stream to the corresponding target code rate.
In one possible implementation manner, the matching module is configured to:
when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams of all paths are sequentially reduced;
for any path of code stream, if the code rate of the code stream is reduced and no jamming occurs in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, continuously reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced;
if the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
In one possible implementation manner, the matching module is configured to:
and sequentially reducing the code rate of each path of code stream according to the set order of the important priority of each path of code stream from low to high.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the matching module is configured to:
and adjusting the code rate of each path of code stream to the next low-level code rate.
In one possible implementation manner, the matching module is configured to:
when jamming does not occur in the process of sending the multi-path code streams within a second set time length and the code streams which do not reach the highest code rate exist in the current multi-path code streams, sequentially increasing the code rates of the code streams which do not reach the highest code rate;
for any one path of code stream which does not reach the highest code rate, if jamming occurs in the process of sending the multi-path code stream within a third set time length after the code rate of the code stream is increased, determining the total code rate of the multi-path code stream before the code rate of the code stream is increased as a target total code rate; if jamming does not occur in the process of sending the multi-path code streams within a third set time length after the code rates of the code streams are increased, and the code streams which do not reach the highest code rate still exist in the current multi-path code streams, increasing the code rate of the next path of code streams which do not reach the highest code rate until the code rates of all the code streams which do not reach the highest code rate are increased too much;
if the code rates of all the code streams which do not reach the highest code rate are increased, in a third set time length, jamming still does not exist in the process of sending the multi-path code streams, and when the code streams which do not reach the highest code rate still exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate are increased again.
In one possible implementation manner, the matching module is configured to:
and sequentially increasing the code rate of the code stream which does not reach the highest code rate according to the set order of the important priority of each path of code stream from high to low.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the matching module is configured to:
and adjusting the code rate of the code stream which does not reach the highest code rate to a code rate of a higher level.
In one possible implementation manner, the multi-path code stream is two paths of code streams, code rates of the two paths of code streams are both smaller than a corresponding highest code rate, and the matching module is configured to:
adjusting the code rate of the code stream with higher important priority to be the code rate of the minimum integer level which is more than or equal to (M + N)/2, wherein M represents the level of the current code rate of the code stream with higher important priority, and N represents the level of the highest code rate of the code stream with higher important priority;
and adjusting the code rate of the code stream with lower important priority to the code rate of the previous high level.
In a third aspect, a terminal is provided, where the terminal includes a memory and a processor, where the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for adjusting the code rate of multiple code streams according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the method for adjusting the code rate of multiple code streams according to the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the embodiment of the application provides a method for adjusting code rates of multiple paths of code streams, which can be used for adjusting the code rates of the multiple paths of code streams when the multiple paths of code streams are sent and stuck. When the total code rate of the multi-path code stream is detected to be not matched with the network environment, for example, when jamming occurs in the process of sending the multi-path code stream, the total code rate matched with the network environment is determined. And then, determining the target code rate of each path of code stream based on the set weight and the target total code rate of each path of code stream. And finally, adjusting the code rate of each path of code stream to the corresponding target code rate. According to the method provided by the embodiment of the application, when the multi-path code stream is jammed in the process of sending the multi-path code stream, the code rate of the multi-path code stream can be reduced according to the current network environment, so that the jamming is eliminated, the video watched by a user on the playing terminal is smooth, and the watching experience of the user is improved. And, by setting the weight of each path of code stream, the code rate of the code stream with higher importance can be preferentially ensured to be higher.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for adjusting code rates of multiple code streams according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus for adjusting code rates of multiple code streams according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 4 is an implementation environment diagram of a method for adjusting code rates of multiple code streams according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The embodiment of the application provides a method for adjusting code rates of multiple paths of code streams, which can be realized by a terminal. The terminal can be a mobile terminal such as a mobile phone, a tablet computer and a notebook computer, and can also be a fixed terminal such as a desktop computer.
The method for adjusting the code rate of the multi-path code stream provided by the embodiment of the application can be applied to the process that the terminal sends the multi-path code stream to the stream server. As shown in fig. 4, an implementation environment diagram of a method for adjusting code rates of multiple code streams provided in an embodiment of the present application includes a shooting terminal, a stream server, and a playing terminal. The shooting terminal can comprise different cameras, the different cameras can shoot different original videos, then the shooting terminal carries out coding to obtain a plurality of paths of code streams, and the code streams are sent to the stream server. When the network environment is detected to be not matched with the total code rate of the multi-path code stream, the code rate of the multi-path code stream can be adjusted by using the method for adjusting the code rate of the multi-path code stream provided by the embodiment of the application, so that the total code rate of the current multi-path code stream is matched with the network environment. The stream server can send corresponding code streams to different playing terminals according to the selection of the user at the playing terminal, so that the video watched by the user on the playing terminal is smooth and high in definition, and the watching experience of the user is improved.
As shown in fig. 1, the processing flow of the method for adjusting the code rate of multiple code streams may include the following steps:
in step 101, when it is detected that the total code rate of the multi-path code stream does not match the network environment, a target total code rate matching the network environment is determined.
The total code rate of the multi-path code stream is not matched with the network environment, the current network environment is not enough to support the multi-path code stream to be transmitted at the current total code rate, or the current network environment can support the multi-path code stream to be transmitted at a higher total code rate.
The target total code rate matched with the network environment means that the target total code rate can support the transmission of a plurality of paths of code streams in the network environment, but the target total code rate cannot support the transmission of a plurality of paths of code streams in a higher total code rate; or the target total code rate is the sum of the highest code rates of the multi-path code streams.
In implementation, when the network environment is not enough to support continuous transmission of multiple code streams at the current overall code rate, if the multiple code streams continue to be transmitted at the current overall code rate, the video watched by the user on the playing terminal is not smooth. When the network environment can support the multi-path code stream to be sent at a higher total code rate and the code stream with the code rate lower than the corresponding highest code rate exists in the multi-path code stream, if the multi-path code stream is continuously sent according to the current total code rate, the definition of the video watched by the user on the playing terminal is poor. Both of the above two situations will cause the viewing experience of the user to be poor, and therefore, the code rates of the multiple code streams need to be adjusted.
When the network environment is not enough to support the continuous transmission of the multi-path code stream at the current total code rate, the determined target total code rate is lower than the current total code rate of the multi-path code stream; when the network environment can support the multi-path code stream to be sent at a higher total code rate and the code stream with the code rate lower than the corresponding highest code rate exists in the multi-path code stream, the determined target total code rate is higher than the current total code rate of the multi-path code stream.
In the following, the total code rate of the multi-path code stream is not matched with the network environment, and is divided into two cases for more detailed discussion. The first one is that the current network environment is not enough to support the multi-path code stream to be sent with the current total code rate, the second one is that the current network environment can support the multi-path code stream to be sent with the higher total code rate, and the code stream with the code rate lower than the corresponding highest code rate exists in the multi-path code stream
In the first case, the current network environment is not sufficient to support the multi-path code stream to be transmitted at the current total code rate, the corresponding processing procedure in step 101 may be as follows, and when a pause occurs during the transmission of the multi-path code stream, the code rates of the respective code streams are sequentially reduced. For any path of code stream, if the code rate of the code stream is reduced and jamming does not occur in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced. If the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
Wherein the first set duration may be set by a technician for detecting whether a stuck exists.
In implementation, in order to preferentially ensure that the code rate of the code stream with a high important priority is higher, an important priority can be set for each path of code stream. The importance priority can represent the importance of each code stream. For example, when a user watches a video at a playing terminal, there is a higher possibility that a video corresponding to some code streams is watched (for example, a video at a main viewing angle), and there is a lower possibility that a video corresponding to some code streams is watched. Therefore, the important priority of the code stream corresponding to the video with high viewing possibility can be set higher, and the important priority of the code stream corresponding to the video with low viewing possibility can be set lower. It can be understood that if the network environment is not sufficient to support all the code streams to be transmitted according to the highest code rate, the code rate of the code stream with high important priority should be made higher. Therefore, when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams can be sequentially reduced according to the sequence of the important priority levels from low to high. Therefore, the code rate of the code stream with lower important priority is reduced first, and the code rate of the code stream with higher important priority can be ensured to be higher to a certain extent.
In the process of reducing the code rate of each path of code stream, if the card is still in the process of sending the multi-path code stream within the first set time length after the code rate of a certain code stream is reduced, the network environment still does not support sending the multi-path code stream according to the current total code rate, and at this time, the code rate of the next path of code stream with higher important priority level should be continuously reduced until the code rates of the multi-path code stream are all reduced. If the jamming is eliminated in the process of sending the multi-path code stream within the first set time length after the code rate of a certain code stream is reduced, the network environment supports sending the multi-path code stream according to the current total code rate, and the total code rate of the current multi-path code stream is determined to be the target total code rate at the moment.
And if the jamming still exists after the code rates of the multiple paths of code streams are sequentially reduced, reducing the code rates of the multiple paths of code streams again according to the sequence of the important priority from low to high until the target total code rate is determined.
It should be noted that the shooting terminal determines that a jam occurs in the process of sending the multi-path code stream, or the shooting terminal sends a jam message to the shooting terminal when the stream server is jammed in the process of receiving the multi-path code stream, so that the shooting terminal determines that a jam occurs in the process of sending the multi-path code stream according to the jam message.
In addition, when the code rates of the code streams of the paths are reduced in sequence, the code rates of the code streams of the paths can be reduced in sequence according to the order from low to high of the important priority. And the code rate of each path of code stream can be reduced in sequence from high priority to low priority. Or, the code rates of the code streams of all paths are sequentially reduced according to a random sequence. By adopting any one of the above sequences to reduce the code rate of each path of code stream, the target total code rate can be determined, which is not limited in the present application.
In a possible implementation manner, in order to facilitate adjustment of the code rate of the code stream, for any code stream, a multi-level code rate may be preset, and at this time, when the code rate of each path of code stream is reduced, the code rate of each path of code stream may be adjusted to the next low-level code rate.
The multi-level code rates corresponding to the multi-path code streams may be the same or different, and this is not limited in this application. The following description will take as an example that the multi-level code rate of the multi-path code stream is [300, 285, 270, 250, 230, 215, 200, 185, 170, 150, 140, 130, 120, 110, 100 ].
In implementation, when the code rate of the code stream is reduced, the code rate of the code stream can be directly adjusted to the code rate of the next low level. For example, if the code rate of a certain path of code stream is 270, the code rate of the path of code stream is directly adjusted to 250 when the code rate of the path of code stream is reduced.
In the second case, the current network environment may support that multiple code streams are transmitted at a higher total code rate, and the corresponding processing procedure in step 101 may be as follows. When jamming does not occur in the process of sending the multi-path code streams within a second set time length and the code streams which do not reach the highest code rate exist in the current multi-path code streams, sequentially increasing the code rates of the code streams which do not reach the highest code rate; for any one code stream which does not reach the highest code rate, if jamming occurs in the process of sending the multi-path code stream within a third set time length after the code rate of the code stream is increased, determining the total code rate of the multi-path code stream before the code rate of the code stream is increased as a target total code rate; if jamming does not occur in the process of sending the multi-path code streams within a third set time length after the code rate of the code stream is increased, and the code streams which do not reach the highest code rate still exist in the current multi-path code streams, increasing the code rate of the next path of code streams which do not reach the highest code rate until the code rates of all the code streams which do not reach the highest code rate are increased too much; if the code rates of all the code streams which do not reach the highest code rate are increased, in a third set time length, jamming still does not exist in the process of sending the multi-path code streams, and when the code streams which do not reach the highest code rate exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate are increased again.
The second set time period may be a time period set by a technician, and the second set time period may be longer than the first set time period.
The highest code rate refers to the highest code rate set by each code stream, and may also be referred to as a set code rate.
The third set time period may be a time period set by a technician, and the third set time period may be equal to the first set time period.
In implementation, when jamming does not occur in the process of sending the multiple paths of code streams within the second set duration and a code stream which does not reach the highest code rate exists in the current multiple paths of code streams, it is indicated that the current network environment may support the multiple paths of code streams to be sent at a higher total code rate. At this time, the code rates of the code streams which do not reach the highest code rate can be sequentially increased according to the order of the important priority from high to low. Therefore, the code rate of the code stream with higher important priority is increased first, and the code rate of the code stream with higher important priority can be ensured to be higher to a certain extent.
In the process of increasing the code rate of each path of code stream, if jamming occurs in the process of sending the multiple paths of code streams within a third set time after the code rate of a certain code stream is increased, it is indicated that the current network environment is insufficient to support the multiple paths of code streams to be sent at the current total code rate, and the total code rate of the multiple paths of code streams before the code rate of the code stream is increased should be determined as the target total code rate. If the code rate of a certain code stream is increased and jamming does not occur in the process of sending the multi-path code stream within the third set time length, the current network environment can support the multi-path code stream to be sent at the current total code rate, and if the code stream which does not reach the highest code rate still exists in the multi-path code stream, whether the current network environment supports the multi-path code stream to be sent at the higher total code rate or not should be detected. At this time, the code rate of the next code stream with lower important priority can be increased until the code rates of all the code streams which do not reach the highest code rate are increased.
If the code rates of all the code streams which do not reach the highest code rate are increased, the jamming still does not exist in the process of sending the multi-path code streams within the third set time length, and when the code streams which do not reach the highest code rate exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate can be increased again until the target total code rate is determined.
It should be noted that when the code rates of all the code streams that do not reach the highest code rate are sequentially increased, the code rates may be sequentially increased according to the order of the important priority from high to low. Or the importance priority can be increased in sequence from low to high. Alternatively, the increase is in order in a random order. By adopting any one of the above sequences, the target total code rate can be determined, which is not limited in the present application.
In a possible implementation manner, in order to facilitate adjustment of the code rate of the code stream, for any code stream, a multi-level code rate may be preset, and when the code rate of the code stream is increased, the code rate of the code stream that does not reach the highest code rate may be adjusted to a higher-level code rate.
In implementation, when the code rate of the code stream is increased, the code rate of the code stream can be increased at different levels at one time according to different important priorities of different code streams.
When the code rate of the code stream with high important priority is increased, the number of the grade of the code rate increase at each time can be not less than that of the code stream with low important priority at each time, so that the code rate of the code stream with high important priority can be increased at a higher speed, and the code rate of the code stream with high important priority can be ensured to be higher to a certain extent. For example, for two code streams with code rates of 185, the code rate of the code stream with higher important priority can be directly increased to 230, and the code rate of the code stream with lower important priority can be increased to 200.
For the process of determining the target total bit rate in step 101, the following discusses in detail by taking the multi-path code stream as two paths of code streams. The two paths of code streams are respectively A and B, the important priority of A is higher than that of B, and both A and B do not reach the highest code rate.
When pause occurs in the process of sending the two paths of code streams, the code rates of the two paths of code streams are alternately reduced, and the code rate of the B path of code stream can be reduced firstly.
After the code rate of one path of code stream is reduced each time, whether the process of sending the two paths of code streams is blocked or not is detected within a first set time length. If the jamming does not occur, determining the total code rate of the current two paths of code streams as a target total code rate; and if the jamming occurs, continuously reducing the code rate of the next path of code stream until the target total code rate is determined.
And when the jamming does not occur in the process of sending the two paths of code streams within the second set time length, the code rates of the two paths of code streams are alternately increased, and the code rate of the A path of code stream can be increased firstly for the first time.
And after the code rate of one path of code stream is increased each time, detecting whether the process of sending the two paths of code streams is blocked or not within a third set time length. If the jamming occurs, determining the total code rate of the two paths of code streams as a target total code rate before the code rate of the code stream is increased; and if the jamming does not occur, continuing to increase the code rate of the next path of code stream until the target total code rate is determined.
It should be noted that, if the a-path code stream and the B-path code stream have multiple levels of code rates in advance, the number of levels of code rate increase when the code rate of the a-path code stream increases each time may be not less than the number of levels of code rate increase when the B-path code stream increases each time. The corresponding process can be as follows.
When the code rate of the code stream with higher important priority is increased, a dichotomy can be used, that is, the code rate with higher important priority is adjusted to be the code rate of the minimum integer level greater than or equal to (M + N)/2, wherein M represents the current code rate level of the code stream with higher important priority, and N represents the highest code rate level of the code stream with higher important priority.
For example, [300, 285, 270, 250, 230, 215, 200, 185, 170, 150, 140, 130, 120, 110, 100] is the multi-level code rate of the a-way code stream. The current code rate of the path a code stream is 170 (level 7), and the highest code rate is 300 (level 15).
The process of increasing the code rate of the a-path code stream is as follows: the first lift is (7+15)/2 ═ 11, i.e., 230; the second lifting is (11+15)/2 ═ 13, namely 270; the third lift is (13+15)/2 ═ 14 stages, i.e. 285; the fourth lifting is the smallest integer 15 stages, i.e. 300, which is also the highest stage, larger than (14+15)/2 ═ 14.5.
When the code rate of the code rate with lower important priority is increased, the code rate of the code stream with lower important priority can be adjusted to the code rate of the previous high level. That is, when the code rate of the code stream with lower important priority is increased, the code rate is increased by one level each time.
For example, [300, 285, 270, 250, 230, 215, 200, 185, 170, 150, 140, 130, 120, 110, 100] is the multi-level code rate of the B-path code stream. The current code rate of the B-path code stream is 250 (level 12), and the highest code rate is 300 (level 15).
The process of increasing the code rate of the B-path code stream is as follows: the first lift is 13 stages, i.e. 270; the second lift is 14 stages, namely 285; the third boost is 15 stages, i.e., 300, which is also the highest stage.
In step 102, a target code rate of each path of code stream is determined based on the set weight and the target total code rate of each path of code stream.
The set weight of each path of code stream is set by technicians based on the importance of each path of code stream, the weight is a positive number smaller than 1, and the sum of the weights of each path of code stream is 1. The importance of each code stream can be determined according to the number of audiences of videos corresponding to each code stream, and the weight of the code stream corresponding to the video with more audiences is greater than that of the code stream corresponding to the video with less audiences. When the code rate is distributed, the code rate of the code stream corresponding to the video with more audiences is higher, and the definition of the video watched by most people is preferentially ensured.
It can be understood that the higher the weight of the code stream, the higher the important priority of the code stream.
In implementation, after the target total code rate is determined, the weight of each path of code stream may be multiplied by the target total code rate, so as to obtain the target code rate of each path of code stream.
In some cases, under the condition that the target total code rate of the multi-path code stream is higher, the weight of the code stream is multiplied by the target total code rate, and the obtained numerical value may be greater than the highest code rate of the code stream, and then the numerical value should be adjusted. The corresponding process can be as follows:
and multiplying the weight of each path of code stream by the target total code rate to obtain an initial target code rate, and if all the initial target code rates are smaller than the corresponding highest code rate, determining the target code rate of each path of code stream as the corresponding initial target code rate. At this time, all the code streams are distributed code streams.
And if the initial target code rates which are larger than the corresponding highest code rate exist, determining the target code rates of the code streams corresponding to the initial target code rates as the corresponding highest code rates. And determining the code streams as allocated code streams, and determining the rest code streams as unallocated code streams. And subtracting the sum of the target code rates of all the allocated code streams from the target total code rate to obtain the unallocated code rate.
And adjusting the weight of all the unallocated code streams, and dividing the weight of any unallocated code stream by the sum of the weights of all the unallocated code streams to obtain the adjusted weight. And multiplying the adjusted weight by the unallocated code rate to obtain a new initial target code rate, and if all the initial target code rates are smaller than the corresponding highest code rate, determining the target code rate of each path of code stream as the corresponding initial target code rate, wherein each path of code stream is an allocated code stream. And if the new initial target code rate greater than the corresponding highest code rate exists, determining the target code rate of the code stream corresponding to the new initial target code rate as the corresponding highest code rate, and determining the code streams as the allocated code streams. And the processing of the step is carried out again on the residual unallocated code streams until all the code streams are allocated code streams.
For example, there are A, B, C three-way code streams, the corresponding highest code rates are Ha, Hb, and Hc, the weights are w1, w2, and w3, the sum of w1, w2, and w3 is 1, and the target total code rate is T.
If T × w1> Ha, T × w2< Hb, and T × w3< Hc, the target code rate Xa of the path A code stream is Ha; the target code rate of the B path code stream is (T-Ha) xw 2/(w2+ w 3); the target code rate of the C path code stream is (T-Ha) xw 3/(w2+ w 3).
It is understood that (T-Ha) × w2/(w2+ w3) < Hb, (T-Ha) × w3/(w2+ w3) < Hc.
In step 103, the code rate of each path of code stream is adjusted to the corresponding target code rate.
In implementation, after the target code rate of each path of code stream is determined, the code rate of each path of code stream can be readjusted, and the code rate of each path of code stream is adjusted to the corresponding target code rate. Then, the adjusted code streams can be sent.
When the total code rate of the multi-path code stream is detected to be not matched with the network environment again, the method for adjusting the code rate of the multi-path code stream provided by the embodiment of the application can be adopted again to adjust the code rate of the multi-path code stream.
It should be noted that adjusting the code rate of each path of code stream to the corresponding target code rate means encoding the corresponding original video according to the target code rate to obtain each path of code stream after adjustment.
The method for adjusting the code rates of the multiple paths of code streams provided by the embodiment of the application can be used for adjusting the code rates of the multiple paths of code streams when the total code rate of the multiple paths of code streams is detected to be not matched with the network environment. Specifically, when it is detected that the total code rate of the multi-path code stream is not matched with the network environment, first, a target total code rate matched with the network environment may be determined. And then, distributing the target total code rate according to the importance of each path of code stream to obtain the target code rate of each path of code stream. Finally, the code rate of each path of code stream can be adjusted to the corresponding target code rate. According to the method for adjusting the code rates of the multiple paths of code streams, when the current network environment is insufficient to support the sending of the multiple paths of code streams at the current total code rate, the total code rate of the multiple paths of code streams can be reduced; when the current network environment can support the multi-path code stream to be transmitted with a higher total code rate, the total code rate of the multi-path code stream can be increased. Therefore, on the premise of ensuring the fluency of the video played on the playing terminal, the definition of the video is ensured as much as possible, the definition of the video corresponding to the code stream with high important priority is preferentially ensured, and the watching experience of the user is improved.
Based on the same technical concept, an embodiment of the present application further provides a device for adjusting a code rate of a multi-path code stream, where the device may be a terminal in the foregoing embodiment, as shown in fig. 2, and the device includes:
the matching module 201 is configured to determine a target total code rate matched with a network environment when it is detected that the total code rate of the multi-path code stream is not matched with the network environment;
the determining module 202 is configured to determine a target code rate of each path of code stream based on the set weight and the target total code rate of each path of code stream;
and the adjusting module 203 is configured to adjust the code rate of each path of code stream to a corresponding target code rate.
In one possible implementation, the matching module 201 is configured to:
when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams of all paths are sequentially reduced;
for any path of code stream, if the code rate of the code stream is reduced and jamming does not occur in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, continuously reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced;
if the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
In one possible implementation, the matching module 201 is configured to:
and sequentially reducing the code rate of each path of code stream according to the set order of the important priority of each path of code stream from low to high.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the matching module is configured to:
and adjusting the code rate of each path of code stream to the next low-level code rate.
In one possible implementation, the matching module 201 is configured to:
when jamming does not occur in the process of sending the multi-path code streams within a second set time length and the code streams which do not reach the highest code rate exist in the current multi-path code streams, sequentially increasing the code rates of the code streams which do not reach the highest code rate;
for any one code stream which does not reach the highest code rate, if jamming occurs in the process of sending the multi-path code stream within a third set time length after the code rate of the code stream is increased, determining the total code rate of the multi-path code stream before the code rate of the code stream is increased as a target total code rate; if jamming does not occur in the process of sending the multi-path code streams and the code streams which do not reach the highest code rate still exist in the current multi-path code streams within a third set time length after the code rates of the code streams are increased, increasing the code rates of the next path of code streams which do not reach the highest code rate until the code rates of all the code streams which do not reach the highest code rate are increased too much;
if the code rates of all the code streams which do not reach the highest code rate are increased, in a third set time length, jamming still does not exist in the process of sending the multi-path code streams, and when the code streams which do not reach the highest code rate still exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate are increased again.
In one possible implementation, the matching module 201 is configured to:
and sequentially increasing the code rate of the code stream which does not reach the highest code rate according to the set order of the important priority of each path of code stream from high to low.
In a possible implementation manner, for any code stream, a multi-level code rate is preset, and the matching module 201 is configured to:
and adjusting the code rate of the code stream which does not reach the highest code rate to a code rate of a higher level.
In a possible implementation manner, the multi-path code stream is two paths of code streams, code rates of the two paths of code streams are both smaller than a corresponding highest code rate, and the matching module 201 is configured to:
adjusting the code rate of the code stream with higher important priority to be the code rate of the minimum integer level which is more than or equal to (M + N)/2, wherein M represents the level of the current code rate of the code stream with higher important priority, and N represents the level of the highest code rate of the code stream with higher important priority;
and adjusting the code rate of the code stream with lower important priority to the code rate of the previous high level.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that: the device for adjusting the code rate of the multiple paths of code streams provided in the foregoing embodiment performs the adjustment of the code rate of the multiple paths of code streams, which is only illustrated by the division of the functional modules, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for adjusting the code rate of the multiple paths of code streams and the method for adjusting the code rate of the multiple paths of code streams provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 3 is a block diagram of a terminal according to an embodiment of the present disclosure. The terminal 300 may be a portable mobile terminal such as: smart phones, tablet computers, smart cameras. The terminal 300 may also be referred to by other names such as user equipment, portable terminal, etc.
Generally, the terminal 300 includes: a processor 301 and a memory 302.
The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 301 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 302 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 302 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 302 is used to store at least one instruction for execution by the processor 301 to implement the method for adjusting the code rate of a multi-path code stream provided in the present application.
In some embodiments, the terminal 300 may further include: a peripheral interface 303 and at least one peripheral. Specifically, the peripheral device includes: at least one of radio frequency circuitry 304, display screen 305, camera assembly 306, audio circuitry 307, positioning assembly 308, and power supply 309.
The peripheral interface 303 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 301 and the memory 302. In some embodiments, processor 301, memory 302, and peripheral interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302 and the peripheral interface 303 may be implemented on a separate chip or circuit board, which is not limited by the embodiment.
The Radio Frequency circuit 304 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 304 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 304 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 304 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. The display screen 305 also has the ability to capture touch signals on or over the surface of the touch display screen 305. The touch signal may be input to the processor 301 as a control signal for processing. The display screen 305 is used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 305 may be one, providing the front panel of the terminal 300; in other embodiments, the display screens 305 may be at least two, respectively disposed on different surfaces of the terminal 300 or in a folded design; in still other embodiments, the display 305 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 300. Even further, the display screen 305 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 305 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 306 is used to capture images or video. Optionally, camera assembly 306 includes a front camera and a rear camera. Generally, a front camera is used for realizing video call or self-shooting, and a rear camera is used for realizing shooting of pictures or videos. In some embodiments, the number of the rear cameras is at least two, and each of the rear cameras is any one of a main camera, a depth-of-field camera and a wide-angle camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting function and a VR (Virtual Reality) shooting function. In some embodiments, camera assembly 306 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuit 307 is used to provide an audio interface between the user and terminal 300. Audio circuitry 307 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 301 for processing or inputting the electric signals to the radio frequency circuit 304 to realize voice communication. The microphones may be provided in plural numbers, respectively, at different portions of the terminal 300 for the purpose of stereo sound collection or noise reduction. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 301 or the radio frequency circuitry 304 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 307 may also include a headphone jack.
The positioning component 308 is used to locate the current geographic Location of the terminal 300 to implement navigation or LBS (Location Based Service). The Positioning component 308 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
The power supply 309 is used to supply power to the various components in the terminal 300. The power source 309 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 309 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 300 also includes one or more sensors 310. The one or more sensors 310 include, but are not limited to: acceleration sensor 311, gyro sensor 312, pressure sensor 313, fingerprint sensor 314, optical sensor 315, and proximity sensor 316.
The acceleration sensor 311 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the terminal 300. For example, the acceleration sensor 311 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 301 may control the display screen 305 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 311. The acceleration sensor 311 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 312 may detect a body direction and a rotation angle of the terminal 300, and the gyro sensor 312 may cooperate with the acceleration sensor 311 to acquire a 3D motion of the user on the terminal 300. The processor 301 may implement the following functions according to the data collected by the gyro sensor 312: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 313 may be disposed on a side bezel of the terminal 300 and/or on a lower layer of the display screen 305. When the pressure sensor 313 is disposed at the side frame of the terminal 300, a user's grip signal of the terminal 300 can be detected, and left-right hand recognition or shortcut operation can be performed according to the grip signal. When the pressure sensor 313 is disposed at the lower layer of the display screen 305, the operability control on the UI interface can be controlled according to the pressure operation of the user on the display screen 305. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 314 is used for collecting a fingerprint of a user to identify the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, processor 301 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 314 may be disposed on the front, back, or side of the terminal 300. When a physical button or a vendor Logo is provided on the terminal 300, the fingerprint sensor 314 may be integrated with the physical button or the vendor Logo.
The optical sensor 315 is used to collect the ambient light intensity. In one embodiment, the processor 301 may control the display brightness of the display screen 305 based on the ambient light intensity collected by the optical sensor 315. Specifically, when the ambient light intensity is high, the display brightness of the display screen 305 is increased; when the ambient light intensity is low, the display brightness of the display screen 305 is reduced. In another embodiment, the processor 301 may also dynamically adjust the shooting parameters of the camera head assembly 306 according to the ambient light intensity collected by the optical sensor 315.
A proximity sensor 316, also known as a distance sensor, is typically provided on the front face of the terminal 300. The proximity sensor 316 is used to collect the distance between the user and the front surface of the terminal 300. In one embodiment, when the proximity sensor 316 detects that the distance between the user and the front surface of the terminal 300 gradually decreases, the processor 301 controls the display screen 305 to switch from the bright screen state to the dark screen state; when the proximity sensor 316 detects that the distance between the user and the front surface of the terminal 300 is gradually increased, the display screen 305 is controlled by the processor 301 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not intended to be limiting of terminal 300 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, a computer-readable storage medium is further provided, where at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the method for adjusting the code rate of multiple code streams in the foregoing embodiments. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for adjusting code rates of multiple code streams is characterized in that the method comprises the following steps:
when the total code rate of the multi-path code stream is detected to be not matched with the network environment, determining a target total code rate matched with the network environment;
determining the target code rate of each path of code stream based on the set weight of each path of code stream and the target total code rate;
adjusting the code rate of each path of code stream to a corresponding target code rate;
when the total code rate of the multi-path code stream is detected not to be matched with the network environment, determining the target total code rate matched with the network environment, wherein the method comprises the following steps:
when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams of all paths are sequentially reduced;
for any path of code stream, if the code rate of the code stream is reduced and jamming does not occur in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, continuously reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced;
if the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
2. The method of claim 1, wherein the sequentially reducing the code rate of each code stream comprises:
and sequentially reducing the code rate of each path of code stream according to the set order of the important priority of each path of code stream from low to high.
3. The method according to any one of claims 1 or 2, wherein for any one code stream, a multi-level code rate is preset, and the reducing the code rate of each code stream comprises:
and adjusting the code rate of each path of code stream to the next low-level code rate.
4. The method of claim 1, wherein when it is detected that the total code rate of the multi-path code stream does not match the network environment, determining a target total code rate matching the network environment comprises:
when jamming does not occur in the process of sending the multi-path code streams within a second set time length and the code streams which do not reach the highest code rate exist in the current multi-path code streams, sequentially increasing the code rates of the code streams which do not reach the highest code rate;
for any one path of code stream which does not reach the highest code rate, if jamming occurs in the process of sending the multi-path code stream within a third set time length after the code rate of the code stream is increased, determining the total code rate of the multi-path code stream before the code rate of the code stream is increased as a target total code rate; if jamming does not occur in the process of sending the multi-path code streams within a third set time length after the code rates of the code streams are increased, and the code streams which do not reach the highest code rate still exist in the current multi-path code streams, increasing the code rate of the next path of code streams which do not reach the highest code rate until the code rates of all the code streams which do not reach the highest code rate are increased too much;
if the code rates of all the code streams which do not reach the highest code rate are increased, in a third set time length, jamming still does not exist in the process of sending the multi-path code streams, and when the code streams which do not reach the highest code rate still exist in the multi-path code streams, the code rates of the code streams which do not reach the highest code rate are increased again.
5. The method of claim 4, wherein the sequentially increasing the code rates of the code streams that do not reach the highest code rate comprises:
and sequentially increasing the code rate of the code stream which does not reach the highest code rate according to the set order of the important priority of each path of code stream from high to low.
6. The method according to any one of claims 4 or 5, wherein, for any code stream, a plurality of code rates are preset, and the increasing of the code rate of the code stream which does not reach the highest code rate comprises:
and adjusting the code rate of the code stream which does not reach the highest code rate to a code rate of a higher level.
7. The method of claim 6, wherein the multi-path code stream is two paths of code streams, the code rates of the two paths of code streams are both smaller than the corresponding highest code rate, and the adjusting the code stream that does not reach the highest code rate to a higher level code rate comprises:
adjusting the code rate of the code stream with higher important priority to be the code rate of the minimum integer level which is more than or equal to (M + N)/2, wherein M represents the level of the current code rate of the code stream with higher important priority, and N represents the level of the highest code rate of the code stream with higher important priority;
and adjusting the code rate of the code stream with lower important priority to the code rate of the previous high level.
8. An apparatus for adjusting a code rate of a plurality of code streams, the apparatus comprising:
the matching module is used for determining a target total code rate matched with the network environment when the total code rate of the multi-path code stream is not matched with the network environment;
the determining module is used for determining the target code rate of each path of code stream based on the set weight of each path of code stream and the target total code rate;
the adjusting module is used for adjusting the code rate of each path of code stream to the corresponding target code rate;
when the total code rate of the multi-path code stream is detected not to be matched with the network environment, determining the target total code rate matched with the network environment, wherein the method comprises the following steps: when jamming occurs in the process of sending the multi-path code streams, the code rates of the code streams of all paths are sequentially reduced; for any path of code stream, if the code rate of the code stream is reduced and jamming does not occur in the process of sending the multi-path code stream within a first set time length, determining the total code rate of the current multi-path code stream as a target total code rate; if jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rate of the code stream is reduced, continuously reducing the code rate of the next path of code stream until the code rates of the multi-path code stream are all reduced; if the jamming still exists in the process of sending the multi-path code stream within the first set time length after the code rates of the multi-path code stream are all reduced, the processing of reducing the code rates of the code streams of all paths is carried out again.
9. A terminal, characterized in that the terminal comprises a memory and a processor, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for adjusting the code rate of the multi-path code stream according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the method for adjusting a code rate of a multi-path code stream according to any one of claims 1 to 7.
CN201911096746.6A 2019-11-11 2019-11-11 Method and device for adjusting code rate of multi-path code stream Active CN110769271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911096746.6A CN110769271B (en) 2019-11-11 2019-11-11 Method and device for adjusting code rate of multi-path code stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911096746.6A CN110769271B (en) 2019-11-11 2019-11-11 Method and device for adjusting code rate of multi-path code stream

Publications (2)

Publication Number Publication Date
CN110769271A CN110769271A (en) 2020-02-07
CN110769271B true CN110769271B (en) 2021-09-14

Family

ID=69337496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911096746.6A Active CN110769271B (en) 2019-11-11 2019-11-11 Method and device for adjusting code rate of multi-path code stream

Country Status (1)

Country Link
CN (1) CN110769271B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510735B (en) * 2020-04-21 2022-11-01 新石器慧通(北京)科技有限公司 Encoding transmission method and device for multi-channel video in weak network environment and unmanned vehicle
CN112104898A (en) * 2020-08-31 2020-12-18 广州华多网络科技有限公司 Live connection control method and device, corresponding equipment and storage medium
CN112104880A (en) * 2020-08-31 2020-12-18 广州华多网络科技有限公司 Network connection live broadcast control and display method and device, equipment and storage medium
WO2022236758A1 (en) * 2021-05-13 2022-11-17 深圳市大疆创新科技有限公司 Data encoding method and device
CN115623216A (en) * 2021-07-15 2023-01-17 广州迈聆信息科技有限公司 Video coding method and device, intelligent equipment and storage medium
CN114827664B (en) * 2022-04-27 2023-10-20 咪咕文化科技有限公司 Multi-path live broadcast mixed stream method, server, terminal equipment, system and storage medium
CN115174567A (en) * 2022-06-22 2022-10-11 浙江大华技术股份有限公司 Code sending method, device, equipment and storage medium
CN115174965B (en) * 2022-06-30 2024-01-02 杭州海康威视数字技术股份有限公司 Video preview method, device, electronic equipment and computer readable storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060256856A1 (en) * 2005-05-16 2006-11-16 Ashish Koul Method and system for testing rate control in a video encoder
CN102027546A (en) * 2008-05-16 2011-04-20 夏普株式会社 Recording apparatus
CN102740108B (en) * 2011-04-11 2015-07-08 华为技术有限公司 Video data quality assessment method and apparatus thereof
CN102307302B (en) * 2011-07-06 2014-07-30 杭州华三通信技术有限公司 Method and device for maintaining continuity of video image
CN102427532B (en) * 2011-10-24 2013-10-09 成都虢电智能电力科技有限公司 Multipath video adapting coding transmission method under limited bandwidth and transmission system thereof
CN102724491A (en) * 2012-06-15 2012-10-10 北京博雅华录视听技术研究院有限公司 Statistical multiplexing method based on parallel coding
CN103501429A (en) * 2013-10-22 2014-01-08 中国农业银行股份有限公司 Data coding method and device based on dynamic code rate
CN103686346A (en) * 2013-12-26 2014-03-26 乐视网信息技术(北京)股份有限公司 Video playing unsmoothness switching method and system
CN105635734B (en) * 2014-11-03 2019-04-12 掌赢信息科技(上海)有限公司 Adaptive video coding method and device based on video calling scene
CN109874031A (en) * 2017-12-04 2019-06-11 华平信息技术股份有限公司 Multipriority dynamic code rate method of adjustment and system based on network bandwidth prediction
CN108881972B (en) * 2018-08-01 2021-06-15 广州视源电子科技股份有限公司 Code rate allocation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110769271A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
CN110769271B (en) Method and device for adjusting code rate of multi-path code stream
CN108966008B (en) Live video playback method and device
CN109788303B (en) Live video stream pushing method and device, electronic equipment and storage medium
CN110022489B (en) Video playing method, device and storage medium
CN110278464B (en) Method and device for displaying list
CN110764730A (en) Method and device for playing audio data
CN110740340B (en) Video live broadcast method and device and storage medium
CN111586431B (en) Method, device and equipment for live broadcast processing and storage medium
CN111107389B (en) Method, device and system for determining live broadcast watching time length
CN111464830B (en) Method, device, system, equipment and storage medium for image display
CN108427630B (en) Performance information acquisition method, device, terminal and computer readable storage medium
CN112965683A (en) Volume adjusting method and device, electronic equipment and medium
CN111031170A (en) Method, apparatus, electronic device and medium for selecting communication mode
CN110856152A (en) Method, device, electronic equipment and medium for playing audio data
CN110149491B (en) Video encoding method, video decoding method, terminal and storage medium
CN109089137B (en) Stuck detection method and device
CN110912830A (en) Method and device for transmitting data
CN110543403A (en) power consumption evaluation method and device
CN111050211A (en) Video processing method, device and storage medium
CN112153404B (en) Code rate adjusting method, code rate detecting method, code rate adjusting device, code rate detecting device, code rate adjusting equipment and storage medium
CN111586433B (en) Code rate adjusting method, device, equipment and storage medium
CN111698262B (en) Bandwidth determination method, device, terminal and storage medium
CN111083162B (en) Multimedia stream pause detection method and device
CN111369434B (en) Method, device, equipment and storage medium for generating spliced video covers
CN108310767B (en) Information display method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant