Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments。Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of protection of the invention。
With reference to Fig. 1, in HS server-client system framework, content of multimedia is divided by HTTP streaming media server, obtain media content to describe, streaming medium content is transmitted by HTTPStreaming network, HTTP streaming media clients media play relief area is downloaded to, for media renderer plays from streaming media server。
Streaming media server is divided into multiple program time-interval a complete content of multimedia from reproduction time, and each program time-interval is responsible for the media content in the time period and is play;Media content to same program time-interval, HS server provides multiple program bursts that code check version is different, and each program burst has an independent URL。Leave the media content structure of HS server in, describe file by a media content based on XML and be described。Streaming media clients learns the structural information of media content by reading media content descriptor file。During media content as shown in Figure 2 describes, a complete media content is divided into N number of program time-interval, and i-th program time-interval is formed (i=1...N) by the program burst that M_i code check is different。One complete program comprises multiple program time-interval, and each program time-interval comprises multiple program bursts that the consistent code check of content is different。
Streaming media client, each program time-interval only needs the program burst selecting a code check suitable, and start a corresponding http traffic and realize media content transmission, the http traffic of each program time-interval joins end to end on media content reproduction time axle, constitutes the http traffic of a full media content。As shown in Figure 3, corresponding to figure 2 above, the end to end http traffic of N section joins end to end and constitutes a complete HTTP blended data stream, the transmission of i-th section of http traffic is the media content (i=1...N) of program time-interval i, and the program burst ∈ that program time-interval i is corresponding program burst (i, 1) ..., program burst (i, M_i) }。
With reference to Fig. 4, the streaming medium content on streaming media server is transmitted by HTTPStreaming network, downloads to streaming media clients media play relief area from streaming media server, for media renderer plays。For media play relief area, network transmission bandwidth B (t) characterizes the speed of data input, and B (t) fluctuates up and down as the TCP network bandwidth provided;Code check R (t) of media content characterizes data output rate, and under each program time-interval, the code check of specific program burst can assume that as invariable。If data volume was 0 (being called buffer underflow) in some moment media play relief area, occur as soon as broadcasting interruption, pending buffer phenomenon。How to be as shown in Figure 3 in N number of program time-interval select code check (i.e. data output rate in a program time-interval) suitable program burst so that streaming media clients media content is play without interruption, is a problem demanding prompt solution。
Reference Fig. 5, one embodiment of media file transmission method provided by the invention, including:
S501: during actual program slot media data loaded, the finish time according to media data network transmission history, actual program moment, start time of next program time-interval and next program time-interval, it is thus achieved that the limit bit rate of next program time-interval;
S502: the limit bit rate according to next program time-interval, selects a program burst of next program time-interval from media server;
S503: receive the program burst of selected next program time-interval。
The embodiment of the present invention, can be embodied in client, by the limit bit rate of next program time-interval is estimated, select to play the program burst that code check is suitable by limit bit rate, the disruption of media play process can be reduced, improve client user's Quality of experience。
Reference Fig. 6, another embodiment of media file transmission method provided by the invention, including:
S601: in media transmission process, records transmission bandwidth, obtains media data network transmission history;
In media transmission process, the transmitted data amount of the media that real time record current time had received in the past。
S602: during actual program slot media data loaded, N number of moment point is selected between start time and the finish time of next program time-interval, the data volume that prediction current time is downloaded from server within the time of i-th moment point, obtain the data volume of N number of prediction, wherein N is the integer be more than or equal to 1,1≤i≤N;
In one embodiment, it is thus achieved that the length before current time is in the continuous time that current time arrives i-th moment point, from the minimum data amount that server is downloaded, wherein i is the integer be more than or equal to N, as the data volume of i-th prediction。
Media play relief area to media client, network bandwidth B (t) (unit: bps) from media server to media client extreme direction inputs as the data of this relief area, broadcasting code check R (t) (unit: bps) of media content exports as the data of this relief area, in order to ensure that HS client media is play without interrupting carrying out, it is necessary to ensure that any time buffer area data volume in media play process is be more than or equal to 0。With reference to Fig. 7, assume that actual program broadcast point is in the T_c moment, it is in program time-interval _ i, and program time-interval _ i media content loaded (can ensure without interrupting playing to the T_s moment), next program time-interval _ (i+1) is in time period [T_s, T_e], the media average bit rate of next program time-interval _ (i+1) is expressed as R_ (i+1)。In order to make next program time-interval playing process occur without interruption, then disconnected time started and the end time [T_s when next program, T_e] in, the constant code rate R_ (i+1) of next program time-interval _ (i+1) of estimation, make at [T_s, T_e] in the time, buffer area data volume is be more than or equal to 0 any time t, wherein T_c < T_s < T_e。
Making in the time period [T_s, T_e], buffer area data volume be more than or equal to 0, must then is fulfilled for following Mathematical inequalities condition (being called " relief area is underflow condition not "):
Wherein,Representing that [T_c, T] is in the time period, network can download to the data volume of media client from media server, and R_ (i+1) * (T-T_s) represents [T_s, T] in the time period, media client media play relief area needs the data volume consumedRepresent [T_s, T_e] any time in the time period。
In above-mentioned " relief area is underflow condition not ", owing to there being infinite moment point between [T_s, T_e], realize in process actual, it is impossible to rightAll consider whether to meet above-mentioned Mathematical inequalities;Owing to T_c is current time point, and T is a moment point of following (generation), when the actual program moment, T_c carried out code rate selection, it is impossible to accurately know that [T_c, T] can download to the data volume of media client from media server in the time period
In order to realize, it is possible to above-mentioned two condition is carried out approximate processing:
1. N number of moment point is selected between start time and the finish time of next program time-interval, as long as meeting relief area not underflow condition at this N number of program times point extracted, namely think [T_s, T_e] in the time period any time be satisfied by relief area not underflow condition。
2. in following a period of time [T_c, T], it is possible to download to the data volume of media client from media serverBe predicted, with data volume predict the outcome P (T_c, T) substituteObtain " relief area is the underflow condition not " of following form:
In one embodiment, Pgmtime disconnected during by next program is divided into the time quantum that a series of length is U, in future time [T_s, T_e], extract N number of moment point discretely, the finish time that each moment point is a time quantum is corresponding, it is designated as T_1, T_2 ..., T_N, satisfies condition: T_c <=T_s < T_1 < T_2 < ... < T_e;And T_i-T_c=L_i*U, L_x are integer;According in history, length be L_i*U, in continuous time, minimum data amount record that client is successfully downloaded to from server, to following one, length be L_i*U, in continuous time, client can be predicted from the data volume P (T_c, T_i) that server downloads to;Wherein, T_i ∈ T_1, T_2 ... T_N}, L_i*U=T_i-T_c。In one embodiment, extract a discrete instants point every 1 time quantum U second。
In one embodiment, use array B [] record that following length is different, in continuous time, client can predicting the outcome from the data volume that server downloads to, namely B [i] represent to following one, length is i*U, data volume predictive value that in continuous time, client can download to from server。Using array A [] to record in each time quantum U, the data volume that client success downloads to from server, namely A [i] records the data volume downloading to media client in i-th time quantum from media server。Use variable cA and variable cB to record the greatest length of array A [] and array B [] respectively, start from media data transmission and start, perform following steps:
Step1 initializes cA=1, cB=1;
Step2, every a time quantum U, detects the newly-increased data volume Add of client terminal playing relief area,
If Add is equal to 0, empty array A [], reinitialize cA=1, wait the finish time of next time quantum U, re-execute step2;
If Add is not equal to 0, makes A [cA]=Add, and update array element B [1] according to following steps ... B [cA], to i=1 to i=cA, perform following steps:
If Step2.1 B [i] equal to 0, make B [i] value equal to A [cA]+A [cA-1]+...+A [cA-i+1], make cB=cB+1;
Step2.2 compare B [i] and A [cA]+A [cA-1]+...+A [cA-i+1], if B [i] > A [cA]+A [cA-1]+...+A [cA-i+1], make B [i] value equal to A [cA]+A [cA-1]+...+A [cA-i+1];Otherwise, B [i] value is maintained constant。
Renewal array B [] makes cA=cA+1 after terminating。
After obtaining two arrays, obtain data volume predictive value according to the following step:
Step1 calculates T_i-T_c=L_i*U, relatively L_i and cB, if L_i is > cB, make P (T_c, T_i) equal to infinity, and end step, not having length before representing current time is the transmission data that current time arrives i-th moment point, the data volume predictive value that according to array B [] information prediction P (T_c, T_i), then cannot make correspondence is infinity;Otherwise, Step2 is performed;
Step2 makes P (T_c, T_i) equal to B [L_i], end step。
S603: obtain the data volume of the prediction of i-th in the data volume of N number of prediction except the start time in next program time-interval is to the minima in the duration of i-th moment point, as the limit bit rate of next program time-interval。
According to P (T_c, T_1), P (T_c, T_2) that prediction obtains ..., P (T_c, T_N) value, calculate the limit bit rate R_ (i+1) of next program time-interval,
R_ (i+1)=min (P (T_c, T_1)/(T_1-T_s), P (T_c, T_2)/(T_2-T_s) ..., P (T_c, T_N)/(T_N-T_s));
Wherein, min represents computing of minimizing。
In one example implemented, time quantum U is set as 1 second, in the reproduction time of program time-interval _ (i+1), a discrete instants point T is extracted every 1 time quantum U=1 second, tentation data transmits 5 seconds, [T_c, T]=2 seconds, be equivalent to H=2 time quantum, so data volume P (T_c, T) it is then data transfer record={ A [the 1]+A [2] of 2 time quantums according to time span in set S, A [2]+A [3], A [3]+A [4], A [4]+A [5] } estimate to obtain, i.e. P (T_c, T)=min (A [1]+A [2], A [2]+A [3], A [3]+A [4], A [4]+A [5])。
S604: the limit bit rate according to next program time-interval, selects a program burst of next program time-interval from media server;
In one embodiment, in multiple program bursts that next program time-interval is corresponding from media server, select the media code rate by utilizing program burst less than limit bit rate。
In another embodiment, if in multiple program bursts that in media server, next program time-interval is corresponding, there is the media code rate by utilizing program burst less than or equal to described limit bit rate, then from less than the program burst selecting a media code rate by utilizing the program burst of described limit bit rate;If all program bursts that next program time-interval is corresponding both are greater than described limit bit rate, then select the media code rate by utilizing time program burst more than described limit bit rate。
If media server is next program segments is provided with the media code rate by utilizing program burst less than R_ (i+1), then selects the media code rate by utilizing time program burst less than R_ (i+1), and start media data loading;If media server is not provided with the media code rate by utilizing program burst less than R_ (i+1) for next program segments, then selects the media code rate by utilizing time program burst more than R_ (i+1), and start media data loading;
For, the 1st program time-interval _ 1st, owing to not having bandwidth history, it is impossible to adaptive polo placement limit bit rate R_1, R_1 value by HTTPStreaming ISP at server settings。
S605: receive the program burst of selected next program time-interval。
In the present embodiment, the data volume that the data volume downloaded in identical time span before current time according to historical storage is downloaded in the time span to next program time-interval is predicted, thus calculating the limit bit rate of next program time-interval, select to play the program burst that code check is suitable by limit bit rate, the disruption of media play process can be reduced, improve client user's Quality of experience。
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can be by the hardware that computer program carrys out instruction relevant to complete, described program can be stored in a computer read/write memory medium, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each side method。Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.。
Being associated with said method embodiment, the present invention also provides for a kind of media file transmitting device, and this device may be located in client。This media file transmitting device can be realized by hardware circuit, or hardware realizes with software。Such as, with reference to Fig. 8, a processor media file transmitting device is called to realize the assessment of video frequency data quality。This media file transmitting device can perform the various methods in said method embodiment and flow process。
With reference to Fig. 9, an embodiment of a kind of media file transmitting device provided by the invention, it can apply to the client of HTTP media transmission, including:
Limit bit rate obtains unit 901, for the finish time according to media data network transmission history, actual program moment, start time of next program time-interval and next program time-interval, it is thus achieved that the limit bit rate of next program time-interval;
Select unit 902, for the limit bit rate according to next program time-interval, from media server, select a program burst of next program time-interval;
Receive unit 903, for receiving the program burst of selected next program time-interval。
With reference to Figure 10, in an embodiment, limit bit rate obtains unit and includes:
Data volume predicting unit 1001, for selecting N number of moment point between start time and the finish time of next program time-interval, it was predicted that the data volume that current time is downloaded from server between i-th moment point, it is thus achieved that the data volume of N number of prediction, wherein N is the integer be more than or equal to 1,1≤i≤N;
Computing unit 1002, for obtaining the data volume of i-th prediction in the data volume of N number of prediction except the start time in next program time-interval is to the minima in the duration of i-th moment point, as the limit bit rate of next program time-interval。
With reference to Figure 11, in an embodiment, data volume predicting unit includes:
Data transmission history logging modle 1101, the transmitted data amount of the media for having received before recording current time;
Predicting unit 1102, is in the continuous time that current time arrives i-th moment point for obtaining length in data transmission history logging modle, and from the minimum data amount that server is downloaded, wherein i is the integer less than or equal to N。
In one embodiment, select unit specifically for:
If in multiple program bursts that in media server, next program time-interval is corresponding, having the media code rate by utilizing program burst less than or equal to described limit bit rate, then from less than the program burst selecting a media code rate by utilizing the program burst of described limit bit rate;If all program bursts that next program time-interval is corresponding both are greater than described limit bit rate, then select the media code rate by utilizing time program burst more than described limit bit rate。
Figure 12 a-b and Figure 13 a-b is the experiment effect figure adopting the present invention program。Figure 12 a starts each segment encode rate variation diagram that code check is 200Kbps;Figure 12 b starts each section of interruption frequency variation diagram that code check is 200Kbps。Figure 13 a represents each segment encode rate variation diagram that startup code check is 600Kbps;Figure 13 b represents each section of interruption frequency variation diagram that startup code check is 600Kbps。
Experiment one: server end is to client link: it is 100ms that bandwidth 2Mbps, RTT take minima, and meansigma methods is 100ms, and standard variance is the normal distribution of 10ms, and link packet drop rate is 0.5%;Server transport layer uses TCPCubic algorithm。Client is to server end link: it is 100ms that bandwidth 2Mbps, RTT take minima, and meansigma methods is 100ms, and standard variance is the normal distribution of 10ms, and link packet drop rate is 0.5%;Media server is provided with the media content of 7 program time-intervals。Each program time-interval reproduction time is 2 minutes。Each program time-interval is respectively provided with the program burst of 9 versions that code check is 200Kbps, 300Kbps, 400Kbps, 500Kbps, 600Kbps, 700Kbps, 800Kbps, 900Kbps and 1000Kbps。The program burst that the 1st section program time-interval of client selects code check to be 200Kbps, 7 program time-intervals use the HS above-mentioned specific embodiment of media transmission bit rate control method to carry out code check and select program burst adaptively thereafter。In test process, record the code check of each program time-interval and the change procedure of interruption frequency。Wherein, the reproduction time that the interruption times/program time-interval in interruption frequency=program time-interval playing process is corresponding。
Testing 1 effect such as shown in Figure 12 a, b, in figure, Rate Control represents the method that the embodiment of the present invention adopts, wherein time quantum U=1 second;In the reproduction time of program time-interval _ (i+1), extract a discrete instants point T every 1 time quantum U=1 second;The curve putting on rhombus represents the effect of the inventive method。As we can see from the figure, the method adopting the embodiment of the present invention, the code check of each program time-interval can from relatively low version according to network bandwidth conditions, it is adaptively adjusted higher-version, while improving media code rate by utilizing, and each program time-interval broadcasting interruption frequency is controlled to close to 0, compared to the HS media play not carrying out Rate Control, with existing algorithm, be provided that the output of bigger code check, bigger code check output means better user experience quality。
Experiment two: server end is to client link: it is 100ms that bandwidth 2Mbps, RTT take minima, and meansigma methods is 100ms, and standard variance is the normal distribution of 100ms, and link packet drop rate is 0.1%;Server transport layer uses TCPCubic algorithm。Client is to server end link: it is 100ms that bandwidth 2Mbps, RTT take minima, and meansigma methods is 100ms, and standard variance is the normal distribution of 100ms, and link packet drop rate is 0.1%;
Media server is provided with the media content of 7 program time-intervals。Each program time-interval reproduction time is 2 minutes。Each program time-interval is respectively provided with the program burst of 9 versions that code check is 200Kbps, 300Kbps, 400Kbps, 500Kbps, 600Kbps, 700Kbps, 800Kbps, 900Kbps and 1000Kbps。The program burst that the 1st section program time-interval of client selects code check to be 600Kbps, 7 program time-intervals use the HS above-mentioned specific embodiment of media transmission bit rate control method to carry out code check and select program burst adaptively thereafter。In test process, we record the change procedure of the code check of each program time-interval and interruption frequency。Wherein, the reproduction time that the interruption times/program time-interval in interruption frequency=program time-interval playing process is corresponding。
Testing 2 effects such as shown in Figure 13 a, b, in figure, Rate Control represents the method that the embodiment of the present invention adopts, wherein time quantum U=1 second;In the reproduction time of program time-interval _ (i+1), extract a discrete instants point T every 1 time quantum U=1 second;The curve putting on rhombus represents the effect of the inventive method。As we can see from the figure, the method adopting the embodiment of the present invention, the code check of each program time-interval from higher version according to network bandwidth conditions, can be adaptively adjusted relatively lowest version, each program time-interval is play interruption frequency control to close to 0 so that media can smooth playing。Compared to the HS media play not carrying out Rate Control, our bit rate control method improves broadcasting fluency;Compared to existing third party's algorithm, while our bit rate control method ensures to play fluency again, still ensure that bigger code check output, it is ensured that user experience quality preferably。
The foregoing is only several embodiments of the present invention, the present invention can be carried out various change or modification without deviating from the spirit and scope of the present invention according to disclosed in application documents by those skilled in the art。