CN104967884A - Code stream switching method and code stream switching device - Google Patents

Code stream switching method and code stream switching device Download PDF

Info

Publication number
CN104967884A
CN104967884A CN201510185473.8A CN201510185473A CN104967884A CN 104967884 A CN104967884 A CN 104967884A CN 201510185473 A CN201510185473 A CN 201510185473A CN 104967884 A CN104967884 A CN 104967884A
Authority
CN
China
Prior art keywords
code stream
time
optimum
decision
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510185473.8A
Other languages
Chinese (zh)
Other versions
CN104967884B (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 embodiment of the present invention provides a code stream switching method and a code stream switching device, wherein the method comprises the steps of obtaining a key parameter when the previous video is played, and a target video is played continuously, or when a player is started for the first time to play the target video; based on the key parameter, deciding an actual optimal code stream; when the actual optimal code stream is different from the current playing code stream, calculating a switching opportunity; and when the switching opportunity arrives, switching the current playing code stream of the target video into the actual optimal code stream. According to the present invention, the seamless and smooth switching of the two code streams can be guaranteed, and the user watch experience is improved.

Description

A kind of bitstreams switching method and apparatus
Technical field
The present invention relates to video display arts field, particularly relate to a kind of bitstreams switching method and a kind of bitstreams switching device.
Background technology
Streaming Media (Streaming media) technology refers to after a series of multimedia data compression, carries out the real-time continuous transmission of multi-medium data in the form of streaming for a kind of technique and process viewed and admired.Compared with traditional multimedia file downloading and playing mode, the maximum advantage of Streaming Media is that the data of beginning only need be downloaded to local buffer and just can play by user, broadcasts while download, thus realizes Continuous Play.The startup time delay that this streaming manner not only makes program play significantly shortens, and greatly reduces the demand to user's local cache space.
But because the Internet provides the service of doing one's best; QoS (Quality ofService, service quality) cannot be provided to ensure, often there will be in streaming media playing process and play card; video quality such as acutely to shake at the unfavorable condition, and user cannot obtain good viewing experience.In order to overcome uncertain the caused impact of network condition, stream media system needs to adjust transmission policy adaptively, the network environment of transmission of flow media data process and change is adapted, thus makes user under present network conditions, obtain best Streaming Media experience.
The adaptive stream media transmission technology of current main-stream is divided into server end to realize and client realizes two types.Wherein, in the adaptive stream media transmission that server end realizes, most popular system is mostly based on RTP (real time transport protocol, RTP) and RTSP (real timestreaming protocol, real time streaming transport protocol), first system obtains stream media information and relevant parameter by HTTP, and then operation RTSP sets up the communication between client and streaming media server, finally by RTP transmitting multimedia data.This type of stream media system is the most typical with the Windows Media of the Real System of Real Networks company of the U.S. and Microsoft.But the information that server end realizes Adaptive Transmission needs is more, and the realization of system is mostly based on the proprietary protocol of complexity, and this constrains the development of such stream media technology to a certain extent.
Client realizes in adaptive stream media transmission, server repository has plurality of kinds of contents identical but the different Streaming Media burst of code check, during broadcasting, client is first to server request playlist, the essential information of section is comprised in playlist, as chip durations, time started stamp and sequencing etc., client will according to playlist download stream media section in order, at every turn to before server request downloading slicing, client all can carry out network condition detection, and in time cut into slices to the most suitable Streaming Media of server request according to current network conditions and caching situation, the download of each burst asks-responds to have come by H TT P.Under this implementation, the interactive information between client and server is less, and system realizes simple, do not need to set up special streaming media server, in addition, compared with RTP/RTSP, HTTP easily realizes and safeguards, in passing fire wall/NAT, have more advantage.
At present, adaptive stream media technology based on HTTP has become the development trend of stream media technology, HTTP adaptive stream media system is numerous, and wherein the system of main flow has the HTTPDynamic Streaming of the HTTP LiveStreaming of Apple, SilverLight smooth Streaming and Adobe of Microsoft.Some International Standards Organization have also carried out the standardization effort of the adaptive stream media technology based on HTTP, and influential standard has the HAS of OIPF, the HTTP Live Streaming draft etc. of the DASH of MPEG, IETF.Along with the progressively realization of the technology standardization work such as DASH, academia is also more to the correlative study of this technology in recent years, pays close attention to the formal definition related in technical process relative to standardization body, more pays close attention to actual performance and the optimization method of technology application.The people such as ChristopherMuller analyze IIS Smooth Streaming under live network scene, the performance of Live HTTPstreaming and Dynamic Streaming client, it is the most radical by the adaptive strategy of the request media slicing bit rate and buffer memory status discovery Dynamic Streaming of observing different clients, media slicing bit rate variation is the most violent, buffer underflow number of times is maximum, Ka Dunbigao, IIS SmoothStreaming takes second place, and Live HTTP streaming shows comparatively steady.But these technical schemes are all applied in particular platform, as Live HTTP streaming is mainly used in apple ios system, and main fluctuation situation Network Based and Liang Ge aspect, play buffer calculate, the condition of the optimum code stream of decision-making is more single, can not reflect the broadcasting behavior of actual play device completely.
Summary of the invention
Embodiment of the present invention technical problem to be solved is to provide a kind of bitstreams switching method, in order to ensure that the seamless smoothness of two code streams switches, improves user's viewing experience.
Accordingly, the embodiment of the present invention additionally provides a kind of bitstreams switching device, in order to ensure the implementation and application of said method.
In order to solve the problem, the invention discloses a kind of bitstreams switching method, described method comprises:
When a upper video playback is complete, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
Actual optimum code stream is gone out based on described key parameter decision-making;
When described actual optimum code stream and current broadcast code flow are not identical, calculate switching time;
When described switching time arrives, the current broadcast code flow of described target video is switched to described actual optimum code stream.
Preferably, the described step going out actual optimum code stream based on described key parameter decision-making comprises:
Multiple key parameter is chosen, as multiple decision factor from described key parameter;
Actual optimum code stream is gone out based on described decision factor decision-making.
Preferably, described key parameter at least comprises:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
Preferably, described polytype code stream comprises code stream grade, and the described step going out actual optimum code stream based on described decision factor decision-making comprises:
Set N number of decision condition based on described decision factor, wherein N is positive integer;
If described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
If arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.
Preferably, described decision condition comprises the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if so, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
Preferably, the optimum code stream of described theory obtains in the following manner:
Calculate the mass value of described polytype code stream respectively;
Using code stream maximum for described mass value as the optimum code stream of theory.
Preferably, following formula is adopted to calculate the mass value of described 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, and G [i] represents the mass value of code stream, and Q [i] represents that the default initial mass value that various types of code stream is corresponding, cost [i] represent the default first mass loss value that various code stream card when playing causes; Costs represents the default second mass loss value that two bitstreams switching cause; Current_bitstream_index represents the default index value of current broadcast code flow; P0 [i] represents that player buffering area is empty probability.
Preferably, described target video comprises multiple logic burst; Described p0 [i] obtains in the following way:
Based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
Calculate expectation E (t) that described download time t is corresponding respectively;
Adopt following formulae discovery p0 [i]:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
Preferably, described when described actual optimum code stream and current broadcast code flow are not identical, the step calculating switching time comprises:
Set the prestrain minimal buffering time that various code stream is corresponding;
When described actual optimum code stream and current broadcast code flow are not identical, then adopt following formulae discovery 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 described actual optimum code stream, average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the prestrain minimal buffering time of described actual optimum code stream.
Preferably, described when described switching time arrives, switch to the step of described actual optimum code stream to comprise the current broadcast code flow of described target video:
Calculate the optimum key frame position in the preset range of described switching time;
Described optimum key frame position is deducted the prestrain minimal buffering time of described actual optimum code stream, obtain preload position;
When described target video is played to described preload position, stops loading current broadcast code flow, start to load described actual optimum code stream;
When described target video is played to described optimum key frame position, key frame identical with described optimum key frame position in described actual optimum code stream is sent to decoder.
The invention also discloses a kind of bitstreams switching device, described device comprises:
Key parameter acquisition module, for complete in a upper video playback, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
Decision-making module, for going out actual optimum code stream based on described key parameter decision-making;
Switching time computing module, for when described actual optimum code stream and current broadcast code flow are not identical, calculates switching time;
Handover module, for when described switching time arrives, switches to described actual optimum code stream by the current broadcast code flow of described target video.
Preferably, described decision-making module comprises:
Parameter choose submodule, for choosing multiple key parameter from described key parameter, as multiple decision factor;
Decision-making submodule, for going out actual optimum code stream based on described decision factor decision-making.
Preferably, described key parameter at least comprises:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
Preferably, described polytype code stream comprises code stream grade, described decision-making submodule also for:
Set N number of decision condition based on described decision factor, wherein N is positive integer;
If described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
If arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.
Preferably, described decision condition comprises the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if so, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
16, the device according to claim 13 or 14 or 15, is characterized in that, described key parameter acquisition module also for:
Calculate the mass value of described polytype code stream respectively;
Using code stream maximum for described mass value as the optimum code stream of theory.
Preferably, following formula is adopted to calculate the mass value of described 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, and G [i] represents the mass value of code stream, and Q [i] represents that the default initial mass value that various types of code stream is corresponding, cost [i] represent the default first mass loss value that various code stream card when playing causes; Costs represents the default second mass loss value that two bitstreams switching cause; Current_bitstream_index represents the default index value of current broadcast code flow; P0 [i] represents that player buffering area is empty probability.
Preferably, described target video comprises multiple logic burst; Described p0 [i] obtains in the following way:
Based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
Calculate expectation E (t) that described download time t is corresponding respectively;
Adopt following formulae discovery p0 [i]:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
Preferably, described switching time computing module comprises:
Buffer time setting submodule, for setting prestrain minimal buffering time corresponding to various code stream;
Calculating sub module, for when described actual optimum code stream and current broadcast code flow are not identical, adopts following formulae discovery 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 described actual optimum code stream, average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the prestrain minimal buffering time of described actual optimum code stream.
Preferably, described handover module comprises:
Position calculation submodule, for calculating the optimum key frame position in the preset range of described switching time;
Preload position calculating sub module, for described optimum key frame position being deducted the prestrain minimal buffering time of described actual optimum code stream, obtains preload position;
Prestrain submodule, for when described target video is played to described preload position, stops loading current broadcast code flow, starts to load described actual optimum code stream;
Switching submodule, for when described target video is played to described optimum key frame position, is sent to decoder by key frame identical with described optimum key frame position in described actual optimum code stream.
Compared with prior art, the embodiment of the present invention comprises following advantage:
The embodiment of the present invention goes out actual optimum code stream according to key parameter decision-making, and calculates rational switching time, carrying out bitstreams switching, having enriched the condition of code stream decision-making when arriving switching time, improves the accuracy of code stream decision-making;
In addition, the embodiment of the present invention calculates and switches reality, can ensure that the seamless smoothness of two code streams switches, improve user's viewing experience;
In addition, the present invention does not rely on the particular platform of HTTP adaptive stream media system;
In addition, the present invention considers multiple key parameter and multiple decision condition, and decision-making goes out actual optimum code stream, makes the present invention can take into account video definition and significantly reduce player card to pause ratio.
Accompanying drawing explanation
Fig. 1 is the flow chart of steps of a kind of bitstreams switching embodiment of the method for the present invention;
Fig. 2 is the Ek/M/1 queuing system position phase flow graph in a kind of bitstreams switching embodiment of the method for the present invention;
Fig. 3 is the different code streams speed of download acute variation schematic diagram when identical network situation in a kind of bitstreams switching embodiment of the method for the present invention;
Fig. 4 is that each card in a kind of bitstreams switching embodiment of the method for the present invention pauses distribution results figure under each code stream;
Fig. 5 is that the card in a kind of bitstreams switching embodiment of the method for the present invention pauses than affecting schematic diagram;
Fig. 6 is the structured flowchart of a kind of bitstreams switching device of the present invention embodiment.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, and below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
With reference to Fig. 1, show the flow chart of steps of a kind of bitstreams switching embodiment of the method for the present invention, specifically can comprise the steps:
Step 101, when a upper video playback is complete, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
The embodiment of the present invention starts with the broadcasting trigger action of target video, the broadcasting trigger action of target video can comprise: after a upper video playback, the trigger action of chain broadcast target video, or, when user starts player first time, play the trigger action of target video.This trigger action can be that user clicks target video with the operation of the http request to target video sent.
The player of the embodiment of the present invention periodically detects the broadcasting trigger action to target video, wherein, can be periodically that interval is detected once for 10 seconds, interval is detected once for 20 seconds, etc.
It should be noted that, the video of the embodiment of the present invention can comprise motion picture film.
After target video is played trigger action triggering, player starts acquiescence code stream corresponding to loaded targets video, and starts decoding acquiescence code stream, and plays this acquiescence code stream.In this process, player can obtain the key parameter of this target video, according to key parameter self adaptation dynamic conditioning code stream, wherein, and the parameter relevant to target video that key parameter can be able to obtain for player (client).
As a kind of example, key parameter at least can comprise following parameter:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
Below each key parameter is illustrated.
For above-mentioned key parameter (1), in one embodiment, the acquisition process of code stream list can be: player sends code stream to video server and obtains request, to obtain the code stream list that target video can be supported from video server.Specifically, multiple resolution version can be there is in same video in video server, such as same portion film, video server stores BS_150 (very fast, resolution is for reaching 320x640), BS_Standerd (SD, resolution is 720 × 576 (pal modes) or 720 × 486 (TSC-system formulas)), BS_High (high definition, resolution is 1280 × 720 and 1920 × 1080), BS_720p (resolution is for reaching 1280x720), BS_1080p (resolution can reach 1920x1080), BS_4K (ultra high-definition, resolution can reach 4096x2160) etc. the version of various resolution.After video server receives the request of player, the code stream list of this target video stored is returned player.Wherein, code stream refers to the data traffic that video file uses within the unit interval, be in Video coding image quality control in most important part, under same resolution, the code stream of video file is larger, and compression ratio is less, and image quality is better.
In video server, more high picture quality is higher for the level of resolution of same video, and under network condition enabled condition, the grade of the code stream that target video is supported is more high better, improves video definition when ensureing smooth.
Various resolution has corresponding code stream, and after player receives code stream list, obtain the actual code stream of each resolution that target video is supported, non-existent code stream uses the reference code stream of corresponding resolution.Code stream (Data Rate) refers to the data traffic that video file uses within the unit interval, is also code check, and general unit is that kbps and kilobit are per second.The embodiment of the present invention can use BS_150 (very fast), and BS_Standerd (SD), BS_High (high definition), the symbols such as BS_720p, BS_1080p, BS_4K represent the code stream that each resolution is corresponding.
For above-mentioned key parameter (2), player can also obtain plays up window size to target video, and when broadcast window is changed, automatic renewal plays up window size accordingly, and, record and maximumly play up window size.Such as, during with player plays film, can played in full screen, corresponding window size of playing up can be 1920*1080, then will play up again size and narrow down to 800*600, enlarge to 1024*768 again after a while, etc., these are all played device record to the operation of broadcast window, and the 1920*1080 since simultaneously recording user from drives player maximumly plays up window size.
For above-mentioned key parameter (3), theoretical optimum code stream is optimum code stream ideally, and this theoretical optimum code stream is selected from polytype code stream.
The acquisition process of theoretical optimum code stream relies on Ek/M/1 queuing model.Below Ek/M/1 queuing model is illustrated.Be applied to the embodiment of the present invention, coded data is downloaded to play buffer from server to player, and decoder is supplied to decoding data in buffering area this process that renderer plays up display, Ek/M/1 queuing model can be adopted to carry out mathematical modeling, calculate the target parameter of this queuing model according to the steady-state equation group of Ek/M/1 queuing model, try to achieve the optimum code stream of theory ideally further.Below first the process of establishing of Ek/M/1 queuing model is described.
The foundation of Ek/M/1 queuing model needs to be applied to multiple mathematical theory knowledge, such as queueing theory, flow of event, Poisson (Poisson) stream, quantum condition entropy, Ireland distribution, etc.First various mathematical theory knowledge is illustrated:
Queueing theory (queuing theory): or claim theory of random service system, by arriving and the statistical research of service time to service object, draw the statistical law of these quantitative indexes (stand-by period, queue length, busy period length etc.), then improve the structure of service system according to these rules or reorganize serviced object, make service system can meet the needs of service object, the expense of Neng Shi mechanism is most economical or some indexs optimum again.The adaptable scene of queueing theory as market shopping, library borrows, automobile refuels to gas station, boats and ships landing pier, hospital register sees a doctor, be with repair machine maintenance, video/audio signal transmission, relevant data be stored into computer, telephone office's call transfer etc.
Flow of event: the sequence of similar event (criticizing) individual (batch) being come randomly service window requirement service is called flow of event, as the call-flow, computer glitch stream, incoming bus etc. of telephone office; These events are stochastic variable, and client arrives and interval time of system and service time to be non-negative, therefore they or the stochastic variable of non-negative.
Poisson (Poisson) flows: the simplest flow of event, it has following features: A, stationarity.Be in the time interval of t in any segment length, occur that the probability of any amount event is only relevant with t, and have nothing to do with the position residing for t; B, markov property (also known as without memory or Markov property), being separate without the event number occurred in disjoint two time intervals T1, T2; C, universality.Together in a flash, the probability that more than one event occurs can be ignored.
Quantum condition entropy: when client stream for Poisson flow time, with T represent two in succession client arrive the time interval of system, then T obey quantum condition entropy.
Ireland distribution: investigate most simple event stream, remembers that the time interval sequence that each event arrives system is T1, T2 ..., and they are stochastic variables of same quantum condition entropy, then this flow of event is Irish stochastic flow, note then T obeys the distribution of Ireland, k rank.
Ek/M/1 queuing model: also known as Ek/M/1/ ∞/∞ model, the interval time that expression client arrives system in succession obeys quantum condition entropy, service time also obeys quantum condition entropy, be provided with 1 service window in system, power system capacity is the wait system queuing model of unlimited (fully large).
Below introduce the process of establishing of Ek/M/1 queuing model:
The target video of the embodiment of the present invention comprises multiple logic burst, and wherein, logic burst is burst in logic, and not in esse burst, is the logic burst carried out with time per unit data current goal video.Such as, the film of a 100MB, playing total duration is 1000 seconds, if carried out logic burst in units of 1 second, the size of so each logic burst is 100MB/1000=0.1MB.
Each logic burst is the client of queuing system; Player constantly downloads the video data of target video to buffering area, and the middle client being queuing system reaches flow of event; Decoder is decoded according to video data rate, is the information desk in queuing system; A player only has decoder carrying out one by one to decode, and is the Service events stream in queuing system; Buffering area stores the video data to be decoded downloaded from the Internet and, and is client's queue of line for service in queuing system.
Under common network condition, transmission time of a logic burst can random fluctuation centered by certain average, video data transmission has certain correlation, without memory not remarkable, Ireland distribution can carry out matching to real data better, under being more suitable for multiple series process or inapparent situation without memory, therefore adopt the download time stream of Ireland distribution (Ek) analog logic burst here.In target video, video scene change is frequent and slow, the violent strong and weak code check random fluctuation waiting decision video compression coding data each second when decoding of object of which movement, substantially be a Poisson flow, the decode time of onesize coded data can adopt quantum condition entropy (M) to simulate, a player only has a decoder, namely one-server is only had, under normal circumstances, the complete viewing target video of user, the data loaded can not be lost, namely client can not leave, it is a unlimited wait system, the film source of video server can think infinity simultaneously, namely a unlimited client is had, namely a unlimited client source is had.
The client that Ireland distributes is regarded as the time period sum of k individual separate quantum condition entropy the time of advent, then the time period of each quantum condition entropy regards as one " position phase ", the definition distributed from Ireland, next client is quantum condition entropy by the time needed for a phase place, has without memory.
If existing n position client in system, and (n+1)th the possible position of client before the system of not entering is t1 mutually, t2 ..., tk; So the Stationary Distribution of Number of Customers is in system:
p n ‾ = Σ j = nk j = ( n + 1 ) k - 1 p j , ( n ≥ 0 ) ;
Corresponding Ek/M/1 queuing system position phase flow graph as shown in Figure 2.Kolmogorv-Chapman (K-C) equation can be write out in equilibrium conditions by the position phase flow graph of Fig. 2:
k&lambda; p 0 = &mu; p k k&lambda; p j = k&lambda; p j - 1 + &mu; p j + k , 0 < j < k ( k&lambda; + &mu; ) p j = k&lambda; p j - 1 + &mu; p j + k , j &GreaterEqual; k
Wherein, P ( s ) = &Sigma; j = 0 &infin; p j s j
Make ρ=λ/μ, can have in conjunction with K-C equation:
P ( s ) = ( 1 - s k ) &Sigma; j = 0 k - 1 p j s j k&rho; s k + 1 - ( 1 + k&rho; ) s k + 1
Can be demonstrate,proved by algebra knowledge, as ρ <1, the denominator of P (s) has one to be s1=0, and another is s0, meets | and s0|>1, all the other k-1 root must in unit circle.When | during s|<=1, P (s) is convergence, therefore the molecule denominator of P (s) same root on kernel unit circle in unit circle.Unit circle only has a root s=1, thus has:
k&rho; s k + 1 - ( 1 + k&rho; ) s k + 1 ( s - 1 ) ( s - s 0 ) = K &Sigma; j = 0 k - 1 p j s j
Thus have:
P ( s ) = 1 - s k K ( s - 1 ) ( s - s 0 )
Because of P (1)=1, make s ↑ 1, just have substitute into above formula, obtain:
P ( s ) = 1 k &Sigma; j = 0 k - 1 ( 1 - 1 s 0 j + 1 ) s j + &Sigma; j = 0 k - 1 1 k ( 1 s 0 j - k + 1 - 1 s 0 j + 1 ) s j
Again because of the root that s0 is P (s) point of matrix, that is:
k &rho;s 0 k + 1 - ( 1 + k&rho; ) s 0 k + 1 = 0
So:
1 k ( 1 - 1 s 0 j ) = &rho; ( s 0 - 1 )
The Stationary Distribution of phase place can be obtained:
p j = 1 k ( 1 - 1 s 0 j + 1 ) 0 &le; j < k 1 k ( 1 s 0 j - k + 1 - 1 s 0 j + 1 ) = &rho; ( s 0 - 1 ) s 0 j + 1 j &GreaterEqual; k
Thus the Stationary Distribution of Number of Customers in system can be obtained:
p &OverBar; n = 1 - &rho; n = 0 &rho; ( s 0 k - 1 ) s 0 - nk n > 0
Corresponding target parameter can be obtained thus:
The average queue length of a, system:
L s = &Sigma; n = 0 &infin; n p &OverBar; n = &rho; ( s 0 k - 1 ) &Sigma; n = 0 &infin; n s 0 - nk = &rho; s 0 k s 0 k - 1
B, client residence time in systems in which
W s = L s &lambda; = s 0 k &mu; ( s 0 k - 1 )
Based on the above Ek/M/1 queuing model set up, in a kind of preferred embodiment of the embodiment of the present invention, theoretical optimum code stream can obtain in the following manner:
Sub-step S11, calculates the mass value of described polytype code stream respectively;
Specifically, the mass value of code stream can be the final impression quality of code stream.In one embodiment, following formula can be adopted to calculate 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, and Q [i], cost [i], costs and current_bitstream_index are preset value, and are empirical value; G [i] represents the mass value of code stream, and Q [i] represents the default initial mass value that various types of code stream is corresponding, i.e. initial user perception degree; Cost [i] represents the default first mass loss value that various code stream card when playing causes, and namely blocks a user's perception degree penalty values caused; What costs represented that two bitstreams switching cause presets the second mass loss value, i.e. user's perception degree penalty values of causing of two bitstreams switching, and two code stream spans are larger, lose larger; Current_bitstream_index represents the default index value of current broadcast code flow, the index value of setting when being coding, the index value that the index value that the index value that the index value that the index value that index value is 2, BS_High is corresponding is 3, BS_Super is corresponding is 4, BS_720p is corresponding is 5, BS_1080p is corresponding is 6, BS_4K is corresponding that the index value that such as BS_150 is corresponding is 1, BS_Standerd is corresponding is 7, etc.
P0 [i] represents that player buffering area is empty probability, or claims underflow probability, and in one embodiment, p0 [i] can obtain in the following way:
1) based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
For ensureing the speed of download accuracy of statistics, web download speed in the embodiment of the present invention has filtered out abnormal speed of download, abnormal speed of download can as certain speed of download and the great situation of front and back speed of download gap, filter out the acute variation in the short time of network speed speed, the frequent bitstreams switching of short time can be prevented.
In specific implementation, can based on current speed of download, the download time needed for estimation download assignment of logical, and based on download time of this assignment of logical, calculate the download time t of W logic burst.
2) expectation E (t) corresponding to described download time t is calculated respectively;
After obtaining the download time t of each code stream for each logic burst, expectation E (t) of download time t can be calculated further.
It should be noted that, while expectation E (t) of download time t, the variance D (t) of download time t can also be calculated.
3) following formulae discovery p0 [i] is adopted:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
Specifically, according to the expectation and variance formula of Ireland, k rank distribution:
E ( t ) = 1 &lambda; , D ( t ) = 1 k &lambda; 2
In conjunction with expectation and variance obtained above, try to achieve:
k [ i ] = ( E ( t ) [ i ] ) 2 D ( t ) [ i ] , &lambda; [ i ] = 1 E ( t ) [ i ]
According to the Stationary Distribution of the Ek/M/1 queuing model set up, the solution formula of target parameter is known, and key asks equation unique unit circle outside solution S 0, to whole roots of realistic coefficient polynomial of degree n equation, adopt QR method, by the problem asking the problem of the whole root of equation to be transformed into the All Eigenvalues asking matrix, and this matrix is upper H matrix (Hershberg matrix), from All Eigenvalues, then chooses this solution being greater than 1, be S 0ρ=λ again/μ, and μ is the expectation of player decode logic burst flow of event and quantum condition entropy in queuing model, here logic burst is set to the non-decoded data of unit interval (1 second), the namely code check of corresponding code stream, service rate μ=1 of known decoder, then by average queue length formula obtain L s; By the Stationary Distribution formula of Ek/M/1 queuing model, known player buffering area is empty Probability p 0=1-ρ.In conjunction with above-mentioned formula, formula p0 [i]=1-1/E (t) [i] * μ comprehensively can be obtained.
Sub-step S12, using code stream maximum for described mass value as the optimum code stream of theory.
After the G [i] of above-mentioned each code stream of trying to achieve, by maximum G [i], namely final impression quality the maximum is as the optimum code stream of theory ideally.
In specific implementation, it is not very large that the network speed because of a user generally changes, and it is the optimum code stream of theory ideally calculated that the present invention can also upgrade acquiescence code stream automatically, for acquiescence code stream during video chain broadcast during next video of prestrain.When player is closed, the optimum code stream of theory calculating gained is stored in this locality, during player startup next time, as the code stream that video acquiescence loads.
Theoretical optimum code stream instead of actual optimum code stream (actual optimum code stream will be described herein-after) is adopted to be because the code stream of current film might not exist all code streams of BS_150 ~ BS_4K, the optimum code stream of theory is ideally the optimum code stream calculating gained according to network speed, do the initial code stream given tacit consent to the most suitable, and adopt the optimum code stream of the theory that calculated when watching video last time effectively can reduce player to start the card of a period of time and pause.
For above-mentioned key parameter (4), the residue reproduction time of the video data downloaded in current play buffer is, in play buffer, how many residue reproduction times of the current broadcast code flow (namely starting acquiescence code stream when video data loads) loaded, namely downloaded code stream in addition in play buffer and do not broadcast.Such as, this residue reproduction time can be 10 seconds, 20 seconds etc.
For above-mentioned key parameter (5), for characterizing the data variation in play buffer, can (the first preset time period can represent with buffer window buffer_time_window_ to the first nearest preset time period, such as, the first nearest preset time period is first 30 seconds, then the value of buffer_time_window_ is 30) in, in play buffer, the residue reproduction time of the video data downloaded of each unit interval (such as 1 second) carries out record, namely record in the play buffer in nearest buffer_time_window_ and remain reproduction time, and (curve fitting) is carried out curve fitting to the residue reproduction time of record, the matched curve obtained.
Curve refers to selects suitable curve type to carry out matching observation data, and analyzes the relation between two variablees with the curvilinear equation of matching, in specific implementation, least square method can be adopted to carry out curve fitting.Wherein, the principle minimum by sum of square of deviations chooses matched curve, and takes binomial equation to be the method for matched curve, is called least square method.
It should be noted that, buffer_time_window_ value is more little more responsive, but matched curve error is larger; Buffer_time_window_ value is more large more blunt, but linear fit curve more correctly can reflect the change direction of buffer data.
Because user seek operates the video data download that (user drags the operation of progress bar to certain time point of target video) can interrupt current player, or, during player stopping downloading data, great impact is caused on the residue reproduction time of play buffer, and then the accuracy of influence curve matching, therefore, user seek operate time or player stop downloading data time, the embodiment of the present invention can empty buffer_time_window_, restarts record.
For above-mentioned key parameter (6), the embodiment of the present invention can select a kind of code stream as code stream criterion from multiple code stream, such as choose BS_High code stream as code stream criterion, take BS_High as boundary, using code stream high for BS_High as high-quality code stream, using code stream low for BS_High as high-quality code stream.
For above-mentioned key parameter (7), in specific implementation, judge whether to need to carry out bitstreams switching, having more than is once the result of the section of sentencing, but repeatedly judged result is cumulative, such as, first time is when judging that current code stream is changeable, switchable number of times is designated as 1, and when judging that current code stream is changeable, switchable number of times is designated as 2 next time, etc., by that analogy, until switchable number of times reaches Second Threshold, just once switch.
For above-mentioned key parameter (8), video server and/or player can set the scope of switchable code stream, namely set the limited field of most high code stream and minimum code stream.
For above-mentioned key parameter (9), card number of times is that card so far that current code stream plays target video pauses number of times, and once, a card number of times increases by 1 to card.
For above-mentioned key parameter (10), seek operation is that user drags the operation of progress bar to certain time point of film, detects user and operates the seek of target video, statistics seek number of operations up to now.
For above-mentioned key parameter (11), total switching times of target video can so far, and the number of times that target video switches adds up.
In specific implementation, bitstreams switching frequency can be set, i.e. minimum switching (comprises switching and lower switching, on switch to and switch to code stream more higher leveled than current broadcast code flow, under switch to the code stream switching to one-level lower than current broadcast code flow) interval time, control the number of times of video switch with this.Such as, in conjunction with total duration of current broadcasting film, by the shortest time Separation control of lower switching at 60 seconds ~ 300 seconds, by the shortest time Separation control of upper switching at 300 seconds ~ 600 seconds, thus control total switching times of a film.
For above-mentioned key parameter (12), target video can use polytype code stream in playing process, and player can carry out record to the code stream used.
Step 102, goes out actual optimum code stream based on described 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 optimum code stream of above-mentioned theory, reason is as follows: the theoretical optimum code stream calculation ideally calculated based on Ek/M/1 queuing model only considers web download speed (i.e. network speed), and result is just credible time very high to the accuracy requirement of network speed, the destruction to the stationary process of whole queuing model such as simultaneously not have picture user seek to operate in queuing model middle ideal situation, therefore theoretical optimum code stream is optimum code stream ideally, the single result leaning on Ek/M/1 queuing model to obtain is very unreliable.In specific implementation, need to consider multiple decision condition and carry out decision-making and go out actual optimum code stream.
In a kind of preferred embodiment of the embodiment of the present invention, step 102 can comprise following sub-step:
Sub-step S21, chooses multiple key parameter from described key parameter, as multiple decision factor;
In specific implementation, can using above-mentioned key parameter all as decision factor, or from above-mentioned key parameter selected part key parameter as decision factor.
Sub-step S22, goes out actual optimum code stream based on described decision factor decision-making.After choosing multiple decision factor, actual optimum code stream can be gone out according to decision factor decision-making.In a kind of preferred embodiment of the embodiment of the present invention, sub-step S22 can comprise following sub-step further:
Sub-step S221, sets N number of decision condition based on described decision factor, and wherein N is positive integer;
Decision condition is determine the condition of actual optimum code stream demand fulfillment.As a kind of example, decision condition can comprise the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
Wherein, first threshold is the residue reproduction time threshold value that theoretical optimum code stream is corresponding, such as, current broadcasting high definition film, network speed is relatively good, calculating theoretical optimum code stream through Ek/M/1 queuing model is 720p, namely current network speed can meet the normal play of 720p code stream, if but now the residue reproduction time of video data downloaded of play buffer is little, as only having 10 seconds (being less than 20 seconds that 720p presets), the probability that the code stream now switching 720p causes card to pause can be very large, therefore finally can judge that this decision condition does not meet threshold criteria.If now the residue reproduction time abundant (being greater than 20 seconds that 720p presets) of video data downloaded of play buffer, then judge that this decision condition meets threshold criteria.
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
The curve of matching is that ascendant trend or downward trend can be judged by this slope of a curve, if slope <0, illustrates that the data in buffering area have minimizing trend, otherwise, illustrate that the data in buffering area have growth trend.
The calculating of slope can adopt formula y=ax+b, and wherein, x is the unit time, and y is the residue reproduction time of the video data downloaded in play buffer in this unit interval, and a is slope, and b is correction value.According to the value of x, y, the value of a and the value of b can be tried to achieve.Work as a<0, illustrate that the data in buffering area have minimizing trend, otherwise, illustrate that the data in buffering area have growth trend.
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
After judging that current code stream is as high-quality code stream or low quality code stream, can according to judged result, the threshold criteria of each decision condition of self-adaptative adjustment, wherein, the threshold criteria of each decision condition is the threshold value increasing or reduce key parameter.Such as, if current code stream is high-quality code stream, as BS_720P, judge that key parameter when upwards will be switched to BS_1080p will be stricter than normal value; If current code stream is low quality code stream, as BS_150, then key parameter when being switched to higher code stream on is looser than normal value.Because when the code stream of current broadcasting is high-quality code stream, user's perception very well, unless network speed condition is very good, just can upwards be switched on higher-quality code stream, if current broadcasting is low-quality code stream, just can be switched on high level code stream when network speed situation take a favorable turn.
In embodiments of the present invention, choosing of key parameter needs to carry out actual test in conjunction with player iteration with arranging of its threshold value, chooses applicable key parameter and optimal threshold.
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, current cumulative switchable number of times zero is continued cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
Current broadcast code flow is judged to be that changeable i.e. theoretical optimum code stream is changeable code stream.When switchable number of times reaches Second Threshold, such as, current broadcast code flow is BS_High, Second Threshold is set as 10 times, the optimum code stream of the continuous theory calculated for 10 times is all BS_720p, then decision condition 4) meet threshold criteria, otherwise, do not meet this condition, the result of decision is exactly without the need to switching.Such as the optimum code stream of the current theory calculated for 8 times is BS_720p, and the optimum code stream calculated for the 9th time is BS_Hig, then judge that BS_720p makes zero as the statistics number of changeable code stream, add up from newly.
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
Such as, if optimum code stream is high-quality code stream, but current player to play up window very little, can clear viewing without the need to very high code stream, even if speed of download is very fast, also need not be switched to high-quality code stream, saves the flow of user with this.
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
Such as, if a card number of times is a lot, illustrates that the key parameter threshold value raising code stream in adaptive code stream computational process is unreasonable, can suitably expand these threshold values, the standard of upper switching is improved.
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
The seek operation of user can have an impact to film prestrain, such as user seek is to the position not having prestrain, player needs again to load data from this time point, the data of buffering can be cancelled in the past, if seek number of operations is a lot, key parameter threshold value in adaptive code stream computational process will completely not applicable, can suitably expand these threshold values, the standard calculating optimum code stream improved.
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
If whether total switching times of the target video of record is greater than the 5th threshold value, illustrate that target video frequently switches code stream, now this decision condition does not meet threshold criteria.Otherwise decision condition meets threshold criteria.
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
Decision factor (10) can be applied to special circumstances, as shown in Figure 3, in the situation that test period finds, code stream is frequently switched at BS_150 and BS_720, reason is that same film is under identical network condition, during employing BS_150 code stream, speed of download is very fast, and after being switched to BS_720, speed of download sharply declines, and continues always, after being switched to BS_150, network speed becomes normal, is switched to again BS_720 speed of download and sharply declines ... .. repeated multiple times.This situation is actually rare, but also can exist, and therefore the embodiment of the present invention adds the code stream and the record of code stream life period that use film, during decision-making, if certain the code stream life period used before finding is very short, illustrates and is not suitable for being switched to this code stream.
Sub-step S222, if described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
Sub-step S223, if arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.Such as the code stream of current broadcasting is BS_Standard, user's network speed improves gradually, the optimum code stream of the theory that adaptive code flow module calculates is BS_720p, but there is list according to the code stream that this movie is crossed to find, this film is too short in BS_720p code stream life period, be not suitable for the code stream again playing BS_720p, at this moment a grade can be lowered, i.e. BS_High, as the actual optimum code stream that decision-making goes out, if the BS_High film source of this film does not exist, then the code stream of current broadcasting is exactly actual optimum code stream.A kind of situation is exactly the code stream of current broadcasting is in addition exactly BS_High, and the optimum code stream of the theory calculated is BS_720p, when there is above-mentioned analogue, lowers the code stream that a grade is exactly just in time current broadcasting.
When after setting decision condition, when decision condition all meets the demands, just using optimum for theory code stream as actual optimum code stream, if not all decision condition all meets the demands, then other decision condition of comprehensive reference actual optimum code stream can be turned down the next stage code stream of the optimum code stream of theory, or, using current broadcast code flow as actual optimum code stream.
Such as, current broadcasting high definition film, network speed is relatively good, and calculating theoretical optimum broadcast code flow through Ek/M/1 queuing model is 720p, and namely current network speed can meet the normal play of 720p code stream.The decision condition of setting has above-mentioned (1), (2) and (9), if now the remaining buffered data in play buffer is little, as only having 10 seconds (being less than default 20 seconds), the probability that the code stream now switching 720p causes card to pause can be very large, do not meet decision condition (1), the actual optimum code stream of final decision is current broadcast code flow; If the data of buffering area abundant (being greater than default 20 seconds), when namely meeting decision condition (1), if and the matched curve obtained after carrying out linear fit according to the residue reproduction time of play buffer has minimizing trend, do not meet decision condition (2), the actual optimum code stream of final decision is also current broadcast code flow; If buffer data abundant (meeting decision factor (1)), and matched curve has and increases trend (meeting decision factor (2)) gradually, if judge, whether the switching times of our department's film has exceeded the 5th threshold value, if exceeded (not meeting decision factor (4)), then the actual optimum code stream of final decision is also current broadcast code flow; If do not exceeded (meeting decision factor (4)), then the actual optimum code stream of final decision is also theoretical optimum code stream.
Step 103, when described actual optimum code stream and current broadcast code flow are not identical, calculates switching time;
Actual optimum code stream is not identical with current broadcast code flow, illustrates and needs to switch current broadcast code flow, and switch to 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 comprise following sub-step:
Sub-step S31, sets the prestrain minimal buffering time that various code stream is corresponding;
The calculating of switching time directly affects the fluency of bitstreams switching, make two code stream seamless switchings, improve user's viewing experience, not only need two code stream key frame alignment on server, audio tracks is alignd, and ensures that code stream (optimum code stream) data that will be switched to are pre-loaded when also needing client to switch code stream.Therefore, the embodiment of the present invention sets prestrain minimal buffering time corresponding to various code stream, and choosing of this prestrain minimal buffering time can choose the different time according to different code streams.
Sub-step S32, when described actual optimum code stream and current broadcast code flow are not identical, adopts following formulae discovery 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 described optimum code stream, and average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the minimal buffering time of presetting.Code stream quality is higher, and the value of Time is larger.
Step 104, when described switching time arrives, switches to described actual optimum code stream by the current broadcast code flow of described target video.
In a kind of preferred embodiment of the embodiment of the present invention, step 104 can comprise following sub-step:
Sub-step S41, calculates the optimum key frame position in the preset range of described switching time;
The embodiment of the present invention carrys out according to optimum key frame position the switching time that correction calculation obtains, and wherein, optimum key frame position is the position from a nearest key frame of switching time.Such as, the switching time calculated is that the 320s place of film switches, but might not there be key frame at 320s place, but have a key frame at 317.120s place, a key frame is had at 321.300s place, so optimum key frame is exactly 321.300s, and namely final switching time is the 321.300s place of film.
Sub-step S42, deducts the prestrain minimal buffering time of described actual optimum code stream by described optimum key frame position, obtain preload position;
Sub-step S43, when described target video is played to described preload position, stops loading current broadcast code flow, starts to load described actual optimum code stream;
For ensureing seamless switching, the embodiment of the present invention can at the minimal buffering time place's prestrain actual optimum code stream from optimum key frame position.Specifically, optimum key frame position is deducted the described prestrain minimal buffering time by the embodiment of the present invention, obtains preload position; And carry out loading switching at preload position, namely stop loading current code stream, start to load actual optimum code stream.Such as, the code stream that current film is play is high definition, in playing process, network slowly improves, it is 720p that decision-making goes out actual optimum code stream, and calculating switching time is 320s, and current play time is 300s, namely 720p can be switched to after 20s, the optimum key frame position corresponding with 320s is 320.766s, and the minimal buffering time of this actual optimum code stream is 20s, then at 300s place, the loading of high definition bit stream data can be stopped, starting the data of prestrain 720p.
Sub-step S44, when described target video is played to described optimum key frame position, is sent to decoder by key frame identical with described optimum key frame position in described actual optimum code stream.
Be applied to the embodiment of the present invention, when current code stream is played to optimum key frame position by the time, the key frame place that the optimum code stream of prestrain is identical can be switched to, completes seamless switching.Such as, in upper example, when current code stream is played to 320.766s, be switched to the identical code stream place of 720p, and the same code of this 720p is spread give decoder, complete seamless switching.
In embodiments of the present invention, when player detects that a upper video playback is complete, during chain broadcast target video, or, when first time startup player starts to play target video, player obtains this key parameter, and goes out actual optimum code stream according to key parameter decision-making, when when actual optimum code stream and current broadcast code flow are not identical, calculate rational switching time, carrying out bitstreams switching when arriving switching time, ensureing that the seamless smoothness of two code streams switches, improving user's viewing experience.
In addition, the present invention does not rely on the particular platform of HTTP adaptive stream media system.
In addition, the present invention considers multiple key parameter and multiple decision condition, decision-making goes out actual optimum code stream, makes the present invention can take into account video definition and significantly reduce player card to pause ratio, as can be seen from Figure 4, the card of about 55% times and to occur when code stream is BS_150, explanation the present invention is effective, because the minimum code stream that BS_150 code stream is video server to be provided, occurs card when playing this code stream, the non-constant of user network is described, because network speed difference cannot avoid card.Card under this code stream number of times that pauses accounts for the ratio of a total card number of times higher than the summation of a card accounting under other code streams, illustrates that the control of the embodiment of the present invention to code stream is accurate.As can be seen from Figure 5, use after the present invention, the pause impact effect of ratio of player card is obvious, and when not using of the present invention, mean 0100 calorie pauses than being 6.1%, and after using the present invention, mean 0100 calorie pauses than being 3.8%, and the card reducing 37.7% pauses.
But, the card under above-mentioned BS_150 code stream pause number of times account for the ratio of a total card number of times neither be more high better because the present invention not only will reduce a card ratio, also to take into account video definition, both reasonable compromise, be only the self adaptation dynamic code stream scheme of optimum.
It should be noted that, for embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
With reference to Fig. 6, show the structured flowchart of a kind of bitstreams switching device of the present invention embodiment, specifically can comprise as lower module:
Key parameter acquisition module 601, for complete in a upper video playback, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
Decision-making module 602, for going out actual optimum code stream based on described key parameter decision-making;
Switching time computing module 603, for when described actual optimum code stream and current broadcast code flow are not identical, calculates switching time;
Handover module 604, for when described switching time arrives, switches to described actual optimum code stream by the current broadcast code flow of described target video.
In a kind of preferred embodiment of the embodiment of the present invention, described decision-making module 602 comprises:
Parameter choose submodule, for choosing multiple key parameter from described key parameter, as multiple decision factor;
Decision-making submodule, for going out actual optimum code stream based on described decision factor decision-making.
As a kind of preferred exemplary of the embodiment of the present invention, described key parameter at least comprises:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
In a kind of preferred embodiment of the embodiment of the present invention, described polytype code stream comprises code stream grade, described decision-making submodule also for:
Set N number of decision condition based on described decision factor, wherein N is positive integer;
If described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
If arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.
As a kind of preferred exemplary of the embodiment of the present invention, described decision condition comprises the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if so, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
In a kind of preferred embodiment of the embodiment of the present invention, described key parameter acquisition module 601 also for:
Calculate the mass value of described polytype code stream respectively;
Using code stream maximum for described mass value as the optimum code stream of theory.
In a kind of preferred embodiment of the embodiment of the present invention, following formula is adopted to calculate the mass value of described 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, and G [i] represents the mass value of code stream, and Q [i] represents that the default initial mass value that various types of code stream is corresponding, cost [i] represent the default first mass loss value that various code stream card when playing causes; Costs represents the default second mass loss value that two bitstreams switching cause; Current_bitstream_index represents the default index value of current broadcast code flow; P0 [i] represents that player buffering area is empty probability.
In a kind of preferred embodiment of the embodiment of the present invention, described target video comprises multiple logic burst; Described p0 [i] obtains in the following way:
Based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
Calculate expectation E (t) that described download time t is corresponding respectively;
Adopt following formulae discovery p0 [i]:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
In a kind of preferred embodiment of the embodiment of the present invention, described switching time computing module 603 comprises:
Buffer time setting submodule, for setting prestrain minimal buffering time corresponding to various code stream;
Calculating sub module, for when described actual optimum code stream and current broadcast code flow are not identical, adopts following formulae discovery 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 described actual optimum code stream, average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the prestrain minimal buffering time of described actual optimum code stream.
In a kind of preferred embodiment of the embodiment of the present invention, described handover module 604 comprises:
Position calculation submodule, for calculating the optimum key frame position in the preset range of described switching time;
Preload position calculating sub module, for described optimum key frame position being deducted the prestrain minimal buffering time of described actual optimum code stream, obtains preload position;
Prestrain submodule, for when described target video is played to described preload position, stops loading current broadcast code flow, starts to load described actual optimum code stream;
Switching submodule, for when described target video is played to described optimum key frame position, is sent to decoder by key frame identical with described optimum key frame position in described actual optimum code stream.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.
Those skilled in the art should understand, the embodiment of the embodiment of the present invention can be provided as method, device or computer program.Therefore, the embodiment of the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the embodiment of the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The embodiment of the present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, terminal equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing terminal equipment to produce a machine, making the instruction performed by the processor of computer or other programmable data processing terminal equipment produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing terminal equipment, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded on computer or other programmable data processing terminal equipment, make to perform sequence of operations step to produce computer implemented process on computer or other programmable terminal equipment, thus the instruction performed on computer or other programmable terminal equipment is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although described the preferred embodiment of the embodiment of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of embodiment of the present invention scope.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or terminal equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or terminal equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the terminal equipment comprising described key element and also there is other identical element.
Above to a kind of bitstreams switching method provided by the present invention and a kind of bitstreams switching device, be described in detail, apply specific case herein to set forth principle of the present invention and execution mode, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (20)

