Summary of the invention
Technical problem to be solved by this invention provides method and a kind of network player of a kind of locally storing, searching streaming media, the files in stream media of online broadcast can be saved in this locality, and sets up search in this locality.
In order to address the above problem, the invention discloses the method for a kind of locally storing, searching streaming media, comprising:
All flow media data packet of receiving in real time are buffered in this locality with the form of fragment file;
The fragment file is synthesized complete files in stream media, 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.
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,, after the corresponding files in stream media of local search, also comprise according to keyword:
According to described index, begin to play from the key frame position of the gauge point correspondence of files in stream media.
Preferably, all flow media data packet of receiving in real time are buffered in before this locality with the form of fragment file, also comprise:
Whether authentication this locality has the authority of including, if having, then allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, then allow to be used for the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied at local cache.
Preferably, the fragment file being synthesized complete files in stream media comprises:
According to the timestamp in the fragment file, the fragment file is synthesized complete files in stream media.
The present invention also provides a kind of network player with locally storing, function of search, comprising:
The fragment cache module is used for all flow media data packet of will be in real time receiving and is buffered in this locality with the form of fragment file;
The file synthesis module is used for the fragment file is synthesized complete files in stream media, 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;
Then described search module is searched the key frame of the gauge point correspondence of files in stream media according to described index.
Preferably, described network player also comprises:
The purview certification module is used to authenticate this locality and whether has the authority of including, if having, then allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, then allow to be used for the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied at local cache.
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 process of online broadcast, the flow media data packet that receives in real time is buffered in this locality with the form of fragment file, then the fragment file is synthesized a complete files in stream media, and be stored in this locality.Like this, the online files in stream media of watching of user can be saved in this locality automatically, if the user wishes to watch again certain file, just can directly obtain broadcast from this locality, and not need the dependency 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, and the user can find certain files in stream media of locally storing fast.And, the user can also carry out mark to certain wonderful in the 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, realized the accurate location of files in stream media from the key frame position of gauge point correspondence.The user does not need to take time and waits for the 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, be the method flow diagram of the embodiment of the invention one described a kind of locally storing, 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;
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 packet in real time and can play.Traditional stream transmission need be provided with buffer memory in this locality, is used to store the packet of certain hour section, and after the packet in the buffer memory all played, buffer memory abandoned the content of having play, and utilizes the space of vacating to come the follow-up content of not playing as yet of buffer memory again.The effect of described buffer memory is to eliminate time delay and shake, to guarantee that stream medium data can broadcast continuously.
Equally also need buffer memory be set in the present embodiment in this locality, but, this buffer memory not only is used to guarantee the continuous broadcast of stream medium data, also needs all packets that receive in the 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 bigger.
Step 102 synthesizes complete files in stream media with the fragment file, and is stored in this locality;
When this files in stream media by Network Transmission and after playing, local program can be included arrangement to all fragment files of buffer memory, and all fragment files are synthesized a complete file, is stored in the local storage mediums such as hard disk.This process is equivalent to reduce whole original document by the fragment file.
The synthetic method that present embodiment adopts is: each fragment file all 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;
The stream medium data of online broadcast is indexed to after this locality, and local program also can carry out data analysis and arrangement to a plurality of files in stream media of being included, and sets up the mapping relations of keyword and files in stream media, thereby provides 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 online files in stream media of watching of user can be saved in this locality automatically, if the user wishes to watch again certain file, just can directly obtain broadcast from this locality, and not need the dependency 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, and the user can find certain files in stream media of locally storing fast.
Preferably, in the said process, can also the locally storing authority be set, only, just can obtain this authority meeting (as being the VIP client or the client that pays dues) under the situation of some condition to different user.Therefore, can also comprise step before the step 101: whether authentication this locality has the authority of including, if having, then allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, then allow to be used for the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied at local cache according to traditional stream transmission.The content of having only the user that has an authority through authentication just can play at locally storing has made things convenient for the management to the user.
Embodiment two:
With reference to Fig. 2, be the method flow diagram of the embodiment of the invention two described a kind of locally storings, searching streaming media.
Step 201, in the online playing process of Streaming Media, real-time receiving stream media packet;
Step 202 to the user that authentication is passed through, allows in this locality with all flow media data packet of the form buffer memory of fragment file;
And, not allowing to use locally storing and search function to authenticating unsanctioned user, local program can only buffer memory partial data bag, and can utilize the space of vacating to come the follow-up content of not playing as yet of buffer memory again by abandoning the content of having play.
Step 203 synthesizes complete files in stream media with the fragment file, 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 the position of key frame in the file quickly and accurately.
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 the 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 the files in stream media.
Step 207, the user imports keyword;
Step 208, and begins from the key frame position of the gauge point correspondence of files in stream media to play 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 index again, therefore the accurate location of having realized files in stream media by index, the user does not need to take time and waits for the transmission and the broadcast of previous contents, just can be directly begins to watch from arbitrary gauge point position of Streaming Media.
Embodiment three:
With reference to Fig. 3, be the embodiment of the invention three described a kind of structure charts with network player of locally storing, function of search.
Described network player mainly comprises:
Fragment cache module 31 is used for all flow media data packet of will be in real time receiving and is buffered in this locality with the form of fragment file;
File synthesis module 32 is used for the fragment file is synthesized complete files in stream media, 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;
Then described search module 34 is searched the key frame of the gauge point correspondence of files in stream media according to described index.
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 the key frame position of gauge point correspondence.
Preferably, described player can also comprise:
Purview certification module 38 is used to authenticate this locality and whether has the authority of including, if having, then allows all flow media data packet that receive with the form buffer memory of fragment file in this locality; If do not have, then allow to be used for the partial data bag of current broadcast, and after this partial data bag plays, automatically local cache is emptied at local cache.
In sum, described network player can be saved in this locality with the files in stream media of online broadcast, 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 all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device embodiment, because it is similar substantially to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than to method and a kind of network player of 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, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.