Self-adaptive adjustment method for video stream code rate of mobile terminal based on variable period sampling

文档序号:882764 发布日期:2021-03-19 浏览:2次 中文

阅读说明:本技术 基于变周期采样的移动终端视频流码率的自适应调节方法 (Self-adaptive adjustment method for video stream code rate of mobile terminal based on variable period sampling ) 是由 肖蔼玲 靳世超 吴胜 马礼 王兴辰 于 2020-12-01 设计创作,主要内容包括:基于变周期采样的移动终端视频流码率的自适应调节方法属于移动终端视频播放技术领域,其特征在于,由于环境干扰而导致额定播放状态转为变码率的失稳状态,CPU用额定状态下的一段设定时长作为尺度去衡量变周期中的一段同样时长内实测得到的播放码长,从而得到码率在动态变化下下降的倍率,以此来控制视频播放器码率变化的增量,同样的以额定状态下设定的一段码流长度检测所在变采样周期的时长,以便按变采样周期的序号对下一个变采样周期的码率进行自适应的码率超前调节直到视频播放结束,是一种着眼于以同一个时长段和对应码流段作为两个尺度去衡量稳态和对应的失态下码率变化的有差控制的方法。本发明具有超前,平稳且精准控制的优点。(A self-adaptive adjustment method for video stream code rate of a mobile terminal based on variable period sampling belongs to the technical field of video playing of mobile terminals, it is characterized by that the rated playing state is converted into variable code rate unstability state due to environmental interference, CPU uses a section of set time length in rated state as scale to measure the actually-measured playing code length in a section of same time length in variable period, thereby obtaining the rate of code rate reduction under dynamic change, controlling the increment of the code rate change of the video player, detecting the duration of the variable sampling period with a section of code stream length set under a rated state, the method aims at taking the same time length segment and the corresponding code stream segment as two scales to measure the difference control of the code rate change under the steady state and the corresponding off-state. The invention has the advantages of advanced, stable and accurate control.)

1. The adaptive regulation method of the variable-period sampling mobile terminal video stream code rate is characterized in that the method is sequentially realized in a mobile terminal video stream code rate regulation system, hereinafter referred to as the system, according to the following steps:

step (1) system construction, comprising:

a microprocessor and a video stream buffer, wherein: the microprocessor is provided with: CPU, storage module, buffer module, become duration, the code length measuring module of sampling cycle, and code rate dynamic adjustment module, wherein:

a storage module provided with:

rated code length L input by mobile terminal video player when video block is played at rated code rate NH in medium speed gearHCode rate NHAnd duration T of the play periodHThe subscript "H" indicates the nominal play state, NH=LH/THThe above-mentioned every parameter regards the minute as the timing unit, but under the thunder and lightning, strong electromagnetic source, multipath interference separately act, or when the downstream code rate of the video code stream is unstable, the video stream that is input into the system video player through the video encoder is unstable, thus make the system change from the nominal playing state into the unstable state of the variable code rate, the said memorizer in unstable state, the network continuously stores the following every parameter that appears to the unstable sampling cycle of code rate, every parameter regards second as the timing unit, including: variable sampling period T'HMeans that the same code length m L is transmitted compared with the rated stateHTime T 'required'(H,m)M is a variable sampling period T'(H,m)The rated code length adjusting coefficient m which can be selected is less than 1, the coefficient is selected in the open interval (0.1, 0.9), the superscript symbol "'" represents the variable sampling state, and each variable isSampling period T'H(m,p)The letter "P" in the subscript combination (m, P) indicates the serial number of each variable sampling period, P is (1, 2.. multidot.p.,. multidot.p), the letter "P" indicates the total number of variable sampling periods, P is 1/m, and' in the subscript indicates that the subsequent letter P is the same as the previous letter m, and the code rate is reduced when any kind of interference acts, so that T is the number of the variable sampling periodsH<T′H,T′H=∑T′H(m,p)L p, code length L 'under each variable sampling period'H(m,p)=m*LHBut of varying total code length L 'within the sampling period'H=LH