1. a bitstreams switching method, is characterized in that, described method comprises:
When a upper video playback is complete, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
Actual optimum code stream is gone out based on described key parameter decision-making;
When described actual optimum code stream and current broadcast code flow are not identical, calculate switching time;
When described switching time arrives, the current broadcast code flow of described target video is switched to described actual optimum code stream.
2. method according to claim 1, is characterized in that, the described step going out actual optimum code stream based on described key parameter decision-making comprises:
Multiple key parameter is chosen, as multiple decision factor from described key parameter;
Actual optimum code stream is gone out based on described decision factor decision-making.
3. method according to claim 2, is characterized in that, described key parameter at least comprises:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
4. method according to claim 3, is characterized in that, described polytype code stream comprises code stream grade, and the described step going out actual optimum code stream based on described decision factor decision-making comprises:
Set N number of decision condition based on described decision factor, wherein N is positive integer;
If described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
If arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.
5. method according to claim 4, is characterized in that, described decision condition comprises the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if so, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
6. the method according to claim 3 or 4 or 5, is characterized in that, the optimum code stream of described theory obtains in the following manner:
Calculate the mass value of described polytype code stream respectively;
Using code stream maximum for described mass value as the optimum code stream of theory.
7. method according to claim 6, is characterized in that, adopts following formula to calculate the mass value of described 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, and G [i] represents the mass value of code stream, and Q [i] represents that the default initial mass value that various types of code stream is corresponding, cost [i] represent the default first mass loss value that various code stream card when playing causes; Costs represents the default second mass loss value that two bitstreams switching cause; Current_bitstream_index represents the default index value of current broadcast code flow; P0 [i] represents that player buffering area is empty probability.
8. method according to claim 7, is characterized in that, described target video comprises multiple logic burst; Described p0 [i] obtains in the following way:
Based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
Calculate expectation E (t) that described download time t is corresponding respectively;
Adopt following formulae discovery p0 [i]:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
9. method according to claim 1 and 2, is characterized in that, described when described actual optimum code stream and current broadcast code flow are not identical, and the step calculating switching time comprises:
Set the prestrain minimal buffering time that various code stream is corresponding;
When described actual optimum code stream and current broadcast code flow are not identical, then adopt following formulae discovery 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 described actual optimum code stream, average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the prestrain minimal buffering time of described actual optimum code stream.
10. method according to claim 9, is characterized in that, described when described switching time arrives, and switches to the step of described actual optimum code stream to comprise the current broadcast code flow of described target video:
Calculate the optimum key frame position in the preset range of described switching time;
Described optimum key frame position is deducted the prestrain minimal buffering time of described actual optimum code stream, obtain preload position;
When described target video is played to described preload position, stops loading current broadcast code flow, start to load described actual optimum code stream;
When described target video is played to described optimum key frame position, key frame identical with described optimum key frame position in described actual optimum code stream is sent to decoder.
11. 1 kinds of bitstreams switching devices, is characterized in that, described device comprises:
Key parameter acquisition module, for complete in a upper video playback, during chain broadcast target video, or, when first time startup player starts to play target video, obtain key parameter;
Decision-making module, for going out actual optimum code stream based on described key parameter decision-making;
Switching time computing module, for when described actual optimum code stream and current broadcast code flow are not identical, calculates switching time;
Handover module, for when described switching time arrives, switches to described actual optimum code stream by the current broadcast code flow of described target video.
12. devices according to claim 11, is characterized in that, described decision-making module comprises:
Parameter choose submodule, for choosing multiple key parameter from described key parameter, as multiple decision factor;
Decision-making submodule, for going out actual optimum code stream based on described decision factor decision-making.
13. devices according to claim 12, is characterized in that, described key parameter at least comprises:
(1) the code stream list of types supported of described target video, described code stream list of types comprises polytype code stream;
(2) current player plays up area size;
(3) theoretical optimum code stream;
(4) the residue reproduction time of the video data downloaded in current play buffer;
(5), in the first nearest preset time period, the residue reproduction time of the video data downloaded in the play buffer corresponding to each unit interval, carries out curve fitting, the matched curve obtained;
(6) according to the code stream criterion preset, judge that current broadcast code flow is the judged result of high-quality code stream or low quality code stream;
(7) end Preset Time, current broadcast code flow is judged to be switchable number of times;
(8) the most high code stream preset and minimum code stream limited field;
(9) card that target video is play pauses number of times;
(10) user is dragged to the dragging seek record of progress bar to certain position to target video;
(11) total switching times of current goal video;
(12) the code stream record that used of target video film.
14. devices according to claim 13, is characterized in that, described polytype code stream comprises code stream grade, described decision-making submodule also for:
Set N number of decision condition based on described decision factor, wherein N is positive integer;
If described decision condition all meets corresponding threshold criteria, then using optimum for described theory code stream as described actual optimum code stream;
If arbitrary decision condition does not meet corresponding threshold criteria, then using the code stream of lower level corresponding for optimum for described theory code stream as described actual optimum code stream, or, using current broadcast code flow as described actual optimum code stream.
15. devices according to claim 14, is characterized in that, described decision condition comprises the part or all of of following condition:
1) judge whether the residue reproduction time of the video data downloaded in described current play buffer is greater than first threshold, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
2) the in rising trend or downward trend of described matched curve is judged; If ascendant trend, then judge that this decision condition meets threshold criteria, if downward trend, then judge that this decision condition does not meet threshold criteria;
3) according to described current broadcast code flow be the judged result of high-quality code stream or low quality code stream, adjust the threshold criteria of each decision condition;
4) judge that described current broadcast code flow is judged to be whether switchable number of times is greater than Second Threshold, if so, then judge that this decision condition meets threshold criteria, if not, then continue cumulative described switchable number of times, or, by current cumulative switchable number of times zero;
5) judge the optimum code stream of described theory whether in described default most high code stream and minimum code stream limited field, if so, then judge that this decision condition meets threshold criteria, if not, then judge that this decision condition does not meet threshold criteria;
6) choose and play up the applicable code stream of area size with current player;
7) if described card pauses, number of times is greater than the 3rd threshold value, then adjust the threshold criteria of each decision condition;
8) if described dragging seek record is greater than the 4th threshold value, then the threshold criteria of each decision condition is adjusted;
9) judge whether total switching times of described target video is greater than the 5th threshold value, if so, then judge that this decision condition does not meet threshold criteria, if not, then judge that this decision condition meets threshold criteria;
10) according to the code stream record used, if certain code stream life period is lower than the 6th threshold value, then described code stream is not chosen as actual optimum code stream.
16. devices according to claim 13 or 14 or 15, is characterized in that, described key parameter acquisition module also for:
Calculate the mass value of described polytype code stream respectively;
Using code stream maximum for described mass value as the optimum code stream of theory.
17. devices according to claim 16, is characterized in that, adopt following formula to calculate the mass value of described 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, and G [i] represents the mass value of code stream, and Q [i] represents that the default initial mass value that various types of code stream is corresponding, cost [i] represent the default first mass loss value that various code stream card when playing causes; Costs represents the default second mass loss value that two bitstreams switching cause; Current_bitstream_index represents the default index value of current broadcast code flow; P0 [i] represents that player buffering area is empty probability.
18. devices according to claim 17, is characterized in that, described target video comprises multiple logic burst; Described p0 [i] obtains in the following way:
Based on current web download speed, estimate that described various types of code stream downloads the download time needed for a logic burst respectively, and the download time that definition is downloaded needed for w assignment of logical is t;
Calculate expectation E (t) that described download time t is corresponding respectively;
Adopt following formulae discovery p0 [i]:
p0[i]=1-1/E(t)[i]*μ;
Wherein, E (t) [i] represents the expectation of code stream i; μ represents the expectation preset of the decode time needed for decoders decode logic burst.
19. devices according to claim 11 or 12, it is characterized in that, described switching time computing module comprises:
Buffer time setting submodule, for setting prestrain minimal buffering time corresponding to various code stream;
Calculating sub module, for when described actual optimum code stream and current broadcast code flow are not identical, adopts following formulae discovery 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 described actual optimum code stream, average_download_speed_ is current averaging network speed of download, and bs_min_buffer_time_ [result] represents the prestrain minimal buffering time of described actual optimum code stream.
20. devices according to claim 19, is characterized in that, described handover module comprises:
Position calculation submodule, for calculating the optimum key frame position in the preset range of described switching time;
Preload position calculating sub module, for described optimum key frame position being deducted the prestrain minimal buffering time of described actual optimum code stream, obtains preload position;
Prestrain submodule, for when described target video is played to described preload position, stops loading current broadcast code flow, starts to load described actual optimum code stream;
Switching submodule, for when described target video is played to described optimum key frame position, is sent to decoder by key frame identical with described optimum key frame position in described actual optimum code stream.
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 true CN104967884A (en) 2015-10-07
CN104967884B 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)

