Embodiment
Fig. 1 is the flow chart of video quality control method embodiment one of the present invention, and as shown in Figure 1, the method comprises:
In step 101, acquisition client buffer district, at least two are detected the buffering duration of the video code flow burst that the moment is detected;
Step 102, according to described at least two buffering durations and pre-set buffer duration desired value, determine the network bandwidth controlled quentity controlled variable that described client is current;
Step 103, quality level according to video code flow burst to be transmitted in described network bandwidth controlled quentity controlled variable determination server;
Step 104, send quality level adjustment request to described server, described adjustment asks to comprise described quality level, to make described server with the transmission code rate corresponding with described quality level to video code flow burst to be transmitted described in described client transmissions.
In DASH stream media system, client can cushion a part of video code flow burst.The video duration of buffering can reflect the transmission code rate of current employing and the relation of the network bandwidth.Such as, if buffering duration increases, illustrate that transmission is smooth and easy, the network bandwidth is enough; Otherwise buffering duration reduces, then illustrate and receive data deficiencies, the network bandwidth is deteriorated.In DASH system in the prior art, only determine whether adjusting the quality level of next code stream burst according to the duration of the video code flow burst cushioned in client buffer district during current time, due to the time variation of the wireless network environment that client is run, the change of the wireless network bandwidth become when often causing the current control decision made to be not suitable for, namely such as determine according to current buffering duration the quality level that needs to adjust next video code flow burst, but now network environment flip-flop, available network bandwidth is changed, thus the quality level of the next video code flow burst determined before making therewith time the network bandwidth incompatible, if transmission code rate corresponding to the quality level causing this to determine is higher than available network bandwidth, the card of video playback then may be caused to pause, otherwise, if transmission code rate corresponding to this quality level determined is well below available network bandwidth, then cannot make full use of bandwidth, to user's best video play quality.In addition, the change of quality level also can bring bad viewing experience frequently.
For overcoming the problems referred to above, the described video quality control method that the present embodiment provides adopts following scheme, the impact that the time variation being intended to avoid the network bandwidth to change controls video quality, ensures the flatness of video transmission quality.The executive agent of method described in the present embodiment is a control device, and this control device is optionally integrated in the equipment that client runs.
First, this control device obtains the buffering duration of the video code flow burst of at least two detection moment detections in client buffer district.
In the present embodiment, pre-set sense cycle, for detecting the buffering duration of the video code flow burst cushioned in client buffer district, such as detecting every 1 minute and once cushioning duration.The buffering duration detected when control device is by obtaining multiple sense cycle, the network bandwidth situation of change of client is determined according to multiple buffering duration, thus determine whether according to the network bandwidth situation of change quality level needing adjustment subsequent server video code rate burst waiting for transmission, and determine the quality level of video code flow burst to be transmitted.
Particularly, control device is at the buffered data duration of timing to detection client buffer district during sense cycle, by the timing in repeated detection cycle, control device can obtain the buffering duration of the video code flow burst of at least two detection moment detections in client buffer district.And then control device, according to these at least two buffering durations and pre-set buffer duration desired value, determines the network bandwidth controlled quentity controlled variable that client is current.In the present embodiment, pre-set the desired value of a buffering duration, this desired value reflects acquisition better video display effect when obtaining better user's viewing experience in other words, and the desirable duration of the video code flow burst cushioned in buffering area is such as 75% of buffering area total capacity.During specific implementation, for example, optionally, the difference detecting each buffering duration and this pre-set buffer duration desired value obtained can be calculated respectively, this difference reflects actual buffering duration and the desirable error cushioning duration, and then with different weight coefficients respectively weighting respectively cushion the difference of duration and this pre-set buffer duration desired value, and the weight of different weights coefficient can adapt from the intensity of variation of corresponding different differences, thus obtain characterizing the state variable cushioning duration in this adjustment period internal buffer, because buffering duration can reflect the network bandwidth to a certain extent, therefore, with the change of the state variable characterizing network bandwidth of this buffering duration, namely the network bandwidth controlled quentity controlled variable that client is current is obtained.The simplest situation of one is, each difference is averaging, and obtains a mean value, thus characterizes the network bandwidth controlled quentity controlled variable in this adjustment period corresponding to client with this mean value.
The network bandwidth controlled quentity controlled variable that the multiple buffering durations obtained estimate to determine the current correspondence of client is detected when control device detects the moment according to difference, this network bandwidth controlled quentity controlled variable reflects the variation tendency of the network bandwidth, thus, control device is optional, can according to the corresponding relation of the quality level corresponding with heterogeneous networks bandwidth preset, or, optionally also can according to network bandwidth controlled quentity controlled variable during adjacent last time adjustment and current adopted quality level, the quality level of video code flow burst to be transmitted when determining that this adjusts.Such as, a upper network bandwidth controls value and is less than current network bandwidth control value, and even current network bandwidth is higher than a upper network bandwidth, then determine that the quality level of video code flow burst to be transmitted is a quality level higher than current quality level.
And then, control device sends the quality level adjustment request carrying the quality level of the video code flow burst to be transmitted that it is determined to server, to make server with the transmission code rate corresponding with this quality level to video code flow burst to be transmitted described in client transmissions.Owing to being previously stored with the video code flow burst of different quality level different transmission code rates corresponding respectively in video server, therefore, after the adjustment request receiving the quality level carrying video code flow burst to be transmitted, according to the corresponding relation of above-mentioned default quality level and transmission code rate, determine the transmission code rate corresponding with this quality level, and with this transmission code rate to client transmissions video code flow burst to be transmitted.
In the present embodiment, preset the sense cycle of the buffering duration detecting the video code flow burst cushioned in client buffer district with certain hour interval, thus each sense cycle detects the buffering duration of the video code flow burst cushioned in client buffer district.By obtaining in client buffer district the buffering duration that at least two are detected the video code flow burst that the moment detects, thus according to these at least two buffering durations and pre-set buffer duration desired value, determine the network bandwidth controlled quentity controlled variable that client is current, and then according to the quality level of follow-up video code flow burst to be transmitted in this network bandwidth controlled quentity controlled variable determination server, thus to server request with the transmission code rate corresponding with this quality level to client transmissions video code flow burst to be transmitted.By the buffering duration in client buffer district during the repeated detection difference detection moment, the network bandwidth situation of change obtaining client is estimated according to the multiple buffering durations detecting acquisition, and as according to the quality level determining subsequent video code stream burst, the time variation impact making the quality level determined effectively to avoid bandwidth to change, and can not cause adjusting quality level frequently, be conducive to ensureing video transmission quality.
Fig. 2 is the flow chart of video quality control method embodiment two of the present invention, and as shown in Figure 2, the method comprises:
In step 201, acquisition client buffer district, at least two are detected the buffering duration of the video code flow burst that the moment is detected;
Step 202, determine according to formula (1) network bandwidth controlled quentity controlled variable u (t) that described client is current;
Wherein, K
p, K
iand K
dweight coefficient respectively, t
1and t
2be respectively initial detection moment and cut-off detection moment, e (t) is t
2the buffering duration that the detection moment is corresponding and described pre-set buffer duration desired value B
rdifference.
Wherein three coefficients are determined according to the classical way (as Ziegler-Mike Nichols method) of control field, also can manually adjust.
In the present embodiment, when calculating current network bandwidth controlled quentity controlled variable u (t), have employed each buffering duration and pre-set buffer duration desired value B
rthe ratio of error, integration, differential the mode of weighted sum, thus had the feature considering the change of error current, historical record error, predicated error concurrently, make the result of calculation of current network bandwidth controlled quentity controlled variable u (t) more accurately can reflect the change of the network bandwidth.
Particularly, at t
1to t
2in each detection moment, obtain the value of buffering duration of the video code flow burst of buffering area buffering, then carry out additive operation with buffering duration desired value, draw error variance.Error variance is calculated as follows to the value of three parts:
One, proportional parts, i.e. Section 1 on the right side of the middle equal sign of formula (1).This part is exactly the margin of error itself, as the feedback to current network bandwidth and transmission code rate matching degree, and the continuous convergence desired value of buffering duration of the video code flow burst cushioned to drive buffering area.Wherein, the e (t) in this is t
2the buffering duration that the detection moment is corresponding and pre-set buffer duration desired value B
rdifference, wherein, t
1detect the time adjustment that the moment means the last time, this t
2if detecting the moment means from t
1detect the moment, to t
2the network bandwidth controlled quentity controlled variable that the multiple buffering durations detecting moment acquisition calculate according to formula (1), and then obtain expecting transmission code rate according to formula (2), if this expectation transmission code rate meets situation about being greater than in step 205, then t
2moment is the time adjustment needing the quality level adjusting follow-up video code flow burst to be transmitted.To be adjusted complete after, with this t
2detecting the moment is another initial detection moment, and repeated detection obtains multiple buffering duration again, and then repeats above-mentioned adjustment process successively.
Proportional parts=margin of error.
Its two, integral part, i.e. Section 2 on the right side of equal sign in formula (1).This part is the accumulation from the margin of error after last Mass adjust-ment namely after a upper time adjustment.Can reflect the average case of network bandwidth change in the nearly section time for a long time to the testing result of buffering duration, object reduces frequently to adjust quality level thus the possibility causing video playing quality to fluctuate.
Integral part=margin of error 1+ margin of error 2+ ... + margin of error n, (1 ... n is that in the current adjustment period, the different margin of error detecting the moment detects index).
Its three, differential part, i.e. Section 3 on the right side of equal sign in formula (1).This part is t
2detect the moment margin of error and t
2last detection the moment margin of error differential.Main application is the variation tendency of the prediction network bandwidth.
Differential part=(the error Bian Liang – in the detection moment that time adjustment is corresponding detected the error variance in moment adjacent last time)/detection time interval.
Step 203, determine the expectation transmission code rate R1 of described video code flow burst to be transmitted according to formula (2);
R1=[1-u(t)/B
r]×R0(2)
Wherein, R0 is current transmission code check.
Step 204, determine whether the difference of described expectation transmission code rate and current transmission code check is greater than predetermined threshold value, if be greater than, then perform step 205, otherwise, determine that the quality level of video code flow burst to be transmitted is identical with current Quality level;
The corresponding relation of the transmission code rate that step 205, basis are default and quality level, determines the quality level corresponding with described expectation transmission code rate;
Step 206, send quality level adjustment request to described server, described adjustment asks to comprise described quality level, to make described server with the transmission code rate corresponding with described quality level to video code flow burst to be transmitted described in described client transmissions.
Further, after obtaining current network bandwidth controlled quentity controlled variable according to formula (1), according to this network bandwidth controlled quentity controlled variable and current transmission code check, the adjustment needing to carry out video code flow burst quality level can be determined whether, and adjustment direction and dynamics.
Particularly, can Section 1 first in computing formula (2) on the right side of equal sign, namely calculate the variation tendency of transmission code rate according to current network bandwidth controlled quentity controlled variable, and then be multiplied by current transmission code check with this variation tendency, obtain above-mentioned expectation transmission code rate.And then determine whether the difference of this expectation transmission code rate and this current transmission code check is greater than predetermined threshold value, if be not more than, then illustrate that network bandwidth change is little, still with the follow-up video code flow burst to be transmitted of current transmission code check transmission, without the need to adjusting quality level, otherwise, if be greater than, then according to the transmission code rate preset consistent with server of this locality storage and the corresponding relation of quality level, determine the quality level corresponding with this expectation transmission code rate.In practical application, this expectation transmission code rate is not probably one in server in Preset Transfer code check, therefore determine in this locality that with the quality level corresponding to that transmission code rate that this expectation transmission code rate difference is minimum be the quality level corresponding with this expectation transmission code rate, thus the adjustment request of carrying the quality level corresponding with this expectation transmission code rate is sent to server, make server transmit video code flow burst waiting for transmission with that transmission code rate minimum with this expectation transmission code rate difference.
In the present embodiment, by the buffering duration in client buffer district during the repeated detection difference detection moment, by reducing the possibility of frequent adjustment to the integral operation of multiple buffering duration, and the buffering duration corresponding to time adjustment is differentiated and is predicted the change of the network bandwidth.Make can consider the historical information in client buffer district, current state and future trend to the calculating of network bandwidth change, and carry out the adjustment of quality level accordingly.Ensure that the optimization of video quality, can give user best viewing experience.
Fig. 3 is the structural representation of video quality control device embodiment one of the present invention, and as shown in Figure 3, this device comprises:
Acquisition module 11, for obtaining the buffering duration of the video code flow burst of at least two detection moment detections in client buffer district;
First determination module 12, for according to described at least two buffering durations and pre-set buffer duration desired value, determines the network bandwidth controlled quentity controlled variable that described client is current;
Second determination module 13, for the quality level according to video code flow burst to be transmitted in described network bandwidth controlled quentity controlled variable determination server;
Sending module 14, for sending quality level adjustment request to described server, described adjustment request comprises described quality level, to make described server with the transmission code rate corresponding with described quality level to video code flow burst to be transmitted described in described client transmissions.
The device of the present embodiment may be used for the technical scheme performing embodiment of the method shown in Fig. 1, and it realizes principle and technique effect is similar, repeats no more herein.
Fig. 4 is the structural representation of video quality control device embodiment two of the present invention, as shown in Figure 4, the device that the present embodiment provides on basis embodiment illustrated in fig. 3, described first determination module 12, specifically for:
Network bandwidth controlled quentity controlled variable u (t) that described client is current is determined according to formula (1):
Wherein, K
p, K
iand K
dweight coefficient respectively, t
1and t
2be respectively initial detection moment and cut-off detection moment, e (t) is t
2the buffering duration that the detection moment is corresponding and described pre-set buffer duration desired value B
rdifference.
Further, described second determination module 13, comprising:
First determining unit 131, for determining the expectation transmission code rate R1 of described video code flow burst to be transmitted according to formula (2):
R1=[1-u(t)/B
r]×R0(2)
Wherein, R0 is current transmission code check;
Second determining unit 132, for determining the quality level corresponding with described expectation transmission code rate.
Particularly, described second determining unit 132, specifically for: according to the transmission code rate preset and the corresponding relation of quality level, determine the quality level corresponding with described expectation transmission code rate.
Further, described first determining unit 131 also for: determine whether the difference of described expectation transmission code rate and described current transmission code check is greater than predetermined threshold value;
If be greater than predetermined threshold value, then described second determining unit 132 performs the step determining the quality level corresponding with described expectation transmission code rate.
The device of the present embodiment may be used for the technical scheme performing embodiment of the method shown in Fig. 2, and it realizes principle and technique effect is similar, repeats no more herein.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that program command is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.