A kind of online play buffering system and method
Technical field
The present invention relates to a kind of online play buffering system and method, particularly, relate to a kind of online http playing stream media buffer system and method, belong to streaming media playing field.
Background technology
Along with popularizing of the Internet, the lifting of the Internet speed, under the trend of the integration of three networks, the speed of the Internet is just in fast lifting, the viewing behavior of people converts online viewing to from download viewing fast, online broadcasting (play online) is a kind of video playback form, refer to need not individually video download to local computing and can direct-on-line viewing one play form.The Internet Online Video plays the site for service uploaded can support uploaded videos, realize the demand of user oneself, video show oneself such as by uploading, significant video is uploaded to the Internet, on the one hand can together with friend sharing information, also exchange with other people by video on the one hand, also some instructional video can be uploaded to the Internet, others is allowed to consult study, some amusement class videos can also be uploaded, such as can upload TV play collection of drama, film, the concert of star, entertainment video, for user's viewing, some news that also same day can be occurred or user lives through and the major event be filmed uploads to the Internet, and then meet the different demands of users.
In recent years, online play-back technology is deep into the audio-visual products such as internet television, iptv.But, these products at present also in examination commercial stage, a lot of product exist play online overlong time, can not Appropriate application effective bandwidth, the problems such as after redirect the response time is long, have had a strong impact on the audiovisual experience of spectators.
Summary of the invention
In view of above reason, the present invention aims to provide a kind of online displaying video buffering and pre-buffering mechanism, and can effectively solve airtime excessively slow, redirect is corresponding excessively slow, the problems such as buffering effect is undesirable, and effectively can utilize user bandwidth.For this reason, the present invention proposes following technical scheme:
A kind of online play buffering system, is made up of pre-buffering module, video information analysis module, transmit control module and state interactive module, it is characterized in that: above-mentioned pre-buffering module carries out pre-buffering to the audio/video flow received; Above-mentioned video information analysis module is analyzed from pre-buffering module reading video data, obtains the code rate information of each audio/video flow in video file, and information is passed to player control module; After transmit control module obtains audio frequency and video code rate information, arrange the bit stream buffer district of player, the setting of described transmit control module to the bit stream buffer district of player comprises the setting of video code flow buffering area and audio code stream buffering area; After setting up buffering area, transmit control module starts player; Player is in buffer status after starting, from pre-buffering module, read data, fills video code flow buffering area and audio code stream buffering area.
Described state interactive module is used for carrying out alternately with user, when the broadcast state of player is sent to state interactive module by transmit control module, the state of player is presented to user by state interactive module, is made the operations such as time-out, wait or redirect by user.
Further, the size of described video code flow buffering area is set to VBuffer=VMaxRate*Time, the size ABuffer=AMaxRate*Time of described audio code stream buffering area; Wherein, VBuffer is the size of the video code flow buffering area of player, and described VMaxRate is the maximal rate of video flowing; ABuffer is the size of the audio code stream buffering area of player, and described AMaxRate is the maximal rate of audio stream, and described Time is adjustable time parameter.
Preferably, described Time is 10 seconds.
One preferably in execution mode, in buffering course, the state of the code stream of player control module cycle detection player, after being greater than threshold value S depending on the data volume in video or audio buffer, player control module sends to player and starts play command; Described threshold value S=VMaxRate*0.5S.
Further, after player starts broadcasting, player control module continues the code stream state of cycle detection player, when the data in video or audio buffer are less than threshold value L, suspend the broadcasting of player, and this event is sent to state interactive module, described threshold value L=VMaxRate*1 second; When the data in video or audio code stream buffering area are greater than the VBuffer upper limit or MaxBuffer, or time out overtime threshold value P, broadcast state replied by transmit control module notice player, and give state interactive module by this event, its broadcast state is fed back to transmit control module by player.
The present invention also provides a kind of online way to play for time, comprises the following steps:
Step 1: pre-buffering module carries out pre-buffering to the data received, and data is supplied to video information analysis module;
Step 2: video information analysis module is analyzed from pre-buffering module reading video data.Described analysis content includes but not limited to data content, data bit rate information etc., and described data are audio/video information;
Step 3: video information analysis module is analyzed video data, obtains the code rate information of each audio/video flow in video file, and information is passed to player control module;
Step 4: after transmit control module obtains audio frequency and video code rate information, is arranged the bit stream buffer district of player, and start player, player reads data from pre-buffering module, fills screen buffer and audio buffer.
One preferred embodiment in, described step 4 comprises:
Step 4-1: by the size VBuffer=VMaxRate*Time of the video code flow buffering area of player;
Step 4-2: by the size ABuffer=AMaxRate*Time of the audio code stream buffering area of player;
Wherein, VBuffer is the size of the video code flow buffering area of player, and described VMaxRate is the maximal rate of video flowing; ABuffer is the size of the audio code stream buffering area of player, and described AMaxRate is the maximal rate of audio stream, and described Time is adjustable time parameter.
Alternatively, also comprise after described step 4: step 5: the state of the code stream of player control module cycle detection player, after being greater than threshold value S depending on the data volume in video or audio buffer, player control module sends to player and starts play command, and player starts playing audio-video; Described threshold value S=VMaxRate*0.5S.
Further, also comprise after described step 5:
After player starts broadcasting, player control module continues the code stream state of cycle detection player, when the data in video or audio buffer are less than threshold value L, suspends the broadcasting of player, and this event is sent to state interactive module, described threshold value L=VMaxRate*1 second; When the data in video or audio code stream buffering area are greater than the VBuffer upper limit or MaxBuffer, or time out overtime threshold value P, broadcast state replied by transmit control module notice player, and give state interactive module by this event, its broadcast state is fed back to transmit control module by player.
Technique scheme effectively can save Installed System Memory, and can ensure enough bufferings.As long as when just to start broadcasting and user's redirect time guarantee the video data of a frame time just start broadcasting, effectively can reduce the stand-by period of user like this, add Consumer's Experience.
Accompanying drawing explanation
Fig. 1 is the schematic diagram of the online buffer system of the present invention.
Embodiment
Below will describe preferred embodiment of the present invention, those skilled in the art should know these execution modes and nonrestrictive.In order to solve the problem, specific implementation provided by the invention is as follows.
See accompanying drawing 1, first the present invention provides a kind of online play buffering system, and this system is made up of pre-buffering module, video information analysis module, transmit control module and state interactive module.
Above-mentioned pre-buffering module receives the data that data reception module (not shown in figure 1) sends over, and carries out pre-buffering to the data received, and then data are supplied to extraneous module and use, described data reception module is used for from Network Capture data.
Video information analysis module is analyzed from pre-buffering module reading video data, analyzes content and includes but not limited to data content, data bit rate information etc.Preferably, described data are audio/video information.After analysis, video information analysis module obtains the code rate information of each audio/video flow in video file, and information is passed to player control module, if be difficult to the code rate information automatically obtaining audio frequency and video under some environment, also can manually specify by other means.
After transmit control module obtains audio frequency and video code rate information, code stream (bitstream) buffering area of player is arranged.In one preferably execution mode, by the size VBuffer=VMaxRate*Time of video code flow (bitstream) buffering area of player.Described VBuffer is the size of the video code flow buffering area of player, described VMaxRate is the maximal rate of video flowing, described Time is adjustable time parameter, in a nonrestrictive execution mode, Time is 10 seconds, that is, become to be greater than the size of maximal rate video flowing 10s data by the video code flow setting buffers of player.On the other hand, by the size ABuffer=AMaxRate*Time of audio code stream (bitstream) buffering area of player.Described ABuffer is the size of the audio code stream buffering area of player, described AMaxRate is the maximal rate of audio stream, described Time is adjustable time parameter, in a nonrestrictive execution mode, Time is 10 seconds, that is, become to be greater than the size of maximal rate audio stream 10s data by the audio code stream setting buffers of player.If the upper limit MaxBuffer of VMaxRate*Time >=buffering area, then VBuffer=MaxBuffer.
After setting up buffering area, transmit control module starts player.
First player is in buffer status after starting, and reads data from pre-buffering module, fills screen buffer and audio buffer.
In buffering course, the state of the code stream bitstram of player control module cycle detection player, after being greater than threshold value S depending on the data volume in video or audio buffer, player control module sends to player and starts play command; Preferably, in order to ensure the continuity of video playback, described threshold value S=VMaxRate*0.5S, that is, the data of desirable VMaxRate*0.5 second.Similarly, due to audio-visual synchronization, now when the amount of audio data in audio buffer is AMaxRate*0.5.
Player starts to play, and after starting broadcasting, player control module continues the code stream state of cycle detection player, when the data in video or audio buffer are less than threshold value L, suspend the broadcasting of player, and this event is sent to state interactive module.Preferably, in order to ensure the repeatedly pause do not occurred in playing process, described threshold value L=VMaxRate*1S, that is, the data of desirable VMaxRate*1 second.On the other hand, when the data in video or audio code stream buffering area are greater than the VBuffer upper limit or MaxBuffer, or time out overtime threshold value P, broadcast state replied by transmit control module notice player, and give state interactive module by this event, its broadcast state is fed back to transmit control module by player.Above-mentioned P=20 second alternatively.
State interactive module is used for carrying out alternately with user, and when the broadcast state of player is sent to state interactive module by transmit control module, the state of player is presented to user by state interactive module, is made the operations such as time-out, wait or redirect by user.When user's redirect, buffering strategy processes by when starting broadcasting.
On the other hand, the present invention also provides a kind of online way to play for time, comprises the following steps:
Step 1: pre-buffering module carries out pre-buffering to the data received, and data is supplied to video information analysis module.
Step 2: video information analysis module is analyzed from pre-buffering module reading video data.Described analysis content includes but not limited to data content, data bit rate information etc.Preferably, described data are audio/video information.
Step 3: after video information analysis module is analyzed video data, obtain the code rate information of each audio/video flow in video file, and information is passed to player control module, if be difficult to the code rate information automatically obtaining audio frequency and video under some environment, also can manually specify by other means.
Step 4: after transmit control module obtains audio frequency and video code rate information, is arranged code stream (bitstream) buffering area of player.In one preferably execution mode, by the size VBuffer=VMaxRate*Time of video code flow (bitstream) buffering area of player.Described VBuffer is the size of the video code flow buffering area of player, described VMaxRate is the maximal rate of video flowing, described Time is adjustable time parameter, in a nonrestrictive execution mode, Time is 10 seconds, that is, become to be greater than the size of maximal rate video flowing 10s data by the video code flow setting buffers of player.On the other hand, by the size ABuffer=AMaxRate*Time of audio code stream (bitstream) buffering area of player.Described ABuffer is the size of the audio code stream buffering area of player, described AMaxRate is the maximal rate of audio stream, described Time is adjustable time parameter, in a nonrestrictive execution mode, Time is 10 seconds, that is, become to be greater than the size of maximal rate audio stream 10s data by the audio code stream setting buffers of player.If the upper limit MaxBuffer of VMaxRate*Time >=buffering area, then VBuffer=MaxBuffer.
Step 5: after transmit control module sets up buffering area, transmit control module starts player.First player is in buffer status after starting, and reads data from pre-buffering module, fills screen buffer and audio buffer.
In buffering course, the state of the code stream bitstram of player control module cycle detection player, after the data volume in video or audio buffer is greater than threshold value S, player control module sends to player and starts play command; Preferably, in order to ensure the continuity of video playback, described threshold value S=VMaxRate*0.5S, that is, the data of desirable VMaxRate*0.5 second.Similarly, due to audio-visual synchronization, now when the amount of audio data in audio buffer is AMaxRate*0.5.
Step 6: player starts to play, after starting broadcasting, player control module continues the code stream state of cycle detection player, when the data in video or audio buffer are less than threshold value L, suspend the broadcasting of player, and this event is sent to state interactive module.Preferably, in order to ensure the repeatedly pause do not occurred in playing process, described threshold value L=VMaxRate*1S, that is, the data of desirable VMaxRate*1 second.On the other hand, when the data in video or audio code stream buffering area are greater than the VBuffer upper limit or MaxBuffer, or time out overtime threshold value P, broadcast state replied by transmit control module notice player, and give state interactive module by this event, its broadcast state is fed back to transmit control module by player.Above-mentioned P=20 second alternatively.
State interactive module is used for carrying out alternately with user, and when the broadcast state of player is sent to state interactive module by transmit control module, the state of player is presented to user by state interactive module, is made the operations such as time-out, wait or redirect by user.When user's redirect, buffering strategy processes by when starting broadcasting.
The invention has the advantages that: the size arranging audio frequency and video bitstream buffering according to the code check of audio frequency and video, the method effectively can save Installed System Memory, and can ensure enough bufferings.As long as when just to start broadcasting and user's redirect time guarantee the video data of a hardwood time just start broadcasting, effectively can reduce the stand-by period of user like this, and can be the fastest the first frame picture of film, or the new picture after redirect is presented to user.