CN105306968A - Media stream live broadcast method, server and system - Google Patents

Media stream live broadcast method, server and system Download PDF

Info

Publication number
CN105306968A
CN105306968A CN201410252079.7A CN201410252079A CN105306968A CN 105306968 A CN105306968 A CN 105306968A CN 201410252079 A CN201410252079 A CN 201410252079A CN 105306968 A CN105306968 A CN 105306968A
Authority
CN
China
Prior art keywords
code check
bit rate
actual bit
theoretical
average actual
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.)
Granted
Application number
CN201410252079.7A
Other languages
Chinese (zh)
Other versions
CN105306968B (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.)
China Mobile Group Inner Mongolia Co Ltd
Original Assignee
China Mobile Group Inner Mongolia 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 China Mobile Group Inner Mongolia Co Ltd filed Critical China Mobile Group Inner Mongolia Co Ltd
Priority to CN201410252079.7A priority Critical patent/CN105306968B/en
Publication of CN105306968A publication Critical patent/CN105306968A/en
Application granted granted Critical
Publication of CN105306968B publication Critical patent/CN105306968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the invention provide a media stream live broadcast method, a server and a system. The method comprises the following steps: monitoring and recording an actual code rate of media stream; when determining a cache occupation state is proper cache occupation, predicating a predicted code rate according to the actual code rate; and slicing the media stream by use of the predicted code rate to generate a transmission media stream TS file.

Description