Cited By (13)

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

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101421936A (en) * 2006-03-03 2009-04-29 维德约股份有限公司 System and method for providing error resilience, random access and rate control in scalable video communications
US20100166056A1 (en) * 2002-12-10 2010-07-01 Steve Perlman System and method for encoding video using a selected tile and tile rotation pattern
CN102291599A (en) * 2011-05-07 2011-12-21 董友球 Network video playing method and network video playing device
WO2013059930A1 (en) * 2011-10-28 2013-05-02 Avvasi Inc. Methods and apparatus for providing a media stream quality signal
CN103248953A (en) * 2013-04-24 2013-08-14 Tcl集团股份有限公司 Method and system for processing TV advertisement time and TV programme playing terminal
US20130227080A1 (en) * 2012-02-27 2013-08-29 Qualcomm Incorporated Dash client and receiver with playback rate selection
CN103297847A (en) * 2013-04-28 2013-09-11 四川长虹电器股份有限公司 Method for achieving signal source intelligent navigation and switching
CN103428107A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive bitstream switching method and system based on cache underflow probability estimation
CN103428105A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive HTTP streaming code stream switching method and system based on bandwidth 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

Patent Citations (13)

* 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
CN101421936A (en) * 2006-03-03 2009-04-29 维德约股份有限公司 System and method for providing error resilience, random access and rate control in scalable video communications
CN102291599A (en) * 2011-05-07 2011-12-21 董友球 Network video playing method and network video playing device
WO2013059930A1 (en) * 2011-10-28 2013-05-02 Avvasi Inc. Methods and apparatus for providing a media stream quality signal
US20130227080A1 (en) * 2012-02-27 2013-08-29 Qualcomm Incorporated Dash client and receiver with playback rate selection
CN103428107A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive bitstream switching method and system based on cache underflow probability estimation
CN103428105A (en) * 2012-05-14 2013-12-04 中国科学院声学研究所 Self-adaptive HTTP streaming code stream switching method and system based on bandwidth estimation
CA2804741A1 (en) * 2013-01-21 2014-07-21 Disternet Technology, Inc. Media server
CN103248953A (en) * 2013-04-24 2013-08-14 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
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

