CN104967884B - A kind of bitstreams switching method and apparatus - Google Patents

A kind of bitstreams switching method and apparatus Download PDF

Info

Publication number
CN104967884B
CN104967884B CN201510185473.8A CN201510185473A CN104967884B CN 104967884 B CN104967884 B CN 104967884B CN 201510185473 A CN201510185473 A CN 201510185473A CN 104967884 B CN104967884 B CN 104967884B
Authority
CN
China
Prior art keywords
code stream
time
threshold value
decision
actual optimum
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.)
Active
Application number
CN201510185473.8A
Other languages
Chinese (zh)
Other versions
CN104967884A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201510185473.8A priority Critical patent/CN104967884B/en
Publication of CN104967884A publication Critical patent/CN104967884A/en
Application granted granted Critical
Publication of CN104967884B publication Critical patent/CN104967884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/23805Controlling the feeding rate to the network, e.g. by controlling the video pump
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiments of the invention provide a kind of bitstreams switching method and apparatus, wherein methods described includes:When a upper video playback finishes, during chain broadcast target video, or, when starting player for the first time and commencing play out target video, obtain key parameter;Actual optimum code stream is gone out based on the key parameter decision-making;When the actual optimum code stream and currently playing code stream differ, switching time is calculated;It is the actual optimum code stream by the currently playing bitstreams switching of the target video when the switching time reaches.Present invention can ensure that the seamless smooth switching of two code streams, improves user's viewing experience.

Description