The CPU, when initializing, is provided with: the T isH、LH、NHP, m;

step (2), the CPU realizes the video stream code rate N 'under the variable sampling period according to the following steps in sequence'H=m*LH/T′H(m,p)Adaptive adjustment of

Step (2.1), when playing a certain video stream under the set code rate level, the code stream in the video block is in the rated state according to the rated parameter NH、LH、THAfter the video frame is sent to the video encoder, the video player plays all the video frames in a medium-speed gear,

step (2.2), CPU detects the output code rate of the video stream buffer, if the deviation value is NHAnd when descending, the following steps are adopted for self-adaptive adjustment:

step (2.2.1), when a variable sampling period begins, the CPU inputs a set rated time length m x T to the variable sampling period code length measuring moduleHMeasuring the transmission code length L' of the code stream input by the cache module in real timeH(m,p)To discriminate at the same time interval m x THAnd (3) descending the value of the code stream in a variable sampling state, wherein the superscript "" represents the parameter value measured in a variable sampling period.

Step (2.2.2), at the end of the first variable sampling period, the CPU inputs a set rated code length segment m × L to the variable sampling period duration measuring moduleHTo discriminate between the same m x LHDown-conversion samplingThe value of the period duration to determine the start of the second variable sampling period,

step (2.2.3), under the control of the CPU, the code rate dynamic adjusting module is used for inputting L ″)H(m,p,1)And m LHValue pressing formula KH(m,p,1)=(m*LH)/L″H(m,p,1)Calculate KH(m,p,1)The value is sent to the CPU to calculate the multiplying power K of the code rate increaseH(m,p,1)Then, the following judgment is carried out:

if K is 1, it means that the state of the variable code rate is changed to the rated steady state, and K is not processed, and K is changed to the rated steady stateH(m,p,1)The information is stored in a storage device (a),

if KH(m,p,1)If the bit rate is more than 1, the output code rate of the buffer is increased by KH(m,p,1)Multiple and in a second variable sampling period TH(m,p,2)To increase the playing code rate N 'of the second variable sampling period'H(m,p,2)

And (2.3) repeating the step (2.2) until the total number of the variable sampling periods is P, wherein T'HAnd THThe difference value is positive and is within the allowable error range, so that the unstable state is transited to a new stable state by using a continuous difference regulation method.

Technical Field

A self-adaptive regulation method of mobile terminal video stream code rate based on variable period sampling belongs to the technical field of mobile terminal video playing, in particular to an automatic regulation technology of code stream playing speed, namely code rate in a video block

Background

The invention discloses a code rate self-adaptive adjustment method for video live broadcast based on a finite state machine and a device thereof with the application number of 201910218253.9, and provides the code rate self-adaptive adjustment method for video live broadcast, which is a method for adjusting video play speed and slow change by setting corresponding sufficient buffer threshold values and dangerous buffer threshold values based on original data fed back by a system in a past preset decision period as historical data to improve the current bandwidth estimation accuracy, and overcomes the defects that the dynamic change and the time delay constraint of end-to-end time delay are not considered at the source end of methods such as BBA, MPC and pensieve which are frequently used for video on demand. Which is different from the present invention

The problems to be solved are different: firstly, the contrast file is suitable for solving code rate adjustment during video live broadcasting, while the invention is suitable for solving the self-adaptive adjustment of the video playing code rate of the mobile terminal, and secondly, the contrast file is suitable for video on demand, but the invention is not only suitable for video on demand but also suitable for video playing under the normal state of non-on demand. Secondly, the problems to be solved are different, which directly results in different methods adopted by the two. The comparison file is based on the estimation of historical data by using a sufficient buffer threshold and a dangerous buffer threshold, and the invention takes seconds as a timing unit of the variable sampling period from the angle of transition from a rated playing state to a code rate dynamic change state and plays m × L in the rated stateHCode length required time m x THDetecting a variable sampling period T 'as a scale'H(m,p)A same time period m x THActually measured play code length LH(m,p)Detecting L ″)H(m,p)Ratio m LHBy a factor of K ═ m LH)/L″H(m,p)To adjust the code rate of the video encoder. Same code length segment m L according to settingHTo detect the time length of the variable sampling period, according to the variable sampling period TH(m,p)Sequentially finding out the next sampling periodMultiple K of code rate to be adopted at initial momentH(m,p,2)Therefore, the self-adaptive differential adjustment under the dynamic change of code rate can be realized.

