Specific embodiment
Fig. 1 is the flow chart of video quality control method embodiment one of the present invention, as shown in Figure 1, this method includes:
During the buffering of video code flow fragment that at least two detection moments detect in step 101, acquisition client buffer area
It is long;
Step 102 buffers durations and pre-set buffer duration desired value according to described at least two, determines that the client is worked as
Preceding network bandwidth controlled quentity controlled variable;
Step 103, the quality layers that video code flow fragment to be transmitted in server is determined according to the network bandwidth controlled quentity controlled variable
Grade;
Step 104 sends quality level adjust request to the server, and the adjust request includes the quality layers
Grade so that the server with transmission code rate corresponding with the quality level to video to be transmitted described in the client transmissions
Code stream fragment.
In DASH stream media systems, client can buffer a part of video code flow fragment.The video length of buffering can be with
Reflect the relationship of currently employed transmission code rate and network bandwidth.For example, if buffering duration increase, illustrates to send smooth, network
Bandwidth is enough;Conversely, buffering duration reduces, then illustrate to receive data deficiencies, network bandwidth is deteriorated.DASH in the prior art
In system, the duration of video code flow fragment that is buffered in client buffer area during only according to current time decides whether under
The quality level of one code stream fragment adjusts, and by the time variation for the wireless network environment that client is run, often makes
The variation of the wireless network bandwidth of time-varying is not suitable for into the control decision currently made, i.e., such as according to current buffering duration
Determine the quality level for needing to adjust next video code flow fragment, but network environment suddenly change at this time so that net can be used
Network bandwidth changes, so that the quality level of predetermined next video code flow fragment and network bandwidth at this time
It is incompatible, if the corresponding transmission code rate of quality level for causing this determining is higher than available network bandwidth, may cause
The interim card of video playing;, whereas if the determining corresponding transmission code rate of quality level is well below available network bandwidth, then
Bandwidth can not be made full use of, gives user's best video play quality.In addition, frequently the variation of quality level also bring along it is bad
Viewing experience.
In order to overcome the problems referred above, the video quality control method provided in this embodiment uses following scheme, it is intended to
The influence that the time variation that network bandwidth changes controls video quality is avoided, ensures the flatness of video transmission quality.This implementation
The executive agent of example the method is a control device, which is optionally integrated in the equipment that client is run.
First, which obtains the video code flow fragment that at least two detection moments detect in client buffer area
Buffer duration.
In the present embodiment, detection cycle is pre-set, for detecting the video code flow fragment buffered in client buffer area
Buffering duration, such as every the primary buffering duration of detection in 1 minute.It is detected when control device is by obtaining multiple detection cycles
Buffering duration, the network bandwidth situation of change of client is determined according to multiple buffering durations, so as to become according to network bandwidth
Change situation determines the need for the quality level of adjustment subsequent server video code rate fragment to be transmitted and determines to be transmitted
The quality level of video code flow fragment.
Specifically, control device detects the buffered data duration in client buffer area when timing is to detection cycle, passes through
The timing in repeated detection period, control device can obtain the video codes that at least two detection moments detect in client buffer area
The buffering duration of flow fragmentation.And then control device is determined according at least two buffering duration and pre-set buffer duration desired value
The current network bandwidth controlled quentity controlled variable of client.In the present embodiment, the desired value of a buffering duration is pre-set, the desired value is anti-
When having reflected the preferable video display effect of acquisition and obtaining preferable user's viewing experience in other words, the video codes flow point that is buffered in buffering area
The preferable duration of piece, such as 75% for buffering area total capacity.During specific implementation, for example, it is optional, it can calculate respectively
Each buffering duration and the difference of the pre-set buffer duration desired value, the difference that detection obtains reflect practical buffering duration and reason
Think the error of buffering duration, and then each buffering duration and the pre-set buffer duration desired value are weighted with different weighting coefficients respectively
Difference, and the weight of different weighting coefficient can be adapted from the variation degree of corresponding different differences, so as to be characterized
The state variable of duration is buffered in the adjustment period internal buffer, since buffering duration can reflect Netowrk tape to a certain extent
Width, therefore, with the variation of the state variable of buffering duration characterization network bandwidth to get to the current network bandwidth control of client
Amount processed.A kind of simplest situation is to be averaging each difference, obtain an average value, so as to be characterized with the average value
Network bandwidth controlled quentity controlled variable in the adjustment period corresponding to client.
When multiple buffering durations estimation that control device is obtained according to the detection of different detection moments determines that client is current
Corresponding network bandwidth controlled quentity controlled variable, the network bandwidth controlled quentity controlled variable reflect the variation tendency of network bandwidth, so as to which control device can
Choosing, it can be according to the correspondence of preset quality level corresponding with heterogeneous networks bandwidth, alternatively, optionally can also root
Network bandwidth controlled quentity controlled variable and currently employed quality level during according to adjacent last adjustment, determine to be transmitted during this adjustment
The quality level of video code flow fragment.For example, upper network bandwidth control magnitude is less than current network bandwidth and controls magnitude, even
Current network bandwidth is higher than a upper network bandwidth, it is determined that the quality level of video code flow fragment to be transmitted is than current quality
A high quality level of level.
And then control device carries the quality level of its determining video code flow fragment to be transmitted to server transmission
Quality level adjust request so that server with transmission code rate corresponding with the quality level to be transmitted described in client transmissions
Video code flow fragment.Due to being previously stored with regarding for the corresponding different transmission code rates of different quality level in video server
Frequency code flow fragmentation, therefore, after the adjust request for receiving the quality level for carrying available for transmission video code flow fragment, according to upper
The correspondence of preset quality level and transmission code rate is stated, determines transmission code rate corresponding with the quality level, and with the biography
Defeated code check is to client transmissions video code flow fragment to be transmitted.
In the present embodiment, the video code flow fragment buffered in detection client buffer area at a time interval is preset
Buffering duration detection cycle, so as to the video code flow fragment buffered in each detection cycle detection client buffer area
Buffering duration.During by obtaining the buffering of video code flow fragment that at least two detection moments in client buffer area detect
It is long, so as to according at least two buffering duration and pre-set buffer duration desired value, determine the current network bandwidth control of client
Amount processed, and then determine according to the network bandwidth controlled quentity controlled variable quality level of follow-up video code flow fragment to be transmitted in server, from
And it is asked to server with transmission code rate corresponding with the quality level to client transmissions video code flow fragment to be transmitted.Pass through
The buffering duration in client buffer area during repeated detection difference detection moment is estimated according to multiple buffering durations that detection obtains
To the network bandwidth situation of change of client, and as according to the quality level for determining subsequent video code stream fragment so that determine
Quality level time variation that bandwidth can effectively be avoided to change influence, and will not cause frequently to adjust quality level, favorably
In guarantee video transmission quality.
Fig. 2 is the flow chart of video quality control method embodiment two of the present invention, as shown in Fig. 2, this method includes:
During the buffering of video code flow fragment that at least two detection moments detect in step 201, acquisition client buffer area
It is long;
Step 202 determines the current network bandwidth controlled quentity controlled variable u (t) of the client according to formula (1);
Wherein, Kp、KiAnd KdWeighting coefficient respectively, t1And t2Respectively starting detection moment and cut-off detection moment, e (t)
For t2The corresponding buffering duration of detection moment and the pre-set buffer duration desired value BrDifference, e (τ) be τ detection moments correspond to
Buffering duration and the pre-set buffer duration desired value BrDifference.
Wherein three coefficients are determined according to the classical way (such as Ziegler-Mike Nichols method) of control field,
It can manually be adjusted.
In the present embodiment, when calculating current network bandwidth controlled quentity controlled variable u (t), employ each buffering duration and delay with default
Rush duration desired value BrThe ratio of error, integration, differential weighted sum mode, so as to have both consideration error current, go through
The characteristics of history recording error, prediction error change so that the result of calculation of current network bandwidth controlled quentity controlled variable u (t) more can be accurate
Reflect the variation of network bandwidth.
Specifically, in t1To t2In each detection moment, obtain buffering area buffering video code flow fragment buffering duration
Value, then with buffering duration desired value carry out additive operation, obtain error variance.Following three parts are calculated to error variance
Value:
First, equal sign right side first item in proportional parts, i.e. formula (1).This part be exactly the margin of error in itself, as right
The feedback of current network bandwidth and transmission code rate matching degree, to drive the buffering duration of the video code flow fragment of buffering area buffering not
Disconnected approach desired value.Wherein, the e (t) in this is t2The corresponding buffering duration of detection moment and pre-set buffer duration desired value Br
Difference, wherein, t1Detection moment means last time adjustment, the t2If detection moment means to from t1During detection
Quarter, to t2The network bandwidth controlled quentity controlled variable that multiple buffering durations that detection moment obtains are calculated according to formula (1), and then
It obtains it is expected transmission code rate according to formula (2), if the expectation transmission code rate meets situation about in step 205 being more than, t2When
It is the time adjustment for needing to adjust the quality level of follow-up video code flow fragment to be transmitted to carve.After the completion of to be adjusted, with the t2
Detection moment is another starting detection moment, and repeated detection obtains multiple buffering durations again, and then is repeated in carrying out above-mentioned
Adjustment process.
Proportional parts=the margin of error.
Second, equal sign right side Section 2 in integral part, i.e. formula (1).This part be from last Mass adjust- ment it
Afterwards i.e. from the accumulation of the margin of error after a upper time adjustment.For a long time can be reflected to the testing result for buffering duration the proximal segment time
The average case of interior network bandwidth variation, it is therefore an objective to reduce frequently adjustment quality level so as to which video playing quality be caused to fluctuate
Possibility.
Integral part=margin of error 1+ margins of error 2+ ...+margin of error n, (when 1 ... n is detected for difference in the current adjustment period
The margin of error detection index at quarter).
Third, equal sign right side Section 3 in differential part, i.e. formula (1).This part is t2The detection moment margin of error and t2
The previous detection moment margin of error differential.It is mainly used for the variation tendency of prediction network bandwidth.
Differential part=(error of the error variance of the corresponding detection moment of time adjustment-detection moment of adjacent last time becomes
Amount)/detection time interval.
Step 203, the expectation transmission code rate R1 that the video code flow fragment to be transmitted is determined according to formula (2);
R1=[1-u (t)/Br]×R0 (2)
Wherein, R0 is current transmission code check.
Step 204 determines whether the difference of the expectation transmission code rate and current transmission code check is more than predetermined threshold value, if greatly
In step 205 then being performed, otherwise, it determines the quality level of video code flow fragment to be transmitted is identical with current Quality level;
Step 205, the correspondence according to preset transmission code rate and quality level, determine and the expectation transmission code rate
Corresponding quality level;
Step 206 sends quality level adjust request to the server, and the adjust request includes the quality layers
Grade so that the server with transmission code rate corresponding with the quality level to video to be transmitted described in the client transmissions
Code stream fragment.
It further, can be according to the network bandwidth after current network bandwidth controlled quentity controlled variable is obtained according to formula (1)
Controlled quentity controlled variable and current transmission code check, it is determined whether need to carry out the side of the adjustment of video code flow fragment quality level and adjustment
To and dynamics.
Specifically, first item that can be first in calculation formula (2) on the right side of equal sign, i.e., control according to current network bandwidth
The variation tendency of transmission code rate is calculated in amount, and then is multiplied by current transmission code check with the variation tendency, obtains above-mentioned expectation and passes
Defeated code check.And then determine whether the difference of the expectation transmission code rate and the current transmission code check is more than predetermined threshold value, if being not more than,
Then illustrate that network bandwidth variation is little, follow-up video code flow fragment to be transmitted is still transmitted with current transmission code check, without adjusting
Whole quality level, otherwise, if it is greater, then according to being locally stored and the preset transmission code rate and quality in server unanimously
The correspondence of level determines quality level corresponding with the expectation transmission code rate.In practical application, the expectation transmission code rate is very
It may not be one in server in Preset Transfer code check, therefore locally determining and expectation transmission code rate difference minimum
Quality level corresponding to that transmission code rate is quality level corresponding with the expectation transmission code rate, so as to be sent to server
Carry the adjust request of corresponding with expectation transmission code rate quality level so that server with the expectation transmission code rate difference
That minimum transmission code rate transmits video code flow fragment to be transmitted.
In the present embodiment, by the buffering duration in client buffer area during repeated detection difference detection moment, by more
The integral operation of a buffering duration buffers duration progress differential to reduce the possibility frequently adjusted to time adjustment is corresponding
The variation of network bandwidth is predicted in operation.So that going through for client buffer area can be considered to the calculating of network bandwidth variation
History information, current state and future trend, and the adjustment of quality level is carried out accordingly.It ensure that the optimization of video quality, energy
Give user best viewing experience.
Fig. 3 is the structure diagram of video quality control device embodiment one of the present invention, as shown in figure 3, the device includes:
Acquisition module 11, for obtaining the video code flow fragment of at least two detection moments detection in client buffer area
Buffer duration;
First determining module 12, for according to described at least two buffering durations and pre-set buffer duration desired value, determining
The current network bandwidth controlled quentity controlled variable of the client;
Second determining module 13, for determining video codes flow point to be transmitted in server according to the network bandwidth controlled quentity controlled variable
The quality level of piece;
Sending module 14, for sending quality level adjust request to the server, the adjust request includes institute
Quality level is stated, so that the server is treated with transmission code rate corresponding with the quality level to described in the client transmissions
Transmit video code flow fragment.
The device of the present embodiment can be used for performing the technical solution of embodiment of the method shown in Fig. 1, realization principle and skill
Art effect is similar, and details are not described herein again.
Fig. 4 is the structure diagram of video quality control device embodiment two of the present invention, as shown in figure 4, the present embodiment carries
On the basis of the device embodiment shown in Fig. 3 of confession, first determining module 12 is specifically used for:
The current network bandwidth controlled quentity controlled variable u (t) of the client is determined according to formula (1):
Wherein, Kp、KiAnd KdWeighting coefficient respectively, t1And t2Respectively starting detection moment and cut-off detection moment, e (t)
For t2The corresponding buffering duration of detection moment and the pre-set buffer duration desired value BrDifference, e (τ) be τ detection moments correspond to
Buffering duration and the pre-set buffer duration desired value BrDifference.
Further, second determining module 13, including:
First determination unit 131, for determining the expectation transmission code of the video code flow fragment to be transmitted according to formula (2)
Rate R1:
R1=[1-u (t)/Br]×R0 (2)
Wherein, R0 is current transmission code check;
Second determination unit 132, for determining quality level corresponding with the expectation transmission code rate.
Specifically, second determination unit 132, is specifically used for:According to preset transmission code rate and pair of quality level
It should be related to, determine quality level corresponding with the expectation transmission code rate.
Further, first determination unit 131 is additionally operable to:Determine the expectation transmission code rate and the current transmission
Whether the difference of code check is more than predetermined threshold value;
If more than predetermined threshold value, then second determination unit 132, which performs, determines it is expected that transmission code rate is corresponding with described
The step of quality level.
The device of the present embodiment can be used for performing the technical solution of embodiment of the method shown in Fig. 2, realization principle and skill
Art effect is similar, and details are not described herein again.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and aforementioned program can be stored in a computer read/write memory medium, the program
When being executed, step including the steps of the foregoing method embodiments is performed;And aforementioned storage medium includes:ROM, RAM, magnetic disc or light
The various media that can store program code such as disk.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical features into
Row equivalent replacement;And these modifications or replacement, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.