A kind of bitstreams switching method and apparatus
Technical field
The present invention relates to video display arts field, is filled more particularly to a kind of bitstreams switching method and a kind of bitstreams switching Put.
Background technology
Streaming Media (Streaming media) technology refers to after a series of multimedia data compression, in the form of streaming Carry out the real-time continuous a kind of technology and process for being transmitted for viewing and admiring of multi-medium data.Download and broadcast with traditional multimedia file The mode of putting is compared, and the maximum advantage of Streaming Media is that user need to only broadcast the locally downloading buffering area can of the data of beginning Put, downloaded when broadcasting, so as to realize continuous broadcasting.This streaming manner not only makes the startup time delay of program broadcasting significantly Shorten, and be greatly reduced the demand to user's local cache space.
But because internet provides the service done one's best, QoS (Quality of Service, clothes can not be provided It is engaged in quality) ensure, broadcasting interim card often occurs during streaming media playing, a problem that video quality is acutely shaken, uses Family can not obtain preferable viewing experience.In order to overcome network condition not know caused influence, stream media system needs certainly Adaptively adjustment transmission strategy, transmission of flow media data process is set to be adapted with the network environment changed, so that user is working as Optimal Streaming Media experience is obtained under preceding network condition.
The adaptive stream media transmission technology of current main-stream is divided into server end realization and client realizes two types.Its In, in the adaptive stream media transmission that server end is realized, most popular system is mostly based on RTP (real time Transport protocol, RTP) and RTSP (real time streaming protocol, spread in real time Defeated agreement), system obtains stream media information and relevant parameter by HTTP first, then runs RTSP and establishes client and stream matchmaker Communication between body server, finally by RTP transmitting multimedia datas.Such stream media system is with U.S. Real The Real System of Networks companies and the Windows Media of Microsoft are the most typical.But server end is realized adaptive It should transmit that the information of needs is more, the realization of system is mostly based on the proprietary protocol of complexity, and this constrains this to a certain extent The development of class stream media technology.
Client realizes in adaptive stream media transmission that server repository has the stream matchmaker that plurality of kinds of contents is identical but code check is different Body burst, during broadcasting, client asks a playlist to server first, and the basic letter of section is included in playlist Breath, such as chip durations, time started stamp and sequencing etc., client will descend current-carrying matchmaker in order according to playlist Body is cut into slices, and before downloading slicing is asked to server every time, client can all carry out network condition detection, and according to current net Network situation and caching situation in time ask most suitable Streaming Media to be cut into slices to server, and the download of each burst passes through H TT P Request-response is completed.Under this implementation, the interactive information between client and server is less, and system realizes letter It is single, it is not necessary to set up special streaming media server, in addition, compared with RTP/RTSP, HTTP is easily realized and safeguarded, is being passed through Advantage is had more in terms of fire wall/NAT.
At present, the adaptive stream media technology based on HTTP has turned into the development trend of stream media technology, and HTTP is adaptive Stream media system is numerous, and the system of wherein main flow has Apple HTTP Live Streaming, the SilverLight of Microsoft Smooth Streaming and Adobe HTTP Dynamic Streaming.Some International Standards Organization have also carried out base In the standardization effort of HTTP adaptive stream media technology, influential standard has OIPF HAS, MPEG DASH, IETF HTTP Live Streaming drafts etc..It is academic in recent years with being done step-by-step for the technology standardizations such as DASH work The correlative study of the bound pair technology is also more, and the form being related in technical process is paid close attention to relative to standardization body and is defined, more The actual performance and optimization method of concern technology application.Christopher Muller et al. are analyzed under live network scene The performance of IIS Smooth Streaming, Live HTTP streaming and Dynamic Streaming clients, it is logical Cross the request media slicing bit rate of observation different clients and cache status discovery Dynamic Streaming adaptive plan Slightly the most radical, media slicing bit rate variation is most violent, and buffer underflow number is most, and interim card is than high, IIS Smooth Streaming takes second place, and Live HTTP streaming performances are more steady.But these technical schemes are all applied in particular platform, As Live HTTP streaming are used primarily in apple ios systems, and it is based primarily upon network fluctuation situation and play buffer two Individual aspect is calculated, and the condition of the optimal code stream of decision-making is relatively simple, can not reflect the broadcasting behavior of actual play device completely.
The content of the invention
Technical problem to be solved of the embodiment of the present invention is to provide a kind of bitstreams switching method, to ensure two code streams without The smooth switching of seam, improves user's viewing experience.
Accordingly, the embodiment of the present invention additionally provides a kind of bitstreams switching device, to ensure the realization of the above method and Using.
In order to solve the above problems, the invention discloses a kind of bitstreams switching method, methods described includes:
When a upper video playback finishes, during chain broadcast target video, or, start player for the first time and commence play out target and regard During frequency, key parameter is obtained;
Actual optimum code stream is gone out based on the key parameter decision-making;
When the actual optimum code stream and currently playing code stream differ, switching time is calculated;
It is the actual optimum code by the currently playing bitstreams switching of the target video when the switching time reaches Stream.
Preferably, described the step of going out actual optimum code stream based on the key parameter decision-making, includes:
Multiple key parameters are chosen from the key parameter, as multiple decision factors;
Actual optimum code stream is gone out based on the decision factor decision-making.
Preferably, the key parameter comprises at least:
(1) the code stream list of types that the target video is supported, the code stream list of types include polytype code Stream;
(2) current player renders area size;
(3) theoretical optimal code stream;
(4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
(5) in the first nearest preset time period, regarded to what is downloaded in play buffer corresponding to each unit interval The remaining reproduction time of frequency evidence, carries out curve fitting, obtained matched curve;
(6) according to default code stream criterion, judge currently playing code stream for high quality code stream or low quality code stream Judged result;
(7) preset time is ended, currently playing code stream is determined as changeable number;
(8) default highest code stream and minimum code stream limitation scope;
(9) the interim card number that target video plays;
(10) user is dragged to progress bar to target video to the dragging seek records of some position;
(11) total switching times of current goal video;
(12) the code stream record that target video film has used.
Preferably, polytype code stream includes code stream grade, described to go out reality based on the decision factor decision-making The step of optimal code stream, includes:
N number of decision condition is set based on the decision factor, wherein N is positive integer;
If the decision condition be satisfied by corresponding to threshold value standard, using the optimal code stream of theory as the reality most Excellent code stream;
If any decision condition is unsatisfactory for corresponding threshold value standard, by lower level corresponding to the optimal code stream of theory Code stream as the actual optimum code stream, or, using currently playing code stream as the actual optimum code stream.
Preferably, the decision condition includes the part or all of of following condition:
1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first Threshold value, if so, then judging that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then the decision-making bar is judged Part meets threshold value standard, if downward trend, then judges that the decision condition is unsatisfactory for threshold value standard;
3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision-making is adjusted The threshold value standard of condition;
4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging The decision condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, currently cumulative is cut The number zero changed;
5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if It is then to judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
6) choose and render the suitable code stream of area size with current player;
If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging the decision condition Threshold value standard is unsatisfactory for, if it is not, then judging that the decision condition meets threshold value standard;
10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code is not chosen Stream is used as actual optimum code stream.
Preferably, the optimal code stream of theory obtains as follows:
The mass value of polytype code stream is calculated respectively;
Using the maximum code stream of the mass value as theoretical optimal code stream.
Preferably, the mass value of polytype code stream is calculated respectively using equation below:
G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
Wherein, i represents the type identification of code stream, and G [i] represents the mass value of code stream, and Q [i] represents various types of code streams Corresponding default initial mass value, cost [i] represent that various code streams preset the first mass loss value when playing caused by interim card; Costs represents to preset the second mass loss value caused by two bitstreams switchings;Current_bitstream_index represents current The default index value of broadcast code flow;P0 [i] represents player buffering area for empty probability.
Preferably, the target video includes multiple logic bursts;The p0 [i] obtains in the following way:
Based on current network speed of download, estimate that various types of code streams are downloaded needed for a logic burst respectively Download time, and define download w assignment of logical needed for download time be t;
Calculate respectively and E (t) it is expected corresponding to the download time t;
P0 [i] is calculated using equation below:
P0 [i]=1-1/E (t) [i] * μ;
Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the decoding time needed for a logic burst Default expectation.
Preferably, it is described when the actual optimum code stream differs with currently playing code stream, calculate the step of switching time Suddenly include:
Set and the minimal buffering time is preloaded corresponding to various code streams;
When the actual optimum code stream and currently playing code stream differ, then switching time is calculated using equation below time:
Time=(bs_rate_ [result] * 5000)/average_download_speed_+bs_min_buffer_ time_[result]);
Wherein, bs_rate_ [result] represents the code check of the actual optimum code stream, average_download_ Speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the actual optimum code The preloading minimal buffering time of stream.
Preferably, it is described when the switching time reaches, it is institute by the currently playing bitstreams switching of the target video The step of stating actual optimum code stream includes:
Calculate the optimal key frame position in the preset range of the switching time;
The optimal key frame position is subtracted to the preloading minimal buffering time of the actual optimum code stream, obtains pre-add Carry position;
When the target video is played to the preload position, stop loading currently playing code stream, start to load institute State actual optimum code stream;
When the target video is played to the optimal key frame position, by the actual optimum code stream with it is described most Excellent key frame position identical key frame is sent to decoder.
The invention also discloses a kind of bitstreams switching device, described device includes:
Key parameter acquisition module, for being finished in a upper video playback, during chain broadcast target video, or, open for the first time When dynamic player commences play out target video, key parameter is obtained;
Decision-making module, for going out actual optimum code stream based on the key parameter decision-making;
Switching time computing module, for when the actual optimum code stream differs with currently playing code stream, calculating to be cut Change opportunity;
Handover module, for when the switching time reaches, being by the currently playing bitstreams switching of the target video The actual optimum code stream.
Preferably, the decision-making module includes:
Parameter chooses submodule, for choosing multiple key parameters from the key parameter, as multiple decision factors;
Decision-making submodule, for going out actual optimum code stream based on the decision factor decision-making.
Preferably, the key parameter comprises at least:
(1) the code stream list of types that the target video is supported, the code stream list of types include polytype code Stream;
(2) current player renders area size;
(3) theoretical optimal code stream;
(4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
(5) in the first nearest preset time period, regarded to what is downloaded in play buffer corresponding to each unit interval The remaining reproduction time of frequency evidence, carries out curve fitting, obtained matched curve;
(6) according to default code stream criterion, judge currently playing code stream for high quality code stream or low quality code stream Judged result;
(7) preset time is ended, currently playing code stream is determined as changeable number;
(8) default highest code stream and minimum code stream limitation scope;
(9) the interim card number that target video plays;
(10) user is dragged to progress bar to target video to the dragging seek records of some position;
(11) total switching times of current goal video;
(12) the code stream record that target video film has used.
Preferably, polytype code stream includes code stream grade, and the decision-making submodule is additionally operable to:
N number of decision condition is set based on the decision factor, wherein N is positive integer;
If the decision condition be satisfied by corresponding to threshold value standard, using the optimal code stream of theory as the reality most Excellent code stream;
If any decision condition is unsatisfactory for corresponding threshold value standard, by lower level corresponding to the optimal code stream of theory Code stream as the actual optimum code stream, or, using currently playing code stream as the actual optimum code stream.
Preferably, the decision condition includes the part or all of of following condition:
1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first Threshold value, if so, then judging that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then the decision-making bar is judged Part meets threshold value standard, if downward trend, then judges that the decision condition is unsatisfactory for threshold value standard;
3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision-making is adjusted The threshold value standard of condition;
4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging The decision condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, currently cumulative is cut The number zero changed;
5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if It is then to judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
6) choose and render the suitable code stream of area size with current player;
If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging the decision condition Threshold value standard is unsatisfactory for, if it is not, then judging that the decision condition meets threshold value standard;
10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code is not chosen Stream is used as actual optimum code stream.
16th, the device according to claim 13 or 14 or 15, it is characterised in that the key parameter acquisition module is also For:
The mass value of polytype code stream is calculated respectively;
Using the maximum code stream of the mass value as theoretical optimal code stream.
Preferably, the mass value of polytype code stream is calculated respectively using equation below:
G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
Wherein, i represents the type identification of code stream, and G [i] represents the mass value of code stream, and Q [i] represents various types of code streams Corresponding default initial mass value, cost [i] represent that various code streams preset the first mass loss value when playing caused by interim card; Costs represents to preset the second mass loss value caused by two bitstreams switchings;Current_bitstream_index represents current The default index value of broadcast code flow;P0 [i] represents player buffering area for empty probability.
Preferably, the target video includes multiple logic bursts;The p0 [i] obtains in the following way:
Based on current network speed of download, estimate that various types of code streams are downloaded needed for a logic burst respectively Download time, and define download w assignment of logical needed for download time be t;
Calculate respectively and E (t) it is expected corresponding to the download time t;
P0 [i] is calculated using equation below:
P0 [i]=1-1/E (t) [i] * μ;
Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the decoding time needed for a logic burst Default expectation.
Preferably, the switching time computing module includes:
Buffer time sets submodule, for setting the preloading minimal buffering time corresponding to various code streams;
Calculating sub module, for when the actual optimum code stream and currently playing code stream differ, using equation below Calculate switching time time:
Time=(bs_rate_ [result] * 5000)/average_download_speed_+bs_min_buffer_ time_[result]);
Wherein, bs_rate_ [result] represents the code check of the actual optimum code stream, average_download_ Speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the actual optimum code The preloading minimal buffering time of stream.
Preferably, the handover module includes:
Position calculating sub module, the optimal key frame position in preset range for calculating the switching time;
Preload position calculating sub module, for the optimal key frame position to be subtracted into the pre- of the actual optimum code stream The minimal buffering time is loaded, obtains preload position;
Submodule is preloaded, is currently broadcast for when the target video is played to the preload position, stopping loading Code stream is put, starts to load the actual optimum code stream;
Switching submodule, for when the target video is played to the optimal key frame position, by the reality most Sent in excellent code stream with the optimal key frame position identical key frame to decoder.
Compared with prior art, the embodiment of the present invention includes advantages below:
The embodiment of the present invention goes out actual optimum code stream according to key parameter decision-making, and calculates rational switching time, Bitstreams switching is carried out when reaching switching time, enriches the condition of code stream decision-making, improves the accuracy of code stream decision-making;
In addition, the embodiment of the present invention calculates switching reality, it is ensured that smooth switching that two code streams are seamless, improves user's viewing Experience;
In addition, the present invention is without the particular platform for relying on HTTP adaptive stream media systems;
In addition, the present invention considers a variety of key parameters and a variety of decision conditions, decision-making goes out actual optimum code stream, made Of the invention it must can take into account video definition and significantly reduce player interim card ratio.
Brief description of the drawings
Fig. 1 is a kind of step flow chart of bitstreams switching embodiment of the method for the present invention;
Fig. 2 is the Ek/M/1 queuing systems position phase flow graph in a kind of bitstreams switching embodiment of the method for the present invention;
Fig. 3 is that the different code streams in a kind of bitstreams switching embodiment of the method for the present invention download speed in identical network situation Spend acute variation schematic diagram;
Fig. 4 be the present invention a kind of bitstreams switching embodiment of the method in each interim card under each code stream distribution results figure;
Fig. 5 is that the interim card ratio in a kind of bitstreams switching embodiment of the method for the present invention influences schematic diagram;
Fig. 6 is a kind of structured flowchart of bitstreams switching device embodiment of the present invention.
Embodiment
In order to facilitate the understanding of the purposes, features and advantages of the present invention, it is below in conjunction with the accompanying drawings and specific real Applying mode, the present invention is further detailed explanation.
Reference picture 1, a kind of step flow chart of bitstreams switching embodiment of the method for the present invention is shown, can specifically be included Following steps:
Step 101, when a upper video playback finishes, during chain broadcast target video, or, start player for the first time and start to broadcast When putting target video, key parameter is obtained;
The embodiment of the present invention is started with the broadcasting trigger action of target video, and the broadcasting trigger action of target video can be with Including:After a upper video playback, the trigger action of chain broadcast target video, or, when user starts player for the first time, Play the trigger action of target video.The trigger action can be that user clicks on target video to send to target video The operation of http request.
The player of the embodiment of the present invention periodically broadcasting trigger action of the detection to target video, wherein, periodically Can be interval detection in 10 seconds once, interval detection in 20 seconds once, etc..
It should be noted that the video of the embodiment of the present invention can include motion picture film.
After target video is played trigger action triggering, player starts acquiescence code stream corresponding to loaded targets video, And start decoding acquiescence code stream, and play the acquiescence code stream.In this process, player can obtain the target video Key parameter, code stream is adaptively dynamically adjusted according to key parameter, wherein, key parameter can be that player (client) can The parameter related to target video obtained.
As a kind of example, key parameter can at least include following parameter:
(1) the code stream list of types that the target video is supported, the code stream list of types include polytype code Stream;
(2) current player renders area size;
(3) theoretical optimal code stream;
(4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
(5) in the first nearest preset time period, regarded to what is downloaded in play buffer corresponding to each unit interval The remaining reproduction time of frequency evidence, carries out curve fitting, obtained matched curve;
(6) according to default code stream criterion, judge currently playing code stream for high quality code stream or low quality code stream Judged result;
(7) preset time is ended, currently playing code stream is determined as changeable number;
(8) default highest code stream and minimum code stream limitation scope;
(9) the interim card number that target video plays;
(10) user is dragged to progress bar to target video to the dragging seek records of some position;
(11) total switching times of current goal video;
(12) the code stream record that target video film has used.
Each key parameter is illustrated below.
For above-mentioned key parameter (1), in one embodiment, the acquisition process of code stream list can be:Player Code stream is sent to video server and obtains request, to obtain the code stream list that target video can be supported from video server. Specifically, same video may have a variety of resolution versions, such as same portion's film in video server, in video BS_150 (very fast, resolution ratio is that can reach 320x640), BS_Standerd (SD, resolution ratio 720 are stored with server × 576 (pal modes) or 720 × 486 (TSC-system formulas)), BS_High (high definition, resolution ratio be 1280 × 720 and 1920 × 1080), BS_720p (resolution ratio is to reach 1280x720), BS_1080p (resolution ratio can reach 1920x1080), BS_4K are (super High definition, resolution ratio is up to 4096x2160) etc. various resolution ratio version.When video server receive the request of player with Afterwards, the code stream list of the target video of storage is returned into player.Wherein, code stream refers to that video file makes within the unit interval Data traffic, it is most important part in image quality control in Video coding, under same resolution ratio, the code of video file Stream is bigger, and for compression ratio with regard to smaller, image quality is better.
In video server, the level of resolution more high picture quality of same video is higher, allows bar in network condition Under part, the grade for the code stream that target video is supported is the higher the better, ensures to improve video definition in the case of smoothness.
After various resolution ratio have corresponding code stream, player to receive code stream list, obtain target video supported it is each The actual code stream of resolution ratio, the code stream being not present use the reference code stream for corresponding to resolution ratio.Code stream (Data Rate) refers to video The data traffic that file uses within the unit interval, code check is also, unit typically is that kbps i.e. kilobit is per second.It is of the invention real BS_150 (very fast), BS_Standerd (SD), BS_High (high definition), BS_720p, BS_1080p, BS_ can be used by applying example The symbols such as 4K represent code stream corresponding to each resolution ratio.
For above-mentioned key parameter (2), player can also obtain the window size that renders to target video, and play When window is changed, automatically updates and render window size accordingly, and, record maximum renders window size.For example, with play , can be with played in full screen when device plays film, the corresponding window size that renders can be 1920*1080, then will render size again 800*600 is narrowed down to, enlarges to 1024*768, etc. again after a while, these operations to broadcast window are all played device Record, while recorded the 1920*1080 since user from drives player and render window size for maximum.
For above-mentioned key parameter (3), theoretical optimal code stream is optimal code stream ideally, the optimal code stream of the theory Selected from polytype code stream.
The acquisition process of theoretical optimal code stream relies on Ek/M/1 queuing models.Ek/M/1 queuing models are said below It is bright.Applied to the embodiment of the present invention, coded data is downloaded to play buffer from server to player, and decoder is to slow Rush data in area and carry out this process that decoding is supplied to renderer render display, can be entered using Ek/M/1 queuing models Row mathematical modeling, the target parameter of this queuing model is calculated according to the steady-state equation group of Ek/M/1 queuing models, further tried to achieve Theoretical optimal code stream ideally.First the process of establishing of Ek/M/1 queuing models is illustrated below.
The foundation of Ek/M/1 queuing models needs to be applied to a variety of mathematical theory knowledge, such as queueing theory, flow of event, Poisson (Poisson) stream, quantum condition entropy, Ireland distribution, etc..Various mathematical theory knowledge are illustrated first:
Queueing theory (queuing theory):Or theory of random service system, it is by arriving and taking to service object The NULL of business time, the statistical law of these quantitative indexes (stand-by period, queue length, busy period length etc.) is drawn, so Improve the structure of service system according to these rules afterwards or reorganize being serviced object so that service system can meet to take The needs of business object, and can makes the expense of mechanism most economical or some indexs are optimal.The adaptable scene of queueing theory such as market Shopping, library borrows, automobile refuels to gas station, ship landing pier, hospital register sees a doctor, band repaiies machine maintenance, regarding sound The transmission of frequency signal, relevant data Cun Chudao computers, telephone office's call transfer etc..
Flow of event:The sequence that similar event one (criticizing) individual (batch) randomly comes service window requirement service is referred to as thing The call-flow of part stream, such as telephone office, computer glitch stream, incoming bus;These events are stochastic variable, and customer reaches The interval time of system and service time are non-negative, therefore they or non-negative stochastic variable.
Poisson (Poisson) flows:Simplest flow of event, it has following features:A, stationarity.It is in any segment length In t time interval, it is only relevant with t the probability of any amount event occur, and unrelated with the location of t;B, markov property (also known as without memory or Markov property), the event number occurred in without disjoint two time intervals T1, T2 is phase It is mutually independent;C, universality.With in a flash, the probability that more than one event occurs can be neglected.
Quantum condition entropy:When customer's stream is Poisson flow, represent that two successive customers reach the time interval of system with T, Then T obeys quantum condition entropy.
Ireland distribution:Most simple event stream is investigated, remembers that time interval sequence that each event reaches system is T1, T2 ..., And they are the stochastic variables of same quantum condition entropy, then this flow of event is Irish stochastic flow, noteThen T obeys k ranks love You are blue to be distributed.
Ek/M/1 queuing models:Also known as Ek/M/1/ ∞/∞ models, represent that customer reaches the interval time clothes of system in succession From quantum condition entropy, service time also obeys quantum condition entropy, 1 service window is provided with system, power system capacity is infinitely (fully Wait queuing model greatly).
Ek/M/1 queuing models introduced below establish process:
The target video of the embodiment of the present invention includes multiple logic bursts, wherein, logic burst is burst in logic, and The burst of non-actual existence, it is the logic burst carried out to current goal video with time per unit data.For example, one 100MB film, it is 1000 seconds to play total duration, if carrying out logic burst in units of 1 second, then each logic burst Size is 100MB/1000=0.1MB.
Each logic burst is the customer of queuing system;Player constantly downloads the video data of target video to buffering The middle customer in area, as queuing system reaches flow of event;Decoder decodes according to video data rate, as in queuing system Information desk;One player only has a decoder to be decoded one by one, the Service events stream as in queuing system; The video data to be decoded come, customer's queue of line for service as in queuing system are downloaded in buffering area storage from the Internet.
Under common network condition, the transmission time of a logic burst can centered on some average random wave Dynamic, video data transmission has certain correlation, without memory not notable, and Ireland distribution preferably can be intended real data Close, be more suitable for multiple series processes or it is without memory it is inapparent in the case of, therefore here using Ireland distribution (Ek) simulation The download time stream of logic burst.In target video video scene change frequently with slowly, the violent power of object of which movement etc. determines The code check random fluctuation of each second in decoding of video compression coding data, substantially a Poisson flow, an equal amount of coded number According to the decoding time can be simulated using quantum condition entropy (M), a player only has a decoder, i.e., only one clothes Business platform, under normal circumstances, user completely watches target video, and the data of loading will not lose, i.e., customer will not leave, and is a nothing Limit waits system, while the film source of video server is regarded as infinitely great, that is, has unlimited customer, that is, has a unlimited client source.
The customer of Ireland distribution is regarded as arrival time to the period sum of k separate quantum condition entropies, Then the period of each quantum condition entropy is regarded as one " position phase ", and from the definition of Ireland distribution, next customer passes through Time needed for one phase is quantum condition entropy, is had without memory.
If existing n positions customer in system, and possibility position of (n+1)th customer before system is introduced into is mutually t1, t2 ..., tk;So the Stationary Distribution of Number of Customers is in system:
Corresponding Ek/M/1 queuing systems position phase flow graph is as shown in Figure 2.It can be write in equilibrium conditions by Fig. 2 position phase flow graph Go out Kolmogorv-Chapman (K-C) equation:
Wherein,
ρ=λ/μ is made, can be had with reference to K-C equations:
It can be demonstrate,proved by algebra knowledge, work as ρ<When 1, it is s1=0 that P (s) denominator, which has one, and another is s0, is met | s0 |>1, Remaining k-1 root must be in unit circle.When | s |<When=1, P (s) is convergent, therefore P (s) molecule denominator is interior in unit circle Same root on vouching circle of position.There was only a root s=1 on unit circle, so as to have:
So as to have:
Because of P (1)=1, s ↑ 1 is made, is just hadAbove formula is substituted into, is obtained:
Again because s0 is a root of P (s) denominator formulas, i.e.,:
Then:
The Stationary Distribution of phase can be obtained:
So as to obtain the Stationary Distribution of Number of Customers in system:
Thus corresponding target parameter can be obtained:
A, the average queue length of system:
B, the residence time of customer in systems
Based on Ek/M/1 queuing models established above, in a kind of preferred embodiment of the embodiment of the present invention, theory is most Excellent code stream can obtain as follows:
Sub-step S11, the mass value of polytype code stream is calculated respectively;
Specifically, the mass value of code stream can be the final impression quality of code stream.In one embodiment, can use Equation below calculates the mass value of polytype code stream respectively:
G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
Wherein, i represents the type identification of code stream, Q [i], cost [i], costs and current_bitstream_index It is preset value, and is empirical value;G [i] represents the mass value of code stream, and Q [i] represents to preset corresponding to various types of code streams Initial mass value, i.e. initial user perception degree;Cost [i] represents that various code streams preset the first mass when playing caused by interim card User's perception degree penalty values caused by penalty values, i.e. interim card;Costs represents to preset the second mass damage caused by two bitstreams switchings Mistake value, i.e., user's perception degree penalty values caused by two bitstreams switchings, and two code stream spans are bigger, loss is bigger; Current_bitstream_index represents the default index value of currently playing code stream, the index value set when being coding, such as Index value corresponding to BS_150 is 1, index value corresponding to BS_Standerd is 2, index value corresponding to BS_High is 3, BS_ Index value corresponding to Super is 4, index value corresponding to BS_720p is 5, index value corresponding to BS_1080p is 6, BS_4K is corresponding Index value be 7, etc..
P0 [i] represents player buffering area as empty probability, or underflow probability, and in one embodiment, p0 [i] can To obtain in the following way:
1) based on current network speed of download, estimate that various types of code streams download a logic burst institute respectively The download time needed, and the download time defined needed for w assignment of logical of download is t;
To ensure the speed of download accuracy of statistics, the network speed of download in the embodiment of the present invention has been filtered out under exception Speed is carried, abnormal speed of download can filter out network speed such as certain speed of download and the front and rear great situation of speed of download gap Acute variation in the short time of speed, the frequent bitstreams switching of short time can be prevented.
In the specific implementation, can be based on current speed of download, when estimating the download needed for one assignment of logical of download Between, and based on the download time of an assignment of logical, the download time t of W logic burst of calculating.
2) calculate respectively and E (t) it is expected corresponding to the download time t;
After each code stream is obtained for the download time t of each logic burst, download time t phase can be further calculated Hope E (t).
It should be noted that while download time t expectation E (t), download time t variance D can also be calculated (t)。
3) p0 [i] is calculated using equation below:
P0 [i]=1-1/E (t) [i] * μ;
Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the decoding time needed for a logic burst Default expectation.
Specifically, according to the expectation of k ranks Ireland distribution and formula of variance:
With reference to expectation obtained above and variance, try to achieve:
According to the Stationary Distribution of the Ek/M/1 queuing models of foundation, the solution formula of target parameter is understood, it is important to the side of asking JourneyUnique unit circle outside solution S0, to the whole of realistic coefficient polynomial of degree n equation Root, using QR methods, the problem of the problem of seeking equation whole root is transformed into the All Eigenvalues for seeking matrix, and on this matrix is H-matrix (Hershberg matrix), this solution more than 1, as S are then chosen from All Eigenvalues0, and ρ=λ/μ, and μ is Player decode logic burst flow of event is the expectation of quantum condition entropy in queuing model, here sets logic burst for unit The non-decoding data of time (1 second), that is, the code check of corresponding code stream, it is known that service rate μ=1 of decoder, then by average team Long formulaObtain Ls;, can by the Stationary Distribution formula of Ek/M/1 queuing models Know player buffering area for empty Probability p0=1- ρ.With reference to above-mentioned formula, synthesis can obtain formula p0 [i]=1-1/E (t) [i]*μ。
Sub-step S12, using the maximum code stream of the mass value as theoretical optimal code stream.
After the G [i] of the above-mentioned each code stream tried to achieve, by the G [i] of maximum, i.e., final impression quality the maximum is as preferable In the case of theoretical optimal code stream.
In the specific implementation, not being very big because the network speed of a user typically changes, the present invention can also automatically more New acquiescence code stream is the theoretical optimal code stream ideally calculated, is used during for preloading next video during video chain broadcast Acquiescence code stream.When player is closed, the theoretical optimal code stream for calculating gained is stored in local, and player starts next time When, the code stream as video acquiescence loading.
Be using theoretical optimal code stream rather than actual optimum code stream (actual optimum code stream will be described herein-after) because The code stream of current film might not have BS_150~BS_4K all code streams, and theoretical optimal code stream ideally is The optimal code stream of gained is calculated according to network speed, it is the most suitable to do the initial code stream given tacit consent to, and counts during using last time viewing video The theoretical optimal code stream calculated can effectively reduce the interim card that player starts a period of time.
For above-mentioned key parameter (4), the remaining reproduction time for the video data downloaded in currently playing buffering area is, In play buffer, when the residue of the currently playing code stream (acquiescence code stream when starting video data loading) loaded plays Between, i.e., and how many has been downloaded code stream and not broadcast in play buffer.For example, the remaining reproduction time can be 10 seconds, 20 seconds etc..
, can be default to nearest first to characterize the data variation in play buffer for above-mentioned key parameter (5) Period, (the first preset time period can be represented with buffer window buffer_time_window_, for example, nearest first is pre- If the period is first 30 seconds, then buffer_time_window_ value is 30) interior, each unit interval (example in play buffer Such as 1 second) the remaining reproduction time of the video data downloaded recorded, that is, record nearest buffer_time_window_ Remaining reproduction time in interior play buffer, the and (curve that carried out curve fitting to the remaining reproduction time of record Fitting), the matched curve obtained.
Curve matching refers to select appropriate curve type to be fitted observation data, and analyzes two with the curvilinear equation of fitting Relation between variable, in the specific implementation, can be carried out curve fitting using least square method.Wherein, by sum of square of deviations most Small principle chooses matched curve, and takes the method that binomial equation is matched curve, referred to as least square method.
It should be noted that buffer_time_window_ values are smaller more sensitive, but matched curve error is bigger; Buffer_time_window_ values are more big more blunt, but linear fit curve gets over the change side that can correctly reflect buffer data To.
Because user seek operations (user drags progress bar to the operation at some time point of target video) can be interrupted and worked as The video data of preceding player is downloaded, or, when player stops downloading data, the remaining reproduction time of play buffer is made Into strong influence, and then the accuracy of influence curve fitting, therefore, when user seek is operated or player stops downloading number According to when, the embodiment of the present invention can empty buffer_time_window_, restart to record.
For above-mentioned key parameter (6), the embodiment of the present invention can select a kind of code stream as code stream from a variety of code streams Criterion, such as BS_High code streams are chosen as code stream criterion, using BS_High as boundary, by the high code streams of BS_High As high quality code stream, using code stream low BS_High as high quality code stream.
For above-mentioned key parameter (7), in the specific implementation, judge whether to need to carry out bitstreams switching, not just one The secondary result for sentencing section, but multiple judged result is cumulative, for example, when judging that current code stream is changeable for the first time, it is changeable Number is designated as 1, and when judging that current code stream is changeable next time, changeable number is designated as 2, etc., by that analogy, until that can cut The number changed reaches Second Threshold, is just once switched.
For above-mentioned key parameter (8), video server and/or player can set the scope of changeable code stream, Set the limitation scope of highest code stream and minimum code stream.
For above-mentioned key parameter (9), interim card number is the interim card so far time that current code stream plays target video Number, once, interim card number increases by 1 to interim card.
For above-mentioned key parameter (10), seek operations are that user drags progress bar to the behaviour at some time point of film Make, detection user operates to the seek of target video, counts seek number of operations up to now.
For above-mentioned key parameter (11), total switching times of target video can so far, target video switching Number adds up.
In the specific implementation, settable bitstreams switching frequency, i.e., minimum switching (including it is upper switch and lower switching, upper switching To switch to code stream more higher leveled than currently playing code stream, under switch to the code stream for switching to one-level lower than currently playing code stream) Interval time, the number of video switching is controlled with this.For example, with reference to the total duration of currently playing film, by the most short of lower switching Time interval controls were at 60 seconds~300 seconds, by the shortest time Separation control of upper switching at 300 seconds~600 seconds, so as to control one Total switching times of portion's film.
For above-mentioned key parameter (12), target video can use polytype code stream in playing process, play Device can record to the code stream used.
Step 102, actual optimum code stream is gone out based on the key parameter decision-making;
After player obtains the key parameter of target video, actual optimum code stream can be gone out according to key parameter decision-making, Actual optimum code stream might not be identical with the optimal code stream of above-mentioned theory, and reason is as follows:Calculated based on Ek/M/1 queuing models Theoretical optimum code stream calculation ideally only takes into account network speed of download (i.e. network speed), and to the accuracy requirement of network speed When very high result just it is credible, while in queuing model in ideal situation not as user seek operation etc. to whole queuing model The destruction of stationary process, therefore theoretical optimal code stream is optimal code stream ideally, it is single to be obtained by Ek/M/1 queuing models The result arrived is not very reliable.Carry out decision-making in the specific implementation, needing to consider a variety of decision conditions and go out actual optimum code Stream.
In a kind of preferred embodiment of the embodiment of the present invention, step 102 can include following sub-step:
Sub-step S21, multiple key parameters are chosen from the key parameter, as multiple decision factors;
In the specific implementation, can be using above-mentioned key parameter all as decision factor, or from above-mentioned key parameter Selected part key parameter is as decision factor.
Sub-step S22, actual optimum code stream is gone out based on the decision factor decision-making., can after choosing multiple decision factors To go out actual optimum code stream according to decision factor decision-making.In a kind of preferred embodiment of the embodiment of the present invention, sub-step S22 enters One step can include following sub-step:
Sub-step S221, N number of decision condition is set based on the decision factor, wherein N is positive integer;
The condition that decision condition meets to determine actual optimum code stream to need.As a kind of example, decision condition can wrap Include the part or all of of following condition:
1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first Threshold value, if so, then judging that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
Wherein, first threshold is remaining reproduction time threshold value corresponding to theoretical optimal code stream, for example, currently playing high definition shadow Piece, network speed is relatively good, and it is 720p that theoretical optimal code stream, which is calculated, by Ek/M/1 queuing models, i.e., current network speed can To meet the normal play of 720p code streams, but if the remaining reproduction time for the video data that now play buffer has been downloaded is very Few, such as only 10 seconds (being less than 720p 20 seconds set in advance), the code stream for now switching 720p causes the probability of interim card can be very big, Therefore it may finally judge that the decision condition is unsatisfactory for threshold value standard.If the video data that now play buffer has been downloaded Remaining reproduction time is enough (being more than 720p 20 seconds set in advance), then judges that the decision condition meets threshold value standard.
2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then the decision-making bar is judged Part meets threshold value standard, if downward trend, then judges that the decision condition is unsatisfactory for threshold value standard;
The curve of fitting is that ascendant trend or downward trend can be judged by the slope of a curve, if slope<0, Illustrate that the data in buffering area are reduced trend, otherwise, illustrate that the data in buffering area have growth trend.
The calculating of slope can use formula y=ax+b, wherein, x is the unit time, and y is to play to delay in the unit interval The remaining reproduction time for the video data downloaded in area is rushed, a is slope, and b is correction value.A can be tried to achieve according to x, y value Value and b value.Work as a<0, illustrate that the data in buffering area are reduced trend, otherwise, illustrate that the data in buffering area have increasing Long trend.
3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision-making is adjusted The threshold value standard of condition;
When judge current code stream for high quality code stream or low quality code stream after, can be according to judged result, adaptive adjustment is each The threshold value standard of individual decision condition, wherein, the threshold value standard of each decision condition is to increase or decrease the threshold value of key parameter.Example Such as, if current code stream is high quality code stream, such as BS_720P, key parameter when judging to switch up BS_1080p will Can be stricter than normal value;If current code stream is low quality code stream, such as BS_150, then on pass when being switched to higher code stream Bond parameter is looser than normal value.Because when currently playing code stream is high quality code stream, user's perception is fine, unless net Fast condition is very good, can just switch up on higher-quality code stream, is low-quality code stream if currently playing, network speed It could switch to when situation take a favorable turn on high level code stream.
In embodiments of the present invention, the selection of key parameter and the setting of its threshold value need to combine the progress of player iteration in fact Border is tested, and chooses suitable key parameter and optimal threshold.
4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging The decision condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, currently cumulative is cut The number zero changed continues the changeable number that adds up, or, currently cumulative changeable number is zeroed;
Currently playing code stream is determined as that changeable i.e. theoretical optimal code stream is changeable code stream.When changeable number reaches During Second Threshold, for example, currently playing code stream is BS_High, Second Threshold is set as 10 times, and the theory of continuous 10 calculating is most Excellent code stream is all BS_720p, then decision condition 4) meet threshold value standard, otherwise, this condition is unsatisfactory for, the result of decision is exactly need not Switching.For example the theoretical optimal code stream of current 8 calculating is BS_720p, the optimal code stream of the 9th calculating is BS_Hig, then sentences Determine the statistics number that BS_720p is changeable code stream to be zeroed, added up since new.
5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if It is then to judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
6) choose and render the suitable code stream of area size with current player;
If for example, optimal code stream is high quality code stream, but current player renders window very little, it is without very high code stream It can clearly watch, even if speed of download is quickly, need not also be switched to high quality code stream, the flow of user is saved with this.
If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
For example, if interim card number is a lot, illustrate the key parameter threshold value that code stream is raised in adaptive code stream calculating process It is unreasonable, it can suitably expand these threshold values, the standard of upper switching is improved.
If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
User seek operation can to film preload have an impact, such as user seek arrive without preloading position, Player needs to load data from the time point again, and the data buffered in the past can be cancelled, adaptive if seek number of operations is a lot Key parameter threshold value in code stream calculating process is answered will not suitably to expand these threshold values, will calculate optimal entirely appropriate The standard of code stream improves.
9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging the decision condition Threshold value standard is unsatisfactory for, if it is not, then judging that the decision condition meets threshold value standard;
If whether total switching times of the target video of record are more than the 5th threshold value, illustrate target video frequent switching Code stream, now the decision condition be unsatisfactory for threshold value standard.Otherwise, decision condition meets threshold value standard.
10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code is not chosen Stream is used as actual optimum code stream.
Decision factor (10) can apply to special circumstances, as shown in figure 3, situation about being found during test, code stream exist BS_150 and BS_720 by frequent switching, reason be same film under identical network condition, using BS_150 code streams at present Carry speed quickly, speed of download drastically declines after being switched to BS_720, and is continued for, and after being switched to BS_150, network speed becomes Normally, BS_720 speeds of download are switched to again drastically to decline ... .. is repeated multiple times.Such case is actually rare, but can also deposit Therefore the embodiment of the present invention adds the code stream that uses film and the record of code stream existence time, during decision-making, if before finding Some the code stream existence time used is very short, illustrates to be not appropriate for being switched to this code stream.
Sub-step S222, if the decision condition is satisfied by corresponding threshold value standard, the optimal code stream of the theory is made For the actual optimum code stream;
Sub-step S223, if any decision condition is unsatisfactory for corresponding threshold value standard, by the optimal code stream pair of theory The code stream for the lower level answered as the actual optimum code stream, or, using currently playing code stream as the actual optimum code Stream.Such as currently playing code stream is BS_Standard, user's network speed gradually improves, the reason that adaptive code flow module calculates It is BS_720p by optimal code stream, but list discovery be present in the code stream crossed according to the movie playback, and the film is in BS_720p code streams Existence time is too short, is not suitable for playing BS_720p code stream again, at this moment can lower a grade, i.e. BS_High, as The actual optimum code stream that decision-making goes out, if the BS_High film sources of the film are not present, currently playing code stream be exactly reality most Excellent code stream.Also a kind of situation is exactly that currently playing code stream is exactly BS_High, and the theoretical optimal code stream calculated is BS_ 720p, when there is above-mentioned analogue, it is exactly just currently playing code stream to lower a grade.
After decision condition is set, when decision condition all meets to require, just using theoretical optimal code stream as actual optimum Code stream, can be with other decision conditions of comprehensive reference by actual optimum code stream if not all decision condition all meets to require The next stage code stream of theoretical optimal code stream is turned down, or, using currently playing code stream as actual optimum code stream.
For example, currently playing high definition film, network speed is relatively good, and theory is calculated most by Ek/M/1 queuing models Excellent broadcast code flow is 720p, i.e., current network speed can meet the normal play of 720p code streams.The decision condition of setting has above-mentioned (1), (2) and (9), if now the remaining buffered data in play buffer is seldom, such as only 10 seconds (being less than default 20 seconds), The code stream for now switching 720p causes the probability of interim card can be very big, is unsatisfactory for decision condition (1), the actual optimum code of final decision Flow for currently playing code stream;If the data of buffering area are enough (being more than default 20 seconds), that is, when meeting decision condition (1), And if the matched curve for according to the remaining reproduction time of play buffer obtain after linear fit is reduced trend, it is unsatisfactory for Decision condition (2), the actual optimum code stream of final decision is also currently playing code stream;(meet if buffer data is enough Decision factor (1)), and matched curve has gradual increase trend (meeting decision factor (2)), if judging the switching time of our department's film Whether number has exceeded the 5th threshold value, if it exceeds (being unsatisfactory for decision factor (4)), then the actual optimum code stream of final decision is also Currently playing code stream;If being not above and (meeting decision factor (4)), the actual optimum code stream of final decision also for it is theoretical most Excellent code stream.
Step 103, when the actual optimum code stream and currently playing code stream differ, switching time is calculated;
Actual optimum code stream differs with currently playing code stream, illustrates to need to switch over currently playing code stream, switching For actual optimum code stream, now, the embodiment of the present invention can calculate switching time, to ensure the seamless switching of two code streams. In a kind of preferred embodiment of the embodiment of the present invention, step 103 can include following sub-step:
Sub-step S31, set and the minimal buffering time is preloaded corresponding to various code streams;
The calculating of switching time directly affects the fluency of bitstreams switching, to make two code stream seamless switchings, improves user and sees Experience is seen, not only needs two code stream key frame alignment on server, audio tracks alignment, it is also necessary to during client switching code stream Ensure that the code stream to be switched to (optimal code stream) data are pre-loaded.Therefore, it is corresponding to set various code streams for the embodiment of the present invention The preloading minimal buffering time, the selection of the preloading minimal buffering time, when can choose different according to different code streams Between.
Sub-step S32, when the actual optimum code stream differs with currently playing code stream, calculated and cut using equation below Change opportunity time:
Time=(bs_rate_ [result] * 5000)/average_download_speed_+bs_min_buffer_ time_[result]);
Wherein, bs_rate_ [result] represents the code check of the optimal code stream, and average_download_speed_ is Current averaging network speed of download, bs_min_buffer_time_ [result] represent the default minimal buffering time.Code stream Quality is higher, and Time value is bigger.
Step 104, it is the reality by the currently playing bitstreams switching of the target video when the switching time reaches The optimal code stream in border.
In a kind of preferred embodiment of the embodiment of the present invention, step 104 can include following sub-step:
Sub-step S41, calculate the optimal key frame position in the preset range of the switching time;
The embodiment of the present invention corrects the switching time being calculated according to optimal key frame position, wherein, optimal key Frame position is the position of a key frame nearest from switching time.For example, the switching time being calculated is film Switch at 320s, but there might not be key frame at 320s, but have a key frame at 317.120s, at 321.300s There is a key frame, then optimal key frame is exactly 321.300s, i.e., final switching time is at the 321.300s of film.
Sub-step S42, when the optimal key frame position is subtracted into the preloading minimal buffering of the actual optimum code stream Between, obtain preload position;
Sub-step S43, when the target video is played to the preload position, stop loading currently playing code stream, Start to load the actual optimum code stream;
For ensure seamless switching, the embodiment of the present invention can at the minimal buffering time from optimal key frame position pre-add Carry actual optimum code stream.Specifically, when optimal key frame position is subtracted the preloading minimal buffering by the embodiment of the present invention Between, obtain preload position;And carry out loading switching in preload position, that is, stop loading current code stream, it is actual to start loading Optimal code stream.For example, the code stream that current film plays is high definition, in playing process, network slowly improves, and decision-making goes out actual optimum Code stream is 720p, and it is 320s that switching time, which is calculated, and current play time is 300s, i.e. 720p can be switched to after 20s, with Optimal key frame position is 320.766s corresponding to 320s, and the minimal buffering time of the actual optimum code stream is 20s, then in 300s Place, can stop the loading of high definition bit stream data, start to preload 720p data.
Sub-step S44, when the target video is played to the optimal key frame position, by the actual optimum code stream In sent with the optimal key frame position identical key frame to decoder.
Applied to the embodiment of the present invention, until current code stream is played to optimal key frame position, pre-add can be switched to At the optimal code stream identical key frame carried, seamless switching is completed.For example, in upper example, when current code stream is played to During 320.766s, it is switched at 720p identical code stream, and the same code of the 720p is spread and gives decoder, completes no seaming and cutting Change.
In embodiments of the present invention, when player detects that a upper video playback finishes, during chain broadcast target video, or, When startup player commences play out target video for the first time, player obtains the key parameter, and is gone out according to key parameter decision-making Actual optimum code stream, when when actual optimum code stream and currently playing code stream differ, calculating rational switching time, to Up to bitstreams switching is carried out during switching time, ensure the seamless smooth switching of two code streams, improve user's viewing experience.
In addition, the present invention is without the particular platform for relying on HTTP adaptive stream media systems.
In addition, the present invention considers a variety of key parameters and a variety of decision conditions, decision-making goes out actual optimum code stream, made Of the invention it must can take into account video definition and significantly reduce player interim card ratio, from fig. 4, it can be seen that about 55% interim card is Occur when code stream is BS_150, illustrate that the present invention is effective, provided most because BS_150 code streams are video servers Low code stream, there is interim card when playing this code stream, illustrate that user network is excessively poor, because network speed difference can not avoid interim card.This code The interim card number flowed down accounts for the ratio of total interim card number higher than the summation of interim card accounting under other code streams, illustrates the embodiment of the present invention Control to code stream is accurate.From fig. 5, it can be seen that using the present invention after, player interim card than impact effect it is obvious, without using Average interim card ratio is 6.1% when of the invention, the use of average interim card ratio after the present invention is 3.8%, reduces 37.7% interim card.
However, the interim card number under above-mentioned BS_150 code streams accounts for the ratio of total interim card number nor the higher the better, because The present invention will not only reduce interim card ratio, also to take into account video definition, both reasonable compromises, be only optimal adaptive dynamic code Stream scheme.
It should be noted that for embodiment of the method, in order to be briefly described, therefore it is all expressed as to a series of action group Close, but those skilled in the art should know, the embodiment of the present invention is not limited by described sequence of movement, because according to According to the embodiment of the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art also should Know, embodiment described in this description belongs to preferred embodiment, and the involved action not necessarily present invention is implemented Necessary to example.
Reference picture 6, a kind of structured flowchart of bitstreams switching device embodiment of the present invention is shown, can specifically be included as follows Module:
Key parameter acquisition module 601, for being finished in a upper video playback, during chain broadcast target video, or, for the first time When startup player commences play out target video, key parameter is obtained;
Decision-making module 602, for going out actual optimum code stream based on the key parameter decision-making;
Switching time computing module 603, for when the actual optimum code stream differs with currently playing code stream, calculating Switching time;
Handover module 604, for when the switching time reaches, by the currently playing bitstreams switching of the target video For the actual optimum code stream.
In a kind of preferred embodiment of the embodiment of the present invention, the decision-making module 602 includes:
Parameter chooses submodule, for choosing multiple key parameters from the key parameter, as multiple decision factors;
Decision-making submodule, for going out actual optimum code stream based on the decision factor decision-making.
As a kind of preferred exemplary of the embodiment of the present invention, the key parameter comprises at least:
(1) the code stream list of types that the target video is supported, the code stream list of types include polytype code Stream;
(2) current player renders area size;
(3) theoretical optimal code stream;
(4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
(5) in the first nearest preset time period, regarded to what is downloaded in play buffer corresponding to each unit interval The remaining reproduction time of frequency evidence, carries out curve fitting, obtained matched curve;
(6) according to default code stream criterion, judge currently playing code stream for high quality code stream or low quality code stream Judged result;
(7) preset time is ended, currently playing code stream is determined as changeable number;
(8) default highest code stream and minimum code stream limitation scope;
(9) the interim card number that target video plays;
(10) user is dragged to progress bar to target video to the dragging seek records of some position;
(11) total switching times of current goal video;
(12) the code stream record that target video film has used.
In a kind of preferred embodiment of the embodiment of the present invention, polytype code stream includes code stream grade, described Decision-making submodule is additionally operable to:
N number of decision condition is set based on the decision factor, wherein N is positive integer;
If the decision condition be satisfied by corresponding to threshold value standard, using the optimal code stream of theory as the reality most Excellent code stream;
If any decision condition is unsatisfactory for corresponding threshold value standard, by lower level corresponding to the optimal code stream of theory Code stream as the actual optimum code stream, or, using currently playing code stream as the actual optimum code stream.
As a kind of preferred exemplary of the embodiment of the present invention, the decision condition includes the part or all of of following condition:
1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first Threshold value, if so, then judging that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then the decision-making bar is judged Part meets threshold value standard, if downward trend, then judges that the decision condition is unsatisfactory for threshold value standard;
3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision-making is adjusted The threshold value standard of condition;
4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging The decision condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, currently cumulative is cut The number zero changed;
5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if It is then to judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
6) choose and render the suitable code stream of area size with current player;
If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging the decision condition Threshold value standard is unsatisfactory for, if it is not, then judging that the decision condition meets threshold value standard;
10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code is not chosen Stream is used as actual optimum code stream.
In a kind of preferred embodiment of the embodiment of the present invention, the key parameter acquisition module 601 is additionally operable to:
The mass value of polytype code stream is calculated respectively;
Using the maximum code stream of the mass value as theoretical optimal code stream.
In a kind of preferred embodiment of the embodiment of the present invention, polytype code is calculated respectively using equation below The mass value of stream:
G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
Wherein, i represents the type identification of code stream, and G [i] represents the mass value of code stream, and Q [i] represents various types of code streams Corresponding default initial mass value, cost [i] represent that various code streams preset the first mass loss value when playing caused by interim card; Costs represents to preset the second mass loss value caused by two bitstreams switchings;Current_bitstream_index represents current The default index value of broadcast code flow;P0 [i] represents player buffering area for empty probability.
In a kind of preferred embodiment of the embodiment of the present invention, the target video includes multiple logic bursts;The p0 [i] is obtained in the following way:
Based on current network speed of download, estimate that various types of code streams are downloaded needed for a logic burst respectively Download time, and define download w assignment of logical needed for download time be t;
Calculate respectively and E (t) it is expected corresponding to the download time t;
P0 [i] is calculated using equation below:
P0 [i]=1-1/E (t) [i] * μ;
Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the decoding time needed for a logic burst Default expectation.
In a kind of preferred embodiment of the embodiment of the present invention, the switching time computing module 603 includes:
Buffer time sets submodule, for setting the preloading minimal buffering time corresponding to various code streams;
Calculating sub module, for when the actual optimum code stream and currently playing code stream differ, using equation below Calculate switching time time:
Time=(bs_rate_ [result] * 5000)/average_download_speed_+bs_min_buffer_ time_[result]);
Wherein, bs_rate_ [result] represents the code check of the actual optimum code stream, average_download_ Speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the actual optimum code The preloading minimal buffering time of stream.
In a kind of preferred embodiment of the embodiment of the present invention, the handover module 604 includes:
Position calculating sub module, the optimal key frame position in preset range for calculating the switching time;
Preload position calculating sub module, for the optimal key frame position to be subtracted into the pre- of the actual optimum code stream The minimal buffering time is loaded, obtains preload position;
Submodule is preloaded, is currently broadcast for when the target video is played to the preload position, stopping loading Code stream is put, starts to load the actual optimum code stream;
Switching submodule, for when the target video is played to the optimal key frame position, by the reality most Sent in excellent code stream with the optimal key frame position identical key frame to decoder.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is described by the way of progressive, what each embodiment stressed be with The difference of other embodiment, between each embodiment identical similar part mutually referring to.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can be provided as method, apparatus or calculate Machine program product.Therefore, the embodiment of the present invention can use complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can use one or more wherein include computer can With in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code The form of the computer program product of implementation.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, terminal device (system) and computer program The flow chart and/or block diagram of product describes.It should be understood that can be by computer program instructions implementation process figure and/or block diagram In each flow and/or square frame and the flow in flow chart and/or block diagram and/or the combination of square frame.These can be provided Computer program instructions are set to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing terminals Standby processor is to produce a machine so that is held by the processor of computer or other programmable data processing terminal equipments Capable instruction is produced for realizing in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames The device for the function of specifying.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing terminal equipments In the computer-readable memory to work in a specific way so that the instruction being stored in the computer-readable memory produces bag The manufacture of command device is included, the command device is realized in one flow of flow chart or multiple flows and/or one side of block diagram The function of being specified in frame or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing terminal equipments so that Series of operation steps is performed on computer or other programmable terminal equipments to produce computer implemented processing, so that The instruction performed on computer or other programmable terminal equipments is provided for realizing in one flow of flow chart or multiple flows And/or specified in one square frame of block diagram or multiple square frames function the step of.
Although having been described for the preferred embodiment of the embodiment of the present invention, those skilled in the art once know base This creative concept, then other change and modification can be made to these embodiments.So appended claims are intended to be construed to Including preferred embodiment and fall into having altered and changing for range of embodiment of the invention.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, article or terminal device including a series of elements are not only wrapped Those key elements, but also the other element including being not expressly set out are included, or is also included for this process, method, article Or the key element that terminal device is intrinsic.In the absence of more restrictions, wanted by what sentence "including a ..." limited Element, it is not excluded that other identical element in the process including the key element, method, article or terminal device also be present.
Above to a kind of bitstreams switching method provided by the present invention and a kind of bitstreams switching device, detailed Jie has been carried out Continue, specific case used herein is set forth to the principle and embodiment of the present invention, and the explanation of above example is only It is the method and its core concept for being used to help understand the present invention;Meanwhile for those of ordinary skill in the art, according to this hair Bright thought, there will be changes in specific embodiments and applications, in summary, this specification content should not manage Solve as limitation of the present invention.

