CN105100912A - Streaming media processing method and streaming media processing apparatus - Google Patents
Streaming media processing method and streaming media processing apparatus Download PDFInfo
- Publication number
- CN105100912A CN105100912A CN201410198527.XA CN201410198527A CN105100912A CN 105100912 A CN105100912 A CN 105100912A CN 201410198527 A CN201410198527 A CN 201410198527A CN 105100912 A CN105100912 A CN 105100912A
- Authority
- CN
- China
- Prior art keywords
- transport stream
- fragment
- stream fragment
- play
- reservation
- 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
Links
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application discloses a streaming media processing method and apparatus, which are applied to electronic devices. The method includes the steps: playing a streaming media file by obtaining and playing at least one transport stream fragment among multiple transport stream fragments, wherein the multiple transport stream fragments are formed by dividing the streaming media file in another device; detecting a play ending instruction, the play ending instruction being used for ending playing of the streaming media file; determining one or more reserved transport stream fragments from the uploaded transport stream fragments; and deleting other transport stream fragments except the reserved transport stream fragments, among the uploaded transport stream fragments. In this way, conflicts between a storage space and download time consuming in an electronic device can be settled by only reserving a part of the TS segments among all the downloaded TS fragments at present, and thus the user experience is improved to the maximum.
Description
Technical field
The present invention relates to field of computer technology, more specifically, the present invention relates to a kind of Streaming Media processing method and Streaming Media processing unit.
Background technology
At present, along with the development of electronic equipment and internet, online broadcasting has become more and more general.Such as, people can use electronic equipment, appreciate various multimedia resource whenever and wherever possible based on Technology of Multimedia Stream Playing (such as, watching video, listening to audio etc.).
In order to streaming media play-back technology standardizes, different manufacturers proposes different Streaming Media standards.Among many standards, most multimedia supply commercial city uses HTML (Hypertext Markup Language) (HTTP) real-time streaming transport (HTTPLiveStreaming, HLS) agreement to provide the service of the multimedia on electronic equipment to user.HLS is a stream media network host-host protocol based on HTTP proposed by apple (Apple) company, and it is a part for Apple QuickTime and iPhone software systems.
The operation principle of HLS protocol (or to be referred to as by whole files in stream media, media stream) fragment is (to be namely divided into the transport stream based on http protocol (TS) little one by one, there is the file of TS form), carry out downloading and playing for user, such as, consider that the network bandwidth limits, user only can download some TS fragments wherein at every turn, and broadcasting limit, limit is downloaded.That is, HLS protocol server end multimedia data stream is encapsulated as continuous print, its each there is little TS fragment long very in short-term; Accordingly, client is then constantly downloaded and is play these little TS fragments, until whole files in stream media finishes playing.
Summary of the invention
Files in stream media is being appreciated (such as based on HLS protocol, watch certain film) time, if user terminated for some reason and in advance to play before whole files in stream media appreciation is complete, then when again appreciating the files in stream media that this does not complete, this user continues to play often wishing to interrupt from last time " historical record " play, instead of starts anew to re-start broadcasting.
For this reason, can retain in the electronic device and currently download to all TS fragment datas of local storage and current playing progress rate, use for during user's continued broadcasting next time.
But if do not delete the TS fragment downloaded for a long time, so the memory (such as, SD card) of electronic equipment data cached will soon to be full of by these.Typically, such as duration is 120 minutes, resolution is the memory space that the film of 480P often needs to take 800MB.
Therefore, in order to save the memory space in electronic equipment, user do not appreciated files in stream media just terminate play time, the TS fragment all downloaded can be deleted from electronic equipment, and only preserve current playing progress rate in the electronic device, namely current play time (or being referred to as, end reproduction time), uses for during this film of user's continued broadcasting.
But, in the case, when user expects this files in stream media of playing progress rate continued broadcasting from last time, because the TS fragment of previous institute buffer memory is eliminated, although so electronic equipment needs again to download those according to above-mentioned end reproduction time downloaded the deleted TS fragment when terminating broadcasting when previous broadcastings.Therefore, a large amount of time is lost to above the repeated downloads of the TS fragment waiting for corresponding historical record, thus it is chronic to cause waiting for required for continued broadcasting.
In order to solve the problems of the technologies described above, according to an aspect of the present invention, provide a kind of Streaming Media processing method, be applied to electronic equipment, described method comprises: by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file, wherein, described multiple transport stream fragment generates by dividing described files in stream media in another equipment; Detect and terminate play instruction, described end play instruction plays described files in stream media for terminating; One or more reservation transport stream fragment is determined in the transport stream fragment downloaded; And delete other transport stream fragments among the transport stream fragment downloaded, except described reservation transport stream fragment.
In addition, according to a further aspect in the invention, provide a kind of Streaming Media processing unit, be applied to electronic equipment, described device comprises: fragment obtains broadcast unit, for by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file, wherein, described multiple transport stream fragment generates by dividing described files in stream media in another equipment; END instruction detecting unit, for detecting end play instruction, described end play instruction plays described files in stream media for terminating; Retain fragment determining unit, for determining one or more reservation transport stream fragment in the transport stream fragment downloaded; And other fragment delete cellses, for deleting other transport stream fragments among the transport stream fragment downloaded, except described reservation transport stream fragment.
Compared with prior art, adopt the Streaming Media processing method according to the embodiment of the present invention and device, can to obtain and at least one the transport stream fragment play in the multiple transport stream fragments generated by dividing described files in stream media in another equipment is come in the process of playing stream media file, detect for terminating the end play instruction playing described files in stream media, in the transport stream fragment downloaded, one or more reservation transport stream fragment is determined according to the strategy pre-set, continue to retain these transport stream fragments, and among the transport stream fragment that deletion has been downloaded, except other transport stream fragments except described reservation transport stream fragment.Therefore, in an embodiment of the present invention, one Streaming Media processing method and device flexibly can be provided, its can come coordinate storage space in the electronic device by a part of TS fragment only retained in the current all TS fragments downloaded and download consuming time between contradiction, to promote Consumer's Experience most possibly.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from specification, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in specification, claims and accompanying drawing and obtain.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for specification, together with embodiments of the present invention for explaining the present invention, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 be a diagram that the flow chart of the Streaming Media processing method according to the embodiment of the present invention.
Fig. 2 be a diagram that the schematic diagram of the display effect of the graphic user interface according to the embodiment of the present invention.
Fig. 3 be a diagram that the flow chart of determination reservation transport stream fragment according to a first embodiment of the present invention.
Fig. 4 be a diagram that the schematic diagram according to the corresponding relation between the current play time of the embodiment of the present invention and transport stream fragment.
Fig. 5 be a diagram that the flow chart of determination reservation transport stream fragment according to a second embodiment of the present invention.
Fig. 6 be a diagram that the block diagram of the Streaming Media processing unit according to the embodiment of the present invention.
Fig. 7 be a diagram that the block diagram of the electronic equipment according to the embodiment of the present invention.
Embodiment
Describe in detail with reference to the accompanying drawings according to each embodiment of the present invention.Here it is to be noted that it in the accompanying drawings, identical Reference numeral is given there is identical or similar structures and function part substantially, and the repeated description of will omit about them.
Before description is according to the Streaming Media processing method of the embodiment of the present invention and Streaming Media processing unit, first existing Technology of Multimedia Stream Playing is simply introduced.
In existing streaming Media Technology, usually mainly comprise following concept:
Elementary stream (ES), it can be the continuous bit stream comprising such as video, audio frequency or other data.
The elementary stream (PES) of packing, it can be the packet do not waited by elementary stream ES being divided into as required length, and adds what packet header was formed.
Transport stream (TS), it can be made up of the fragment of regular length (such as, 188 bytes) or variable-length, and the one or more programs (program) containing base time independent, be applicable to the environment that error code is more.
When broadcast program, electronic equipment (such as, client) first can in this locality from another equipment (such as, server) receive TS fragment, then this TS fragment is decoded, obtain PES data, and PES data are removed header to obtain ES data, finally ES data are decoded in a decoder, thus obtain video data one by one, to play to user.
Particularly, among all Technology of Multimedia Stream Playings, the maximum difference of the streaming Media Technology based on HLS protocol is, as client electronic equipment accessed by be not a complete files in stream media.HLS protocol is as in another equipment of server end, according to self-defining stripping strategy, live data streams is divided into continuous print, media file (MPEG-TS form) long very in short-term, and after the storage completing a segmental file, upgrade M3U8 index file, to record playing sequence and the duration of each segmental file (or being called transport stream fragment).
Therefore, in HLS protocol, HLS data are made up of numerous TS fragment and M3U8 index information usually.
Each TS fragment has different sequence numbers to represent its playing sequence.Such as, TS (n) can play and play before TS (n+1) after TS (n-1), and wherein n represents the broadcasting sequence number of TS fragment and is positive integer.Further, depend on stripping strategy, each TS fragment can correspond to identical playing duration, and such as, each TS fragment can correspond to the playing duration of 10 seconds; Alternatively, each TS fragment also can correspond to different playing duration, and such as, some TS fragments may correspond to the playing duration of 10 seconds, and some TS fragments may correspond to the playing duration of 3 seconds or 8 seconds.
M3U8 index information can indicate and altogether comprise how many TS fragments in a files in stream media.In addition, when each TS fragment also can correspond to different playing duration, this M3U8 index information can also indicate the corresponding relation of each TS fragment and reproduction time further.Particularly, M3U8 index information can be the file of expansion .m3u form by name, and uses UTF-8 character to encode.
Alternatively, in HLS protocol, each TS fragment also can not be represented by sequence number, but has different identifiers.In the case, this M3U8 index information can also indicate the playing sequence of TS fragment in whole files in stream media with different identification symbol further.
Below, the main thought of the embodiment of the present invention will be described briefly.
In order to solve technical problem of the prior art, when namely continuing playing stream media file when user wishes to interrupt play position from last time, if retain the current all TS fragments downloaded in the electronic device, then memory space inadequate may be caused; And iff retaining current playing progress rate, then cause owing to again downloading TS fragment waiting for continued broadcasting time lengthening, propose a kind of novel Streaming Media processing method and Streaming Media processing unit in an embodiment of the present invention, it can by when terminating files in stream media and playing, only retain a part of TS fragment in the current all TS fragments downloaded (such as, with one or more TS fragments of interrupting current playing progress rate when playing and being associated) come coordinate storage space and download consuming time between contradiction, to promote Consumer's Experience most possibly.
Hereinafter, first the Streaming Media processing method according to the embodiment of the present invention will be described.
Fig. 1 be a diagram that the flow chart of the Streaming Media processing method according to the embodiment of the present invention.
Streaming Media processing method as illustrated in figure 1 can be applied to one or more electronic equipment.
Such as, in order to provide multi-media player function to user, display unit can be integrated with (such as in this electronic equipment, liquid crystal display, cathode-ray tube display etc.), with the target viewdata (such as, image, video or text etc.) of display from various Data Source.Alternatively or cumulatively, loudspeaker arrangement (such as, loud speaker) can be integrated with in this electronic equipment, to play the target Audiotex (such as, audio frequency etc.) from various Data Source.
In addition, communicator can also be integrated with (such as in described electronic equipment, mobile communication module, wireless communication module etc.), with from internet download or from another equipment (such as, server end or other electronic equipments) in receive a formation files in stream media multiple transport stream fragments among at least one transport stream fragment, to play these transport stream fragments in order successively in display unit and/or loudspeaker arrangement, thus play the files in stream media corresponding with the plurality of transport stream fragment.
Further, can also be integrated with storage device in described electronic equipment, the transport stream fragment made it possible to being obtained by communicator carries out buffer memory, so that user is when normal appreciation files in stream media, carries out playback as required.
Obviously, in order to complete other operations, other functional devices can also be integrated with in described electronic equipment, not enumerate at this.
, the Streaming Media processing method according to the embodiment of the present invention will be explained in following instantiation below, wherein, suppose that electronic equipment is the mobile phone as client; Another equipment is the video server as server end, and it is for stored stream media file and provide multimedia service based on HLS protocol to mobile phone; This files in stream media is video file; And this mobile phone based on HLS protocol from video server download and play this video file to user.
But, it should be noted that, the present invention is not limited thereto.This electronic equipment can be the electronic equipment of any type, and it includes but not limited to: notebook, panel computer, mobile phone, multimedia player, personal digital assistant etc.This another equipment also can be the electronic equipment of any type, and it includes but not limited to: personal computer, work station, server etc.This files in stream media can be the target data of any type, and it includes but not limited to: pure audio, pure video, audio frequency and video and other data etc.And, according to the Streaming Media processing method of the embodiment of the present invention except can being applied to the streaming Media Technology based on HLS protocol, other streaming Media Technology can also be applied to, as long as this streaming Media Technology has following principle, namely at another equipment (such as, server end) files in stream media is divided into multiple transport stream fragment, and by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file in electronic equipment (such as, client).In addition, any other relevant treatment that can also will be applied to according to the Streaming Media processing method of the embodiment of the present invention in electronic equipment.
As illustrated in figure 1, described Streaming Media processing method comprises:
In step s 110, by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file.
In the method, can come from another equipment, obtain the multiple transport stream fragments forming this files in stream media according to the playing sequence of files in stream media, and in turn play these transport stream fragments, thus play this files in stream media.Such as, described multiple transport stream fragment generates by dividing described files in stream media in another equipment.
In one example, consider network speed, only can obtain one or several transport stream fragment in multiple transport stream fragment at every turn, and in turn play these transport stream fragments, constantly continue to obtain one or several follow-up transport stream fragment simultaneously in the process play, thus realize the played in order of whole files in stream media.
In concrete scene, along with the development of electronic equipment and internet, user can use and be positioned at local electronic equipment (such as, mobile phone) watch and be positioned at another long-range equipment (such as, video server) files in stream media (such as, video file).
For this reason, first user can open the application program for playing stream media file.This application program can be common application, such as, and browser; Alternatively, this application program also can be proprietary application, such as, and the playout software etc. that some content suppliers develop.
Then, user can input beginning play instruction for starting playing stream media file by various mode, such as, click the program chaining on video server webpage, click and be placed on the project or manual input video chained address etc. of collecting in collection in advance.
Such as, after opening a certain application program, this application program can provide the various program-related information such as character introduction, thumbnail general view, classified browse device of various programme content to user.User can click the thumbnail of a certain program according to the needs of oneself, and sends this and start play instruction, plays to enter program.
After receiving this and starting play instruction, electronic equipment can start according to this data source that play instruction arranges files in stream media, and such as, this data source can be the URL(uniform resource locator) (URL) of the files in stream media that will play.That is, electronic equipment can determine that this starts the position of data source corresponding to play instruction in video server, and from video server, obtains associated program content based on Streaming transfer protocol (such as, HLS protocol).
As mentioned above, in video server, whole video file can be divided into the transport stream based on http protocol (TS) fragment little one by one in advance, and generate the index information (such as, M3U8 index file) relevant to this video file according to division result.
Then, the data source (such as, hyperlink http://www.a.com/b.ram) that electronic equipment can be selected according to user to download the index file corresponding with this video file, such as b.m3u8 from server.The index information of each transport stream fragment of this video file b.ram is described, the duration of such as each TS fragment and other various attribute information in this index file b.m3u8.
Next, this electronic equipment can determine order and the playing duration of (such as, calculate and preserve) these TS fragments according to the index information of each TS fragment in this files in stream media, and downloads TS fragment successively from video server.Depend on the network bandwidth, this electronic equipment can once download one or several TS fragment from video server.Subsequently, these TS fragments can be play according to predetermined policy (such as, the playing sequence according to video file), and continue follow-up down operation in the process play.So analogize, to realize the play operation to whole video file in the electronic device.
Such as, when being represented each TS fragment by sequence number, these TS fragments of played in order can be carried out according to the sequence number of TS fragment.Such as, TS (n) can play and play before TS (n+1) after TS (n-1), and wherein n represents the sequence number of TS fragment and is positive integer.
And for example, when being represented each TS fragment by identifier, also can judge the playing sequence of the TS fragment with different identification symbol by reading M3U8 index information, and play these TS fragments according to this playing sequence.
Such as, in order to playing video file, the graphic user interface for playing a certain specific stream media file can be shown on the display unit of electronic equipment.
Fig. 2 be a diagram that the schematic diagram of the display effect of the graphic user interface according to the embodiment of the present invention.
As illustrated in Figure 2, the graphic user interface shown in display unit can be a broadcast interface.Such as, this broadcast interface can show program play area and just in the title/title of broadcast program, and return push-button and/or X button can be shown.Such as, this return push-button may be used for turning back to the first front interface of current program broadcast interface (such as, the informative presentations of various program, breviary display, category division etc. can be provided in this first front interface), and this X button may be used for directly closedown for the current application program of playing stream media file.
In addition, this broadcast program can also show the control button such as broadcast button, pause button, stop button, progress bar button for Play Control.Further, owing to just may there are other related-programs at broadcast program, select so these other related-programs can also be provided on broadcast interface for user.Such as, when this is just when broadcast program is a certain collection in certain TV play, these other related-programs can be other collection in this TV play.At this moment, a upper collection that can also show in this broadcast program for controlling to carry out switching in different program collects button with next.
Without the need to repeating, one or more in the above-mentioned display items display in broadcast interface are optional, and according to user's needs, they can switch in hidden state and show state.In addition, some function also can share a button, and such as, after click broadcast button, this broadcast button can become pause button, and after click pause button, this pause button can become broadcast button etc.
In the step s 120, end play instruction is detected.
By to obtain and at least one the transport stream fragment play in multiple transport stream fragment is come in the process of playing stream media file, can detect the end play instruction that user sends, this terminates play instruction and plays described files in stream media for terminating.
Particularly, user is after have viewed current video file, and may find oneself to lose interest in this video file, at this moment user can click the return push-button in Fig. 2, thus reselects program and watch.Or user also may wish to watch a upper collection of current video file or the plot of next collection, the upper collection that at this moment user can click in Fig. 2 carries out collection of drama switching with next collection button.Alternatively, user also may wish to watch other programs relevant to current video file, and at this moment user directly can select other related-programs from the rendition list Fig. 2.In addition, user also may need interrupt current viewing operation and use other things of electronic equipment process for some reason, and at this moment this user can click the X button in Fig. 2, thus exits application program.
No matter there is above-mentioned arbitrary situation, all will trigger generation one in the electronic device and terminate play instruction, for the play operation terminating current video file.In the method, such as, the end play instruction that user sends can be detected in real time or periodically, with the deletion of triggering following and reservation operations.
In addition, user is in the process that have viewed current video file, and also may need to suspend the broadcasting of this video file, at this moment user can click the pause button in Fig. 2, thus stops viewing program.For this reason, in the electronic device triggering generation one is suspended play instruction, for the play operation stopping current video file provisionally.But, with above differently, because this stopping is temporary, user may recover to play this video file at any time, so such as, and can after this time-out play instruction being detected, the not deletion of triggering following and reservation operations, that is, in the memory of electronic equipment, still retain all fragments of download transport stream, to recover rapidly to play when user continues to play this video file later by click broadcast button.
In step s 130, which, in the transport stream fragment downloaded, one or more reservation transport stream fragment is determined.
In response to end play instruction being detected, the one or more reservation transport stream fragments among the transport stream fragment downloaded can be determined in the method.
For this reason, can terminate after play instruction detecting, determine current playing progress rate, and retain with interrupting TS fragment corresponding to current playing progress rate when playing.In various embodiments, this current playing progress rate can be different parameter.
Such as, in a first embodiment, this current playing progress rate can be the identification information of the current TS fragment play when end play instruction being detected.
Below, the determination first described according to a first embodiment of the present invention is retained the step of transport stream fragment.
Fig. 3 be a diagram that the flow chart of determination reservation transport stream fragment according to a first embodiment of the present invention.
As illustrated in fig. 3, describedly determine that the step retaining transport stream fragment comprises:
In step S1310, determine the sequence number of the current transmission stream fragment play when terminating playing stream media file.
After the end play instruction for interrupting playing stream media file being detected, can inquire about and currently in the electronic device play which TS fragment, and determining the identification information of this TS fragment, such as, sequence number, identifier etc.
Below, for convenience of description, suppose that total duration of user-selected video file b.ram is 100 minutes (as illustrated in Figure 2) and is divided into 1000 TS fragments, and the duration (that is, playing duration) of each TS fragment is unfixed.Further, whole place stopped playing this video file b.ram at the 30th minute to suppose user, and the TS fragment corresponding with current play time is TS (n).
Fig. 4 be a diagram that the schematic diagram according to the corresponding relation between the current play time of the embodiment of the present invention and transport stream fragment.
As illustrated in figure 4, when end play instruction being detected, the current TS fragment play is TS (n), and its duration is 10 seconds, and current play time is in the starting position place of the 5th second in TS (n) on the 30th minute.In addition, first TS fragment before being positioned at TS (n) is TS (n-1), and its duration is 3 seconds; Second TS fragment before being positioned at TS (n) is TS (n-2), and its duration is 9 seconds; First TS fragment after being positioned at TS (n) is TS (n+1), and its duration is 12 seconds; Second TS fragment after being positioned at TS (n) is TS (n+2), and its duration is 5 seconds.
Therefore, based on above-mentioned hypothesis, can inquire the current TS fragment play in this step is TS (n).Wherein, TS (n) can be the sequence number of this TS fragment, and it represents that this TS fragment n-th carries out the TS fragment play among 1000 TS fragments.Alternatively, TS (n) also can be the identifier of this TS fragment, and at this moment, can record this TS fragment in M3U8 index file is n-th carry out the playing sequence play in 1000 TS fragments.
In step S1320, determine to retain transport stream fragment according to the sequence number of current transmission stream fragment.
After the sequence number determining the current transmission stream fragment play when terminating playing stream media file, can determine to retain transport stream fragment according to the sequence number of current transmission stream fragment.
Such as, determine detect terminate play instruction time after the current TS fragment play is TS (n), can determine to need to carry out in the electronic device retaining according to the sequence number of current transmission stream fragment (or identification information) and not deleted fall one or more reservation transport stream fragments.Such as, described reservation transport stream fragment can comprise: at least one the transport stream fragment before described current transmission stream fragment and/or described current transmission stream fragment and/or at least one the transport stream fragment after described current transmission stream fragment.
Particularly, in a first example, reservation transport stream fragment only can be defined as current transmission stream fragment, i.e. TS (n).Like this, when this video file of user's continued broadcasting, both can ensure that electronic equipment can continue rapidly to play from " historical record " of this video file interruption last time broadcasting, and can ensure again minimally to take the memory space in electronic equipment.
In the second example, in order to obtain continued broadcasting time point more accurately, except retaining current transmission stream fragment, also the side-play amount of this current play time in current transmission stream fragment can be preserved further.As illustrated in figure 4, can also store following information in the electronic device, namely current play time is in the starting position place of the 5th second in TS (n) on the 30th minute.Like this, when user continues to play this video file subsequently, can not be to TS (n) from the beginning (namely, from the 1st second) play, but after skew TS (n) being carried out to 4 seconds time quantums, play from the 5th in TS (n) second.
In the 3rd example, story of a play or opera when above-mentioned interruption is play can be remembered more in order to ensure user, can when user play this video file again, a period of time starts to play in advance.For this reason, reservation transport stream fragment only can be defined as the some transport stream fragments be positioned at before current transmission stream fragment, i.e. TS (n-1) or TS (n-2) etc.Like this, when this video file of user's continued broadcasting, both continued rapidly to play can having ensured " historical record " a period of time in advance that electronic equipment can interrupt broadcasting last time from this video file, and can ensure again minimally to take the memory space in electronic equipment.In addition, in this example, the multiple transport stream fragments be positioned at before current transmission stream fragment can also be retained, i.e. TS (n-1) and TS (n-2) etc.; Or also can retain the one or more transport stream fragments be positioned at before current transmission stream fragment and current transmission stream fragment, i.e. TS (n), TS (n-1) and TS (n-2) etc.
In the 4th example, when electronic equipment memory space allows, except current transmission flow section and/or except being positioned at before current transmission stream fragment one or more transport stream fragments, reservation transport stream fragment can also be defined as the one or more transport stream fragments be positioned at after current transmission stream fragment, i.e. TS (n+1) and TS (n+2) etc.Like this, when this video file of user's continued broadcasting, can when taking the memory space in electronic equipment as few as possible, preserve the TS of the download fragment of some, thus reduce the download demand of electronic equipment when continued broadcasting further, to ensure that electronic equipment can continue rapidly to play from " historical record " of this video file interruption last time broadcasting better.
Above, describe following situation in a first embodiment, namely this current playing progress rate can be the identification information of the current TS fragment play when end play instruction being detected, and the TS fragment of current broadcasting, the several TS fragment before it and/or several TS fragments afterwards can be preserved simply, for continued broadcasting operation subsequently, and without the need to determining concrete current play time.
But, because the duration of each TS fragment is unfixed, even if so story of a play or opera when above-mentioned interruption is play and one or more TS fragments of saving extraly before the current TS fragment play can be remembered in order to ensure user, substance film how long also cannot to be learnt before saving current play time on earth definitely.
Such as, as illustrated in figure 4, when saving a TS fragment before the current TS fragment play extraly, when the current TS fragment play is TS (n), this TS fragment of additionally preserving is TS (n-1), and its duration data is 3 seconds, that is, when this video file of next continued broadcasting, 3 seconds can be shifted to an earlier date before current play time and play; But when the current TS fragment play is TS (n-1), this TS fragment of additionally preserving is TS (n-2), its duration data is 9 seconds, that is, when this video file of next continued broadcasting, 9 seconds can be shifted to an earlier date before current play time and play.Obviously, the disunity of this pre-set time when continued broadcasting may cause puzzlement to user.
Therefore, in order to a fixing reproduction time in advance can be determined, the second following embodiment is proposed.
Such as, in a second embodiment, this current playing progress rate can be the current play time of the described files in stream media when terminating to play described files in stream media.
Below, the determination first described according to a second embodiment of the present invention is retained the step of transport stream fragment.
Fig. 5 be a diagram that the flow chart of determination reservation transport stream fragment according to a second embodiment of the present invention.
As illustrated in fig. 5, describedly determine that the step retaining transport stream fragment comprises:
In step S2310, determine the current play time of the files in stream media when terminating playing stream media file.
After the end play instruction for interrupting playing stream media file being detected, the current play time of this files in stream media (that is, video file) can be inquired about.Based on the identical hypothesis in the first embodiment, the 30th minute that this current play time can be defined as this video file whole.
In step S2320, determine retain initial time and retain the termination time according to current play time.
Story of a play or opera when above-mentioned interruption is play can be remembered more in order to ensure user, can when user play this video file again, from current play time, a period of time carries out continuation broadcasting in advance.For this reason, when considering the memory space of electronic equipment, the transport stream fragment corresponding with the scope T1 for the previous period from current play time can be retained in the electronic device.In addition, in order to reduce the download demand of electronic equipment when this video file of continued broadcasting, also can when considering the memory space of electronic equipment, retain in the electronic device with from current play time after transport stream fragment corresponding to a period of time T2 scope.
Such as, T1 and T2 can be comprise 0 arbitrary value, and both can be identical or different.In addition, this T1 also can be called play start time in advance.
For convenience of description, T1 is assumed to be 10 seconds, and T2 is assumed to be 15 seconds.
Therefore, determining according to current play time to retain initial time and retain in the process of termination time, reservation initial time can be defined as before the 30th minute, shift to an earlier date 10 seconds, namely play from the 29th minute the 51st second, and the reservation termination time can be defined as delaying 15 seconds after the 30th minute, namely at least remain into the film of the 30th minute the 15th second.
In step S2330, determine to retain transport stream fragment according to reservation initial time and reservation termination time.
After determining reservation initial time and retaining the termination time, the reservation transport stream fragment of not wishing deletion can be determined according to these two times among the transport stream fragment downloaded further.
Particularly, step S2330 can comprise following sub-step:
In sub-step 1, obtain the index information of described files in stream media.
When determining to retain transport stream fragment, can first obtain the relative index information (such as, M3U8 index file) of video file.As mentioned above, in this M3U8 file, sequence number and the duration of each transport stream fragment in all transport stream fragments forming this video file can be recorded.
In sub-step 2, from the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described reservation initial time and described 1st transport stream fragment is greater than described reservation initial time to the duration sum of m transport stream fragment to the duration sum of m-1 transport stream fragment, described m is natural number, and described m transport stream fragment is defined as retaining original transmission flow section.
Because describe the length of each transport stream fragment in indexed file, so by the length of each transport stream fragment being sued for peace, the total duration length of whole files in stream media can be obtained.
Such as, in the first situation that each transport stream fragment has the fixing duration, if this b.ram comprises 6000 transport stream fragments, each transport stream fragment is 1 second, then the total duration length of this b.ram is 100 minutes.At this moment, simply, the TS fragment corresponding with retaining initial time (that is, the 29th minute the 51st second) can be defined as being the 1791st TS fragment, i.e. TS (1791).
But, based on the above-mentioned hypothesis in the first embodiment (namely, total duration of user-selected video file b.ram is 100 minutes and is divided into 1000 TS fragments, and the duration of each TS fragment is unfixed) the second situation under, the TS fragment corresponding with retaining initial time (that is, the 29th minute the 51st second) cannot be determined simply.
At this moment, inquiry M3U8 file can be passed through, to obtain the duration of each TS fragment.Further, from the transport stream fragment TS (1) of the 1st in described files in stream media, in turn the duration of the transport stream fragment of the 2nd is below sued for peace.Then, can determine whether following condition is set up, namely the duration of described 1st transport stream fragment TS (1) is less than described reservation initial time and described 1st transport stream fragment TS (1) is greater than described reservation initial time to the duration sum of the 2nd transport stream fragment TS (2).If this condition is false, then continue to sue for peace to the duration of the transport stream fragment of the 3rd below.And rejudge above-mentioned condition whether to set up.So analogize, until described 1st transport stream fragment TS (1) is less than described reservation initial time and described 1st transport stream fragment TS (1) is greater than described reservation initial time to the duration sum of m transport stream fragment TS (m) to the duration sum of m-1 transport stream fragment TS (m-1), described m is natural number and is less than or equal to the sum (that is, 1000) of transport stream fragment among video file.Thus, described m transport stream fragment can be defined as retaining original transmission flow section.
As illustrated in Figure 2, can determine, be 29 minutes 44 seconds from the 1st transport stream fragment TS (1) to the duration sum of the n-th-3 transport stream fragment TS (n-3), it is less than described reservation initial time the 29th minute the 51st second; And be 29 minutes 53 seconds from the 1st transport stream fragment TS (1) to the duration sum of the n-th-2 transport stream fragment TS (n-2), it is greater than described reservation initial time the 29th minute the 51st second.Thus, the n-th-2 transport stream fragment TS (n-2) can be defined as retaining original transmission flow section.
In addition, in order to obtain continued broadcasting time point more accurately, except retaining this reservation original transmission flow section, this side-play amount of play start time T1 in reservation original transmission flow section in advance can also be preserved further.As illustrated in figure 4, can store following information in the electronic device, namely play start time T1 is in the starting position place of the 7th second in TS (n-2) for the 29th minute the 51st second in advance.Like this, when user continues to play this video file subsequently, can not be to TS (n-2) from the beginning (namely, from the 29th minute 45 seconds) play, but after skew TS (n) being carried out to 6 seconds time quantums, play from the 7th TS (n-2) second (that is, from the 29th minute the 51st second), to realize being accurately the broadcasting lead of 10 seconds.
Alternatively, may not be and directly preserve above-mentioned side-play amount in the electronic device, but be kept at determine in step S2310 terminate playing stream media file time files in stream media current play time, so that when continued broadcasting subsequently, obtain above-mentioned side-play amount according to this current play time, thus skew broadcasting is carried out to reservation transport stream fragment.
In sub-step 3, from the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than the described reservation termination time and described 1st transport stream fragment is greater than the described reservation termination time to the duration sum of the n-th transport stream fragment to the duration sum of (n-1)th transport stream fragment, described n is natural number, and described n-th transport stream fragment is defined as retaining termination transport stream fragment.
Such as, in above-mentioned first situation that each transport stream fragment has the consistent time, simply, can by with reservation the termination time (namely, 30th minute 15 seconds) corresponding TS fragment is defined as being the 1815th TS fragment, i.e. TS (1815).
But, in above-mentioned second situation that each transport stream fragment has the uneven duration, still cannot determine the TS fragment corresponding with reservation termination time (that is, the 30th minute 15 seconds) simply.
At this moment, with in sub-step 2 in like manner, as illustrated in Figure 2, can determine, be 30 minutes 6 seconds from the 1st transport stream fragment TS (1) to the duration sum of the n-th transport stream fragment TS (n), it is less than the 30th minute 15 seconds described reservation termination time; And be 30 minutes 18 seconds from the 1st transport stream fragment TS (1) to the duration sum of (n+1)th transport stream fragment TS (n+1), it is greater than described reservation initial time the 30th minute 15 seconds.Thus, (n+1)th transport stream fragment TS (n+1) can be defined as retaining original transmission flow section.
In sub-step 4, be defined as described reservation transport stream fragment by from described reservation original transmission flow section to the described all transport stream fragments stopping transport stream fragment that retain.
After determining reservation original transmission flow section and retaining termination transport stream fragment, all transport stream fragments therebetween can be defined as described reservation transport stream fragment.
Such as, in above-mentioned first situation that each transport stream fragment has the identical duration, the reservation transport stream fragment needing to retain can be defined as to all TS fragments of the 1815th TS fragment TS (1815) from the 1791st TS fragment TS (1791).On the contrary, in above-mentioned second situation that each transport stream fragment may have the not identical duration, the reservation transport stream fragment needing to retain can be defined as to all TS fragments of (n+1)th transport stream fragment TS (n+1) from the n-th-2 transport stream fragment TS (n-2).
In step S140, other transport stream fragments among the transport stream fragment that deletion has been downloaded, except retaining transport stream fragment.
After determining reservation transport stream fragment, all transport stream fragments downloaded of buffer memory in the memory of electronic equipment can be cleared up according to the identification information of the sequence number retaining transport stream fragment and so on.
Such as, in the method, other transport stream fragments among the transport stream fragment downloaded, except retaining transport stream fragment can be deleted, and stay above-mentioned reservation transport stream fragment in the CACHE DIRECTORY relaying continuation of insurance of electronic equipment.Certainly, depend on that user needs, above-mentioned reservation transport stream fragment can be transferred to certain dedicated folder from CACHE DIRECTORY, so that management.
Therefore, describe following situation in the above-described embodiments, namely once end play instruction be detected in the playing process of files in stream media, just in the transport stream fragment downloaded, determine one or more reservation transport stream fragment, and in the memory of electronic equipment, retain these reservation transport stream fragments.
But, the present inventor notices further, due to files in stream media (such as, video file) usually all comprise specific medium part and (or be called effective content part, such as, it can be the positive part etc. of video file) and nonspecific media portion (or be called non-effective content part, such as, it can be the advertisement part of video file, the non-positive parts such as credits present part), so appreciate in the process of files in stream media user, after the appreciation completing above-mentioned specific medium part, probably can not wait for that follow-up nonspecific media portion finishes completely, just click the return push-button in Fig. 2 in advance, to reselect program, or the upper collection in click Fig. 2 collects button, to carry out collection of drama switching with next, or directly from the rendition list Fig. 2, select other related-programs, or closedown application program.In the case, because user probably can not continue to play this video file again, if so still perform the subsequent operation of this method according to the end play instruction detected, then will preserve the transport stream fragment corresponding with nonspecific media portion in the electronic device, thus cause the memory space unnecessarily wasting electronic equipment.
For this reason, in one example, in the process performing above-mentioned steps S130, first the specific medium part whether belonged in the current transmission stream fragment terminating to play when playing described files in stream media in described files in stream media can be judged, and only have when judging to belong to the specific medium part in described files in stream media in the current transmission stream fragment terminating to play when playing described files in stream media, from performing follow-up operation, namely in the transport stream fragment downloaded, determine one or more reservation transport stream fragment.
For this reason, such as, when server end generates transport stream fragment by dividing video file, specific medium part and nonspecific media portion can be distinguished by different identification informations.Like this, can judge whether the current transmission stream fragment play when terminating the described files in stream media of broadcasting belongs to the specific medium part in described files in stream media according to identification information.
And for example, when server end generates transport stream fragment by dividing video file, also can distinguish specific medium part and nonspecific media portion according to reproduction time.Like this, can judge whether the current transmission stream fragment play when terminating the described files in stream media of broadcasting belongs to the specific medium part in described files in stream media according to current reproduction time.
Obviously, the mode for distinguishing specific medium part and nonspecific media portion is not limited thereto.Other modes can also be used to complete aforesaid operations.
In step S150, detect continue-to-play instruction.
After terminating a period of time of appreciating above-mentioned files in stream media, user may wish to interrupt from last time " historical record " play, continue to appreciate the last files in stream media do not completed.Such as, user can be reselected the last video file do not finished watching and watches by various program-related information such as the character introduction of various programme content, thumbnail general view, classified browse devices.
At this moment, first can determine that user-selected video file newly opens the video file of (that is, never viewed) or the video file of prior interrupt viewing.
In one example, the data source that can reselect according to user to download the index file corresponding with this video file from server, and whether compare this index file identical with the index file corresponding to the video file interrupting before user watching.If identical, then can judge that user-selected video file is the video file of prior interrupt viewing.For this reason, in above-mentioned step S140, while deleting other transport stream fragments among the transport stream fragment downloaded, except retaining transport stream fragment, can also retain the index information of this files in stream media.
Obviously, for judging that whether the video file of the up-to-date selection of user is that the mode of the video file of prior interrupt viewing is not limited thereto.Other modes can also be used to complete aforesaid operations.Such as, above-mentioned judgement operation can also be carried out by the identifier of video file preserved more in the electronic device with the identifier of video file newly downloaded from video server.
After determining that user-selected video file is the video file of prior interrupt viewing, the follow-up operation of the continued broadcasting from " historical juncture " of viewing last time can be performed.
Alternatively, also before directly performing continued broadcasting operation, first whether can wish to continue to play from " historical juncture " of viewing last time to user's prompting, or wish to replay from whole video file, and then detect the input of user.For this reason, such as, continued broadcasting button and redial button can be provided on broadcast interface, select for user.
Detect that user such as inputs by clicking corresponding continued broadcasting button for continue to play this files in stream media continue-to-play instruction after, can obtain and play the reservation transport stream relevant to this video file, thus realizing the continued broadcasting of this video file.
Such as, in step S140 in the electronic device and not deleted reservation transport stream fragment can be the situation of an only TS fragment.Such as, this TS fragment can be current transmission stream fragment TS (n) play when terminating the described files in stream media of broadcasting or the some transport stream fragments be positioned at before current transmission stream fragment, i.e. TS (n-1) or TS (n-2) etc.At this moment, directly can play from this TS fragment, constantly continue to obtain follow-up transport stream fragment simultaneously in the process play, thus realize the played in order of whole files in stream media.
Further, as as described in step S1320 and step S2330, due in the transport stream fragment downloaded, determine one or more reservation transport stream fragment in step s 130, which process in can also determine further and the side-play amount that this TS fragment is associated, so before playing from this TS fragment, first as required can also perform offset operation, and then start the broadcasting of this TS fragment.
Such as, when this TS fragment is when terminating current transmission stream fragment TS (n) play when playing described files in stream media, before it is play, an offset information associated therewith can first be obtained.Such as, when the second example in step S1320, can obtain following information from electronic equipment, namely when terminating to play described files in stream media, the current play time of described files in stream media is in the starting position place of the 5th second in TS (n) on the 30th minute.Then, when user continues to play this video file subsequently, can not be to TS (n) from the beginning (namely, from the 1st second) play, but after skew TS (n) being carried out to 4 seconds time quantums, play from the 5th in TS (n) second.
In addition, in step S140 in the electronic device and not deleted reservation transport stream fragment also can be the situation of multiple TS fragment.Described TS fragment can be in step s 130, which according to multiple TS fragments that the first embodiment obtains, such as, terminate play described files in stream media time playing current transmission stream fragment (, TS (n)), be positioned at current transmission stream fragment before at least one transport stream fragment (namely, TS (n-1) or TS (n-2)) and two or more TS fragments of at least one transport stream fragment (that is, TS (n+1) or TS (n+2)) after being positioned at current transmission stream fragment.Or described TS fragment also can be in step s 130, which according to multiple TS fragments that the second embodiment obtains, such as, retain to described all transport stream fragments stopping transport stream fragment from described reservation original transmission flow section.At this moment, need to perform step S160, to determine a particular transport stream fragment, as the original position of this video file of continued broadcasting among multiple reservation transport stream fragment.
In step S160, in reservation transport stream fragment, determine particular transport stream fragment.
As mentioned above, described TS fragment can be in step s 130, which according to multiple TS fragments that the first embodiment obtains, and at this moment only can store multiple TS fragment in the memory of electronic equipment.
At this moment, in one example, can by among multiple reservation transport stream fragment, the transport stream fragment with smallest sequence number is defined as described particular transport stream fragment.Like this, when user plays this video file again, can from the current play time of the described files in stream media when terminating to play described files in stream media, a period of time plays in advance, thus guarantees that user can remember story of a play or opera when above-mentioned interruption is play more.
In another example, if retain transport stream fragment allocation temporary mark information to these further when determining in step s 130, which to retain transport stream fragment, current playing progress rate is corresponded to (namely for which TS fragment of mark, which TS fragment is at current transmission stream fragment TS (n) terminating playing when playing described files in stream media), then also directly this TS fragment can be defined as described particular transport stream fragment.Like this, during the video file do not finished watching when user again appreciates and watching last time, this user can interrupt from last time " historical record " play, continue to play, instead of start anew to re-start broadcasting.In addition, before playing from this TS fragment, also can perform offset operation first as required, and then start the broadcasting of this TS fragment, experience with the continued broadcasting obtaining correct time point.
In addition, described TS fragment can be in step s 130, which according to multiple TS fragments that the second embodiment obtains, at this moment can store in the memory of electronic equipment TS fragment and terminate play described files in stream media time described files in stream media current play time.
At this moment, first, the current play time of the described files in stream media when terminating to play described files in stream media can be obtained, and determines described particular transport stream fragment according to described current play time.
Such as, can by reading the current play time previously preserved from the memory of electronic equipment, such as, based on the identical hypothesis in the first embodiment, can know that this current play time is that the 30th minute of this video file is whole.
Particularly, describedly determine that the step of described particular transport stream fragment can comprise following sub-step according to described current play time:
In sub-step 1, obtain the index information of described files in stream media, described index information is for recording sequence number and the duration of each transport stream fragment in described multiple transport stream fragment.
When determining to retain transport stream fragment, can first read the relative index information (such as, M3U8 index file) of video file.As mentioned above, in this M3U8 file, sequence number and the duration of each transport stream fragment in all transport stream fragments forming this video file can be recorded.
In sub-step 2, from the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described current play time and described 1st transport stream fragment is greater than described current play time to the duration sum of a kth transport stream fragment to the duration sum of kth-1 transport stream fragment, described k is natural number, and a described kth transport stream fragment is defined as described particular transport stream fragment.
Because describe the length of each transport stream fragment in indexed file, so by the length of each transport stream fragment being sued for peace, the total duration length of whole files in stream media can be obtained.
Such as, in the first situation that each transport stream fragment has the fixing duration, if this b.ram comprises 6000 transport stream fragments, each transport stream fragment is 1 second, then the total duration length of this b.ram is 100 minutes.At this moment, simply, the TS fragment (that is, particular transport stream fragment) corresponding with current play time (that is, the 30th minute whole) can be defined as being the 1801st TS fragment, i.e. TS (1801).
But, based on the above-mentioned hypothesis in the first embodiment (namely, total duration of user-selected video file b.ram is 100 minutes and is divided into 1000 TS fragments, and the duration of each TS fragment is unfixed) the second situation under, the TS fragment corresponding with current play time (that is, the 30th minute whole) cannot be determined simply.
At this moment, with in the sub-step 2 in step S2330 in like manner, as illustrated in Figure 2, can determine, be 29 minutes 56 seconds from the 1st transport stream fragment TS (1) to the duration sum of (n-1)th transport stream fragment TS (n-1), it is whole that it is less than described current play time the 30th minute; And be 30 minutes 6 seconds from the 1st transport stream fragment TS (1) to the duration sum of the n-th transport stream fragment TS (n), it is whole that it is greater than described current play time the 30th minute.Thus, the n-th transport stream fragment TS (n) can be defined as the TS fragment (that is, particular transport stream fragment) corresponding with current play time (that is, the 30th minute whole).
In step S170, from particular transport stream fragment, continue playing stream media file.
After determining this particular transport stream fragment, directly can play from this specific T S fragment, and again download from network without the need to waiting for.Simultaneously, in the process play, can also constantly continue to obtain follow-up transport stream fragment, so that follow-up play, due to the TS fragment after just having downloaded in advance when playing this specific T S fragment, therefore the meshwork buffering of follow-up broadcasting also without the need to waiting long, thus to whole files in stream media achieve coherent, play continuously and efficiently.
Further, before playing from this specific T S fragment, offset operation can also be performed first as required, and then start the broadcasting of this specific T S fragment.
As can be seen here, adopt the Streaming Media processing method according to the embodiment of the present invention, can to obtain and at least one the transport stream fragment play in the multiple transport stream fragments generated by dividing described files in stream media in another equipment is come in the process of playing stream media file, detect for terminating the end play instruction playing described files in stream media, in the transport stream fragment downloaded, one or more reservation transport stream fragment is determined according to the strategy pre-set, continue to retain these transport stream fragments, and among the transport stream fragment that deletion has been downloaded, except other transport stream fragments except described reservation transport stream fragment.Therefore, in an embodiment of the present invention, one Streaming Media processing method flexibly can be provided, its can come coordinate storage space in the electronic device by a part of TS fragment only retained in the current all TS fragments downloaded and download consuming time between contradiction, to promote Consumer's Experience most possibly.
That is, by the Streaming Media processing method according to the embodiment of the present invention, when user do not appreciated files in stream media just exit broadcasting time, the transport stream fragment that a part has been downloaded can be retained, delete remaining transport stream fragment, and when user expects this files in stream media of playing progress rate continued broadcasting from last time next time, directly can obtain and play these transport stream fragments retained, making to greatly reduce from the stand-by period of historical record continued broadcasting.And during owing to terminating files in stream media broadcasting, only retain limited several transport stream fragment in the electronic device, so save the memory space in electronic equipment significantly.
Such as, for the film that current resolution is 1080P, the memory space shared by a transport stream fragment is about 2MB usually, can find out that it takies memory space very little in electronic equipment.
Hereinafter, first the Streaming Media processing unit according to the embodiment of the present invention will be described.
Fig. 6 be a diagram that the block diagram of the Streaming Media processing unit according to the embodiment of the present invention, and Fig. 7 be a diagram that the block diagram of the electronic equipment according to the embodiment of the present invention.
The Streaming Media processing method according to the embodiment of the present invention illustrated in Fig. 1 can be realized by the Streaming Media processing unit 100 illustrated in Fig. 6, and this Streaming Media processing unit 100 can be applied to the one or more electronic equipments 1000 illustrated in Fig. 7.
As illustrated in figure 7, described electronic equipment 1000 can comprise: Streaming Media processing unit 100, for when terminating files in stream media and playing, only retains a part of TS fragment in multiple TS fragments of the described files in stream media of the current formation downloaded; Display unit 200, for showing the target viewdata from various Data Source; Loudspeaker arrangement 300, for playing the target Audiotex from various Data Source; Communicator 400, for downloading from internet or receive at least one the transport stream fragment among multiple transport stream fragments of a formation files in stream media from another equipment, to play these transport stream fragments in order successively in display unit and/or loudspeaker arrangement, thus play the files in stream media corresponding with the plurality of transport stream fragment; And storage device 500, for carrying out buffer memory to the transport stream fragment obtained by communicator, so that user is when normal appreciation files in stream media, carry out playback as required.
In addition, this Streaming Media processing unit 100 can be communicated with electronic equipment 1000 by any mode.
In one example, this Streaming Media processing unit 100 can be integrated in this electronic equipment 1000 as a software module and/or hardware module, and in other words, this electronic equipment 1000 can comprise this Streaming Media processing unit 100.Such as, when electronic equipment 1000 is mobile phones, this Streaming Media processing unit 100 can be a software module in the operating system of this mobile phone, or can be aimed at the application program that this mobile phone develops; Certainly, this Streaming Media processing unit 100 can be one of numerous hardware modules of this mobile phone equally.
Alternatively, in another example, this Streaming Media processing unit 100 and this electronic equipment 1000 also can be the equipment be separated, and this Streaming Media processing unit 100 can be connected to this electronic equipment 1000 by wired and/or wireless network, and transmit interactive information according to the data format of agreement.
As illustrated in FIG. 6, this Streaming Media processing unit 100 can comprise: fragment obtains broadcast unit 110, END instruction detecting unit 120, reservation fragment determining unit 130, other fragment delete cellses 140, continues instruction detection unit 150, specific fragment determining unit 160 and fragment continuation broadcast unit 170.
This fragment obtains broadcast unit 110 and may be used for by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file, wherein, described multiple transport stream fragment generates by dividing described files in stream media in another equipment.
This END instruction detecting unit 120 may be used for detecting and terminates play instruction, and described end play instruction plays described files in stream media for terminating.
This reservation fragment determining unit 130 may be used in the transport stream fragment downloaded, determine one or more reservation transport stream fragment.
These other fragment delete cellses 140 may be used for deleting other transport stream fragments among the transport stream fragment downloaded, except described reservation transport stream fragment.
In a first embodiment, described reservation fragment determining unit 130 can determine one or more reservation transport stream fragment by following operating in the transport stream fragment downloaded: determine in the sequence number terminating the current transmission stream fragment play when playing described files in stream media; And determine described reservation transport stream fragment according to the sequence number of described current transmission stream fragment, wherein, described reservation transport stream fragment comprises: at least one the transport stream fragment before described current transmission stream fragment and/or described current transmission stream fragment and/or at least one the transport stream fragment after described current transmission stream fragment.
In a second embodiment, described reservation fragment determining unit 130 can determine one or more reservation transport stream fragment by following operating in the transport stream fragment downloaded: the current play time determining the described files in stream media when terminating to play described files in stream media; Determine retain initial time and retain the termination time according to described current play time; And determine described reservation transport stream fragment according to described reservation initial time and described reservation termination time.
Particularly, described reservation fragment determining unit 130 can determine described reservation transport stream fragment by following operation according to described reservation initial time and described reservation termination time: the index information obtaining described files in stream media, and described index information is for recording sequence number and the duration of each transport stream fragment in described multiple transport stream fragment; From the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described reservation initial time and described 1st transport stream fragment is greater than described reservation initial time to the duration sum of m transport stream fragment to the duration sum of m-1 transport stream fragment, described m is natural number, and described m transport stream fragment is defined as retaining original transmission flow section; From the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than the described reservation termination time and described 1st transport stream fragment is greater than the described reservation termination time to the duration sum of the n-th transport stream fragment to the duration sum of (n-1)th transport stream fragment, described n is natural number, and described n-th transport stream fragment is defined as retaining termination transport stream fragment; And be defined as described reservation transport stream fragment by from described reservation original transmission flow section to the described all transport stream fragments stopping transport stream fragment that retain.
Described reservation fragment determining unit 130 can determine one or more reservation transport stream fragment by following operating in the transport stream fragment downloaded: judge the specific medium part whether belonged in the current transmission stream fragment terminating to play when playing described files in stream media in described files in stream media; And when judging to belong to the specific medium part in described files in stream media in the current transmission stream fragment terminating to play when playing described files in stream media, in the transport stream fragment downloaded, determine one or more reservation transport stream fragment.
In addition, this Streaming Media processing unit 100 can also comprise: current time determining unit 180 and current time memory cell 190.
This current time determining unit 180 may be used for the current play time determining the described files in stream media when terminating to play described files in stream media.
This current time memory cell 190 may be used for storing described current play time.
In addition, this continuation instruction detection unit 150 may be used for detecting continue-to-play instruction, and described continue-to-play instruction plays described files in stream media for continuing.
This specific fragment determining unit 160 may be used for determining particular transport stream fragment in described reservation transport stream fragment.
This fragment continues broadcast unit 170 and may be used for continuing to play described files in stream media from described particular transport stream fragment.
In one example, described specific fragment determining unit 160 can determine particular transport stream fragment by following operating in described reservation transport stream fragment: by among described reservation transport stream fragment, the transport stream fragment with smallest sequence number is defined as described particular transport stream fragment.
In another example, described specific fragment determining unit 160 can determine particular transport stream fragment by following operating in described reservation transport stream fragment: the current play time obtaining the described files in stream media when terminating to play described files in stream media; And determine described particular transport stream fragment according to described current play time.
Particularly, described specific fragment determining unit 160 can determine described particular transport stream fragment by following operation according to described current play time: the index information obtaining described files in stream media, and described index information is for recording sequence number and the duration of each transport stream fragment in described multiple transport stream fragment; And from the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described current play time and described 1st transport stream fragment is greater than described current play time to the duration sum of a kth transport stream fragment to the duration sum of kth-1 transport stream fragment, described k is natural number, and a described kth transport stream fragment is defined as described particular transport stream fragment.
Concrete configuration according to the unit in the Streaming Media processing unit 100 of the embodiment of the present invention and each device in electronic equipment 1000 is introduced in detail with operation in the Streaming Media processing method described above with reference to Fig. 1 to Fig. 5, and therefore, its repeated description will be omitted.
As can be seen here, adopt the Streaming Media processing unit according to the embodiment of the present invention, can to obtain and at least one the transport stream fragment play in the multiple transport stream fragments generated by dividing described files in stream media in another equipment is come in the process of playing stream media file, detect for terminating the end play instruction playing described files in stream media, in the transport stream fragment downloaded, one or more reservation transport stream fragment is determined according to the strategy pre-set, continue to retain these transport stream fragments, and among the transport stream fragment that deletion has been downloaded, except other transport stream fragments except described reservation transport stream fragment.Therefore, in an embodiment of the present invention, one Streaming Media processing unit flexibly can be provided, its can come coordinate storage space in the electronic device by a part of TS fragment only retained in the current all TS fragments downloaded and download consuming time between contradiction, to promote Consumer's Experience most possibly.
In addition, although above-mentioned unit is illustrated each embodiment of the present invention as the executive agent of each step herein, those skilled in the art are it is understood that the present invention is not limited thereto.The executive agent of each step can be served as by other one or more units, unit, even module.
Such as, each step that above-mentioned fragment acquisition broadcast unit 110, END instruction detecting unit 120, reservation fragment determining unit 130, other fragment delete cellses 140, continuation instruction detection unit 150, specific fragment determining unit 160, fragment continue performed by broadcast unit 170, current time determining unit 180 and current time memory cell 190 can be realized by the CPU (CPU) in electronic equipment uniformly.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required hardware platform by means of software and realize, and can certainly all be implemented by software or hardware.Based on such understanding, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, disk, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the present invention or embodiment.
Each embodiment of the present invention is described in detail above.But, it should be appreciated by those skilled in the art that without departing from the principles and spirit of the present invention, various amendment can be carried out to these embodiments, combination or sub-portfolio, and such amendment should fall within the scope of the present invention.
Claims (16)
1. a Streaming Media processing method, is applied to electronic equipment, it is characterized in that, described method comprises:
By to obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file, wherein, described multiple transport stream fragment generates by dividing described files in stream media in another equipment;
Detect and terminate play instruction, described end play instruction plays described files in stream media for terminating;
One or more reservation transport stream fragment is determined in the transport stream fragment downloaded; And
Other transport stream fragments among the transport stream fragment that deletion has been downloaded, except described reservation transport stream fragment.
2. method according to claim 1, is characterized in that, describedly in the transport stream fragment downloaded, determines that the step of one or more reservation transport stream fragment comprises:
Determine in the sequence number terminating the current transmission stream fragment play when playing described files in stream media; And
Described reservation transport stream fragment is determined according to the sequence number of described current transmission stream fragment,
Wherein, described reservation transport stream fragment comprises: at least one the transport stream fragment before described current transmission stream fragment and/or described current transmission stream fragment and/or at least one the transport stream fragment after described current transmission stream fragment.
3. method according to claim 1, is characterized in that, describedly in the transport stream fragment downloaded, determines that the step of one or more reservation transport stream fragment comprises:
Determine the current play time of the described files in stream media when terminating to play described files in stream media;
Determine retain initial time and retain the termination time according to described current play time; And
Described reservation transport stream fragment is determined according to described reservation initial time and described reservation termination time.
4. method according to claim 3, is characterized in that, describedly determines that the step of described reservation transport stream fragment comprises according to described reservation initial time and described reservation termination time:
Obtain the index information of described files in stream media, described index information is for recording sequence number and the duration of each transport stream fragment in described multiple transport stream fragment;
From the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described reservation initial time and described 1st transport stream fragment is greater than described reservation initial time to the duration sum of m transport stream fragment to the duration sum of m-1 transport stream fragment, described m is natural number, and described m transport stream fragment is defined as retaining original transmission flow section;
From the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than the described reservation termination time and described 1st transport stream fragment is greater than the described reservation termination time to the duration sum of the n-th transport stream fragment to the duration sum of (n-1)th transport stream fragment, described n is natural number, and described n-th transport stream fragment is defined as retaining termination transport stream fragment; And
Described reservation transport stream fragment is defined as to the described all transport stream fragments stopping transport stream fragment that retain by from described reservation original transmission flow section.
5. method according to claim 1, is characterized in that, described method also comprises:
Determine the current play time of the described files in stream media when terminating to play described files in stream media; And
Store described current play time.
6. method according to claim 1, is characterized in that, describedly in the transport stream fragment downloaded, determines that the step of one or more reservation transport stream fragment comprises:
Judge the specific medium part whether belonged in the current transmission stream fragment terminating to play when playing described files in stream media in described files in stream media; And
When judging to belong to the specific medium part in described files in stream media in the current transmission stream fragment terminating to play when playing described files in stream media, in the transport stream fragment downloaded, determine one or more reservation transport stream fragment.
7. method according to claim 1, is characterized in that, described method also comprises:
Detect continue-to-play instruction, described continue-to-play instruction plays described files in stream media for continuing;
Particular transport stream fragment is determined in described reservation transport stream fragment; And
Continue to play described files in stream media from described particular transport stream fragment.
8. method according to claim 7, is characterized in that, describedly in described reservation transport stream fragment, determines that the step of particular transport stream fragment comprises:
By among described reservation transport stream fragment, the transport stream fragment with smallest sequence number is defined as described particular transport stream fragment.
9. method according to claim 7, is characterized in that, describedly in described reservation transport stream fragment, determines that the step of particular transport stream fragment comprises:
Obtain the current play time of the described files in stream media when terminating to play described files in stream media; And
Described particular transport stream fragment is determined according to described current play time.
10. method according to claim 9, is characterized in that, describedly determines that the step of described particular transport stream fragment comprises according to described current play time:
Obtain the index information of described files in stream media, described index information is for recording sequence number and the duration of each transport stream fragment in described multiple transport stream fragment; And
From the transport stream fragment of the 1st in described files in stream media, the duration of transport stream fragment is sued for peace, until described 1st transport stream fragment is less than described current play time and described 1st transport stream fragment is greater than described current play time to the duration sum of a kth transport stream fragment to the duration sum of kth-1 transport stream fragment, described k is natural number, and a described kth transport stream fragment is defined as described particular transport stream fragment.
11. 1 kinds of Streaming Media processing unit, are applied to electronic equipment, it is characterized in that, described device comprises:
Fragment obtains broadcast unit, for by obtain and at least one the transport stream fragment play in multiple transport stream fragment carrys out playing stream media file, wherein, described multiple transport stream fragment generates by dividing described files in stream media in another equipment;
END instruction detecting unit, for detecting end play instruction, described end play instruction plays described files in stream media for terminating;
Retain fragment determining unit, for determining one or more reservation transport stream fragment in the transport stream fragment downloaded; And
Other fragment delete cellses, for deleting other transport stream fragments among the transport stream fragment downloaded, except described reservation transport stream fragment.
12. methods according to claim 11, is characterized in that, described reservation fragment determining unit determines one or more reservation transport stream fragment by following operating in the transport stream fragment downloaded:
Determine in the sequence number terminating the current transmission stream fragment play when playing described files in stream media; And
Described reservation transport stream fragment is determined according to the sequence number of described current transmission stream fragment,
Wherein, described reservation transport stream fragment comprises: at least one the transport stream fragment before described current transmission stream fragment and/or described current transmission stream fragment and/or at least one the transport stream fragment after described current transmission stream fragment.
13. methods according to claim 11, is characterized in that, described reservation fragment determining unit determines one or more reservation transport stream fragment by following operating in the transport stream fragment downloaded:
Determine the current play time of the described files in stream media when terminating to play described files in stream media;
Determine retain initial time and retain the termination time according to described current play time; And
Described reservation transport stream fragment is determined according to described reservation initial time and described reservation termination time.
14. devices according to claim 11, is characterized in that, described device also comprises:
Continue instruction detection unit, for detecting continue-to-play instruction, described continue-to-play instruction plays described files in stream media for continuing;
Specific fragment determining unit, for determining particular transport stream fragment in described reservation transport stream fragment; And
Fragment continues broadcast unit, plays described files in stream media for continuing from described particular transport stream fragment.
15. devices according to claim 14, is characterized in that, described specific fragment determining unit determines particular transport stream fragment by following operating in described reservation transport stream fragment:
By among described reservation transport stream fragment, the transport stream fragment with smallest sequence number is defined as described particular transport stream fragment.
16. devices according to claim 14, is characterized in that, described specific fragment determining unit determines particular transport stream fragment by following operating in described reservation transport stream fragment:
Obtain the current play time of the described files in stream media when terminating to play described files in stream media; And
Described particular transport stream fragment is determined according to described current play time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410198527.XA CN105100912B (en) | 2014-05-12 | 2014-05-12 | Streaming Media processing method and Streaming Media processing unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410198527.XA CN105100912B (en) | 2014-05-12 | 2014-05-12 | Streaming Media processing method and Streaming Media processing unit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105100912A true CN105100912A (en) | 2015-11-25 |
CN105100912B CN105100912B (en) | 2018-10-12 |
Family
ID=54580295
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410198527.XA Active CN105100912B (en) | 2014-05-12 | 2014-05-12 | Streaming Media processing method and Streaming Media processing unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105100912B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105516828A (en) * | 2015-12-14 | 2016-04-20 | 成都易瞳科技有限公司 | Method and device for downloading video |
CN105872802A (en) * | 2015-12-30 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Video playing method and device |
WO2017092330A1 (en) * | 2015-12-03 | 2017-06-08 | 乐视控股(北京)有限公司 | Playing method and apparatus based on player |
CN107197359A (en) * | 2017-05-18 | 2017-09-22 | 百度在线网络技术(北京)有限公司 | Video file caching method and device |
CN107886939A (en) * | 2016-09-30 | 2018-04-06 | 北京京东尚科信息技术有限公司 | A kind of termination splice text voice playing method and device in client |
CN108228829A (en) * | 2018-01-03 | 2018-06-29 | 北京百度网讯科技有限公司 | For generating the method and apparatus of information |
CN111124207A (en) * | 2019-12-23 | 2020-05-08 | 维沃移动通信有限公司 | Multimedia file playing method and electronic equipment |
CN113163226A (en) * | 2021-03-26 | 2021-07-23 | 维沃移动通信有限公司 | Media file playing method and device, electronic equipment, server and medium |
CN114727130A (en) * | 2022-04-12 | 2022-07-08 | 北京市博汇科技股份有限公司 | Method and system for virtually cutting TS file to provide HLS on-demand service |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933602A (en) * | 2005-09-13 | 2007-03-21 | 松下电器产业株式会社 | Coding/decoding apparatus, coding/decoding method, coding/decoding integrated circuit and coding/decoding program |
CN103167358A (en) * | 2011-12-09 | 2013-06-19 | 深圳市快播科技有限公司 | Set top box, media playing processing method and media resuming playing method |
CN103618919A (en) * | 2013-11-19 | 2014-03-05 | 深圳Tcl新技术有限公司 | Video loading method and device for network television |
US20140130110A1 (en) * | 2012-11-05 | 2014-05-08 | Comcast Cable Communications, Llc | Methods And Systems For Content Control |
-
2014
- 2014-05-12 CN CN201410198527.XA patent/CN105100912B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933602A (en) * | 2005-09-13 | 2007-03-21 | 松下电器产业株式会社 | Coding/decoding apparatus, coding/decoding method, coding/decoding integrated circuit and coding/decoding program |
CN103167358A (en) * | 2011-12-09 | 2013-06-19 | 深圳市快播科技有限公司 | Set top box, media playing processing method and media resuming playing method |
US20140130110A1 (en) * | 2012-11-05 | 2014-05-08 | Comcast Cable Communications, Llc | Methods And Systems For Content Control |
CN103618919A (en) * | 2013-11-19 | 2014-03-05 | 深圳Tcl新技术有限公司 | Video loading method and device for network television |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017092330A1 (en) * | 2015-12-03 | 2017-06-08 | 乐视控股(北京)有限公司 | Playing method and apparatus based on player |
CN105516828A (en) * | 2015-12-14 | 2016-04-20 | 成都易瞳科技有限公司 | Method and device for downloading video |
CN105872802A (en) * | 2015-12-30 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Video playing method and device |
CN107886939A (en) * | 2016-09-30 | 2018-04-06 | 北京京东尚科信息技术有限公司 | A kind of termination splice text voice playing method and device in client |
CN107886939B (en) * | 2016-09-30 | 2021-03-30 | 北京京东尚科信息技术有限公司 | Pause-continue type text voice playing method and device at client |
CN107197359A (en) * | 2017-05-18 | 2017-09-22 | 百度在线网络技术(北京)有限公司 | Video file caching method and device |
CN108228829A (en) * | 2018-01-03 | 2018-06-29 | 北京百度网讯科技有限公司 | For generating the method and apparatus of information |
CN108228829B (en) * | 2018-01-03 | 2022-01-11 | 北京百度网讯科技有限公司 | Method and apparatus for generating information |
CN111124207A (en) * | 2019-12-23 | 2020-05-08 | 维沃移动通信有限公司 | Multimedia file playing method and electronic equipment |
CN111124207B (en) * | 2019-12-23 | 2021-06-15 | 维沃移动通信有限公司 | Multimedia file playing method and electronic equipment |
CN113163226A (en) * | 2021-03-26 | 2021-07-23 | 维沃移动通信有限公司 | Media file playing method and device, electronic equipment, server and medium |
CN114727130A (en) * | 2022-04-12 | 2022-07-08 | 北京市博汇科技股份有限公司 | Method and system for virtually cutting TS file to provide HLS on-demand service |
Also Published As
Publication number | Publication date |
---|---|
CN105100912B (en) | 2018-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220159349A1 (en) | Methods and apparatus for presenting advertisements during playback of recorded television content | |
CN105100912A (en) | Streaming media processing method and streaming media processing apparatus | |
US8886009B2 (en) | Creation of video bookmarks via scripted interactivity in advanced digital television | |
US8312376B2 (en) | Bookmark interpretation service | |
US10423320B2 (en) | Graphical user interface for navigating a video | |
CN112702645B (en) | Method and system for inserting auxiliary media items into a main media stream | |
EP1921852A1 (en) | Sharing Television Clips | |
JP5863661B2 (en) | Assembling stream content for on-demand presentations | |
CN103081461B (en) | For the method and apparatus providing flow-medium performance and targeted advertisements | |
EP2763429A1 (en) | Preview and playback method of video streams and system thereof | |
CN113424553B (en) | Method and system for playback of media items | |
US20140139742A1 (en) | Methods and systems for displaying advertisements | |
KR20090059923A (en) | A method to provide multimedia for providing contents related to keywords and apparatus thereof | |
CN108810580B (en) | Media content pushing method and device | |
KR20120037411A (en) | Method for selecting versions of a document from a plurality of versions received after a search, and related receiver | |
US8683522B2 (en) | Animated station identifier in program guides | |
US20090254586A1 (en) | Updated Bookmark Associations | |
US10542306B2 (en) | Systems and methods for excluding consumed content from a content presentation | |
CA3187273A1 (en) | Systems and methods for content item insertion | |
JP5243871B2 (en) | Video playback device | |
JP4938384B2 (en) | Moving image data distribution system, moving image data providing method, moving image data distribution program, moving image data providing program, and computer-readable recording medium on which those programs are recorded | |
KR101947186B1 (en) | Content reproduction method and system | |
JP2019054316A (en) | Program guide generation device, display device, television receiver, meta data generation device, program guide generation method, meta data generation method, control program, and recording medium | |
CN104378655A (en) | Program playing method and device | |
JP2009088680A (en) | Moving picture distribution apparatus, terminal device, moving picture distribution system, method, and program of terminal device |
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 |