Cited By (20)

* 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
CN107071529A (en) * 2017-03-29 2017-08-18 咪咕视讯科技有限公司 A kind of HLS video broadcasting methods, terminal and server
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
WO2019149066A1 (en) * 2018-02-01 2019-08-08 腾讯科技(深圳)有限公司 Video playback method, terminal apparatus, and storage medium
CN108307248A (en) * 2018-02-01 2018-07-20 腾讯科技(深圳)有限公司 Video broadcasting method, device, computing device and storage medium
US11356739B2 (en) 2018-02-01 2022-06-07 Tencent Technology (Shenzhen) Company Ltd Video playback method, terminal apparatus, and storage medium
CN109361756A (en) * 2018-11-08 2019-02-19 重庆急视飞救科技发展有限公司 Cross-platform data transmission method based on 120 network alarmings
WO2020151399A1 (en) * 2019-01-23 2020-07-30 上海哔哩哔哩科技有限公司 Method and device for pseudo-seamless switching between different video sources played by web and medium
US11589119B2 (en) 2019-01-23 2023-02-21 Shanghai Bilibili Technology Co., Ltd. Pseudo seamless switching method, device and media for web playing different video sources
CN110087110A (en) * 2019-06-12 2019-08-02 深圳市大数据研究院 Using the method and device of deep search dynamic regulation video playing
CN110087110B (en) * 2019-06-12 2021-03-30 深圳市大数据研究院 Method and device for dynamically regulating and controlling video playing by applying deep search
CN111866433A (en) * 2020-07-31 2020-10-30 腾讯科技(深圳)有限公司 Video source switching method, video source playing method, video source switching device, video source playing device, video source equipment and storage medium
CN113721908A (en) * 2021-08-30 2021-11-30 湖南快乐阳光互动娱乐传媒有限公司 Infinite cascade assembly rendering method and device
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