Claims (16)

  1. A kind of 1. bitstreams switching method, it is characterised in that methods described includes:
    When a upper video playback finishes, during chain broadcast target video, or, start player for the first time and commence play out target video When, obtain key parameter;
    Actual optimum code stream is gone out based on the key parameter decision-making;
    When the actual optimum code stream and currently playing code stream differ, switching time is calculated;
    It is the actual optimum code stream by the currently playing bitstreams switching of the target video when the switching time reaches;
    Wherein, described when the actual optimum code stream and currently playing code stream differ, the step of calculating switching time, includes:
    Set and the minimal buffering time is preloaded corresponding to various code streams;
    When the actual optimum code stream and currently playing code stream differ, then switching time time is calculated using equation below:
    Time=(bs_rate_ [result] * 5000)/average_download_speed_+bs_min_buffer_time_ [result]);
    Wherein, bs_rate_ [result] represents the code check of the actual optimum code stream, and average_download_speed_ is Current averaging network speed of download, bs_min_buffer_time_ [result] represent the pre-add of the actual optimum code stream Carry the minimal buffering time.
  2. 2. according to the method for claim 1, it is characterised in that described that actual optimum code is gone out based on the key parameter decision-making The step of stream, includes:
    Multiple key parameters are chosen from the key parameter, as multiple decision factors;
    Actual optimum code stream is gone out based on the decision factor decision-making.
  3. 3. according to the method for claim 2, it is characterised in that the key parameter comprises at least:
    (1) the code stream list of types that the target video is supported, the code stream list of types include polytype code stream;
    (2) current player renders area size;
    (3) theoretical optimal code stream;
    (4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
    (5) in the first nearest preset time period, to the video counts downloaded in play buffer corresponding to each unit interval According to remaining reproduction time, carry out curve fitting, obtained matched curve;
    (6) according to default code stream criterion, judgement of the currently playing code stream for high quality code stream or low quality code stream is judged As a result;
    (7) preset time is ended, currently playing code stream is determined as changeable number;
    (8) default highest code stream and minimum code stream limitation scope;
    (9) the interim card number that target video plays;
    (10) user is dragged to progress bar to target video to the dragging seek records of some position;
    (11) total switching times of current goal video;
    (12) the code stream record that target video film has used.
  4. 4. according to the method for claim 3, it is characterised in that polytype code stream includes code stream grade, described The step of going out actual optimum code stream based on the decision factor decision-making includes:
    N number of decision condition is set based on the decision factor, wherein N is positive integer;
    If the decision condition is satisfied by corresponding threshold value standard, using the optimal code stream of theory as the actual optimum code Stream;
    If any decision condition is unsatisfactory for corresponding threshold value standard, by the code of lower level corresponding to the optimal code stream of theory Stream is used as the actual optimum code stream, or, using currently playing code stream as the actual optimum code stream.
  5. 5. according to the method for claim 4, it is characterised in that the decision condition includes the part or complete of following condition Portion:
    1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first threshold, If so, then judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
    2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then judge that the decision condition expires Sufficient threshold value standard, if downward trend, then judge that the decision condition is unsatisfactory for threshold value standard;
    3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision-making bar is adjusted The threshold value standard of part;
    4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging to determine Plan condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, it is changeable by what is currently added up Number is zeroed;
    5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if so, Then judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
    6) choose and render the suitable code stream of area size with current player;
    If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
    If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
    9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging that the decision condition is discontented with Sufficient threshold value standard, if it is not, then judging that the decision condition meets threshold value standard;
    10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code stream is not chosen and is made For actual optimum code stream.
  6. 6. according to the method described in claim 3 or 4 or 5, it is characterised in that the optimal code stream of theory obtains as follows :
    The mass value of polytype code stream is calculated respectively;
    Using the maximum code stream of the mass value as theoretical optimal code stream;
    Wherein, the mass value of polytype code stream is calculated respectively using equation below:
    G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
    Wherein, i represents the type identification of code stream, and G [i] represents the mass value of code stream, and Q [i] represents that various types of code streams are corresponding Default initial mass value, cost [i] represents that various code streams preset the first mass loss value when playing caused by interim card; Costs represents to preset the second mass loss value caused by two bitstreams switchings;Current_bitstream_index represents current The default index value of broadcast code flow;P0 [i] represents player buffering area for empty probability.
  7. 7. according to the method for claim 6, it is characterised in that the target video includes multiple logic bursts;The p0 [i] is obtained in the following way:
    Based on current network speed of download, under estimating that various types of code streams are downloaded needed for a logic burst respectively The time is carried, and the download time defined needed for w assignment of logical of download is t;
    Calculate respectively and E (t) it is expected corresponding to the download time t;
    P0 [i] is calculated using equation below:
    P0 [i]=1-1/E (t) [i] * μ;
    Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the pre- of the decoding time needed for a logic burst If expectation.
  8. 8. according to the method for claim 1, it is characterised in that it is described when the switching time reaches, by the target The step of currently playing bitstreams switching of video is the actual optimum code stream includes:
    Calculate the optimal key frame position in the preset range of the switching time;
    The optimal key frame position is subtracted to the preloading minimal buffering time of the actual optimum code stream, obtains and preloads position Put;
    When the target video is played to the preload position, stops loading currently playing code stream, start to load the reality The optimal code stream in border;
    When the target video is played to the optimal key frame position, by the actual optimum code stream with the optimal pass Key frame position identical key frame is sent to decoder.
  9. 9. a kind of bitstreams switching device, it is characterised in that described device includes:
    Key parameter acquisition module, for being finished in a upper video playback, during chain broadcast target video, or, start broadcasts for the first time When putting device and commencing play out target video, key parameter is obtained;
    Decision-making module, for going out actual optimum code stream based on the key parameter decision-making;
    Switching time computing module, when switching for when the actual optimum code stream differs with currently playing code stream, calculating Machine;
    Handover module, for being described by the currently playing bitstreams switching of the target video when the switching time reaches Actual optimum code stream;
    Wherein, the switching time computing module includes:Buffer time sets submodule, for setting corresponding to various code streams Preload the minimal buffering time;Calculating sub module, for when the actual optimum code stream and currently playing code stream differ, adopting Switching time time is calculated with equation below:Time=(bs_rate_ [result] * 5000)/average_download_ speed_+bs_min_buffer_time_[result]);Wherein, bs_rate_ [result] represents the actual optimum code stream Code check, average_download_speed_ is current averaging network speed of download, bs_min_buffer_time_ [result] represents the preloading minimal buffering time of the actual optimum code stream.
  10. 10. device according to claim 9, it is characterised in that the decision-making module includes:
    Parameter chooses submodule, for choosing multiple key parameters from the key parameter, as multiple decision factors;
    Decision-making submodule, for going out actual optimum code stream based on the decision factor decision-making.
  11. 11. device according to claim 10, it is characterised in that the key parameter comprises at least:
    (1) the code stream list of types that the target video is supported, the code stream list of types include polytype code stream;
    (2) current player renders area size;
    (3) theoretical optimal code stream;
    (4) the remaining reproduction time for the video data downloaded in currently playing buffering area;
    (5) in the first nearest preset time period, to the video counts downloaded in play buffer corresponding to each unit interval According to remaining reproduction time, carry out curve fitting, obtained matched curve;
    (6) according to default code stream criterion, judgement of the currently playing code stream for high quality code stream or low quality code stream is judged As a result;
    (7) preset time is ended, currently playing code stream is determined as changeable number;
    (8) default highest code stream and minimum code stream limitation scope;
    (9) the interim card number that target video plays;
    (10) user is dragged to progress bar to target video to the dragging seek records of some position;
    (11) total switching times of current goal video;
    (12) the code stream record that target video film has used.
  12. 12. device according to claim 11, it is characterised in that polytype code stream includes code stream grade, institute Decision-making submodule is stated to be additionally operable to:
    N number of decision condition is set based on the decision factor, wherein N is positive integer;
    If the decision condition is satisfied by corresponding threshold value standard, using the optimal code stream of theory as the actual optimum code Stream;
    If any decision condition is unsatisfactory for corresponding threshold value standard, by the code of lower level corresponding to the optimal code stream of theory Stream is used as the actual optimum code stream, or, using currently playing code stream as the actual optimum code stream.
  13. 13. device according to claim 12, it is characterised in that the decision condition includes the part or complete of following condition Portion:
    1) whether the remaining reproduction time for the video data for judging to have downloaded in the currently playing buffering area is more than first threshold, If so, then judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
    2) judge that the matched curve is in rising trend or downward trend;If ascendant trend, then judge that the decision condition expires Sufficient threshold value standard, if downward trend, then judge that the decision condition is unsatisfactory for threshold value standard;
    3) according to the judged result that the currently playing code stream is high quality code stream or low quality code stream, each decision condition is adjusted Threshold value standard;
    4) judge that the currently playing code stream is determined as whether changeable number is more than Second Threshold, if so, then judging to determine Plan condition meets threshold value standard, if it is not, then continue the changeable number that adds up, or, it is changeable by what is currently added up Number is zeroed;
    5) the optimal code stream of theory is judged whether in the range of the default highest code stream and the limitation of minimum code stream, if so, Then judge that the decision condition meets threshold value standard, if it is not, then judging that the decision condition is unsatisfactory for threshold value standard;
    6) choose and render the suitable code stream of area size with current player;
    If 7) the interim card number is more than the 3rd threshold value, the threshold value standard of each decision condition is adjusted;
    If 8) the dragging seek records are more than the 4th threshold value, the threshold value standard of each decision condition is adjusted;
    9) judge whether total switching times of the target video are more than the 5th threshold value, if so, then judging that the decision condition is discontented with Sufficient threshold value standard, if it is not, then judging that the decision condition meets threshold value standard;
    10) according to the code stream record used, if some code stream existence time is less than the 6th threshold value, the code stream is not chosen and is made For actual optimum code stream.
  14. 14. according to the device described in claim 11 or 12 or 13, it is characterised in that the key parameter acquisition module is also used In:
    The mass value of polytype code stream is calculated respectively;
    Using the maximum code stream of the mass value as theoretical optimal code stream;
    Wherein, the mass value of polytype code stream is calculated respectively using equation below:
    G [i]=Q [i]-p0 [i] * cost [i]-costs* (i-current_bitstream_index);
    Wherein, i represents the type identification of code stream, and G [i] represents the mass value of code stream, and Q [i] represents that various types of code streams are corresponding Default initial mass value, cost [i] represents that various code streams preset the first mass loss value when playing caused by interim card; Costs represents to preset the second mass loss value caused by two bitstreams switchings;Current_bitstream_index represents current The default index value of broadcast code flow;P0 [i] represents player buffering area for empty probability.
  15. 15. device according to claim 14, it is characterised in that the target video includes multiple logic bursts;It is described P0 [i] is obtained in the following way:
    Based on current network speed of download, under estimating that various types of code streams are downloaded needed for a logic burst respectively The time is carried, and the download time defined needed for w assignment of logical of download is t;
    Calculate respectively and E (t) it is expected corresponding to the download time t;
    P0 [i] is calculated using equation below:
    P0 [i]=1-1/E (t) [i] * μ;
    Wherein, E (t) [i] represents code stream i expectation;μ represents that decoder decodes the pre- of the decoding time needed for a logic burst If expectation.
  16. 16. device according to claim 9, it is characterised in that the handover module includes:
    Position calculating sub module, the optimal key frame position in preset range for calculating the switching time;
    Preload position calculating sub module, for the optimal key frame position to be subtracted to the preloading of the actual optimum code stream The minimal buffering time, obtain preload position;
    Submodule is preloaded, for when the target video is played to the preload position, stopping loading currently playing code Stream, starts to load the actual optimum code stream;
    Switching submodule, for when the target video is played to the optimal key frame position, by the actual optimum code Sent in stream with the optimal key frame position identical key frame to decoder.