Disclosure of Invention

The invention aims to provide a self-adaptive adjustment method for video playing code rate of a mobile terminal based on variable period sampling.

The invention is characterized in that the method is realized in a mobile terminal video stream code rate adjusting system, hereinafter referred to as the system, according to the following steps in sequence:

step (1) system construction, comprising:

a microprocessor and a video stream buffer, wherein: the microprocessor is provided with: CPU, storage module, buffer module, become duration, the code length measuring module of sampling cycle, and code rate dynamic adjustment module, wherein:

a storage module provided with:

mobile terminal video player at middle gear with rated code rate NHNominal code length L input when playing video blockHCode rate NHAnd duration T of the play periodHThe subscript "H" indicates the nominal play state, NH=LH/THThe above-mentioned every parameter regards the minute as the timing unit, but under the thunder and lightning, strong electromagnetic source, multipath interference separately act, or when the downstream code rate of the video code stream is unstable, the video stream that is input into the system video player through the video encoder is unstable, thus make the system change from the nominal playing state into the unstable state of the variable code rate, the said memorizer in unstable state, the network continuously stores the following every parameter that appears to the unstable sampling cycle of code rate, every parameter regards second as the timing unit, including: variable sampling period T'HMeans that the same code length m L is transmitted compared with the rated stateHTime T 'required'(H,m)M is a variable sampling period T'(H,m)The rated code length adjusting coefficient m < 1 is selected in an open interval (0.1, 0.9), the superscript symbol "'" represents a variable sampling state, and each variable sampling period T'H(m,p)The letter "p" in the subscript combination (m, p) of (a) represents eachThe number of the variable sampling periods is changed, P is (1, 2.. multidot., P), the letter "P" represents the total number of the variable sampling periods, P is 1/m, and' in the subscript indicates that the next letter P is the same as the subscript of the previous letter m, and the code rate is reduced when any kind of interference acts, so that T is TH<T′H,T′H=∑′TH(m,p)L p, code length L 'under each variable sampling period'H(m,p)=m*LHBut of varying total code length L 'within the sampling period'H=LH

The CPU, when initializing, is provided with: the T isH、LH、NHP, m;

step (2), the CPU realizes the video stream code rate N 'under the variable sampling period according to the following steps in sequence'H=m*LH/T′H(m,p)Adaptive adjustment of

Step (2.1), when playing a certain video stream under the set code rate level, the code stream in the video block is in the rated state according to the rated parameter NH、LH、THAfter the video frame is sent to the video encoder, the video player plays all the video frames in a medium-speed gear,

step (2.2), CPU detects the output code rate of the video stream buffer, if the deviation value is NHAnd when descending, the following steps are adopted for self-adaptive adjustment:

step (2.2.1), when a variable sampling period begins, the CPU inputs a set rated time length m x T to the variable sampling period code length measuring moduleHMeasuring the transmission code length L' of the code stream input by the cache module in real timeH(m,p)To discriminate at the same time interval m x THAnd (3) descending the value of the code stream in a variable sampling state, wherein the superscript "" represents the parameter value measured in a variable sampling period.

Step (2.2.2), at the end of the first variable sampling period, the CPU inputs a set rated code length segment m × L to the variable sampling period duration measuring moduleHTo discriminate between the same m x LHDown-converting the value of the sampling period duration to determine the start of the second sampling period,