A kind of method of live media stream, service end and system
Technical field
The present invention relates to field of multimedia communication, particularly relate to a kind of method, service end and the system of transmitting data.
Background technology
Present inventor, in the process realizing the embodiment of the present application technical scheme, at least finds to there is following technical problem in correlation technique:
In existing network, most of video live broadcast service of mobile Internet is that the maximum feature of HLS supports dynamic code rate based on HTTP real time flow medium (HLS, HTTPLivingStream) protocol realization.And just have the implementation procedure of the video live broadcast service of HLS protocol as follows:
Video media stream is sliced into multiple different version for different code checks by video server, such as the version of 350K, 700K, 1.5M, and generates slice information;
Property file, i.e. profile file is generated according to the slice information generated;
When video starts, client loads and resolves profile file, obtains current slice information;
First client loads the flow of first media from the version of the lowest bit rate 350K slice information, and because the code check of first media flow is low, data volume is little, and the buffer time of screen is short;
After video playback is stable, client detects current network conditions automatically, when testing result be network condition fine time, then select the media flow of high code check version, thus be slowly transitioned into the highest code check; In like manner, testing result be network condition not good time, be slowly transitioned into low bit-rate.
In the playing process of the video live broadcast service realized by said method, the video of broadcasting is more smooth, but there is clear unsharp problem for a moment for a moment, thus, be badly in need of a kind of scheme of live media stream, screen can either be play smoothly, the definition of video pictures can be ensured again.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method of live media stream, service end and system, can either displaying video smoothly, can ensure again the definition of video pictures.
For achieving the above object, the technical scheme of the embodiment of the present invention is achieved in that
The embodiment of the present invention provides a kind of method of live media stream, and described method comprises: monitor and the actual bit rate of recording medium stream; When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate; Utilize described prediction code check to carry out section to Media Stream and generate media stream TS file.
In such scheme, described method also comprises: receive the buffer area occupancy δ that client sends, arrange first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, described buffer memory seizure condition is set to described buffer memory and takies moderate; Wherein, described first threshold δ 1be less than described Second Threshold δ 2.
In such scheme, described method also comprises: as δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low; Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
In such scheme, obtain prediction code check according to described actual bit rate prediction and comprise: be the average actual bit rate of computation of Period with T by described actual bit rate, the average actual bit rate y in the n-th cycle is designated as y n; Calculate the standard deviation S of the average actual bit rate in n cycle n; According to described average actual bit rate and described standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit; Determine between described theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval; According to described average actual bit rate and described theoretical code check interval, recent code check dependent coefficient is set; According to described average actual bit rate and described theoretical code check interval, discrete indicator coefficient is set; Described prediction code check is calculated according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate.
In such scheme, recent code check dependent coefficient is set according to described actual bit rate and described theoretical code check interval and comprises: choose three continuous print cycles; When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.05 ~ 0.2; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.2 ~ 0.4; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.4 ~ 0.5.
In such scheme, recent code check dependent coefficient is set according to described actual bit rate and described theoretical code check interval and comprises: choose three continuous print cycles; When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.15; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.35; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.5.
In such scheme, describedly discrete indicator coefficient is set according to described actual bit rate comprises: when the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient is 0.05 ~ 0.2; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.2 ~ 0.35; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.35 ~ 0.45.
In such scheme, describedly discrete indicator coefficient is set according to described actual bit rate comprises: when the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient is 0.15; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and time outside the described theoretical code check interval of part, described discrete indicator coefficient is 0.35; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.45.
In such scheme, describedly calculate described prediction code check according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate be: according to f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Calculate the prediction code check f in (n+1)th cycle n+1; Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nit is the prediction code check in the n-th cycle.
The embodiment of the present invention also provides a kind of service end of live media stream, and described service end comprises: monitoring unit, predicting unit, section unit; Wherein, described monitoring unit, for monitoring and the actual bit rate of recording medium stream; Described predicting unit, for when determine buffer memory seizure condition be buffer memory take moderate, carry out predicting the prediction of code check according to described actual bit rate; Described section unit, carries out section for utilizing described prediction code check to Media Stream and generates media stream TS file.
In such scheme, described service end also comprises judging unit, for receiving the buffer area occupancy δ that client sends, arranges first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, described buffer memory seizure condition is set to described buffer memory and takies moderate; Wherein, described first threshold δ 1be less than described Second Threshold δ 2.
In such scheme, described judging unit, also for: as δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low; Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
In such scheme, described predicting unit comprises: preparation module, and first arranges module, second arranges module, computing module; Wherein, described preparation module, for being the average actual bit rate of computation of Period with T by described actual bit rate, is designated as y by the average actual bit rate y in the n-th cycle n; Calculate the standard deviation S of the average actual bit rate in n cycle n; According to described average actual bit rate and described standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit; Determine between described theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval; Described first arranges module, for arranging recent code check dependent coefficient according to described average actual bit rate and described theoretical code check interval; Second arranges module, for arranging discrete indicator coefficient according to described average actual bit rate and described theoretical code check interval; Described computing module, for calculating described prediction code check according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate.
In such scheme, described first arranges module, specifically for: choose three continuous print cycles; When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, the described recent code check dependent coefficient in the n-th cycle is 0.05 ~ 0.2; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, the described recent code check dependent coefficient in the n-th cycle is 0.2 ~ 0.4; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, the described recent code check dependent coefficient in the n-th cycle is 0.4 ~ 0.5.
In such scheme, described second arranges module, specifically for when the average actual bit rate in described three cycles is positioned at described theoretical code check interval, and described discrete indicator coefficient value 0.05 ~ 0.2; Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, time outside the described theoretical code check interval of part, and described discrete indicator coefficient value 0.2 ~ 0.35; When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient value 0.35 ~ 0.45.
In such scheme, described computing module, specifically for basis f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Calculate the prediction code check f in (n+1)th cycle n+1; Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nit is the prediction code check in the n-th cycle.
The embodiment of the present invention also provides a kind of system of live broadcast stream media, and described system comprises: the service end described in such scheme, client; Wherein, described service end, monitors and the actual bit rate of recording medium stream; When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate; Utilize described prediction code check to carry out section to Media Stream and generate media stream TS file; Described client, for downloading described TS file and playing described TS file.
Embodiments provide a kind of method of live media stream, monitor and the actual bit rate of recording medium stream; When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate; Utilize described prediction code check to carry out section to Media Stream and generate media stream (TS, TransportStream) file; Thus, make service end can mate current network code check thus avoid the problem that video card pauses and the network bandwidth is wasted caused due to code check coupling inaccuracy, and the method amount of calculation of inventive embodiments is little, easy easy realization.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the method for embodiment of the present invention live media stream file;
Fig. 2 is the schematic flow sheet of the method for the live media stream file of the present invention one embody rule example;
Fig. 3 is the structural representation of the service end of embodiment of the present invention live media stream file;
Fig. 4 is the structural representation of predicting unit;
Fig. 5 is the structural representation of the system of embodiment of the present invention live media stream file.
Embodiment
In embodiments of the present invention, the actual bit rate of also recording medium stream is monitored; When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate; Utilize described prediction code check to carry out section to Media Stream and generate TS file.
Below by drawings and the specific embodiments, the present invention is described in further detail again.
As shown in Figure 1, the method for live media stream that the embodiment of the present invention provides comprises following step:
Step 101, monitors and the actual bit rate of recording medium stream;
Step 102, when determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate;
Step 103, utilizes described prediction code check to carry out section to Media Stream and generates TS file.
In a step 101, service end when carrying out data interaction with client, the actual bit rate of real-time monitoring media stream, and monitored actual bit rate record is stored.
In a step 102, carry out the prediction of prediction code check according to described actual bit rate before, service end receives the buffer area occupancy δ that client sends, and arranges first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, buffer memory seizure condition is set to buffer memory and takies moderate; Wherein, first threshold δ 1be less than described Second Threshold δ 2.Now, to be that buffer memory takies moderate for buffer memory seizure condition; As δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low; Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
When determine buffer memory seizure condition be buffer memory low time, cut into slices according to the highest code check, generate TS file; When determining that buffer memory seizure condition is buffer memory height, cutting into slices according to lowest bit rate, generating TS file.
When determine buffer memory seizure condition be buffer memory moderate time, actual bit rate step 101 recorded take T as the average actual bit rate of computation of Period every T time section, and the average actual bit rate in the n-th cycle is designated as y n; Calculate the standard deviation S of the average actual bit rate in n cycle n; According to average actual bit rate and standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit; Determine between theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval; After determining theoretical code check interval, recent code check dependent coefficient is set according to average actual bit rate and theoretical code check interval; According to average actual bit rate and theoretical code check interval, discrete indicator coefficient is set; According to recent code check dependent coefficient, discrete indicator coefficient, average actual bit rate computational prediction code check.
When determining the value of recent code check dependent coefficient, different according to the relation in actual bit rate and theoretical code check region, the value of recent code check dependent coefficient is different, concrete:
Choose three continuous print cycles;
When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.2 ~ 0.4;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.4 ~ 0.5.
When carrying out the choosing of recent code check dependent coefficient, also a fixed value can be chosen, concrete:
Choose three continuous print cycles;
When the average actual bit rate in these three cycles is all positioned at theoretical code check interval, recent code check dependent coefficient is 0.15; Average actual bit rate part when these three cycles is positioned at theoretical code check interval, and when part is positioned at outside described theoretical code check interval, recent code check dependent coefficient is 0.35; When the average actual bit rate in these three cycles is positioned at outside theoretical code check interval, recent code check dependent coefficient is 0.5.
When determining the value of discrete indicator coefficient, discrete indicator coefficient and recent code check dependent coefficient have certain positive correlation, different from the relation in theoretical code check region according to actual bit rate, and the value of discrete indicator coefficient is also different, concrete:
When the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.2 ~ 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.35 ~ 0.45.
When carrying out the choosing of nearly discrete indicator coefficient, also a fixed value can be chosen, concrete:
When the average actual bit rate in these three cycles is positioned at theoretical code check interval, discrete indicator coefficient is 0.15; Average actual bit rate part when these three cycles is positioned at theoretical code check interval, and when part is positioned at outside described theoretical code check interval, discrete indicator coefficient is 0.35; When average every actual bit rate in these three cycles is positioned at outside theoretical code check interval, discrete indicator coefficient is 0.45.
After determining recent code check dependent coefficient, discrete indicator coefficient, according to f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Calculate the prediction code check f in (n+1)th cycle n+1;
Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nit is the prediction code check in the n-th cycle.
Here, three selected continuous print cycles are choose according to the rule preset, wherein, rule can be according to the live situation of Media Stream empirically data obtain.
It should be noted that, in the process of live media stream, for the calculating of prediction code check, only need carry out a value to recent code check dependent coefficient and off-line index coefficient, determined recent code check dependent coefficient and off-line index coefficient are fixed value, in practice, fixing recent code check dependent coefficient and discrete indicator coefficient can reduce the algorithm difficulty predicting code check, and reduce amount of calculation.
More relative to prior art sample requested number, the feature of computational process complexity, the amount of calculation of the prediction code check of the embodiment of the present invention is little, easy easy realization.Meanwhile, in the computational process of prediction code check, computational methods have controllability, and parameter can independently be arranged, thus consider that the feature that existing network data transmits makes the result accuracy of prediction high.
In step 103, after service end generates TS file according to prediction code check, client downloads to be gone forward side by side row cache, broadcasting according to the TS file that prediction code check generates.
Fig. 2 is the schematic flow sheet of the method for the live media stream file of the present invention one embody rule example, as shown in Figure 2, comprises the following steps:
Step 201, receives the buffer area occupancy δ that client sends, and monitors and the actual bit rate of recording medium stream;
Here, service end receives the buffer area occupancy δ of the instruction client current cache district service condition that client sends, to know the buffer memory service condition of the buffer area of active client, the actual bit rate of the Media Stream of simultaneous real-time monitoring also between record with client; Wherein, δ ∈ [0,1], the actual bit rate of i-th second of record is x i.
Step 202, determines buffer occupancy state according to buffer area occupancy δ;
Here, service end is provided with first threshold δ 1with Second Threshold δ 2, by the buffer area occupancy δ of reception and first threshold δ 1, Second Threshold δ 2compare, determine the buffer memory service condition of the buffer area of active client; Here, δ 1, δ 2∈ [0,1] and δ 1< δ 2, first threshold δ 1can 20% be set to, Second Threshold δ 2can be set to 80%, also can select other numerical value according to actual conditions, the embodiment of the present invention does not limit this.
As δ < δ 1time, show that the buffer occupancy of client is low, buffer memory seizure condition mark is set to buffer memory and takies low mark, then buffer memory seizure condition is low;
Work as δ 1≤ δ≤δ 2time, buffer memory takies moderate, and buffer memory seizure condition mark is set to buffer memory and takies moderate mark, then buffer memory seizure condition is moderate;
Work as δ 2during < δ, buffer occupancy is high, and buffer memory seizure condition mark is set to buffer memory and takies high mark, then buffer memory seizure condition is high.
Step 203, judges that buffer memory seizure condition identifies;
Take low mark when buffer memory seizure condition is designated buffer memory, perform step 203a;
Take moderate mark when buffer memory seizure condition is designated buffer memory, perform step 203b;
Take high mark when buffer memory seizure condition is designated buffer memory, perform step 203c.
Step 203a, cuts into slices according to the highest code check, generates TS file;
Now, service end is directly cut into slices according to the highest code check, generates the highest code check TS file, and to improve buffer area occupancy as far as possible, guarantee that video playback is smooth, here, the highest code check can be 1.5M.
Step 203b, according to actual bit rate prediction prediction code check, cuts into slices according to prediction code check, generates TS file;
Concrete, comprise following two steps according to actual bit rate prediction prediction code check:
Step a, take T as the average actual bit rate in computation of Period each cycle, the average actual bit rate y in the n-th cycle is designated as y n; The value of T can choose the arbitrary value in 5s-30s according to actual conditions.Here, take T as 5s be example, to y ncalculating be described.
The average actual bit rate y of one-period 1for y 1=(x 1+ x 2+ x 3+ x 4+ x 5)/5;
The average actual bit rate y of second period 2for y 2=(x 6+ x 7+ x 8+ x 9+ x 10)/5;
In like manner, the average actual bit rate y in the n-th cycle nfor y n=(x nT-4+ x nT-3+ x nT-2+ x nT-1+ x nT)/5.
The standard deviation S of the average actual bit rate in the n-th cycle is calculated according to the average actual bit rate in a front n cycle n, so that the discrete case of actual bit rate to be described.
Here, S n = 1 n [ ( y 1 - y &OverBar; 1 ) 2 + ( y 2 - y &OverBar; 2 ) 2 + &CenterDot; &CenterDot; &CenterDot; + ( y n - y &OverBar; n ) 2 ]
Wherein, represent the mean value of the actual bit rate in n cycle,
Here, the standard deviation defining the 1st cycle in cycle to the n-th average actual bit rate is respectively S 1, S 2..., S n.
Step b, basis f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Obtain f n+1;
Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nbe the prediction code check in the n-th cycle, here, α, beta, gamma ∈ [0,1] and alpha+beta+γ=1; The prediction code check in the 1st cycle in cycle to the n-th is respectively f 1, f 2..., f n.
In stepb, the prediction code check f in next cycle n+1can by the average actual bit rate y of current period n, the average actual bit rate of current period standard deviation S nwith current period prediction code check f nlinear combination represent, in, α represents that the prediction code check in (n+1)th cycle is to the degree of dependence of recent actual bit rate.α is larger, and prediction code check more depends on recent actual bit rate; β represents the discrete indicator in (n+1)th cycle, when actual bit rate fluctuate large randomness strong time, β gets higher value; γ represents that the n-th period forecasting code check is on the impact of (n+1)th period forecasting code check, and here, γ is determined by α, β, γ=1-alpha-beta.
In actual applications, α, β, the γ in each cycle adopt following methods to arrange.
Before arranging α, β, γ, according to the S in step (1) ncalculate theoretical limit bit rate and theoretical code check lower limit, theoretical code check to be reached the standard grade and to be defined as theoretical code check interval region between theoretical code check lower limit; Wherein, when arranging α, β, the γ in the n-th cycle, can by the S of one of the average plus thirty of actual bit rate in 10 cycles before the n-th cycle nas theoretical limit bit rate, the S one of the average of actual bit rate in 10 cycles in the n-th cycle to be minused thirty nas theoretical code check lower limit.Here, determining to prescribe a time limit under theoretical limit bit rate and theoretical code check, the average of actual bit rate have selected front 10 cycles in the n-th cycle, S nweight selected in actual applications, the average of the actual bit rate of front 5 cycles to front 20 cycles in selectable n-th cycle during the average of actual bit rate is calculated; S nweights can select arbitrary value in 2.
The method to set up of α is as follows:
Three cycles of continuous print are chosen according to the live situation of Media Stream:
When the average actual bit rate in three cycles chosen is positioned at described theoretical code check interval, the actual bit rate in the n-th cycle is stable level trend, is namely positioned at the stage of stable development, and α is 0.15;
Average actual bit rate part when three cycles chosen is positioned at theoretical code check interval, when part is positioned at outside theoretical code check interval, that is, the average actual bit rate of part is within theoretical code check interval, the average actual bit rate of part is beyond theoretical code check interval, namely the actual bit rate in the n-th cycle is positioned at the fluctuation phase, and α is 0.35;
When the average actual bit rate in three cycles chosen is positioned at outside theoretical code check interval, the actual bit rate in the n-th cycle has significantly rising or downward trend, and be namely positioned at rising stage or decrement phase, α is 0.5.
The method to set up of β is as follows:
When the average actual bit rate in three cycles chosen is positioned at described theoretical code check interval, the actual bit rate in the n-th cycle is stable level trend, is namely positioned at the stage of stable development, and now, β is 0.15;
Average actual bit rate part when three cycles chosen is positioned at theoretical code check interval, when part is positioned at outside theoretical code check interval, that is, the average actual bit rate of part is within theoretical code check interval, the average actual bit rate of part is beyond theoretical code check interval, namely the actual bit rate in the n-th cycle is positioned at the fluctuation phase, and β is 0.35;
When the average actual bit rate in three cycles chosen is positioned at outside theoretical code check interval, the actual bit rate in the n-th cycle has significantly rising or downward trend, and be namely positioned at rising stage or decrement phase, β is 0.45.
γ determines to have γ=1-alpha-beta by α, β.
It should be noted that, according to f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Have:
&gamma; n + 1 = f n + 1 f n - y n &alpha; + 1 2 S n &beta; f n
Work as α, time β value is less, γ value increases, and the sequence of average actual bit rate is stable level trend, and the value of actual bit rate is shaken up and down in certain amplitude, revises like this with regard to needs to predicting the outcome.Here, be then that the prediction code check of next cycle is to the correction of upper one-period prediction code check.
Work as α, time β value is large, γ levels off to 0, and the sequence of average actual bit rate has significantly rising or downward trend, illustrate that the prediction code check of next cycle and recent code check and fluctuating range have comparatively Important Relations, without the need to revising.
Obtaining the prediction code check f in (n+1)th cycle n+1after, according to f n+1cut into slices, generation code check is f n+1tS file, the code check of the network that exact matching is current.
Step 203c, cuts into slices according to lowest bit rate, generates TS file;
Now, service end is directly cut into slices according to lowest bit rate, generates lowest bit rate TS file, to reduce buffer area occupancy as far as possible, ensures video playback image quality; Here, lowest bit rate can be 350K.
Step 204, sends TS file.
Here, the TS file generated in step 203a, 203b, 203c is sent to client, the TS file of download is carried out buffer memory and plays by client, thus can either displaying video smoothly, can ensure again the definition of video pictures.
It should be noted that: in step 203b,
According to f n + 1 = y n &alpha; + 1 2 S n &beta; + f n &gamma; Have:
f n + 1 = y n &alpha; + 1 2 S n &beta; + ( y n - 1 &alpha; + 1 2 S n - 1 &beta; + f n - 1 &gamma; ) &gamma; ;
f n + 1 = &alpha; ( y n + y n - 1 &gamma; ) + 1 2 &beta; ( S n + S n - 1 &gamma; ) + f n - 1 &gamma; 2 ;
f n + 1 = &alpha; ( y n + t n - 1 &gamma; + &CenterDot; &CenterDot; &CenterDot; + y 1 &gamma; n ) + 1 2 &beta; ( S n + S n - 1 &gamma; + &CenterDot; &CenterDot; &CenterDot; + S 1 &gamma; n ) + f 1 r n ;
Due to S nfor the square root of the arithmetic average of the difference square of each average actual bit rate and its average in the cycle of statistics, so work as y n>y n-1time, S nfor on the occasion of; Work as y n<y n-1time, S nfor negative value.It can thus be appreciated that the (n+1)th phase actual bit rate predicted value equals the weighted sum of front n phase average actual bit rate, the weighted sum of the standard deviation of front n phase actual bit rate, initial value (leveling off to 0) comprehensive.The flexible strategy of average actual bit rate and standard deviation draw near and are respectively α, α γ ... α γ nand β, β γ ... β γ n.These two flexible strategy, by geometric progression decay, meet recent flexible strategy large, the requirement that flexible strategy at a specified future date are little.Here, f 1be a predicted value in the 1st cycle, that is, they can not be tried to achieve with formula, can only be estimated.Generally, f 1be the mean value of actual bit rate value in 0 or nearest 3 cycles.
In actual applications, service end is video server, mutual employing HTML (Hypertext Markup Language) (HTTP, the HyperTextTransportProtocol) data interaction between service end and client; When client and service end carry out data interaction by HTTP data, extended field is increased in HTTP data, utilize this extended field to the buffer occupancy sending the current buffer area of service end, thus service end can simultaneously according to buffer state and network condition dynamic adaptation code check.
It should be noted that, the starting stage of live media stream, service end is cut into slices with lowest bit rate, and client is downloaded and buffer memory first TS file with lowest bit rate, to shorten buffer time as far as possible.
For realizing said method, the embodiment of the present invention provides a kind of server of live media stream.As shown in Figure 3, service end 30 comprises: monitoring unit 301, predicting unit 302, section unit 303; Wherein,
Monitoring unit 301, for monitoring and the actual bit rate of recording medium stream;
Predicting unit 302, for when determine buffer memory seizure condition be buffer memory take moderate, carry out predicting the prediction of code check according to described actual bit rate;
As shown in Figure 4, predicting unit 302 comprises: preparation module 3021, and first arranges module 3022, second arranges module 3023, computing module 3024; Wherein,
The average actual bit rate y in the n-th cycle, for being the average actual bit rate of computation of Period with T by described actual bit rate, is designated as y by preparation module 3021 n; Calculate the standard deviation S of the average actual bit rate in n cycle n; According to described average actual bit rate and described standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit; Determine between described theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval;
First arranges module 3022, for arranging recent code check dependent coefficient according to described average actual bit rate and described theoretical code check interval;
Concrete, for choosing three continuous print cycles;
When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.2 ~ 0.4;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.4 ~ 0.5.
Second arranges module 3023, for arranging discrete indicator coefficient according to described average actual bit rate and described theoretical code check interval;
Concrete, for when the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient value 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, when part is positioned at outside described theoretical code check interval, and described discrete indicator coefficient value 0.2 ~ 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient value 0.35 ~ 0.45.
Computing module 3024, for calculating described prediction code check according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate;
Concrete, for basis calculate the prediction code check fn+1 in (n+1)th cycle;
Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of all average actual bit rate in n cycle; Fn is the prediction code check in the n-th cycle.
Section unit 303, carries out section for utilizing described prediction code check to Media Stream and generates media stream TS file.
As shown in Figure 3, service end 30 also comprises: judging unit 304, for territory, reception buffer zone occupancy δ, arranges first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, described buffer memory seizure condition is set to buffer memory and takies moderate; Wherein, described first threshold is less than described Second Threshold.
Judging unit 304, also for working as δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low; Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
As shown in Figure 5, the embodiment of the present invention also provides a kind of system of live media stream, and this system comprises the service end 30 shown in Fig. 4, client 40; Wherein,
Service end 30, for monitoring and the actual bit rate of recording medium stream; When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate; Utilize described prediction code check to carry out section to Media Stream and generate media stream TS file;
Client 40, for downloading described TS file and playing described TS file.
In actual applications, device provided by the invention or system and device can be used as an independent system, can also be as increased the logical block of difference in functionality in personal computer (PC, PersonalComputer) in existing terminal.
When increasing logical block in PC, service end 30 and monitoring unit 301 thereof, predicting unit 302, section unit 303, judging unit 304 and client 40 can by the central processing unit (CPU being arranged in PC, CentralProcessingUnit), digital signal processor (DSP, DigitalSignalProcessor) or programmable gate array (FPGA, FieldProgrammableGateArray) realize.
The above, be only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.