CN201510185473.8A 2015-04-17 2015-04-17 A kind of bitstreams switching method and apparatus Active CN104967884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510185473.8A CN104967884B (en) 2015-04-17 2015-04-17 A kind of bitstreams switching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510185473.8A CN104967884B (en) 2015-04-17 2015-04-17 A kind of bitstreams switching method and apparatus

Publications (2)

Publication Number Publication Date
CN104967884A CN104967884A (en) 2015-10-07
CN104967884B true CN104967884B (en) 2018-01-26

Family

ID=54221807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510185473.8A Active CN104967884B (en) 2015-04-17 2015-04-17 A kind of bitstreams switching method and apparatus

Country Status (1)

Country Link
CN (1) CN104967884B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106921870A (en) * 2015-12-24 2017-07-04 北京奇虎科技有限公司 A kind of video broadcasting method and device
CN106878828A (en) * 2017-02-21 2017-06-20 微鲸科技有限公司 The method and device of automatic switchover multimedia code check
CN106937141A (en) * 2017-03-24 2017-07-07 北京奇艺世纪科技有限公司 A kind of bitstreams switching method and device
CN107071529B (en) * 2017-03-29 2018-10-26 咪咕视讯科技有限公司 A kind of HLS video broadcasting methods, terminal and server
CN107666593B (en) * 2017-08-28 2020-04-21 中国电子科技集团公司第二十八研究所 Video real-time transmission method under fluctuating network environment
CN109803167A (en) * 2017-11-17 2019-05-24 中国电信股份有限公司 Stream media document transmission method, streaming media clients and computer readable storage medium
CN108307248B (en) * 2018-02-01 2019-10-29 腾讯科技(深圳)有限公司 Video broadcasting method, calculates equipment and storage medium at device
CN109361756A (en) * 2018-11-08 2019-02-19 重庆急视飞救科技发展有限公司 Cross-platform data transmission method based on 120 network alarmings
CN111479171B (en) 2019-01-23 2022-05-20 上海哔哩哔哩科技有限公司 Pseudo seamless switching method, device and medium among different video sources played by Web
CN110087110B (en) * 2019-06-12 2021-03-30 深圳市大数据研究院 Method and device for dynamically regulating and controlling video playing by applying deep search
CN111866433B (en) * 2020-07-31 2021-06-29 腾讯科技(深圳)有限公司 Video source switching method, video source playing method, video source switching device, video source playing device, video source equipment and storage medium
CN113721908B (en) * 2021-08-30 2024-03-22 湖南快乐阳光互动娱乐传媒有限公司 Unlimited cascade component rendering method and device
CN114025211A (en) * 2021-10-27 2022-02-08 福建野小兽健康科技有限公司 Video issuing method and system adaptive to user equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291599A (en) * 2011-05-07 2011-12-21 董友球 Network video playing method and network video playing device
CN103428105A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive HTTP streaming code stream switching method and system based on bandwidth estimation
CN103428107A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive bitstream switching method and system based on cache underflow probability estimation
CN103686167A (en) * 2013-12-24 2014-03-26 广东威创视讯科技股份有限公司 Multi-stream broadcast method and device
CA2804741A1 (en) * 2013-01-21 2014-07-21 Disternet Technology, Inc. Media server
CN103997680A (en) * 2014-06-06 2014-08-20 北京奇艺世纪科技有限公司 Switching method and device of video bitstream
CN104219579A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Video switching method and video switching device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100166056A1 (en) * 2002-12-10 2010-07-01 Steve Perlman System and method for encoding video using a selected tile and tile rotation pattern
JP5753341B2 (en) * 2006-03-03 2015-07-22 ヴィドヨ,インコーポレーテッド System and method for providing error resilience, random access, and rate control in scalable video communication
US9191284B2 (en) * 2010-10-28 2015-11-17 Avvasi Inc. Methods and apparatus for providing a media stream quality signal
US9503490B2 (en) * 2012-02-27 2016-11-22 Qualcomm Incorporated Dash client and receiver with buffer water-level decision-making
CN103248953B (en) * 2013-04-24 2017-04-19 Tcl集团股份有限公司 Method and system for processing TV advertisement time and TV programme playing terminal
CN103297847A (en) * 2013-04-28 2013-09-11 四川长虹电器股份有限公司 Method for achieving signal source intelligent navigation and switching

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291599A (en) * 2011-05-07 2011-12-21 董友球 Network video playing method and network video playing device
CN103428105A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive HTTP streaming code stream switching method and system based on bandwidth estimation
CN103428107A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive bitstream switching method and system based on cache underflow probability estimation
CA2804741A1 (en) * 2013-01-21 2014-07-21 Disternet Technology, Inc. Media server
CN103686167A (en) * 2013-12-24 2014-03-26 广东威创视讯科技股份有限公司 Multi-stream broadcast method and device
CN103997680A (en) * 2014-06-06 2014-08-20 北京奇艺世纪科技有限公司 Switching method and device of video bitstream
CN104219579A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Video switching method and video switching device