step (2.2.3), under the control of the CPU, the code rate dynamic adjusting module is used for inputting L ″)H(m,p,1)And m LHValue pressing formula KH(m,p,1)=(m*LH)/L″H(m,p,1)Calculate KH(m,p,1)The value is sent to the CPU to calculate the multiplying power K of the code rate increaseH(m,p,1)Then, the following judgment is carried out:

if K is 1, it means that the state of the variable code rate is changed to the rated steady state, and K is not processed, and K is changed to the rated steady stateH(m,p,1)The information is stored in a storage device (a),

if KH(m,p,1)If the bit rate is more than 1, the output code rate of the buffer is increased by KH(m,p,1)Multiple and in a second variable sampling period TH(m,p,2)To increase the playing code rate N 'of the second variable sampling period'H(m,p,2)

And (2.3) repeating the step (2.2) until the total number of the variable sampling periods is P, wherein T'HAnd THThe difference value is positive and is within the allowable error range, so that the unstable state is transited to a new stable state by using a continuous difference regulation method.

The invention has the advantages that: the invention has the advantages of advanced, stable and accurate control.

Drawings

FIG. 1 is a schematic diagram of the system structure of the present invention.

Fig. 2, schematic diagram of variable sampling principle: FIG. 2-1, first variable sampling period T'H(m,p,1)Schematic diagram, FIGS. 2-2, second variable sampling period T'H(m,p,2)Schematic representation.

FIG. 3 is a flowchart of the process of the present invention.

The attached drawings are marked as follows

THRated cycle duration measured in minutes, LHThe length of the rated playing code is long,

NHrated playing code rate

Variable sampling period total duration T'H,T′H=∑T′H(m,p)And | P, P is the serial number of each variable sampling period, and P is the total number of all the variable sampling periods.

m*LHIs the length of a code stream segment set in each sampling period in a rated state, m is an adjusting coefficient, a value space (0.1, 0.9) is taken,

L′H(m,p)each variable sampling period code length L'H(m,p)=m*LH

L″H(m,p)Is each variable sampling period T'H(m,p)A time period m x THThe actual measured length of playing code (m T)H)<T′H(m,p)

K is the code rate regulation multiplying power: in the rated playing state, K is equal to 1, and in the variable sampling state, K is equal to 1>1 this is because when the rate of the downlink is interfered by electromagnetic interference or multipath interference, or video broadcasting stream, the rate will decrease by KH(m,p)=(m*LH)/L″H(m,p)X, so that T'HIncrease in cycle time of

The specific implementation mode is as follows:

wherein, each variable sampling period is used as an adjusting step length, and (m × T)H) And as the sampling step size, realizing the advance control by the sampling step size, and realizing the code rate adjustment multiple between two adjacent variable sampling periods by adjusting the step size.

Please refer to fig. 2 for a schematic diagram

In a first variable sampling period T'H(m,p)When, see fig. 2-1, the horizontal axis is the play code length L, and the vertical axis is the total duration T of each variable sampling periodHFirst sampling period T 'in which the code rate decreases due to the slow playback speed caused by interference'H(m,p,1)Greater than m x T due to rate instabilityHThen also at m x THThe actually measured code length L' in the rated playing time periodH(m,p)Is less than the corresponding time interval m x T in the rated stateHInner nominal play yard length segment m x LHObtaining a second variable sampling period T'H(m,p,2)The initial code rate of (2).

In FIGS. 2-2, the above situation is again at the second sampling period T'H(m,p,1)Inner repetition, since the playing code rate is L at this timeH/L″H(m,p,2)Multiplying to obtain a second sampling period T'H(m,p,2)Shorten to make code stream L ″)H(m,p,2)Greater than LH(m,p,1)It can be seen that m x THRealize thatEach variable sampling period takes an equal number of samples. The same code length segment is used to determine the time length of the variable sampling period to realize the advanced control, and the code rate regulation strength depends on the actually measured L ″H(m,p)A change in (c).

Thereby realizing the continuity of the variable period control.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:检测窗口自定义定形系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类