Claims (17)

1. a method for live media stream, is characterized in that, described method comprises:
Monitor and the actual bit rate of recording medium stream;
When determine buffer memory seizure condition be buffer memory take moderate time, carry out predicting the prediction of code check according to described actual bit rate;
Utilize described prediction code check to carry out section to Media Stream and generate media stream TS file.
2. method according to claim 1, is characterized in that, described method also comprises: receive the buffer area occupancy δ that client sends, arrange first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, described buffer memory seizure condition is set to described buffer memory and takies moderate;
Wherein, described first threshold δ 1be less than described Second Threshold δ 2.
3. method according to claim 2, is characterized in that, described method also comprises:
As δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low;
Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
4. method according to claim 1, is characterized in that, obtains prediction code check comprise according to described actual bit rate prediction:
Be the average actual bit rate of computation of Period with T by described actual bit rate, the average actual bit rate y in the n-th cycle is designated as y n;
Calculate the standard deviation S of the average actual bit rate in n cycle n;
According to described average actual bit rate and described standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit;
Determine between described theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval;
According to described average actual bit rate and described theoretical code check interval, recent code check dependent coefficient is set;
According to described average actual bit rate and described theoretical code check interval, discrete indicator coefficient is set;
Described prediction code check is calculated according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate.
5. method according to claim 4, is characterized in that, arranges recent code check dependent coefficient comprise according to described actual bit rate and described theoretical code check interval:
Choose three continuous print cycles;
When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.2 ~ 0.4;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.4 ~ 0.5.
6. method according to claim 4, is characterized in that, arranges recent code check dependent coefficient comprise according to described actual bit rate and described theoretical code check interval:
Choose three continuous print cycles;
When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, described recent code check dependent coefficient is 0.15;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described recent code check dependent coefficient is 0.5.
7. the method according to claim 5 or 6, is characterized in that, describedly arranges discrete indicator coefficient according to described actual bit rate and comprises:
When the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.2 ~ 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.35 ~ 0.45.
8. the method according to claim 5 or 6, is characterized in that, describedly arranges discrete indicator coefficient according to described actual bit rate and comprises:
When the average actual bit rate in described three cycles is positioned at described theoretical code check interval, described discrete indicator coefficient is 0.15;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and when part is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient is 0.45.
9. method according to claim 4, is characterized in that, describedly calculates described prediction code check according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate is:
According to calculate the prediction code check f in (n+1)th cycle n+1;
Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nit is the prediction code check in the n-th cycle.
10. a service end for live media stream, is characterized in that, described service end comprises: monitoring unit, predicting unit, section unit; Wherein,
Described monitoring unit, for monitoring and the actual bit rate of recording medium stream;
Described predicting unit, for when determine buffer memory seizure condition be buffer memory take moderate, carry out predicting the prediction of code check according to described actual bit rate;
Described section unit, carries out section for utilizing described prediction code check to Media Stream and generates media stream TS file.
11. service ends according to claim 10, is characterized in that, described service end also comprises judging unit, for receiving the buffer area occupancy δ that client sends, arrange first threshold δ 1, Second Threshold δ 2, work as δ 1≤ δ≤δ 2time, described buffer memory seizure condition is set to described buffer memory and takies moderate;
Wherein, described first threshold δ 1be less than described Second Threshold δ 2.
12. service ends according to claim 11, is characterized in that, described judging unit, also for:
As δ < δ 1time, described buffer memory seizure condition is set to buffer memory and takies low;
Work as δ 2during < δ, described buffer memory seizure condition is set to buffer memory and takies height.
13. service ends according to claim 10, is characterized in that, described predicting unit comprises: preparation module, and first arranges module, second arranges module, computing module; Wherein,
Described preparation module, for being the average actual bit rate of computation of Period with T by described actual bit rate, is designated as y by the average actual bit rate y in the n-th cycle n; Calculate the standard deviation S of the average actual bit rate in n cycle n; According to described average actual bit rate and described standard deviation S ndetermine theoretical limit bit rate and theoretical code check lower limit; Determine between described theoretical limit bit rate and theoretical code check lower limit for theoretical code check is interval;
Described first arranges module, for arranging recent code check dependent coefficient according to described average actual bit rate and described theoretical code check interval;
Second arranges module, for arranging discrete indicator coefficient according to described average actual bit rate and described theoretical code check interval;
Described computing module, for calculating described prediction code check according to described recent code check dependent coefficient, described discrete indicator coefficient, described average actual bit rate.
14. service ends according to claim 13, is characterized in that, described first arranges module, specifically for: choose three continuous print cycles;
When the average actual bit rate in described three cycles is all positioned at described theoretical code check interval, the described recent code check dependent coefficient in the n-th cycle is 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, and time outside the described theoretical code check interval of part, the described recent code check dependent coefficient in the n-th cycle is 0.2 ~ 0.4;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, the described recent code check dependent coefficient in the n-th cycle is 0.4 ~ 0.5.
15. service ends according to claim 14, is characterized in that, described second arranges module, specifically for when the average actual bit rate in described three cycles is positioned at described theoretical code check interval, and described discrete indicator coefficient value 0.05 ~ 0.2;
Average actual bit rate part when described three cycles is positioned at described theoretical code check interval, when part is positioned at outside described theoretical code check interval, and described discrete indicator coefficient value 0.2 ~ 0.35;
When the average actual bit rate in described three cycles is positioned at outside described theoretical code check interval, described discrete indicator coefficient value 0.35 ~ 0.45.
16. service ends according to claim 13, is characterized in that, described computing module, specifically for basis calculate the prediction code check f in (n+1)th cycle n+1;
Wherein, α is recent code check dependent coefficient; β is discrete indicator coefficient; γ is influence coefficient, γ=1-alpha-beta; S nfor the standard deviation of the average actual bit rate in n cycle; f nit is the prediction code check in the n-th cycle.
The system of 17. 1 kinds of live broadcast stream medias, is characterized in that, described system comprises: client and the service end as described in any one of claim 10 to 16; Wherein,
Described client, for downloading TS file and playing described TS file.
CN201410252079.7A 2014-06-09 2014-06-09 A kind of method, server-side and the system of live media stream Active CN105306968B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410252079.7A CN105306968B (en) 2014-06-09 2014-06-09 A kind of method, server-side and the system of live media stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410252079.7A CN105306968B (en) 2014-06-09 2014-06-09 A kind of method, server-side and the system of live media stream