Also Published As

Publication number Publication date
CN104967884A (en) 2015-10-07

Similar Documents

Publication Publication Date Title
CN104967884B (en) A kind of bitstreams switching method and apparatus
Spiteri et al. From theory to practice: Improving bitrate adaptation in the DASH reference player
US10110650B2 (en) Client side stream switching
US9167007B2 (en) Stream complexity mapping
EP2300928B1 (en) Client side stream switching
US8930559B2 (en) Adaptive hypertext transfer protocol (“HTTP”) media streaming systems and methods
CA2825019C (en) Variable bit video streams for adaptive streaming
CN110636346B (en) Code rate self-adaptive switching method and device, electronic equipment and storage medium
CN105814900B (en) System and method for managing adjacent channel in adaptive streaming environment
CN104205769B (en) The DASH clients and receiver of the improvement selected using playback rate
EP2649792B1 (en) Pre-buffering audio/video stream pairs
US10091269B2 (en) Buffering in HTTP streaming client
CN106993237A (en) Dynamic self-adapting code rate selection method based on MPEG DASH agreements
CN109257631A (en) Video carousel playback method, device, computer equipment and storage medium
JP5140952B2 (en) Content distribution system, content distribution server, content reproduction terminal, program, and content distribution method
Liang et al. Balancing interruption frequency and buffering penalties in VBR video streaming
WO2017071428A1 (en) Fast forward/rewind processing method and terminal
CN104581340A (en) Client-side, streaming media data receiving method and streaming media data transmission system
CN115460458B (en) Video frame loss method and device
CN109218809B (en) Streaming media playing method and device
Ma et al. Buffer control in VR video transmission over MMT system
Shen et al. QoE-optimal rate adaptation for HTTP adaptive streaming
EP4038892B1 (en) Methods, systems, and media for streaming video content using adaptive buffers

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