Also Published As

Publication number Publication date
CN104967884B (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN104967884A (en) Code stream switching method and code stream switching device
US10623785B2 (en) Streaming manifest quality control
EP3387836B1 (en) Recording of abr content
EP3022884B1 (en) Quality optimization with buffer and horizon constraints in adaptive streaming
US9571827B2 (en) Techniques for adaptive video streaming
US8930559B2 (en) Adaptive hypertext transfer protocol (“HTTP”) media streaming systems and methods
KR101500892B1 (en) Variable bit video streams for adaptive streaming
US8837586B2 (en) Bandwidth-friendly representation switching in adaptive streaming
CN110636346B (en) Code rate self-adaptive switching method and device, electronic equipment and storage medium
CN105323604A (en) QoE (Quality of Experience) driven HTTP streaming media on demand buffer area control method
KR20110120836A (en) Controlling an adaptive streaming of digital content
CN108353198B (en) Method and apparatus for providing power saving media content
CN105872722A (en) Online video start playing caching system and method
WO2022052566A1 (en) Video bitrate adjustment method and apparatus, and electronic device and machine-readable storage medium
CN112714315B (en) Layered buffering method and system based on panoramic video
JP2022545623A (en) Prediction-Based Drop Frame Handling Logic in Video Playback
US9313243B2 (en) Video streaming over data networks
US20240056637A1 (en) Performing Trick Plays of Segmented Video Content
US9571871B2 (en) Method for delivering video content encoded at one or more quality levels over a data network
CN109218809B (en) Streaming media playing method and device
CN116962809A (en) Rebuffering reduction for adaptive bitrate video streaming

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