Publications (2)

Publication Number Publication Date
CN105306968A true CN105306968A (en) 2016-02-03
CN105306968B CN105306968B (en) 2019-05-10

Family

ID=55203643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410252079.7A Active CN105306968B (en) 2014-06-09 2014-06-09 A kind of method, server-side and the system of live media stream

Country Status (1)

Country Link
CN (1) CN105306968B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038011A (en) * 2016-02-04 2017-08-11 中兴通讯股份有限公司 It is a kind of to adjust the method and device for showing fluency, mobile terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242532A (en) * 2007-12-12 2008-08-13 浙江万里学院 A code rate control method oriented to multi-view point video
CN103260053A (en) * 2013-04-15 2013-08-21 威盛电子股份有限公司 System, multimedia playing device and method for dynamically adjusting multimedia data code rate

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242532A (en) * 2007-12-12 2008-08-13 浙江万里学院 A code rate control method oriented to multi-view point video
CN103260053A (en) * 2013-04-15 2013-08-21 威盛电子股份有限公司 System, multimedia playing device and method for dynamically adjusting multimedia data code rate

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KONSTANTIN MILLER ET AL.: "Adaptation Algorithm for Adaptive Streaming over HTTP", 《PROCEEDINGS OF 2012 IEEE 19TH INTERNATIONAL PACKET VIDEO WORKSHOP》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038011A (en) * 2016-02-04 2017-08-11 中兴通讯股份有限公司 It is a kind of to adjust the method and device for showing fluency, mobile terminal

