WO2015081893A1 - 一种轮播媒体分片的方法、客户端及系统 - Google Patents
一种轮播媒体分片的方法、客户端及系统 Download PDFInfo
- Publication number
- WO2015081893A1 WO2015081893A1 PCT/CN2014/093188 CN2014093188W WO2015081893A1 WO 2015081893 A1 WO2015081893 A1 WO 2015081893A1 CN 2014093188 W CN2014093188 W CN 2014093188W WO 2015081893 A1 WO2015081893 A1 WO 2015081893A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- index list
- media
- downloaded
- play address
- serial number
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/611—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/612—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Definitions
- the present application relates to the field of streaming media playback, and in particular, to a method, a client, and a system for carousel media segmentation.
- the HLS (Http live streaming) protocol is a streaming media network transmission protocol based on the HTTP protocol proposed by Apple, which enables live streaming and on-demand streaming.
- the client that performs the HLS live broadcast does not obtain a complete data stream, but stores the latest live data stream on the server side as a continuous, short duration media slice (MPEG).
- MPEG continuous, short duration media slice
- -TS Dynamic Image Experts Group - Transport Stream
- the client needs to continuously download and sequentially play these media segments in order to achieve HLS live broadcast.
- the HLS protocol does not support the carousel mode, but the form of the carousel mode is similar to the live broadcast, except that the data stream played by the server is not a live stream, but is a pre-made data such as a movie, a TV series, a variety video. Therefore, it can be considered to implement the carousel mode based on the HLS live broadcast mode.
- the playback requirements of the live mode and the carousel mode are quite different.
- the client when performing HLS live broadcast, when the network is jittery, the media segment played by the client often lags behind the latest media segment delivered by the server, and cannot be synchronized with the server. At this time, the client ensures the live broadcast of the live broadcast.
- the HLS protocol stipulates that the client should automatically discard the lag media fragments that have not been played yet, and directly play the server update. The latest media shards quickly catch up with the latest media shards from the server, and jumps during the video playback, jumping from one time period to another.
- the playback requirement is to ensure the integrity of the play as much as possible, and the above HLS live broadcast technology is obviously not suitable for realizing the play requirement of the carousel mode.
- the current HLS protocol does not support the carousel technology. How to deal with the characteristics of automatically discarding media fragments in the live broadcast specified in the HLS protocol, and effectively utilizing the HLS live broadcast technology to implement the carousel mode has become a technical problem to be solved urgently.
- the technical problem to be solved by the present application is to provide a method, a client and a system for carousel media segmentation, in order to cope with the characteristics of automatically discarding media segments in the live broadcast specified in the HLS protocol, thereby effectively utilizing the HLS live broadcast technology to implement the round. Broadcast mode.
- a method for carousel media segmentation comprising:
- each updated index list has a play address of a plurality of latest media fragments to be sequentially played and a corresponding unique serial number
- the serial number missing between the two serial numbers is added, and a corresponding media segment is added according to the added serial number and the recorded serial number. Playing the address, and sequentially combining the supplementary play address and the play address in the updated index list according to the corresponding serial number to obtain a current index list, and sequentially downloading to the server according to the play address in the current index list.
- the corresponding media slice is played.
- a computer readable recording medium having a program configured to execute the above method is recorded thereon.
- a method for carousel media segmentation includes:
- each updated index list has a play address of the latest media fragments to be sequentially played and a corresponding unique serial number
- serial numbers are sequentially combined to obtain a current index list, and the corresponding media fragments are downloaded to the server for playing according to the play address in the current index list.
- a computer readable recording medium having a program configured to execute the above method is recorded thereon.
- a client of a carousel media segment includes: a request module, a parsing module, a recording module, a choreography module, a capture play module, a judging module, and a download module;
- the requesting module is configured to send a request to the server to obtain an index list that is continuously updated by the server, where each updated index list has a play address of the latest media fragments to be sequentially played and corresponding unique serial number;
- the parsing module is configured to obtain an updated index list and discard the old index list, and identify a sequence number of the media fragment ranked in the first broadcast position in the updated index list;
- the recording module is configured to record a serial number of a media slice to be downloaded when the old index list is discarded, and identify a serial number of the media slice ranked in the first broadcast bit in the updated index list;
- the orchestration module is configured to, after comparing, determining that the two serial numbers are not equal and discontinuous, adding a serial number missing between the two serial numbers, according to the added serial number and the recorded sequence And generating a supplementary play address of the corresponding media slice, and sequentially combining the supplementary play address and the play address in the updated index list according to the corresponding serial number to obtain a current index list;
- the capturing and playing module is configured to download and play the corresponding media segment to the server according to the play address in the current index list.
- a client of a carousel media segment includes: a request module, a parsing module, a recording module, a choreography module, a capture play module, a judging module, and a download module;
- the requesting module is configured to send a request to the server to obtain the server that is continuously updated.
- An index list wherein each updated index list has a play address of a plurality of latest media fragments to be sequentially played and a corresponding unique serial number;
- the parsing module is configured to obtain an updated index list and discard the old index list, and identify a sequence number of the media fragment ranked in the first broadcast position in the updated index list;
- the recording module is configured to record a serial number of a media slice to be downloaded when the old index list is discarded, and identify a serial number of the media slice ranked in the first broadcast bit in the updated index list;
- the orchestration module is configured to determine, after the comparison, that the two serial numbers are not equal but continuous, generate a supplemental play address of the corresponding media slice according to the recorded serial number, and add the supplementary play address and the update
- the play addresses in the index list are sequentially combined according to the corresponding serial numbers to obtain a current index list
- the capturing and playing module is configured to download and play the corresponding media segment to the server according to the play address in the current index list.
- a seventh aspect a system for carousel media segmentation, comprising: one or more clients and servers, wherein the client includes a client of a carousel segment as described above; the server, It is configured to continuously update the index list, wherein each updated index list has a play address of the latest media fragments to be sequentially played and a corresponding unique serial number.
- FIG. 1 is a flowchart of a method according to Embodiment 1 of the present application.
- FIG. 2 is a flowchart of a method according to Embodiment 2 of the present application.
- FIG. 3 is a flowchart of a method according to Embodiment 3 of the present application.
- FIG. 4 is a flowchart of a method according to Embodiment 4 of the present application.
- FIG. 5 is a schematic diagram of an m3u8 file according to Embodiment 4 of the present application.
- FIG. 6 is a schematic diagram of a local m3u8 file according to Embodiment 4 of the present application.
- FIG. 7 is a structural diagram of a client according to Embodiment 5 of the present application.
- FIG. 8 is a structural diagram of a client according to Embodiment 6 of the present application.
- FIG. 9 is a structural diagram of a client according to Embodiment 7 of the present application.
- FIG. 10 is a structural diagram of a client according to Embodiment 8 of the present application.
- FIG. 11 is a system architecture diagram of Embodiment 9 of the present application.
- the media slice described below may be a streaming image slice format file such as a Moving Picture Experts Group-Transport Stream (MPEG-TS), although the application is not limited thereto.
- MPEG-TS Moving Picture Experts Group-Transport Stream
- the following index list may be an index directory file such as an m3u8 file, although the application is not limited thereto.
- the following play address may be a network access address such as a uniform resource locator (URL), and the present application is not limited thereto.
- URL uniform resource locator
- the media segment played by the client when the network is jittery, the media segment played by the client often lags behind the latest media segment delivered by the server, and cannot be synchronized with the server. At this time, the client needs to ensure the real-time performance of the live broadcast.
- the protocol stipulates that the client should automatically abandon the lag media fragments that have not been played, and directly play the latest media shards updated by the server to quickly catch up with the latest media shards of the server, and jump during the video playback.
- the media segment currently being played by the client and the latest media segment updated by the direct playback server are not continuous in playback.
- the solution of the present application considers that the client replenishes the media fragment that is missing due to the discontinuous occurrence. After the currently played media segment is executed, the self-replenished media segment is played, and then the latest media segment updated by the server is played. This will ensure full playback in the carousel mode.
- FIG. 1 it is a flowchart of a method according to Embodiment 1 of the present application, including:
- Step S100 the client sends a request to the server to obtain an index that is continuously updated by the server. a list, wherein each updated index list has a play address of a plurality of latest media segments to be sequentially played and a corresponding unique serial number;
- the media shards identify the order between themselves and other media shards by using the serial number, so the serial number itself has a corresponding relationship with the play address of the media shard.
- Step S102 the client obtains the updated index list and discards the old index list, records the sequence number of the media slice currently to be downloaded when the old index list is discarded, and identifies the updated index list in the first broadcast position. Serial number of the media segment;
- serial number of the media slice to be downloaded when the old index list is discarded is also the media slice that has not been successfully downloaded.
- Step S104 when the client compares and determines that the two serial numbers are not equal and are discontinuous, add a serial number missing between the two serial numbers, according to the added serial number and the recorded sequence. And generating a supplementary play address of the corresponding media slice, and sequentially combining the supplementary play address and the play address in the updated index list according to the corresponding serial number to obtain a current index list, which is sequentially according to the current index list.
- the serial number missing between the two serial numbers is added, since the serial number is generally a number, the serial number missing between the two discontinuous serial numbers can be obtained according to the arrangement relationship before the serial number.
- the serial number recorded in step S102 is also a media slice that has not been successfully downloaded.
- the media segment according to the added sequence number and the recorded sequence number can generate a corresponding supplementary play address; according to the order of the sequence numbers, the supplementary play address is to be ranked. Between the currently playing media shard and the server's latest updated play address. It should be noted that, since there are more than one serial number added, the multiple supplementary play addresses are also arranged in the order of the serial numbers.
- Embodiment 2 is a diagrammatic representation of Embodiment 1:
- FIG. 2 it is a flowchart of a method according to Embodiment 2 of the present application, including:
- the media segment played by the client when the network is jittery, the media segment played by the client often lags behind the latest media segment delivered by the server, and cannot be synchronized with the server. At this time, the client needs to ensure the real-time performance of the live broadcast.
- the protocol stipulates that the client should automatically abandon the lag media fragments that have not been played, and directly play the latest media shards updated by the server to quickly catch up with the latest media shards of the server, and jump during the video playback.
- the media segment currently being played by the client and the latest media segment updated by the direct playback server are not continuous in playback.
- the solution of the present application considers that the client suffices the media fragment that is missing due to the discontinuity, and after the currently played media shard is executed, the self-supplemented media shard is played, and then the latest media score of the server update is played. Slice, so you can guarantee full playback in the carousel mode.
- Step S200 The client sends a request to the server to obtain an index list that is continuously updated by the server, where each updated index list has a play address of the latest media fragments to be sequentially played and a corresponding unique serial number. ;
- the media shards identify the order between themselves and other media shards by using the serial number, so the serial number itself has a corresponding relationship with the play address of the media shard.
- Step S202 the client obtains the updated index list and discards the old index list, records the sequence number of the media slice currently to be downloaded when the old index list is discarded, and identifies the updated index list in the first broadcast position. Serial number of the media segment;
- serial number of the media slice to be downloaded when the old index list is discarded is a media slice that has not been successfully downloaded.
- Step S204 the client compares and determines that the two serial numbers are not equal but consecutive, generates a supplementary play address of the corresponding media slice according to the recorded serial number, and adds the supplementary play address and the update.
- the play addresses in the index list are sequentially combined according to the corresponding serial numbers to obtain a current index list, and the corresponding media slices are downloaded to the server for playing according to the play address in the current index list.
- step S202 Only the sequence number recorded in step S202 is a media slice that has not been successfully downloaded. It is sufficient to obtain the play address of the media slice. But the old index list has been discarded, so you still need to generate a supplement. Play address.
- the corresponding patch play address can be generated according to the media slice of the recorded serial number; according to the order of the serial numbers, the supplementary play address is arranged in the currently playing media. Between the shard and the server's latest updated play address.
- Embodiment 3 is a diagrammatic representation of Embodiment 3
- a flowchart of a method according to Embodiment 3 of the present application includes:
- step S300 the server continuously updates the index list, wherein each updated index list has a play address of the latest media fragments to be sequentially played and a corresponding unique serial number.
- a sequence number is assigned, which is equal to the unique serial number of the media segment ranked in the first broadcast position in the index list, and the second media segment after the first broadcast bit
- the serial number is increased by 1.
- the serial number of the second media segment after the first broadcast bit is increased by 2.
- the index list generally has three play addresses. Of course, the application is not limited thereto.
- the server stores a live media library, an on-demand media library, and a carousel media library, and each of the libraries stores a corresponding media segment to be played.
- a media segment of a carousel is stored in a carousel resource library, and multiple media segments are combined and played in sequence to form a complete video resource.
- a complete video resource may be a movie or a TV series.
- the order in which the plurality of media segments are played together is arranged according to the serial number of each media segment.
- Step S302 when the server selects the media segment to be played from the carousel media library to continuously generate the updated index list, the server adds the carousel identifier in real time in the updated index list, so that the client requests the request.
- the carousel flag can be read when the list is rotated, thereby identifying the carousel mode and initiating the corresponding operation.
- the carousel logo is added directly to each playlist in the index list with a single symbol. Behind the address.
- the client sends a request to the server at a first time interval to obtain an index list updated by the server at a second time interval, wherein the first time interval is smaller than the second time interval.
- the first time interval is equal to half of the second time interval.
- Step S304 the client obtains the updated index list and discards the old index list. After parsing the carousel identifier in the old index list, records the media segment to be downloaded when the old index list is discarded. a serial number; when parsing the carousel identifier in the updated index list, obtaining a sequence number of the media segment ranked in the first broadcast bit in the updated index list, and comparing the two serial numbers.
- the old index list When the client obtains the old index list, the old index list generally has multiple play addresses. According to the HLS protocol, there are three play addresses, and the client sequentially according to the old index list. The play address, each time downloading a media slice to the server for playing. If the cache is large enough, the next media slice or even the next two media segments can be downloaded while playing the currently downloaded media slice. The delay in getting the data or updated index list by the server due to network jitter. When the carousel identifier in the old index list is identified, the serial number of the media slice currently to be downloaded in the old index list is continuously recorded and the previous record is overwritten until the old index list is discarded. At the end, the serial number of the media slice to be downloaded is recorded last.
- the carousel process is initiated when the carousel identifier in the updated index list is identified, and when the client discards the old index list, the serial number of the media slice that is currently expected to be downloaded but not yet downloaded is identified and recorded. At the same time, it is also necessary to identify the sequence number of the media slice ranked in the first broadcast bit in the updated index list, that is, the sequence number of the updated index list.
- Step S306 after the client compares and determines that the two serial numbers are not equal and discontinuous, add a sequence number that is missing between the two serial numbers, according to the added sequence number and the recorded sequence. And generating a supplementary play address of the corresponding media slice, and sequentially combining the supplementary play address and the play address in the updated index list according to the corresponding serial number to obtain a current index list, and executing step S312.
- the client compares and determines that the two serial numbers are not equal and discontinuous, it indicates that there is a gap between the two serial numbers, for example, the serial number 4 is missing between the serial number 3 and the serial number 5.
- the media segment corresponding to the serial number recorded has not been downloaded yet.
- the media segment that has not been downloaded and the media segment that has been downloaded before (the previously downloaded media segment may be playing, or may not have started playing yet). It is only cached to be broadcasted. It is obviously continuous.
- the serial number 2 media slice has been downloaded, and the media slice corresponding to serial number 3 has not been downloaded. The two media slices are obviously continuous.
- the missing serial number can be inferred according to the law, and the missing serial number and the recorded media fragment corresponding to the serial number that has not been downloaded yet. All need to be downloaded to ensure continuous playback.
- the inferred missing serial number and the recorded serial number combined with certain rules (for example, the playback address of the media slice is also consecutively numbered, according to the serial number to be added and before and after The difference between the known serial numbers, the play address corresponding to the previously known serial number, and the supplementary play address are generated to generate the supplemental play address of the corresponding media slice, for example, the index list where the serial numbers 2, 3, and 4 are located.
- Serial number 5 is the updated index list.
- the first broadcast bit, serial number 4 and serial number 5 are missing the serial number 4, so there is a certain deviation between the client and the server.
- the client generates corresponding numbers according to serial numbers 3 and 4.
- the supplementary play address of the media slice is combined with the play address of the media slice whose serial number is 5, 6, and 7 of the updated index list to form a current index list.
- Step S308 the client compares and determines that the two serial numbers are not equal but consecutive, generates a supplemental play address of the corresponding media slice according to the recorded serial number, and adds the supplementary play address and the update.
- the play addresses in the index list are sequentially combined according to the corresponding serial numbers to obtain a current index list, and step S312 is performed.
- the client compares and determines that the two serial numbers are not equal but continuous, it indicates that there is no gap between the two serial numbers, for example, serial number 3 and serial number 4 are consecutive.
- the media slice corresponding to the serial number that has not been downloaded can guarantee continuous playback, and combines certain rules according to the recorded serial number (for example, the playing place of the media segment)
- the addresses are also consecutively numbered, and according to the difference between the serial number to be added and the known serial number, the play address corresponding to the known serial number is used to calculate the supplementary play address) to generate the supplementary play of the corresponding media slice.
- the address list for example, the index list where serial numbers 2, 3, and 4 are located has been discarded.
- the sequence number of the updated index list is 4, 5, and 6, and the media slice of serial number 2 has been downloaded, and the media number corresponding to serial number 3 is divided.
- the film has not been downloaded yet, the serial number 4 is the first broadcast bit of the updated index list, and the serial number 3 and the serial number 4 are different but continuous, so there is a certain deviation between the client and the server, and the client generates corresponding according to the serial number 3
- the supplemental play address of the media slice is combined with the play address of the media slice of the updated index list with sequence numbers 4, 5, and 6 to form a new index list.
- Step S310 when the client compares and determines that the two serial numbers are equal, the updated index list is used as the current index list, and step S312 is performed.
- serial number of the updated index list is 3. 4
- serial number 3 is the first broadcast bit of the updated index list, and there is no downloaded serial number and updated
- the sequence number of the first broadcast bit of the index list is 3, indicating that the client does not deviate from the server at this time, the update is synchronous, and the updated index list obtained from the server is the current index list.
- Step S312 downloading corresponding media segments to the server for playing according to the play address in the current index list.
- the client sequentially downloads a media slice to the server for playing according to the play address in the current index list. If the cache is large enough, the next media can be downloaded while playing the currently downloaded media slice. Fragmentation is even the next two media slices to cope with the delay in getting data from the server or updating the index list due to network jitter. For example, if the current index list includes media fragments with sequence numbers 3, 4, 5, 6, and 7, the client sequentially downloads the media fragments to the server according to the play addresses corresponding to the sequence numbers until the client receives the update. The index list is jumped to step S304.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- the method for downloading corresponding media fragments to the server according to the play address in the current index list in sequence includes the following steps:
- Step S401 Determine whether the media slice corresponding to the to-be-downloaded play address in the play address in the current index list can be downloaded:
- Step S402 if the download is available, download the corresponding media segment according to the to-be-downloaded play address, and store each downloaded media segment in a specified location on the local disk;
- Step S403 If the download is not possible, the next play address of the to-be-downloaded play address is determined as a new play address to be downloaded.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- #EXTM3U Indicates the m3u file header and put it on the first line.
- #EXT-X-TARGETDURATION Indicates the maximum length of the specified video clip, in seconds.
- #EXTINF Indicates the duration of each video clip ts file, only valid for the following URL.
- the duration specified in #EXTINF must be less than or equal to the duration specified in #EXT-X-TARGETDURATION.
- #EXT-X-ENDLIST Indicates the end of the m3u8 file.
- a complete medium corresponds to an m3u8 file
- the m3u8 file includes URLs of multiple video clips of the complete media.
- the present invention sequentially downloads video segments from the cloud server according to the URL of the video segment in the m3u8 file, and stores each video segment in a specified location.
- the specified location is on the local disk and can be the default location for downloading.
- the default download location is: C: ⁇ Users ⁇ Download, or it can be a user-defined location.
- the video segments in the above m3u8 file are sequentially downloaded: sample_100k-1.ts, sample_100k-2.ts, and sample_100k-3.ts.
- the URL to be downloaded http://218.30.13.36/sample_100k-2.ts corresponding video segment sample_100k-2.
- Ts can not be downloaded, then skip sample_100k-2.ts, to the next URL of http://218.30.13.36/sample_100k-2.ts in the above m3u8 file: http://218.30.13.36/sample_100k-3.ts
- the URL to be downloaded if the sample_100k-3.ts can be downloaded, continue to download sample_100k-3.ts. The whole process will not be able to download sample_100k-3.ts because sample_100k-2.ts cannot be downloaded.
- the present invention first determines whether the video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded, and if it can be downloaded, downloads the corresponding media segment according to the URL, if not If the download is made, the media slice is skipped, and the next URL of the URL to be downloaded is used as a new URL to be downloaded. Therefore, even when a certain media slice download error occurs, the erroneous media slice can be skipped and the next media slice can be downloaded, and when the subsequent errored media slice is downloaded, the fault problem is likely to have been restore. Therefore, the invention reduces the time for waiting for the error media segmentation during the media downloading process, and improves the download speed.
- the process of determining whether the media slice corresponding to the to-be-played play address in the play address in the current index list can be downloaded includes: determining a media score corresponding to the play address to be downloaded in the play address in the current index list Whether the download is completed within the predetermined time.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- the process of determining whether the video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded is further determined whether the video segment corresponding to the URL to be downloaded in the m3u8 file is downloaded in a predetermined time.
- this embodiment can determine that the video clip can be at a predetermined time. No download is completed to determine if the video clip is downloading fault.
- the above predetermined time can be set by the administrator according to the size of the video clip and the average network speed.
- the media fragments that cannot be downloaded in step S403 are downloaded.
- the design of the invention skips downloading the faulty video segment, preferentially downloads the video clip without downloading the fault, and downloads the faulty video clip that was skipped before downloading all the video clips without downloading the fault. At this time, the video clip cannot be downloaded before. It is highly probable that the problem of the video clip has been recovered, which saves the time waiting for the download of the faulty video clip and improves the download speed.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- a local m3u8 file of the target video is generated according to a path of a specified location where the video clip is located.
- a local m3u8 file is generated while the video clip download is completed.
- the format of the local m3u8 file is the same as that of the cloud server, except that the URL in the local m3u8 file is a local address.
- the video clip in the m3u8 file shown in Figure 5 is downloaded to the local disk C: ⁇ Users ⁇ Download as an example.
- the local m3u8 file generated after the download is completed is shown in Figure 6. The subsequent synthesis and playback of the target video is achieved by generating the above-mentioned local m3u8 file.
- the user is presented with a video file, and the user can click the video file to play.
- a plurality of video segments of the target video are saved, and for the user, the local m3u8 file can be clicked to realize the playing.
- all major players basically support the playback of m3u8 files, such as MPlayer, VLC, ffplayer, etc. It can be seen that it is very convenient to play the video clip through the local m3u8 file without additional operations.
- the video slice stored in the specified location may also be The segments are merged into a target video.
- the invention downloads and saves each video segment of the target video separately, that is to say, the downloaded target video is a collection of multiple video segments. Since the number of files is large, it is not convenient to copy, so the local m3u8 file can be downloaded according to the above. A good video clip is a complete target video.
- each video segment is merged into a complete target video according to the order of each video segment in the local m3u8 file.
- combining video segments into one video can be based on a known video merging method. For example, the video is combined and decoded by the video format coding specification, and then the code is re-merged according to the target format coding specification. Taking the HLS protocol as an example, the video clip is in the ts format, and after combining, a large video file in the ts format can be output.
- merging the video clips it is convenient for the user to perform operations such as copying the target video.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- the m3u8 file is saved locally, and the URL for which the download has been completed is marked in the m3u8 file.
- the download of the target video is restarted, the download is continued according to the unmarked URL of the above-mentioned m3u8 file saved locally.
- the embodiment provides a method for the target video to continue downloading.
- the target video In the actual application, there will be a movie that has not been downloaded, but the user has turned off the computer, and after the computer is turned back on, the user still wants to continue downloading. Or because the network is faulty, the download is interrupted. When the fault is recovered, you need to continue downloading. To continue downloading, you need to know which video clips have been downloaded and which video clips have not yet been downloaded.
- the m3u8 file is saved to the local area, and the downloaded video segment is marked in the m3u8 file, so that when the download is restarted, the unmarked URL in the m3u8 file can be downloaded and not yet downloaded. Video clip.
- a preset field may be added after the URL of each video segment of the m3u8 file. Used to mark, for example, the add field &downloaded to indicate that the video clip has been downloaded. Then, when restarting the download of the target video, it is only necessary to download the video clip of the unmarked &downloaded field in the above m3u8 file.
- other methods can also be used, such as establishing a download schedule locally.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- the client of the carousel media segment includes: a requesting module 500, a parsing module 520, a recording module 540, a first orchestration module 560, and a capture play module 580;
- the requesting module 500 is configured to send a request to the server to obtain an index list that is continuously updated by the server, where each updated index list has a play address of the latest media fragments to be sequentially played and corresponding unique Serial number;
- the parsing module 520 is coupled to the requesting module 500, configured to obtain an updated index list and discard the old index list, and notify the recording module 540 when parsing the updated index list and the carousel identifier in the old index list. ;
- the recording module 540 is coupled to the parsing module 520, and configured to record the serial number of the media segment to be downloaded when the old index list is discarded after parsing the carousel identifier in the old index list. And obtaining, when parsing the carousel identifier in the updated index list, a sequence number of the media segment ranked in the first broadcast bit in the updated index list;
- the first orchestration module 560 is coupled to the parsing module 520 and the recording module 540, and is configured to determine that the two serial numbers are not equal and discontinuous after the comparison, and the missing between the two serial numbers is added. a serial number, generating a supplementary play address of the corresponding media slice according to the added serial number and the recorded serial number, and according to the corresponding serial number of the supplementary play address and the play address in the updated index list Perform sequential combination to get the current index list;
- the capture and play module 580 is coupled to the first orchestration module 560, and configured to download and play the corresponding media slice to the server according to the play address in the current index list.
- the requesting module 500 is further configured to send a request to the server at a first time interval to obtain an index list updated by the server at a second time interval, wherein the first time interval is smaller than the second time interval.
- the parsing module 520 has the carousel identifier added by the server in real time in the index list of each update obtained.
- the capturing and playing module 580 is further configured to sequentially download a media segment to the server according to the playing address in the current index list or the old index list, and play the message if the buffer is large enough to be played.
- the currently downloaded media slice downloads the next media slice or even the next two media slices to cope with the delay in obtaining data or updating the index list by the server due to network jitter.
- the recording module 540 is further configured to continuously record the serial number of the media segment currently to be downloaded in the old index list and overwrite the previous record when the carousel identifier in the old index list is identified. The serial number of the media slice currently to be downloaded is last recorded until the old index list is discarded.
- the first programming module 560 is further configured to: after comparing, determining that the two serial numbers are not equal but continuous, generating a supplementary play address of the corresponding media slice according to the recorded serial number, and adding the supplementary play address And the play addresses in the updated index list are sequentially combined according to the corresponding serial numbers to obtain a current index list.
- the first orchestration module 560 is further configured to determine, when the comparison is that the two serial numbers are equal, the updated index list as a current index list.
- the capture play module 580 of the embodiment includes: a determination module 5801, a download module 5802, and a generation module 5803.
- the determining module 5801 is configured to determine whether the media segment corresponding to the to-be-downloaded play address in the play address in the current index list can be downloaded; if the download is successful, the determination result is sent to the download module; if not, And determining, by using the next play address of the to-be-downloaded play address as the new play address to be downloaded;
- the downloading module 5802 is configured to download a corresponding media segment according to the to-be-downloaded play address, and store the downloaded media segments separately when the media segment corresponding to the play address in the current index list can be downloaded. On the specified location in the local disk.
- the generating module 5803 is configured to generate a local index list of the media according to a path of the specified location of the downloaded media segment.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- the determining module 6801 is configured to determine whether the video segment corresponding to the to-be-downloaded URL in the m3u8 file can be downloaded; if yes, send the determination result to the downloading module; if not, the next URL of the to-be-downloaded URL is new The URL to be downloaded is judged.
- the downloading module 6802 is configured to download a video segment corresponding to the URL to be downloaded in the m3u8 file, and download the corresponding video segment according to the URL to be downloaded, and store each downloaded video segment in a specified location on the local disk. .
- the determining module 5801 first determines whether the video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded. If the video segment cannot be downloaded, the video segment is skipped, and the next URL of the URL to be downloaded is used as the new URL to be downloaded. If the download is available, the download module 5802 downloads the corresponding video clip according to the URL. Therefore, when a video clip is downloaded incorrectly, the erroneous video clip can be skipped and the subsequent video clip can be downloaded, thereby saving waiting time and improving. download speed.
- the download module 5802 downloads the video clip that is determined to be undownloadable to implement complete downloading of the target video.
- the generating module 5803 is configured to generate a local m3u8 file of the target video according to the path of the specified location where the video clip is located, to implement subsequent synthesis and playback of the target video.
- the downloading module 5802 is further configured to save the m3u8 file to the local, and mark the URL of the completed download in the m3u8 file, and according to the unmarked URL of the locally saved m3u8 file when restarting the download of the target video. Continue to download. By saving the m3u8 file to the local and marking the URL of the downloaded download, the URL of the undownloaded video clip in the m3u8 file can be identified, and then the download can be continued when the download is restarted.
- the present invention first determines whether a video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded. If the video segment can be downloaded, the corresponding video segment is downloaded according to the URL, and if the video segment cannot be downloaded, The video clip is skipped, and the next URL of the URL to be downloaded is judged by the new URL to be downloaded. Therefore, even when a certain video clip is downloaded incorrectly, the erroneous video clip can be skipped and the next video clip can be downloaded, and when the erroneous video clip is downloaded later, the fault problem is likely to be recovered. Therefore, the present invention reduces the time for waiting for an erroneous video clip during the video downloading process, and improves the download speed.
- the client of the carousel media segment includes: a requesting module 600, a parsing module 620, a recording module 640, a second orchestration module 660, and a capture play module 680;
- the requesting module 600 is configured to send a request to the server to obtain an index list that is continuously updated by the server, where each updated index list has a play address of the latest media fragments to be sequentially played and corresponding unique Serial number;
- the parsing module 620 is coupled to the requesting module 600, configured to obtain an updated index list and discard the old index list, and notify the recording module 640 when parsing the updated index list and the carousel identifier in the old index list. ;
- the recording module 640 is coupled to the parsing module 620, and configured to record the serial number of the media segment to be downloaded when the old index list is discarded after parsing the carousel identifier in the old index list. And obtaining, when parsing the carousel identifier in the updated index list, a sequence number of the media segment ranked in the first broadcast bit in the updated index list;
- the second orchestration module 660 is coupled to the parsing module 620 and the recording module 640, and is configured to determine, after the comparison, that the two serial numbers are not equal but continuous, and generate corresponding media fragments according to the recorded serial numbers. Adding a play address, and sequentially combining the supplementary play address and the play address in the updated index list according to the corresponding serial number to obtain a current index list;
- the capture and play module 680 is coupled to the second orchestration module 660, and configured to download and play the corresponding media segment to the server according to the play address in the current index list.
- the requesting module 600 is further configured to send a request to the server at a first time interval to obtain an index list updated by the server at a second time interval, wherein the first time interval is smaller than the second time interval. time interval.
- the parsing module 620 has the carousel identifier added by the server in real time in the index list of each update obtained.
- the capture and play module 680 is further configured to download a media slice to the server for playing according to the play address in the current index list or the old index list, and play it if the cache is large enough.
- the currently downloaded media slice downloads the next media slice or even the next two media slices to cope with the delay in obtaining data or updating the index list by the server due to network jitter.
- the recording module 640 is further configured to continuously record the serial number of the media segment currently to be downloaded in the old index list and overwrite the previous record when the carousel identifier in the old index list is identified. The serial number of the media slice currently to be downloaded is last recorded until the old index list is discarded.
- the second orchestration module 660 is further configured to: when the two sequence numbers are equal after the comparison, the updated index list is used as the current index list.
- the capture play module 680 of the embodiment includes: a determination module 6801, a download module 6802, and a generation module 6803.
- the determining module 6801 is configured to determine whether the media segment corresponding to the to-be-downloaded play address in the play address in the current index list can be downloaded; if the download is successful, the determination result is sent to the download module; if not, And determining, by using the next play address of the to-be-downloaded play address as the new play address to be downloaded;
- the downloading module 6802 is configured to download the corresponding media segment according to the to-be-downloaded play address, and store the downloaded media segments separately when the media segment corresponding to the play address in the current index list can be downloaded. On the specified location in the local disk.
- the generating module 6803 is configured to generate a local index list of the media according to the path of the specified location of the downloaded media segment.
- the play address is a Uniform Resource Locator (URL)
- the index list is an m3u8 file
- the media slice is a video clip
- the present application is not intended to be a uniform resource locator. (URL)
- the index list is an m3u8 file
- the media slice is a video clip.
- the determining module 6801 is configured to determine whether the video segment corresponding to the to-be-downloaded URL in the m3u8 file can be downloaded; if yes, send the determination result to the downloading module; if not, the next URL of the to-be-downloaded URL is new The URL to be downloaded is judged.
- the downloading module 6802 is configured to download a video segment corresponding to the URL to be downloaded in the m3u8 file, and download the corresponding video segment according to the URL to be downloaded, and store each downloaded video segment in a specified location on the local disk. .
- the determining module 6801 first determines whether the video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded. If the video segment cannot be downloaded, the video segment is skipped, and the next URL of the URL to be downloaded is used as the new URL to be downloaded. If the download is available, the download module 6802 downloads the corresponding video clip according to the URL. Therefore, when a video clip is downloaded incorrectly, the erroneous video clip can be skipped and the subsequent video clip can be downloaded, thereby saving waiting time and improving. download speed.
- the download module 6802 downloads the video clip that is determined to be undownloadable to complete the complete download of the target video.
- the generating module 6803 is configured to generate a local m3u8 file of the target video according to the path of the specified location where the video clip is located, to implement subsequent synthesis and playback of the target video.
- the downloading module 6802 is further configured to save the m3u8 file to the local, and mark the URL of the completed download in the m3u8 file, and according to the unmarked URL of the locally saved m3u8 file when restarting the download of the target video. Continue to download. By saving the m3u8 file to the local and marking the URL of the downloaded download, the URL of the undownloaded video clip in the m3u8 file can be identified, and then the download can be continued when the download is restarted.
- the present invention first determines whether a video segment corresponding to the URL to be downloaded in the m3u8 file can be downloaded. If the video segment can be downloaded, the corresponding video segment is downloaded according to the URL, and if the video segment cannot be downloaded, The video clip is skipped, and the next URL of the URL to be downloaded is judged by the new URL to be downloaded. Therefore, even when a certain video clip is downloaded incorrectly, the erroneous video clip can be skipped and the next video clip can be downloaded, and when the erroneous video clip is downloaded later, the fault problem is likely to be recovered. Therefore, the present invention reduces the time for waiting for an erroneous video clip during the video downloading process, and improves the download speed.
- FIG. 11 it is a system architecture diagram of Embodiment 9 of the present application, including: one or more clients 700 and a server 720, where
- the client 700 refers to the fourth and fifth embodiments, and details are not described herein again.
- the client may be a network television, a tablet computer, a personal computer, a network video player (network set top box), a mobile phone, etc., and the application is not limited thereto.
- the server 720 is configured to continuously update the index list, wherein each updated index list has a play address of the latest media fragments to be sequentially played and a corresponding unique serial number.
- the server 720 assigns a sequence number to the index list for each update.
- the serial number is equal to the unique serial number of the media segment ranked in the first broadcast position in the index list, the serial number of the second media segment after the first broadcast bit is increased by 1, and the second media content after the first broadcast bit
- the serial number of the slice is increased by 2.
- the index list generally has three play addresses. Of course, the application is not limited thereto.
- the server 720 stores a live media library, an on-demand media library, and a carousel media library, and each of the libraries stores a corresponding media segment to be played.
- a media segment of a carousel is stored in a carousel resource library, and multiple media segments are combined and played in sequence to form a complete video resource.
- a complete video resource may be a movie or a TV series.
- the order in which the plurality of media segments are played together is arranged according to the serial number of each media segment.
- the server 720 selects a media slice to be played from the carousel media library to continuously generate an updated index list
- the server adds a carousel identifier in real time in each updated index list, so that the client requests the round.
- the carousel flag can be read when the list is played, thereby identifying the carousel mode and initiating the corresponding operation.
- the carousel logo is directly added to each play address in the index list with a symbol.
- the broadcast control server of the video resource established by the server for a network video service provider, the HLS protocol is supported in the broadcast control server, and the carousel mode configuration according to the above embodiment is supported by the HLS protocol;
- the client is the A branded network television set launched by a network video service provider, in which the modules described in the above embodiments are installed.
- the server stores a live media library, an on-demand media library, and a carousel media library.
- the server is currently broadcasting a football match.
- the live media library stores media segments that are real-time produced according to the live event, and provides an index through the HLS live broadcast mode. List, the network TV is watching the football match by updating the index list, but due to the bad network conditions, the network TV can not keep in sync with the server, and continuously catch the media stream by quickly discarding the media segmentation, jumping The picture gives the user a very bad feeling.
- the server continuously updates the index list according to the media segment of the TV episode ABC in a cycle of 20 seconds.
- the current latest index list 1 has the TV episode to be sequentially played.
- ABC's three latest media fragments play address URL2, URL3, URL4 and corresponding serial numbers 2, 3, 4.
- the server adds the carousel identifier t after the play address URL in the index list 1 in real time.
- the index list 1 sequence number is equal to the sequence number of the URL 2 ranked in the first broadcast position in the index list 1, and the subsequent URL 3 and URL 4 are sequentially added to infer that the sequence numbers are 3 and 4.
- the client obtains the above index list 1, and sequentially downloads the media slice of the URL2-t to the server according to the play address in the index list 1, and then plays the media slice of the URL2-t while the client is ready. Download the media slice of URL3-t to the server.
- the client reads the play address in the index list 1
- the client identifies the carousel identifier t, and knows that the current index list is in the carousel mode. In this case, the client needs to continuously record the current index list to be downloaded. The serial number of the media slice and overwrite the previous record.
- the client While the client performs the above operation according to the index list 1, the client also requests the updated index list from the server in a 10-second period.
- the server sequentially generates updated index lists 2, 3, and 4 according to the media segment of the TV episode ABC.
- the playlist 2 has the play address of the three latest media segments of the TV episode ABC to be sequentially played.
- index list 3 has the play address URL4, URL5, URL6 and corresponding serial number 4 of the three latest media fragments of the TV episode ABC to be sequentially played.
- the index list 4 has the play address URL5, URL6, URL7 and the corresponding serial number 5, 6, 7 of the three latest media fragments of the TV episode ABC to be sequentially played.
- the server plays in real time in index lists 2, 3 and 4 Add the carousel identifier t after the address URL.
- the index list 2 sequence number is equal to the sequence number of the URL 3 ranked in the first broadcast position in the index list 2
- the index list 3 sequence number (sequence) is equal to the sequence number of the URL 4 ranked in the first broadcast bit in the index list 3
- the index list 4 sequence is equal to the sequence number of the URL 5 ranked in the first broadcast position in the index list 4.
- Index list 2 index list 3 index list 4
- the client does not obtain the index lists 2 and 3, and only obtains the latest index list 4 at a later time.
- the old index list 1 needs to be discarded according to the HLS protocol, and the last time the index list 1 is discarded.
- the serial number of the recorded media fragment URL3 to be downloaded is 3.
- the client When the client recognizes the carousel identifier t when reading the play address in the latest index list 4, the client automatically obtains the serial number 5 of the media segment URL5 ranked in the first broadcast position in the latest index list 4, and the index is discarded.
- the last recorded serial number 3 at list 1 is compared with the serial number 5 listed in the first broadcast position in index list 4:
- serial number 3 and the serial number 5 are not equal and discontinuous, and the supplementary play address of the corresponding media slice is generated according to the missing serial number 4 between the two serial numbers and the recorded serial number 3. Since the serial number of URL5 is 5, and the serial number of URL2 is 2, according to this rule, it can be inferred that the play address of serial number 3 is URL3, the play address of serial number 4 is URL4, and URL3 and URL4 are supplementary play addresses. .
- the supplementary play address URL3, URL4, and the play address URL5, URL6, and URL7 in the latest index list 4 are sequentially combined according to the corresponding serial number to obtain a current index list.
- the current index list does not follow the HLS protocol.
- the client sequentially downloads a media slice to the server for playing according to the play address in the current index list, until the client receives the updated index list.
- the method, client and system for carousel media segmentation provided by the present application, It can guarantee the integrity of the user playing media; it can guarantee that the client will not miss the update of the server and not too frequent requests to waste processing resources; in addition, it can cope with the database index or the updated index list caused by network jitter. delay.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请公开了轮播媒体分片的方法、客户端及系统,其中所述方法包括:获取服务器不断更新的索引列表;获取更新的索引列表并丢弃旧索引列表,记录丢弃旧索引列表时当前待下载的媒体分片的序列号,识别更新的索引列表中排在首播位的媒体分片的序列号;判定两个序列号不相等且不连续时,添加两个序列号之间所缺少的序列号,根据添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将增补播放地址以及更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据当前索引列表中的播放地址向服务器下载相应媒体分片进行播放。本申请自动增补客户端没有请求的滞后的媒体分片,从而保证了播放的完整性。
Description
交叉引用
本申请引用于2013年12月6日递交的名称为“轮播媒体分片的方法、客户端及系统”的第201310664166.9号中国专利申请以及2013年12月9日递交的名称为“一种基于HLS协议的视频下载方法及其装置”的第201310665514.4号中国专利申请,其通过引用被全部并入本申请。
本申请涉及流媒体播放领域,具体涉及一种轮播媒体分片的方法、客户端及系统。
HLS(Http live streaming)协议,是由苹果公司提出的基于HTTP协议的流媒体网络传输协议,可实现流媒体的直播和点播。不同于常见的流媒体直播协议,进行HLS直播的客户端获取到的不是一个完整的数据流,而是在服务器端将最新的直播数据流存储为连续的、很短时长的媒体分片(MPEG-TS,动态图像专家组-传输流),客户端需要不断地按顺序下载并按顺序播放这些媒体分片,就实现了HLS直播。
目前HLS协议并不支持轮播模式,但是轮播模式的形式类似于直播,只是服务器端播放的数据流并不是直播数据流,而是预先做好的如电影、电视剧、综艺录像等数据。因此可以考虑以HLS直播的方式为基础来实现轮播模式。
但是直播模式和轮播模式的播放要求存在较大差异,利用HLS直播实现轮播模式还存在一些需要解决的问题。例如,在进行HLS直播时,当网络出现抖动时,客户端播放的媒体分片往往滞后于服务器端最新发放的媒体分片,无法与服务器端保持同步,此时客户端为了保证直播的实时性,HLS协议规定客户端要自动放弃还未播放的滞后的媒体分片,而直接播放服务器更新的
最新的媒体分片从而快速赶上服务器最新发放的媒体分片,在播放视频的过程中会出现跳跃,从一个时间段快速跳到另一个时间段。
而对于轮播模式,播放要求是尽可能保证播放的完整性,而上述HLS直播技术显然不适于实现轮播模式的播放要求。但是目前HLS协议并不支持轮播技术,如何应对HLS协议中规定的直播中自动丢弃媒体分片的特点,从而有效利用HLS直播技术来实现轮播模式就成为了亟待解决的技术问题。
发明内容
本申请所要解决的技术问题在于提供一种轮播媒体分片的方法、客户端及系统,以应对HLS协议中规定的直播中自动丢弃媒体分片的特点,从而有效利用HLS直播技术来实现轮播模式。
为达到上述目的,本申请实施例采用如下技术方案:
第一方面,一种轮播媒体分片的方法,其方法包括:
获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
获取更新的索引列表并丢弃旧索引列表,记录丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
第二方面,一种在其上记录有配置于执行上述方法的程序的计算机可读记录介质。
第三方面,一种轮播媒体分片的方法,其方法包括:
获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址以及相应的唯一的序列号;
获取更新的索引列表并丢弃旧索引列表,记录丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
第四方面,一种在其上记录有配置于执行上述方法的程序的计算机可读记录介质。
第五方面,一种轮播媒体分片的客户端,其包括:请求模块、解析模块、记录模块、编排模块、撷取播放模块、判断模块和下载模块;
所述请求模块,配置于向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
所述解析模块,配置于获取更新的索引列表并丢弃旧索引列表,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
所述记录模块,配置于记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
所述编排模块,配置于比较后判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表;
所述撷取播放模块,配置于依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片并进行播放。
第六方面,一种轮播媒体分片的客户端,其包括:请求模块、解析模块、记录模块、编排模块、撷取播放模块、判断模块和下载模块;
所述请求模块,配置于向服务器发出请求以获取所述服务器不断更新的
索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
所述解析模块,配置于获取更新的索引列表并丢弃旧索引列表,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
所述记录模块,配置于记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
所述编排模块,配置于比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表;
所述撷取播放模块,配置于依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片并进行播放。
第七方面,一种轮播媒体分片的系统,其包括:一个或多个客户端和服务器,其中,所述客户端,包括如上述的轮播媒体分片的客户端;所述服务器,配置于不断更新索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号。
附图概述
图1为本申请实施例一的一方法流程图。
图2为本申请实施例二的一方法流程图。
图3为本申请实施例三的一方法流程图。
图4为本申请实施例四的一方法流程图。
图5为本申请实施例四的m3u8文件的示意图。
图6为本申请实施例四的本地m3u8文件的示意图。
图7为本申请实施例五的一客户端结构图。
图8为本申请实施例六的一客户端结构图。
图9为本申请实施例七的一客户端结构图。
图10为本申请实施例八的一客户端结构图。
图11为本申请实施例九的一系统架构图。
本申请的较佳实施方式
以下将配合图式及实施例来详细说明本申请的实施方式,藉此对本申请如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解并据以实施。
下述媒体分片,可以是动态图像专家组-传输流(MPEG-TS)等流媒体分片格式文件,当然本申请并不限于此。
下述索引列表,可以是m3u8文件等索引目录文件,当然本申请并不限于此。
下述播放地址,可以是统一资源定位符(URL)等网络存取地址,当然本申请并不限于此。
实施例一
在进行HLS直播时,当网络出现抖动时,客户端播放的媒体分片往往滞后于服务器端最新发放的媒体分片,无法与服务器端保持同步,此时客户端为了保证直播的实时性,HLS协议规定客户端要自动放弃还未播放的滞后的媒体分片,而直接播放服务器更新的最新的媒体分片从而快速赶上服务器最新发放的媒体分片,在播放视频的过程中会出现跳跃。
显然,客户端当前播放的媒体分片和直接播放服务器更新的最新的媒体分片之间在播放上是不连续。本申请的方案考虑客户端自行补充导致不连续发生而缺少的媒体分片,在当前播放的媒体分片执行完后,播放自行补充的媒体分片,然后再播放服务器更新的最新的媒体分片,这样就可以保证轮播模式下的完整播放。
如图1所示,为本申请实施例一的方法流程图,包括:
步骤S100,客户端向服务器发出请求以获取所述服务器不断更新的索引
列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
媒体分片通过用序列号来标识自身以及和其他媒体分片之间的排列顺序,因此序列号本身与媒体分片的播放地址存在对应关系。
步骤S102,所述客户端获取更新的索引列表并丢弃旧索引列表,记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
需要说明的是,丢弃所述旧索引列表时当前待下载的媒体分片的序列号也是没有下载成功的媒体分片。
步骤S104,所述客户端比较后判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
添加所述两个序列号之间所缺少的序列号时,因为序列号一般是数字,具体根据序列号之前的排列关系就可以得到两个不连续序列号之间缺少的序列号。同时步骤S102中所记录的序列号也是没有下载成功的媒体分片。
利用序列号与媒体分片的播放地址的对应关系,根据添加的序列号和所记录的序列号的媒体分片就可以生成相应的增补播放地址;按照序列号的排列顺序,增补播放地址要排在当前播放的媒体分片和服务器最新更新的播放地址之间。需要说明的是,因为添加的序列号不只一个,多个增补播放地址之间也要按照序列号排列顺序。
在播放完当前的媒体分片后,先去增补播放地址下载媒体分片进行播放,之后再去服务器最新更新的播放地址下载媒体分片进行播放。这样播放完整性得以实现。
实施例二:
如图2所示,为本申请实施例二的方法流程图,包括:
在进行HLS直播时,当网络出现抖动时,客户端播放的媒体分片往往滞后于服务器端最新发放的媒体分片,无法与服务器端保持同步,此时客户端为了保证直播的实时性,HLS协议规定客户端要自动放弃还未播放的滞后的媒体分片,而直接播放服务器更新的最新的媒体分片从而快速赶上服务器最新发放的媒体分片,在播放视频的过程中会出现跳跃。
显然,客户端当前播放的媒体分片和直接播放服务器更新的最新的媒体分片之间在播放上是不连续。本申请的方案考虑在客户端自行补充导致不连续发生而缺少的媒体分片,在当前播放的媒体分片执行完后,播放自行补充的媒体分片,然后再播放服务器更新的最新的媒体分片,这样就可以保证轮播模式下的完整播放。
步骤S200,客户端向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址以及相应的唯一的序列号;
媒体分片通过用序列号来标识自身以及和其他媒体分片之间的排列顺序,因此序列号本身与媒体分片的播放地址存在对应关系。
步骤S202,所述客户端获取更新的索引列表并丢弃旧索引列表,记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;
需要说明的是,丢弃所述旧索引列表时当前待下载的媒体分片的序列号是没有下载成功的媒体分片。
步骤S204,所述客户端比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
所述两个序列号之间是连续的,因此没有缺少序列号,那只有步骤S202中所记录的序列号是没有下载成功的媒体分片,只要获取这个媒体分片的播放地址就可以了。但是所述旧索引列表已经丢弃了,所以还是需要生成增补
播放地址。
利用序列号与媒体分片的播放地址的对应关系,根据所记录的序列号的媒体分片就可以生成相应的增补播放地址;按照序列号的排列顺序,增补播放地址要排在当前播放的媒体分片和服务器最新更新的播放地址之间。
在播放完当前的媒体分片后,先去增补播放地址下载媒体分片进行播放,之后再去服务器最新更新的播放地址下载媒体分片进行播放。这样播放完整性得以实现。
实施例三:
如图3所示,为本申请实施例三的方法流程图,包括:
步骤S300,服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号。
对于每次更新的索引列表会赋予一个序列号(sequence),这个序列号等于索引列表中排在首播位的媒体分片的唯一的序列号,排在首播位之后第二位的媒体分片的序列号增加1,排在首播位之后第二位的媒体分片的序列号增加2,按照HLS协议的规定索引列表一般会存有3个播放地址,当然本申请并不限于此。
所述服务器保存有直播媒体库、点播媒体库和轮播媒体库,各个库中存放有相应的待播放的媒体分片。
例如,轮播资源库中保存有轮播的媒体分片,多个媒体分片按顺序组合在一起播放就构成了一个完整的视频资源,一个完整的视频资源可以是一部电影或者一集电视剧,多个媒体分片组合在一起播放的顺序按每个媒体分片的序列号进行排列。
步骤S302,当服务器从轮播媒体库中选取待播放的媒体分片不断生成更新的索引列表时,所述服务器在每次更新的索引列表中实时添加轮播标识,以便客户端在请求到这个轮播列表时可以读取到轮播标识,从而识别出轮播模式从而启动相应操作。
在实际应用中,轮播标识用一个符号直接添加在索引列表中的每个播放
地址的后面。
所述客户端以第一时间间隔为周期向所述服务器发出请求以获取所述服务器以第二时间间隔为周期更新的索引列表,其中,所述第一时间间隔小于第二时间间隔。一般来说,第一时间间隔等于第二时间间隔的一半,这样的取值可以使客户端向服务器进行请求获取更新的索引列表的频率大于服务器自身更新索引列表的频率,这样一方面保证了客户端不会错过服务器的更新,同样也保证客户端不会过于频繁的进行请求从而浪费处理资源。
步骤S304,所述客户端获取更新的索引列表并丢弃旧索引列表,在解析到所述旧索引列表中的轮播标识后,记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号;在解析到所述更新的索引列表中的轮播标识时,获取所述更新的索引列表中排在首播位的媒体分片的序列号,对所述两个序列号进行比较。
所述客户端在之前获取到旧索引列表时,旧索引列表中一般存有多个播放地址,按照HLS协议的规定会存有3个播放地址,所述客户端依次根据所述旧索引列表中的播放地址,每次向所述服务器下载一个媒体分片进行播放,如果缓存足够大,可以在播放当前下载的媒体分片的同时下载下一个媒体分片甚至是下两个媒体分片以应付因为网络抖动导致的由服务器获取数据或者更新的索引列表的延迟。在识别到所述旧索引列表中的轮播标识时,还会不断记录在所述旧索引列表中当前待下载的媒体分片的序列号并覆盖在先的记录,直到丢弃所述旧索引列表时最后记录当前待下载的媒体分片的序列号。
在识别到所述更新的索引列表中的轮播标识时启动轮播处理,在所述客户端丢弃旧索引列表时,识别当前期望下载但是还没有下载的媒体分片的序列号并记录。同时还需要识别所述更新的索引列表中排在首播位的媒体分片的序列号,也就是所述更新的索引列表的序列号(sequence)。
步骤S306,所述客户端比较后判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,执行步骤S312。
所述客户端比较后判定所述两个序列号不相等且不连续时,说明两个序列号之间存在断档,例如序列号3和序列号5之间缺少了序列号4。
这时所记录的序列号对应的媒体分片还没有下载,这个没有下载的媒体分片与之前已经下载的媒体分片(之前已经下载的媒体分片可能正在播放,也可能还没开始播放,只是缓存着待播)显然是连续的,例如序列号2媒体分片已经下载,而序列号3对应的媒体分片还没有下载,这两个媒体分片显然是连续的。
而两个序列号之间缺少的部分则无法得到了,这时缺少的序列号是可以根据规律推断出的,而缺少的序列号与所记录的还没有下载的序列号所对应的媒体分片都是需要下载才能保证连续播放的,根据推断出的缺少的序列号以及所记录的序列号,结合一定的规则(例如媒体分片的播放地址也是连续编号的,根据待增补序列号与前后已知的序列号之间的差值,与前后已知的序列号对应的播放地址推算出增补播放地址)生成相应的媒体分片的增补播放地址,例如序列号2、3、4所在的索引列表已经丢弃,更新的索引列表的序列号为5、6、7,而序列号2的媒体分片已经下载,而序列号3对应的媒体分片还没有下载,序列号5是更新的索引列表的首播位,序列号3和序列号5之间缺少了序列号4,因此客户端和服务器之间存在一定的偏差,客户端根据序列号3和4生成相应的媒体分片的增补播放地址,再结合更新的索引列表的序列号为5、6、7的媒体分片的播放地址组成当前索引列表。
步骤S308,所述客户端比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,执行步骤S312。
所述客户端比较后判定所述两个序列号不相等但连续时,说明两个序列号之间不存在断档,例如序列号3和序列号4之间是连续的。
这时没有下载的媒体分片与之前已经下载的媒体分片(之前已经下载的媒体分片可能正在播放,也可能还没开始播放,只是缓存着待播)显然是连续的,只要下载所记录的还没有下载的序列号所对应的媒体分片就可以保证连续播放的,根据所记录的序列号结合一定的规则(例如媒体分片的播放地
址也是连续编号的,根据待增补序列号与前后已知的序列号之间的差值,与前后已知的序列号对应的播放地址推算出增补播放地址)生成相应的媒体分片的增补播放地址,例如序列号2、3、4所在的索引列表已经丢弃,更新的索引列表的序列号为4、5、6,而序列号2的媒体分片已经下载,而序列号3对应的媒体分片还没有下载,序列号4是更新的索引列表的首播位,序列号3和序列号4之间不同但是连续,因此客户端和服务器之间存在一定的偏差,客户端根据序列号3生成相应的媒体分片的增补播放地址,再结合更新的索引列表的序列号为4、5、6的媒体分片的播放地址组成新的索引列表。
步骤S310,所述客户端比较后判定所述两个序列号相等时,将所述更新的索引列表作为当前索引列表,执行步骤S312。
所述客户端比较后判定所述两个序列号相等,说明两个序列号之间不存在断档,例如序列号2、3、4所在的索引列表已经丢弃,更新的索引列表的序列号为3、4、5,而序列号2的媒体分片已经下载,而序列号3对应的媒体分片还没有下载,序列号3是更新的索引列表的首播位,还没有下载的序列号和更新的索引列表的首播位的序列号都是3,说明此时客户端与服务器没有偏差,更新是同步的,从服务器得到的所述更新的索引列表就是当前索引列表。
步骤S312,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
所述客户端依次根据所述当前索引列表中的播放地址,每次向所述服务器下载一个媒体分片进行播放,如果缓存足够大,可以在播放当前下载的媒体分片的同时下载下一个媒体分片甚至是下两个媒体分片以应付因为网络抖动导致的由服务器获取数据或者更新的索引列表的延迟。例如,当前索引列表包括序列号为3、4、5、6、7的媒体分片,则客户端依次根据这些序列号对应的播放地址去向服务器下载媒体分片,直到客户端又接收到更新的索引列表,跳转执行步骤S304。
实施例四:
如图4所示,为本申请实施例四的方法流程图,本实施例基于上述实施
例,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片的方法包括以下步骤:
步骤S401,判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载:
步骤S402,若能下载,根据所述待下载播放地址下载对应的媒体分片,并将下载到的各个媒体分片分别存储在本地磁盘中的指定位置上;
步骤S403,若不能下载,以所述待下载播放地址的下一个播放地址为新的待下载的播放地址进行判断。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
依据HLS协议,请参考图5所示的m3u8文件示意图,其中:
#EXTM3U:表示m3u文件头,放在第一行。
#EXT-X-TARGETDURATION:表示指定的最大视频片段时长,单位是秒。
#EXTINF:表示每个视频片段ts文件的时长,仅对其后的URL有效,#EXTINF中指定的时长必须小于等于#EXT-X-TARGETDURATION中指定的时长。
http://218.30.13.36/sample_100k-1.ts:表示视频片段sample_100k-1的媒体数据ts文件的URL。
#EXT-X-ENDLIST:表示m3u8文件的结束符。
通常来讲,一个完整的媒体对应一个m3u8文件,该m3u8文件中包括这个完整媒体的多个视频片段的URL。本发明在获取到上述m3u8文件后,根据该m3u8文件中视频片段的URL从云服务器顺序下载视频片段,并将各个视频片段分别存储在指定的位置上。该指定的位置位于本地磁盘上,可以是下载的默认位置,比如,默认下载位置是:C:\Users\Download,也可以是用户自定义的位置。
仍以图5所示的m3u8文件为例,顺序下载上述m3u8文件中的视频片段:sample_100k-1.ts、sample_100k-2.ts以及sample_100k-3.ts。在这个过程中,如果其中某一个待下载的URL对应的视频片段经判断不能下载,比如:待下载的URL:http://218.30.13.36/sample_100k-2.ts对应的视频片段sample_100k-2.ts不能下载,那么则跳过sample_100k-2.ts,以上述m3u8文件中http://218.30.13.36/sample_100k-2.ts的下一个URL:http://218.30.13.36/sample_100k-3.ts作为待下载的URL进行判断,如果sample_100k-3.ts可以下载,则继续下载sample_100k-3.ts。整个过程不会因为sample_100k-2.ts的无法下载而导致sample_100k-3.ts也无法下载。
由以上描述可以看出,本发明在下载媒体分片的过程中,先判断m3u8文件中待下载URL对应的视频片段能否下载,如果能下载则依据该URL下载对应的媒体分片,如果不能下载,则跳过该媒体分片,以所述待下载URL的下一个URL为新的待下载URL进行判断。因此,即使在某一个媒体分片下载出错时,也可以跳过该出错的媒体分片,继续下载下一个媒体分片,而后续再下载出错的媒体分片时,其故障问题极有可能已经恢复。所以本发明减少了媒体下载过程中等待出错媒体分片的时间,提高了下载速度。
进一步地判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载的过程包括:判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片在预定的时间内是否下载完成。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
即进一步地限定判断上述m3u8文件中的待下载URL对应的视频片段能否下载的过程包括:判断m3u8文件中的待下载URL对应的视频片段在预定的时间内是否下载完成。
在实际应用中,视频片段无法下载往往会有很多原因,比如:云服务器故障、网络中断等等。无论哪种情况,都会造成短时间内待下载URL对应的视频片段不能下载完成。所以,本实施例通过判断视频片段在预定的时间能
否下载完成来判断视频片段是否下载故障。上述预定的时间可以由管理员根据视频片段的大小和平均网速来设置。
进一步地,本实施例在所有能下载的媒体分片下载完成后,下载所述步骤S403不能下载的媒体分片。本发明设计跳过下载故障的视频片段,优先下载没有下载故障的视频片段,并在所有没有下载故障的视频片段下载完成后,再下载之前跳过的故障视频片段,这个时候,之前不能下载的视频片段的故障问题极有可能已经恢复,这就节省了等待下载故障视频片段的时间,提高了下载速度。
进一步地限定:根据下载到的所述媒体分片的指定位置的路径,生成所述媒体的本地索引列表。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
具体地,根据视频片段所在的指定位置的路径,生成所述目标视频的本地m3u8文件。
本实施例在视频片段下载完成的同时,生成本地m3u8文件。优选地,该本地m3u8文件的格式和云服务器的相同,不同的是本地m3u8文件中的URL是本地地址。以图5所示的m3u8文件中的视频片段下载到本地磁盘C:\Users\Download中为例,下载完成后生成的本地m3u8文件如图6所示。通过生成上述本地m3u8文件以实现后续对目标视频的合成以及播放。
对于传统的视频下载而言,下载完成后呈现给用户的是一个视频文件,用户点击该视频文件就可以实现播放。而本发明下载完成后,保存的是目标视频的多个视频片段,对于用户而言,可以通过点击本地m3u8文件来实现播放。目前各大播放器基本都支持m3u8文件的播放,比如,MPlayer、VLC、ffplayer等。由此可见,通过本地m3u8文件对视频片段进行播放也是极为便利的,不会产生额外操作。
进一步地,根据上述本地m3u8文件,还可以将存储在指定位置的视频片
段合并成目标视频。
本发明是将目标视频的各个视频片段分别下载并保存,也就是说下载好的目标视频是多个视频片段的集合,由于文件数量较多,不便于拷贝,所以可以依据上述本地m3u8文件将下载好的视频片段合成完整的目标视频。
在本实施例的一种具体实现中,依据本地m3u8文件中各个视频片段的顺序,将各个视频片段合并为完整的目标视频。其中,将各个视频片段合并为一个视频可以依据已知的视频合并方法。比如,通过视频格式编码规范对视频进行合并解码,再根据目标格式编码规范重新合并编码。以HLS协议为例,视频片段是ts格式,经过合并后可以输出一个ts格式的大视频文件。通过对视频片段的合并,可以方便用户对目标视频的拷贝等操作。
进一步地限定:将所述当前索引列表保存到本地,并在所述当前索引列表中标记已完成下载的播放地址,在重新启动所述媒体的下载时,根据本地保存的所述当前索引列表中未做标记的播放地址继续下载。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
具体地将m3u8文件保存到本地,并在该m3u8文件中标记已完成下载的URL,在重新启动目标视频的下载时,根据本地保存的上述m3u8文件中未做标记的URL继续下载。
换而言之,本实施例提供了一种目标视频继续下载的方法。在实际应用中,会出现一部电影没有下载完毕,但用户关闭了电脑,在电脑重新开启后,用户还想要继续下载的情况。或者是由于网络故障,导致下载中断,在故障恢复时,也需要继续下载。要实现继续下载,就需要知道哪些视频片段已经下载完毕,哪些视频片段还没有下载。本实施例设计将m3u8文件保存到本地,并在该m3u8文件中标记已完成下载的视频片段,这样在重新启动下载的时候,就可以依据该m3u8文件中未做标记的URL下载还未下载的视频片段。
具体地,可以在m3u8文件的各个视频片段的URL后面加上预设的字段
用来标记,比如,增加字段&downloaded用来表明该视频片段已经下载完毕。那么,在重新启动目标视频的下载时,只需要下载上述m3u8文件中未标记&downloaded字段的视频片段。当然,也可以采取其他的方式,比如,在本地建立下载进度表。
| URL | 下载状态 |
| http://218.30.13.36/sample_100k-1.ts | downloaded |
| http://218.30.13.36/sample_100k-2.ts | downloaded |
表1
仍以图5所示的m3u8文件为例,请进一步参考表1,在重新启动下载时,对比m3u8文件和上述下载进度表,只下载该下载进度表中没有的URL,也就是http://218.30.13.36/sample_100k-3.ts,以此实现继续下载。本发明对此不作限制,本领域技术人员也可以采用其他方法标识已下载完毕的视频片段。
实施例五:
如图7所示,为本申请实施例五的客户端结构图。轮播媒体分片的客户端,包括:请求模块500、解析模块520、记录模块540、第一编排模块560和撷取播放模块580;
所述请求模块500,配置于向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
所述解析模块520,与请求模块500耦接,配置于获取更新的索引列表并丢弃旧索引列表,解析到所述更新的索引列表和所述旧索引列表中的轮播标识时通知记录模块540;
所述记录模块540,与解析模块520耦接,配置于在解析到所述旧索引列表中的轮播标识后,记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,在解析到所述更新的索引列表中的轮播标识时,获取所述更新的索引列表中排在首播位的媒体分片的序列号;
所述第一编排模块560,分别与解析模块520和记录模块540耦接,配置于比较后判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表;
所述撷取播放模块580,与第一编排模块560耦接,配置于依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片并进行播放。
所述请求模块500,进一步配置于以第一时间间隔为周期向所述服务器发出请求以获取所述服务器以第二时间间隔为周期更新的索引列表,其中,所述第一时间间隔小于第二时间间隔。
所述解析模块520,所获取的每次更新的索引列表中具有所述服务器实时添加的轮播标识。
所述撷取播放模块580,进一步配置于依次根据所述当前索引列表中或者旧索引列表中的播放地址,每次向所述服务器下载一个媒体分片进行播放,如果缓存足够大,可以在播放当前下载的媒体分片的同时下载下一个媒体分片甚至是下两个媒体分片以应付因为网络抖动导致的由服务器获取数据或者更新的索引列表的延迟。
所述记录模块540,进一步配置于在识别到所述旧索引列表中的轮播标识时,不断记录在所述旧索引列表中当前待下载的媒体分片的序列号并覆盖在先的记录,直到丢弃所述旧索引列表时最后记录当前待下载的媒体分片的序列号。
所述第一编排模块560,还配置于比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表。
所述第一编排模块560,还配置于比较后判定所述两个序列号相等时,将所述更新的索引列表作为当前索引列表。
以上不足之处参考实施例一和实施例三。
实施例六:
如图8所示,为本申请实施例六的客户端结构图,基于上述实施例,本实施例的所述撷取播放模块580包括:判断模块5801、下载模块5802和生成模块5803。
所述判断模块5801,配置于判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载;若能下载,则将判断结果发送至下载模块;若不能下载,则以所述待下载播放地址的下一个播放地址为新的待下载的播放地址进行判断;
所述下载模块5802,配置于在当前索引列表中的播放地址对应的媒体分片能下载时,根据所述待下载播放地址下载对应的媒体分片,并将下载到的各个媒体分片分别存储在本地磁盘中的指定位置上。
所述生成模块5803,配置于根据下载到的所述媒体分片的指定位置的路径,生成所述媒体的本地索引列表。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
判断模块6801配置于判断上述m3u8文件中的待下载URL对应的视频片段能否下载;若能,则将判断结果发送至下载模块;若不能,则以上述待下载URL的下一个URL为新的待下载URL进行判断。
下载模块6802配置于在上述m3u8文件中的待下载URL对应的视频片段能下载时,根据待下载URL下载对应的视频片段,并将下载到的各个视频片段分别存储在本地磁盘中的指定位置上。
判断模块5801先判断m3u8文件中待下载URL对应的视频片段能否下载,如果不能下载,则跳过该视频片段,以上述待下载URL的下一个URL为新的待下载URL进行判断。如果能下载,则由下载模块5802依据该URL下载对应的视频片段。因此,在某一个视频片段下载出错时,也能够跳过该出错的视频片段,继续下载后面的视频片段,从而节约了等待时间,提高了
下载速度。
进一步地,下载模块5802在所有能下载的视频片段下载完成后,下载经判断未能下载的视频片段,以实现对目标视频的完整下载。
生成模块5803配置于根据视频片段所在的指定位置的路径,生成目标视频的本地m3u8文件,以实现后续对目标视频的合成以及播放。
进一步地,下载模块5802还配置于将m3u8文件保存到本地,并在该m3u8文件中标记已完成下载的URL,在重新启动目标视频的下载时,根据本地保存的m3u8文件中未做标记的URL继续下载。通过将m3u8文件保存到本地并标记已完成下载的URL,可以识别该m3u8文件中未下载的视频片段的URL,进而在重新启动下载时,实现继续下载。
由以上描述可以看出,本发明在下载视频的过程中,先判断m3u8文件中待下载URL对应的视频片段能否下载,如果能下载则依据该URL下载对应的视频片段,如果不能下载,则跳过该视频片段,以所述待下载URL的下一个URL为新的待下载URL进行判断。因此,即使在某一个视频片段下载出错时,也可以跳过该出错的视频片段,继续下载下一个视频片段,而后续再下载出错的视频片段时,其故障问题极有可能已经恢复。所以本发明减少了视频下载过程中等待出错视频片段的时间,提高了下载速度。
实施例七
如图9所示,为本申请实施例七的客户端结构图。轮播媒体分片的客户端,包括:请求模块600、解析模块620、记录模块640、第二编排模块660和撷取播放模块680;
所述请求模块600,配置于向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;
所述解析模块620,与请求模块600耦接,配置于获取更新的索引列表并丢弃旧索引列表,解析到所述更新的索引列表和所述旧索引列表中的轮播标识时通知记录模块640;
所述记录模块640,与解析模块620耦接,配置于在解析到所述旧索引列表中的轮播标识后,记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,在解析到所述更新的索引列表中的轮播标识时,获取所述更新的索引列表中排在首播位的媒体分片的序列号;
所述第二编排模块660,分别与解析模块620和记录模块640耦接,配置于比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表;
所述撷取播放模块680,与第二编排模块660耦接,配置于依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片并进行播放。
所述请求模块600,进一步配置于以第一时间间隔为周期向所述服务器发出请求以获取所述服务器以第二时间间隔为周期更新的索引列表,其中,所述第一时间间隔小于第二时间间隔。
所述解析模块620,所获取的每次更新的索引列表中具有所述服务器实时添加的轮播标识。
所述撷取播放模块680,进一步配置于依次根据所述当前索引列表中或者旧索引列表中的播放地址,每次向所述服务器下载一个媒体分片进行播放,如果缓存足够大,可以在播放当前下载的媒体分片的同时下载下一个媒体分片甚至是下两个媒体分片以应付因为网络抖动导致的由服务器获取数据或者更新的索引列表的延迟。
所述记录模块640,进一步配置于在识别到所述旧索引列表中的轮播标识时,不断记录在所述旧索引列表中当前待下载的媒体分片的序列号并覆盖在先的记录,直到丢弃所述旧索引列表时最后记录当前待下载的媒体分片的序列号。
所述第二编排模块660,还配置于比较后判定所述两个序列号相等时,将所述更新的索引列表作为当前索引列表。
以上不足之处参考实施例二和实施例三。
实施例八:
如图10所示,为本申请实施例八的客户端结构图,基于上述实施例,本实施例的所述撷取播放模块680包括:判断模块6801、下载模块6802和生成模块6803。
所述判断模块6801,配置于判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载;若能下载,则将判断结果发送至下载模块;若不能下载,则以所述待下载播放地址的下一个播放地址为新的待下载的播放地址进行判断;
所述下载模块6802,配置于在当前索引列表中的播放地址对应的媒体分片能下载时,根据所述待下载播放地址下载对应的媒体分片,并将下载到的各个媒体分片分别存储在本地磁盘中的指定位置上。
所述生成模块6803,配置于根据下载到的所述媒体分片的指定位置的路径,生成所述媒体的本地索引列表。
下面以播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段为例进行对上述步骤的详细描述,但是本申请并不现定于播放地址是统一资源定位符(URL),索引列表是m3u8文件,媒体分片是视频片段。
判断模块6801配置于判断上述m3u8文件中的待下载URL对应的视频片段能否下载;若能,则将判断结果发送至下载模块;若不能,则以上述待下载URL的下一个URL为新的待下载URL进行判断。
下载模块6802配置于在上述m3u8文件中的待下载URL对应的视频片段能下载时,根据待下载URL下载对应的视频片段,并将下载到的各个视频片段分别存储在本地磁盘中的指定位置上。
判断模块6801先判断m3u8文件中待下载URL对应的视频片段能否下载,如果不能下载,则跳过该视频片段,以上述待下载URL的下一个URL为新的待下载URL进行判断。如果能下载,则由下载模块6802依据该URL下载对应的视频片段。因此,在某一个视频片段下载出错时,也能够跳过该出错的视频片段,继续下载后面的视频片段,从而节约了等待时间,提高了
下载速度。
进一步地,下载模块6802在所有能下载的视频片段下载完成后,下载经判断未能下载的视频片段,以实现对目标视频的完整下载。
生成模块6803配置于根据视频片段所在的指定位置的路径,生成目标视频的本地m3u8文件,以实现后续对目标视频的合成以及播放。
进一步地,下载模块6802还配置于将m3u8文件保存到本地,并在该m3u8文件中标记已完成下载的URL,在重新启动目标视频的下载时,根据本地保存的m3u8文件中未做标记的URL继续下载。通过将m3u8文件保存到本地并标记已完成下载的URL,可以识别该m3u8文件中未下载的视频片段的URL,进而在重新启动下载时,实现继续下载。
由以上描述可以看出,本发明在下载视频的过程中,先判断m3u8文件中待下载URL对应的视频片段能否下载,如果能下载则依据该URL下载对应的视频片段,如果不能下载,则跳过该视频片段,以所述待下载URL的下一个URL为新的待下载URL进行判断。因此,即使在某一个视频片段下载出错时,也可以跳过该出错的视频片段,继续下载下一个视频片段,而后续再下载出错的视频片段时,其故障问题极有可能已经恢复。所以本发明减少了视频下载过程中等待出错视频片段的时间,提高了下载速度。
实施例九
如图11所示,为本申请实施例九的系统架构图,包括:一个或多个客户端700和服务器720,其中,
所述客户端700,包括如图7或者图9中所示出的轮播媒体分片的客户端,参考实施例四和五,在此不再赘述。所述客户端可以是网络电视、平板电脑、个人电脑、网络视频播放机(网络机顶盒)、手机等,本申请并不限于此。
所述服务器720,配置于不断更新索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号。
所述服务器720对于每次更新的索引列表会赋予一个序列号(sequence),
这个序列号等于索引列表中排在首播位的媒体分片的唯一的序列号,排在首播位之后第二位的媒体分片的序列号增加1,排在首播位之后第二位的媒体分片的序列号增加2,按照HLS协议的规定索引列表一般会存有3个播放地址,当然本申请并不限于此。
所述服务器720中保存有直播媒体库、点播媒体库和轮播媒体库,各个库中存放有相应的待播放的媒体分片。例如,轮播资源库中保存有轮播的媒体分片,多个媒体分片按顺序组合在一起播放就构成了一个完整的视频资源,一个完整的视频资源可以是一部电影或者一集电视剧,多个媒体分片组合在一起播放的顺序按每个媒体分片的序列号进行排列。
所述服务器720从轮播媒体库中选取待播放的媒体分片不断生成更新的索引列表时,所述服务器在每次更新的索引列表中实时添加轮播标识,以便客户端在请求到这个轮播列表时可以读取到轮播标识,从而识别出轮播模式从而启动相应操作,在实际应用中,轮播标识用一个符号直接添加在索引列表中的每个播放地址的后面。
以上不足之处参考上述方法实施例以及装置实施例。
应用实例
服务器为某网络视频服务商建立的视频资源的播控服务器,该播控服务器中支持HLS协议,并支持基于HLS协议所做出的如以上实施例所进行的轮播模式配置;客户端为该网络视频服务商推出的某品牌的网络电视机,该网络电视机中安装有以上实施例中所述的各模块。
服务器中保存有直播媒体库、点播媒体库和轮播媒体库,服务器当前正在直播某足球赛事,直播媒体库中保存有根据所述直播赛事实时制作的媒体分片,并通过HLS直播模式提供索引列表,网络电视机正在通过更新该索引列表收看该足球赛事,但是受不良的网络状况影响,该网络电视机无法与服务器保持同步,不断通过丢弃媒体分片从而快速赶上服务器的直播,跳跃的画面给用户的感受非常不好。
用户操作该网络电视机转换频道开始收看某轮播电视剧集ABC。如果不
依靠本申请的方案,轮播该电视剧集ABC时也会出现如直播足球赛事一样的跳跃丢帧的播放画面。但是利用本申请的方案后,首先,服务器以20秒为周期依据该电视剧集ABC的媒体分片不断更新的索引列表,按照HLS协议,当前最新的索引列表1中具有待顺序播放的该电视剧集ABC的三个最新媒体分片的播放地址URL2、URL3、URL4及相应的序列号2、3、4。服务器实时在索引列表1中的播放地址URL后添加轮播标识t。索引列表1序列号(sequence)等于索引列表1中排在首播位的URL2的序列号,后续URL3、URL4顺次加一就可以推测出序列号是3和4。
| Sequence2 |
| URL2-t |
| URL3-t |
| URL4-t |
索引列表1
客户端获取到上述索引列表1,依次根据索引列表1中的播放地址,先向服务器下载URL2-t的媒体分片进行播放,在URL2-t的媒体分片进行播放的同时,客户端再准备向服务器下载URL3-t的媒体分片。另外,客户端在读取到索引列表1中的播放地址时,识别到轮播标识t,知道当前的索引列表是轮播模式,此时需要不断记录在所述旧索引列表中当前待下载的媒体分片的序列号并覆盖在先的记录。客户端在根据索引列表1进行如上操作的同时,还在以10秒为周期向服务器请求更新的索引列表。
服务器依据该电视剧集ABC的媒体分片先后产生了更新的索引列表2、3和4,按照HLS协议,索引列表2中具有待顺序播放的该电视剧集ABC的三个最新媒体分片的播放地址URL3、URL4、URL5及相应的序列号3、4、5;索引列表3中具有待顺序播放的该电视剧集ABC的三个最新媒体分片的播放地址URL4、URL5、URL6及相应的序列号4、5、6;索引列表4中具有待顺序播放的该电视剧集ABC的三个最新媒体分片的播放地址URL5、URL6、URL7及相应的序列号5、6、7。服务器实时在索引列表2、3和4中的播放
地址URL后添加轮播标识t。索引列表2序列号(sequence)等于索引列表2中排在首播位的URL3的序列号,索引列表3序列号(sequence)等于索引列表3中排在首播位的URL4的序列号,索引列表4序列号(sequence)等于索引列表4中排在首播位的URL5的序列号。
| Sequence3 | Sequence4 | Sequence5 |
| URL3-t | URL4-t | URL5-t |
| URL4-t | URL5-t | URL6-t |
| URL5-t | URL6-t | URL7-t |
索引列表2 索引列表3 索引列表4
此时受到网络抖动的影响,客户端没有获取到索引列表2和3,只在稍后获取到了最新的索引列表4,这时按照HLS协议需要丢弃旧索引列表1,在丢弃索引列表1时最后记录的当前待下载的媒体分片URL3的序列号是3。
客户端在读取最新的索引列表4中的播放地址时,识别到轮播标识t,则自动获取最新的索引列表4中排在首播位的媒体分片URL5的序列号5,对在丢弃索引列表1时最后记录的序列号3与索引列表4中排在首播位的序列号5进行比较:
显然序列号3和序列号5不相等且不连续,根据所述两个序列号之间缺少的序列号4以及所记录的序列号3生成相应的媒体分片的增补播放地址。因为URL5的序列号是5,而URL2的序列号是2,因此根据这种规则可以推测出,序列号3的播放地址是URL3,序列号4的播放地址是URL4,URL3和URL4就是增补播放地址。
将所述增补播放地址URL3、URL4以及最新的索引列表4中的播放地址URL5、URL6、URL7,按照相应的序列号进行顺序组合得到当前索引列表,此时当前索引列表中并不遵循HLS协议中只有三个最新媒体分片的播放地址,而是根据实际情况存放相应数量的最新媒体分片的播放地址。
| Sequence5 |
| URL3-t |
| URL4-t |
| URL5-t |
| URL6-t |
| URL7-t |
当前索引列表
客户端依次根据所述当前索引列表中的播放地址,每次向所述服务器下载一个媒体分片进行播放,直到客户端又接收到更新的索引列表。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本发明所提供的一种轮播媒体分片的方法、客户端及系统,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是配置于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。
应用上述技术方案,本申请提供的轮播媒体分片的方法、客户端及系统,
可以保证用户播放媒体的完整性;可以保证客户端不会错过服务器的更新以及不会过于频繁的进行请求从而浪费处理资源;另外可以应付因为网络抖动导致的由服务器获取数据或者更新的索引列表的延迟。
Claims (20)
- 一种轮播媒体分片的方法,其特征在于,包括:获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;获取更新的索引列表并丢弃旧索引列表,记录丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
- 如权利要求1所述的方法,其特征在于,获取所述服务器不断更新的索引列表的操作,进一步包括:以第一时间间隔为周期向所述服务器发出请求以获取所述服务器以第二时间间隔为周期更新的索引列表,其中,所述第一时间间隔小于第二时间间隔。
- 如权利要求1所述的方法,其特征在于,每次更新的索引列表中还具有所述服务器实时添加的轮播标识;所述客户端在识别到所述更新的索引列表中的轮播标识时,记录丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号。
- 如权利要求1所述的方法,其特征在于,判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
- 如权利要求1或4所述的方法,其特征在于,所述依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片的方法包括:判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载:若能下载,根据所述待下载播放地址下载对应的媒体分片,并将下载到的各个媒体分片分别存储在本地磁盘中的指定位置上;若不能下载,以所述待下载播放地址的下一个播放地址为新的待下载的播放地址进行判断。
- 如权利要求5所述的方法,其特征在于,判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载的过程包括:判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片在预定的时间内是否下载完成。
- 如权利要求5所述的方法,其特征在于,所述方法还包括:在所有能下载的媒体分片下载完成后,下载所述不能下载的媒体分片。
- 如权利要求5所述的方法,其特征在于,所述方法还包括:根据下载到的所述媒体分片的指定位置的路径,生成所述媒体的本地索引列表。
- 如权利要求5所述的方法,其特征在于,所述方法还包括:将所述当前索引列表保存到本地,并在所述当前索引列表中标记已完成下载的播放地址,在重新启动所述媒体的下载时,根据本地保存的所述当前索引列表中未做标记的播放地址继续下载。
- 一种在其上记录有配置于执行权利要求1-9中任一项所述方法的程序的计算机可读记录介质。
- 一种轮播媒体分片的客户端,其特征在于,包括:请求模块、解析模块、记录模块、编排模块和撷取播放模块;所述请求模块,配置于向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号;所述解析模块,配置于获取更新的索引列表并丢弃旧索引列表,识别所 述更新的索引列表中排在首播位的媒体分片的序列号;所述记录模块,配置于记录在丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号;所述编排模块,配置于比较后判定所述两个序列号不相等且不连续时,添加所述两个序列号之间所缺少的序列号,根据所述添加的序列号以及所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表;所述撷取播放模块,配置于依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片并进行播放。
- 如权利要求11所述的客户端,其特征在于,所述解析模块配置于以第一时间间隔为周期向所述服务器发出请求以获取所述服务器以第二时间间隔为周期更新的索引列表,其中,所述第一时间间隔小于第二时间间隔。
- 如权利要求11所述的客户端,其特征在于,所述请求模块,配置于向服务器发出请求以获取所述服务器不断更新的索引列表,其中,每次更新的索引列表中还具有所述服务器实时添加的轮播标识;所述客户端在识别到所述更新的索引列表中的轮播标识时,记录丢弃所述旧索引列表时当前待下载的媒体分片的序列号,识别所述更新的索引列表中排在首播位的媒体分片的序列号。
- 如权利要求11所述的客户端,其特征在于,所述编排模块还配置于比较后判定所述两个序列号不相等但连续时,根据所记录的序列号生成相应的媒体分片的增补播放地址,并将所述增补播放地址以及所述更新的索引列表中的播放地址按照相应的序列号进行顺序组合得到当前索引列表,依次根据所述当前索引列表中的播放地址向所述服务器下载相应媒体分片进行播放。
- 如权利要求11所述的客户端,其特征在于,所述撷取播放模块包括判断模块和下载模块,其中,所述判断模块,配置于判断所述当前索引列表中的播放地址中的待下载 播放地址对应的媒体分片能否下载;若能下载,则将判断结果发送至下载模块;若不能下载,则以所述待下载播放地址的下一个播放地址为新的待下载的播放地址进行判断;所述下载模块,配置于在当前索引列表中的播放地址对应的媒体分片能下载时,根据所述待下载播放地址下载对应的媒体分片,并将下载到的各个媒体分片分别存储在本地磁盘中的指定位置上。
- 如权利要求15所述的装置,其特征在于,所述判断模块判断所述当前索引列表中的播放地址中的待下载播放地址对应的媒体分片能否下载的过程包括:判断所述当前索引列表中的待下载播放地址对应的媒体分片在预定的时间内是否下载完成。
- 如权利要求15所述的装置,其特征在于,所述下载模块,进一步配置于在所有能下载的媒体分片下载完成后,下载经判断未能下载的媒体分片。
- 如权利要求15所述的装置,其特征在于,所述撷取播放模块还包括:生成模块,配置于根据下载到的所述媒体分片的指定位置的路径,生成所述媒体的本地索引列表。
- 如权利要求15所述的装置,其特征在于,所述下载模块,进一步配置于将所述当前索引列表保存到本地,并在所述当前索引列表中标记已完成下载的播放地址,在重新启动所述媒体的下载时,根据本地保存的所述当前索引列表中未做标记的播放地址继续下载。
- 一种轮播媒体分片的系统,其特征在于,包括:一个或多个客户端和服务器,其中,所述客户端,包括如权利要求11所述的轮播媒体分片的客户端;所述服务器,配置于不断更新索引列表,其中,每次更新的索引列表中具有待顺序播放的最新的若干媒体分片的播放地址及相应的唯一的序列号。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/102,268 US20170013037A1 (en) | 2013-12-06 | 2014-12-05 | Media fragment rotation method, client and system |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310664166.9 | 2013-12-06 | ||
| CN201310664166.9A CN103685264A (zh) | 2013-12-06 | 2013-12-06 | 轮播媒体分片的方法、客户端及系统 |
| CN201310665514.4 | 2013-12-09 | ||
| CN201310665514.4A CN103702176B (zh) | 2013-12-09 | 2013-12-09 | 一种基于hls协议的视频下载方法及其装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2015081893A1 true WO2015081893A1 (zh) | 2015-06-11 |
Family
ID=53272915
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2014/093188 Ceased WO2015081893A1 (zh) | 2013-12-06 | 2014-12-05 | 一种轮播媒体分片的方法、客户端及系统 |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US20170013037A1 (zh) |
| WO (1) | WO2015081893A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106131588A (zh) * | 2016-07-12 | 2016-11-16 | 乐视控股(北京)有限公司 | 一种轮播台多媒体节目的点播方法和装置 |
| CN109756757A (zh) * | 2019-03-21 | 2019-05-14 | 北京数码视讯软件技术发展有限公司 | 直播数据处理方法及装置、直播方法及装置和直播服务器 |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106790337B (zh) * | 2015-11-25 | 2020-05-19 | 腾讯科技(深圳)有限公司 | 信息推送方法和装置 |
| US11265586B2 (en) * | 2019-05-06 | 2022-03-01 | Apple Inc. | Skipping segments in playlists |
| CN113159851A (zh) * | 2021-04-27 | 2021-07-23 | 北京梯影传媒科技有限公司 | 轮播广告排序方法及装置 |
| US20240129558A1 (en) * | 2022-09-14 | 2024-04-18 | Vuerz, Llc | Systems and methods for live and pre-recording broadcasting |
| CN115714766B (zh) * | 2022-11-08 | 2025-07-22 | 北京奇艺世纪科技有限公司 | 一种文件转换方法、系统、装置及电子设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101662654A (zh) * | 2008-08-26 | 2010-03-03 | 华为技术有限公司 | 基于ims的网络电视系统及该系统的实现方法和装置 |
| CN101860558A (zh) * | 2009-04-13 | 2010-10-13 | 中国网通集团宽带业务应用国家工程实验室有限公司 | 跨区域对等网络流媒体点播方法及系统 |
| CN101877722A (zh) * | 2010-06-22 | 2010-11-03 | 中兴通讯股份有限公司 | 电子节目指南系统及文件下载方法 |
| CN101997890A (zh) * | 2009-08-28 | 2011-03-30 | 中国移动通信集团公司 | 一种p2p流媒体下载方法、系统及装置 |
| CN103685264A (zh) * | 2013-12-06 | 2014-03-26 | 乐视致新电子科技(天津)有限公司 | 轮播媒体分片的方法、客户端及系统 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8533489B2 (en) * | 2010-09-29 | 2013-09-10 | Microsoft Corporation | Searchable symmetric encryption with dynamic updating |
| WO2013066131A2 (ko) * | 2011-11-03 | 2013-05-10 | 엘지전자 주식회사 | 이종 네트워크에서 개인 네트워크 사용정보에 기반한 pn 설정 방법 |
| US9413801B2 (en) * | 2012-06-28 | 2016-08-09 | Adobe Systems Incorporated | Media stream index merging |
-
2014
- 2014-12-05 US US15/102,268 patent/US20170013037A1/en not_active Abandoned
- 2014-12-05 WO PCT/CN2014/093188 patent/WO2015081893A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101662654A (zh) * | 2008-08-26 | 2010-03-03 | 华为技术有限公司 | 基于ims的网络电视系统及该系统的实现方法和装置 |
| CN101860558A (zh) * | 2009-04-13 | 2010-10-13 | 中国网通集团宽带业务应用国家工程实验室有限公司 | 跨区域对等网络流媒体点播方法及系统 |
| CN101997890A (zh) * | 2009-08-28 | 2011-03-30 | 中国移动通信集团公司 | 一种p2p流媒体下载方法、系统及装置 |
| CN101877722A (zh) * | 2010-06-22 | 2010-11-03 | 中兴通讯股份有限公司 | 电子节目指南系统及文件下载方法 |
| CN103685264A (zh) * | 2013-12-06 | 2014-03-26 | 乐视致新电子科技(天津)有限公司 | 轮播媒体分片的方法、客户端及系统 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106131588A (zh) * | 2016-07-12 | 2016-11-16 | 乐视控股(北京)有限公司 | 一种轮播台多媒体节目的点播方法和装置 |
| CN109756757A (zh) * | 2019-03-21 | 2019-05-14 | 北京数码视讯软件技术发展有限公司 | 直播数据处理方法及装置、直播方法及装置和直播服务器 |
| CN109756757B (zh) * | 2019-03-21 | 2021-07-13 | 北京数码视讯软件技术发展有限公司 | 直播数据处理方法及装置、直播方法及装置和直播服务器 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20170013037A1 (en) | 2017-01-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6852121B2 (ja) | シグナリング又はブロック生成を用いた拡張ブロック−要求ストリーミングシステム | |
| CN102238419B (zh) | 播放实况内容的方法和装置 | |
| WO2015081893A1 (zh) | 一种轮播媒体分片的方法、客户端及系统 | |
| RU2543568C2 (ru) | Плавная потоковая передача клиентского мультимедиа без фиксации состояния | |
| CN109729371B (zh) | 一种基于hls协议多级管理的直播时移系统及方法 | |
| CN103475932B (zh) | 网络视频的无缝在线播放方法及装置、网络电视系统 | |
| CN103685264A (zh) | 轮播媒体分片的方法、客户端及系统 | |
| CN106412677B (zh) | 一种回放视频文件的生成方法和装置 | |
| WO2016029804A1 (zh) | 一种视频播放方法、媒体设备、播放设备以及多媒体系统 | |
| CN102761524B (zh) | 一种流媒体存储、播放方法及相应系统 | |
| CN103686245B (zh) | 一种基于hls协议的点播与直播切换方法和装置 | |
| CN102487458A (zh) | Ts文件的播放处理方法及装置 | |
| CN106791994B (zh) | 一种低延时快速开播方法及装置 | |
| WO2019119633A1 (zh) | 直播视频的转码装置、方法及计算机可读存储介质 | |
| WO2018028547A1 (zh) | 频道切换的方法及装置 | |
| CN106998478B (zh) | 一种用于智能电视当前播放列表的偏移校正方法和装置 | |
| CN106658150B (zh) | 一种实现回看处理的方法及装置 | |
| JP6589879B2 (ja) | 受信装置、送信装置、およびデータ処理方法 | |
| CN101459976B (zh) | 一种流媒体播放控制方法、设备及系统 | |
| KR101397183B1 (ko) | 스트리밍 서비스에서의 재생 목록 파일 관리 방법 및 그 장치 | |
| CN103248912B (zh) | 网络电视时移播放方法、网络电视系统和装置 | |
| CN102594773B (zh) | 一种实现数据获取的方法和系统 | |
| WO2011137681A1 (zh) | Iptv系统中时移分片文件的归档及节目播放方法和设备 | |
| CN105635753A (zh) | 媒体数据的下载方法和装置 | |
| CN106982376A (zh) | 一种多媒体内容个性化呈现的时间线控制方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14868659 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 15102268 Country of ref document: US |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 14868659 Country of ref document: EP Kind code of ref document: A1 |