Summary of the invention
Technical problem to be solved by this invention is to provide method and a kind of network player of a kind of locally storing, searching streaming media, the files in stream media of playing online can be saved in this locality, and sets up search in this locality.
In order to address the above problem, the invention discloses a kind of method of locally storing, searching streaming media, comprising:
Authenticate this locality according to user type and whether have the authority of including, if having, allow all flow media data packet that receive with the form buffer memory of fragment file in this locality;
All flow media data packet of receiving in real time are buffered in this locality with the form of fragment file;
According to the timestamp in the fragment file, be complete files in stream media with the fragment file synthesis, and be stored in this locality;
To the files in stream media foundation of this locality storage and the mapping relations of keyword;
According to keyword at the corresponding files in stream media of local search;
If this locality does not have the authority of including, allow to be used at local cache the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied;
User with the authority of including comprises: VIP user or the user that pays the fees.
Preferably, described method also comprises:
Files in stream media to this locality carries out mark, and gauge point is corresponding with the key frame of files in stream media.
Preferably, described method also comprises:
Each key frame to files in stream media is set up index.
Preferably,, also comprise after the corresponding files in stream media of local search according to keyword:
According to described index, the key frame position corresponding from the gauge point of files in stream media begins to play.
The present invention also provides a kind of network player with locally storing, function of search, comprising:
The purview certification module is used for authenticating this locality according to user type and whether has the authority of including, if having, allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, allow to be used at local cache the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied; Described user with the authority of including comprises: VIP user or the user that pays the fees;
The fragment cache module is used for all flow media data packet that will receive in real time and is buffered in this locality with the form of fragment file;
The file synthesis module is used for the timestamp according to the fragment file, is complete files in stream media with the fragment file synthesis, and is stored in this locality;
Module is set up in mapping, is used for the files in stream media foundation of this locality storage and the mapping relations of keyword;
Search module is used for according to keyword at the corresponding files in stream media of local search.
Preferably, described network player also comprises:
Mark module is used for the files in stream media of this locality is carried out mark, and gauge point is corresponding with the key frame of files in stream media.
Preferably, described network player also comprises:
Module set up in index, is used for each key frame of files in stream media is set up index;
Described search module according to described index, is searched the key frame corresponding to gauge point of files in stream media.
Compared with prior art, the present invention has the following advantages:
At first, the invention provides a kind of network player with the function of including, can be in the online process of playing, the flow media data packet that receives in real time is buffered in this locality with the form of fragment file, then be a complete files in stream media with the fragment file synthesis, and be stored in this locality.Like this, the files in stream media that the user watched online can be saved in this locality automatically, if the user wishes again to watch certain file, just can directly obtain broadcast from this locality, and not need to rely on network environment, is very easy to the user.
Secondly, the present invention has also set up search service automatically to the files in stream media of locally storing, the user can fast finding to certain files in stream media of locally storing.And, the user can also carry out mark to certain wonderful in files in stream media, gauge point is corresponding with key frame in this document, the key frame of files in stream media has been set up index, so just can be directly begin to play-over from key frame position corresponding to gauge point, realized the accurate location of files in stream media.The user does not need to take time and waits for transmission and the broadcast of previous contents, just can be directly from video arbitrary gauge point begin to watch.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Embodiment one:
With reference to Fig. 1, it is the method flow diagram of the described a kind of locally storing of the embodiment of the present invention one, searching streaming media.
Step 101 is buffered in this locality with all flow media data packet of receiving in real time with the form of fragment file;
The present embodiment is based on the stream transmission technology, and a files in stream media is decomposed into a plurality of packets and is transferred to this locality from server end, and this locality receives in real time packet and can play.Traditional stream transmission need to arrange buffer memory in this locality, is used for the packet of storage certain hour section, and after the packet in buffer memory all played, buffer memory abandoned the content of having play, and the follow-up content of not yet playing of buffer memory is come in the space that re-using is vacated.The effect of described buffer memory is to eliminate delay time and jitter, to guarantee that stream medium data can broadcast continuously.
Equally also need to buffer memory be set in this locality in the present embodiment, but, this buffer memory not only is used for guaranteeing the continuous broadcast of stream medium data, also needs all packets that receive in a files in stream media playing process are all stored, and stores with the form of fragment file.Therefore, the memory capacity of these buffer memory needs is also larger.
Step 102 is complete files in stream media with the fragment file synthesis, and is stored in this locality;
By Internet Transmission and after playing, local program can be included arrangement to all fragment files of buffer memory, is a complete file with all fragment file synthesis when this files in stream media, is stored in the local storage mediums such as hard disk.This process is equivalent to by the whole original document of fragment file reduction.
The synthetic method that the present embodiment adopts is: each fragment file indicates timestamp, according to described timestamp, just can be combined into correct primary flow media file to all fragment files according to time sequencing.
Step 103 is to the files in stream media foundation of this locality storage and the mapping relations of keyword;
After the stream medium data of playing online was indexed to this locality, local program also can carry out data analysis and arrangement to a plurality of files in stream media of including, and sets up the mapping relations of keyword and files in stream media, thereby provided search service for the local user.
Step 104, and is play at the corresponding files in stream media of local search according to keyword.
In sum, the files in stream media that the user watched online can be saved in this locality automatically, if the user wishes again to watch certain file, just can directly obtain broadcast from this locality, and not need to rely on network environment, is very easy to the user.And the present invention has also set up search service automatically to the files in stream media of locally storing, the user can fast finding to certain files in stream media of locally storing.
Preferably, in said process, can also the locally storing authority be set to different user, only in the situation that meet some condition (as for VIP client or the client that pays dues), just can obtain this authority.Therefore, can also comprise step before step 101: authenticate this locality and whether have the authority of including, if having, allow all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, allow to be used at local cache the partial data bag of current broadcast according to traditional stream transmission, and after this partial data bag plays, automatically local cache is emptied.The content of only having the user that has an authority through authentication just can play at locally storing has facilitated the management to the user.
Embodiment two:
With reference to Fig. 2, it is the method flow diagram of the described a kind of locally storing of the embodiment of the present invention two, searching streaming media.
Step 201, in the online playing process of Streaming Media, real-time receiving stream media packet;
Step 202, the user to authentication is passed through allows in this locality with all flow media data packet of the form buffer memory of fragment file;
And to authenticating unsanctioned user, not allowing to use locally storing and search function, local program can only buffer unit divided data bag, and can re-use the space of vacating and come the follow-up content of not yet playing of buffer memory by abandoning the content of having play.
Step 203 is complete files in stream media with the fragment file synthesis, and is stored in this locality;
Step 204 is set up index to each key frame of local files in stream media;
The purpose of key frame being set up index is to navigate to quickly and accurately the position of key frame in file.
Step 205 is carried out mark to the files in stream media of this locality, and gauge point is corresponding with the key frame of files in stream media;
Be that the user can carry out mark to interested certain files in stream media, also can carry out mark to certain wonderful in files in stream media, the key frame position of the gauge point respective file of wonderful.
Step 206 is to the files in stream media foundation of this locality storage and the mapping relations of keyword;
Also can directly set up the corresponding relation of gauge point in keyword and files in stream media.
Step 207, the user inputs keyword;
Step 208, and begins to play from key frame position corresponding to the gauge point of files in stream media according to described index at the corresponding files in stream media of local search according to keyword.
In sum, gauge point is corresponding with key frame, and key frame has been set up again index, the accurate location of therefore having realized files in stream media by index, the user does not need to take time and waits for transmission and the broadcast of previous contents, just can be directly begins to watch from the arbitrary gauge point position of Streaming Media.
Embodiment three:
With reference to Fig. 3, it is the described a kind of structure chart with network player of locally storing, function of search of the embodiment of the present invention three.
Described network player mainly comprises:
Fragment cache module 31 is used for all flow media data packet that will receive in real time and is buffered in this locality with the form of fragment file;
File synthesis module 32, being used for is complete files in stream media with the fragment file synthesis, and is stored in this locality;
Module 33 is set up in mapping, is used for the files in stream media foundation of this locality storage and the mapping relations of keyword;
Search module 34 is used for according to keyword at the corresponding files in stream media of local search.
Preferably, described player can also comprise:
Mark module 35 is used for the files in stream media of this locality is carried out mark, and gauge point is corresponding with the key frame of files in stream media.
Preferably, described player can also comprise:
Module 36 set up in index, is used for each key frame of files in stream media is set up index;
Described search module 34 according to described index, is searched the key frame corresponding to gauge point of files in stream media.
Described player can also comprise:
Playing module 37 is used for reading described files in stream media from the storage medium of this locality, and begins to play from key frame position corresponding to gauge point.
Preferably, described player can also comprise:
Purview certification module 38 is used for authenticating this locality and whether has the authority of including, if having, allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, allow to be used at local cache the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied.
In sum, described network player can be saved in this locality with the files in stream media of playing online, and sets up search in this locality, has enriched the function of player, has strengthened the management function to local file, and is convenient for users.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment that between each embodiment, identical similar part is mutually referring to getting final product.For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part gets final product referring to the part explanation of embodiment of the method.
Above method and a kind of network player to a kind of locally storing provided by the present invention, searching streaming media, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, 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.