Also Published As

Publication number Publication date
CN105306968B (en) 2019-05-10

Similar Documents

Publication Publication Date Title
US10506009B2 (en) Apparatus and method for providing content on basis of DASH adaptive to bandwidth
CN103354618B (en) HLS-based multi-scenario streaming media adaptive live broadcast method
US8218657B2 (en) System and method for automatic adjustment of streaming video bit rate
EP3840390A1 (en) Method and device for controlling video transcoding code rate
CN105357591A (en) QoE monitoring and optimization method for adaptive code rate video direct broadcast
CN107277013B (en) Live broadcast system in peer-to-peer network and node management method
CN104125429A (en) Video data transmission adjusting method and device
CN102098547A (en) Transmission method of self-adaptive/real-time high-definition video for embedded network
EP3563575B1 (en) Transmission parameter control for segment delivery
CN101656887B (en) Method and device for selecting rate control algorithm
CN103973662B (en) Streaming Media requesting method and controller
CN105451099A (en) Method and device for adjusting video code rate
CN108924667A (en) A kind of maximized available bandwidth adaptive video fragment request method of support QoE
US11109389B2 (en) Method for reporting network performance parameter and device
CN105323604A (en) QoE (Quality of Experience) driven HTTP streaming media on demand buffer area control method
CN109981744A (en) Distribution method, device, storage medium and the electronic equipment of data
US20180091386A1 (en) Method and scoring node for estimating a user&#39;s quality of experience for a delivered service
CN112312135A (en) Video publishing method and device, computer equipment and storage medium
CN110012324A (en) A kind of the code rate adaptive approach and system of embedded radio transmission of video
CN104581340A (en) Client-side, streaming media data receiving method and streaming media data transmission system
CN105306968A (en) Media stream live broadcast method, server and system
CN112866756B (en) Code rate control method, device, medium and equipment for multimedia file
EP3651464B1 (en) Data encoding method and apparatus, terminal device and computer readable storage medium
CN114629797B (en) Bandwidth prediction method, model generation method and device
CN116074256A (en) Content distribution network node bandwidth optimization method and device, electronic equipment and medium

Legal Events

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