CN105635753B - The method for down loading and device of media data - Google Patents

The method for down loading and device of media data Download PDF

Info

Publication number
CN105635753B
CN105635753B CN201510312722.5A CN201510312722A CN105635753B CN 105635753 B CN105635753 B CN 105635753B CN 201510312722 A CN201510312722 A CN 201510312722A CN 105635753 B CN105635753 B CN 105635753B
Authority
CN
China
Prior art keywords
segment
streaming media
file
address information
information
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.)
Active
Application number
CN201510312722.5A
Other languages
Chinese (zh)
Other versions
CN105635753A (en
Inventor
曾志荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Dongjing Computer Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Dongjing Computer Technology Co Ltd filed Critical Guangzhou Dongjing Computer Technology Co Ltd
Priority to CN201510312722.5A priority Critical patent/CN105635753B/en
Publication of CN105635753A publication Critical patent/CN105635753A/en
Application granted granted Critical
Publication of CN105635753B publication Critical patent/CN105635753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/23605Creation or processing of packetized elementary streams [PES]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/637Control signals issued by the client directed to the server or network components

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a kind of method for down loading of media data and devices, the method re-replaces download address when certain TS segment failed downloads in Streaming Media, and the TS segment of failed download is re-downloaded, without re-downloading entire Streaming Media, to save time and bandwidth resources.And in the case where still failed download after wherein a part of TS segment continues downloading, if the TS segment of failed download meets and preset abandons downloading condition, that is the ornamental continuity of the missing streaming media of the TS segment does not impact, or it influences smaller, in this case, it abandons downloading this part TS segment, to improve the downloading success rate of Streaming Media and the ornamental experience of user.

Description

The method for down loading and device of media data
Technical field
The present invention relates to Internet technical fields, more particularly to the method for down loading and device of media data.
Background technique
With the rapid development of Internet technology, network video colourful shows content, great convenience with its People's lives, and people's study, social and amusement and recreation are increasingly becoming without alternative important way.Especially with Intelligent mobile terminal it is widely available, make that people can be convenient by the various terminal equipments such as mobile phone, PDA, tablet computer Browser access major video website, watch favorite video resource.The video that major video website provides at present is mostly base In the m3u8 format of HLS (HTTP Live Streaming) streaming media playing agreement.
The feature of HLS protocol maximum is to have used stream cutting technique, the files in stream media such as video, audio is cut into multiple TS segment (or being TS fragment file) is stored respectively, then establishes a m3u8 corresponding with the multiple TS segment File is described, the information such as storage address, clip durations, the playing sequence of each TS segment are described in the m3u8 file. The storage address of client TS segment according to described in m3u8 carries out serial or batch parallel progressive download, and according to institute It states clip durations and playing sequence plays out.The design makes Streaming Media that fragmentation transmission may be implemented, and is conducive to make full use of Network performance.
Major video website often changes several TS in Streaming Media for video copy or otherwise consideration The storage address or streaming media of segment are cut again, are stored, this may make certain TS segments in Streaming Media due to original Download address fails and failed download, causes Streaming Media can not normal play.In failed download, client can generally taste again The Streaming Media is downloaded in examination.Even need repeated downloads repeatedly could will be under whole TS segments downloadings of Streaming Media sometimes Come, downloading success rate is low, also reduces the ornamental experience of user.
Summary of the invention
The embodiment of the invention provides a kind of method for down loading of media data and devices, for downloading the stream matchmaker of m3u8 format Volume data, downloading success rate is low when solving to download the Streaming Media of m3u8 format in the prior art, influences the ornamental experience of user Problem.
In order to solve the above-mentioned technical problem, the embodiment of the invention discloses following technical solutions:
On the one hand, the present invention provides the method for down loading of media data, the method is used to download the stream matchmaker of m3u8 format Volume data, which comprises
If the TS segment failed download for the first number that Streaming Media includes, obtains the TS segment of first number Newly downloaded address information, and continue according to the newly downloaded address information to download the TS segment of first number;
After continuing downloading, if still there is the TS segment downloading of the second number to lose in the TS segment of first number It loses, and the TS segment of second number meets the preset TS piece abandoned downloading condition, then abandon downloading second number Section.
Preferably, whether the TS segment for judging second number meets preset downloading condition of abandoning and includes:
If the segment number of the TS segment of second number is less than the first preset number, and second number The total duration of TS segment is less than the first preset duration.
Preferably, the method also includes:
The broadcasting of the Streaming Media is established according to segment number, corresponding duration and the indexed sequential of downloading successful TS segment End m3u8 describes file;
File, which is described, according to the broadcasting end m3u8 plays the Streaming Media.
Preferably, the newly downloaded address information of the TS segment for obtaining first number includes:
Obtain the newly downloaded address information of the Streaming Media;
File is described according to the new m3u8 that the newly downloaded address information obtains the Streaming Media;
The newly downloaded address information that the TS segment of the first number described in file acquisition is described according to the new m3u8, according to institute State the TS segment of the first number newly downloaded address information replace first number TS segment former download address information.
Preferably, the newly downloaded address information for obtaining the Streaming Media includes:
The address of the same Streaming Media to match with the effective information of the Streaming Media is obtained on default Streaming Media website Information, the newly downloaded address information of the as described Streaming Media, the effective information include the duration information of the Streaming Media, and/ Or the web page address information and/or the Streaming Media where the Streaming Media address information and/or the Streaming Media name Claim.
Preferably, the newly downloaded address of the TS segment that the first number described in file acquisition is described according to the new m3u8 Information includes:
If the new m3u8 describes the TS piece segment information for including in file and the former m3u8 of the Streaming Media describes file In include correspondence TS piece segment information belong to same TS segment, then the TS that the first number is obtained in file is described in the new m3u8 The newly downloaded address information of segment.
Preferably, the new m3u8 describes the former m3u8 description text of the TS piece segment information for including in file and the Streaming Media The correspondence TS piece segment information for including in part belongs to same TS segment and includes:
The new m3u8 describes the segment number for the TS segment for including in file and the former m3u8 description text of the Streaming Media The segment number for the TS segment for including in part is equal, and
The new m3u8 describes the duration for the TS segment for including in file and the former m3u8 of the Streaming Media is described in file The duration for the correspondence TS segment for including is equal.
On the other hand, the present invention provides the download apparatus of media data, described device is used to download the stream of m3u8 format Media data, described device include:
Acquiring unit, if the TS segment failed download for the first number for including for Streaming Media, obtains described first The download address information of the TS segment of number, and continue according to the newly downloaded address information to download the TS piece of first number Section;
Execution unit, for after continuing downloading, if still having the second number in the TS segment of first number TS segment failed download, and the TS segment of second number meet it is preset abandon downloading condition, then abandon described in downloading The TS segment of second number.
Preferably, the execution unit includes:
First confirmation subelement, if the segment number of the TS segment for second number is less than the first present count Mesh, and the total duration of the TS segment of second number is less than the first preset duration, it is determined that the TS piece of second number Section, which meets, preset abandons downloading condition.
Preferably, described device further include:
Unit is established, for establishing institute according to segment number, corresponding duration and the indexed sequential of downloading successful TS segment The broadcasting end m3u8 for stating Streaming Media describes file;
Broadcast unit plays the Streaming Media for describing file according to the broadcasting end m3u8.
Preferably, the acquiring unit includes:
First obtains subelement, for obtaining the newly downloaded address information of the Streaming Media;
Second obtains subelement, and the new m3u8 for obtaining the Streaming Media according to the newly downloaded address information describes text Part;
Third obtain subelement, for described according to the new m3u8 the first number described in file acquisition TS segment it is new Download address information;
Subelement is replaced, the newly downloaded address information replacement described first for the TS segment according to first number counts The former download address information of purpose TS segment.
Preferably, the newly downloaded address information for obtaining the Streaming Media includes:
The address of the same Streaming Media to match with the effective information of the Streaming Media is obtained on default Streaming Media website Information, the newly downloaded address information of the as described Streaming Media, the effective information include the duration information of the Streaming Media, and/ Or the web page address information and/or the Streaming Media where the Streaming Media address information and/or the Streaming Media name Claim.
Preferably, it includes: the second confirmation subelement that the third, which obtains subelement, is used for:
If the former m3u8 of segment number and the Streaming Media that the new m3u8 describes the TS segment for including in file is retouched The segment number for stating the TS segment for including in file is equal, and
The new m3u8 describes the duration for the TS segment for including in file and the former m3u8 of the Streaming Media is described in file The duration for the correspondence TS segment for including is equal, then confirms that the new m3u8 describes the TS piece segment information for including in file and the stream The correspondence TS piece segment information that the former m3u8 of media describes to include in file belongs to same TS segment.
The method for down loading of above-mentioned media data and the technical solution of device, if the TS piece for the first number that Streaming Media includes Section failed download, then obtain the download address information of the TS segment of first number, and according to the newly downloaded address information Continue to download the TS segment of first number;If the TS segment of the second number in the TS segment of first number is still Failed download, and the TS segment of second number meet it is preset abandon downloading condition, then abandon downloading second number Purpose TS segment.
This programme re-replaces download address when certain TS segment failed downloads in Streaming Media, by failed download TS segment re-downloads, without re-downloading entire Streaming Media, to save time and bandwidth resources.And a part of TS wherein Segment continues after downloading still in the case where failed download, if the TS segment of failed download meets and preset abandons lower carrier strip The ornamental continuity of part, i.e. the missing streaming media of the TS segment does not impact, or influence is smaller, in this case, puts Downloading this part TS segment is abandoned, to improve the downloading success rate of Streaming Media and the ornamental experience of user.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, for those of ordinary skill in the art Speech, without any creative labor, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of one embodiment of the method for down loading of media data of the present invention;
Fig. 2 is that the m3u8 of Streaming Media describes a schematic diagram of file;
Fig. 3 is that the new m3u8 of Streaming Media describes a schematic diagram of file;
Fig. 4 is the structural schematic diagram of one embodiment of the download apparatus of media data of the present invention;
Fig. 5 is the structural schematic diagram of the acquiring unit in another embodiment of the download apparatus of media data of the present invention.
Specific embodiment
The embodiment of the method for down loading of media data of the present invention is illustrated first, is media number of the present invention referring to Fig. 1 According to method for down loading one embodiment flow diagram, the method is used to download HD video, the audio of m3u8 format Equal stream medium datas.The present embodiment includes the following steps 101 and step 102:
Step 101: if the TS segment failed download for the first number that Streaming Media includes, obtaining the TS of first number The newly downloaded address information of segment, and continue according to the newly downloaded address information to download the TS segment of first number.
In the downloading process of Streaming Media, a main cause of TS segment failed download is exactly that the m3u8 of Streaming Media is retouched State file failure, TS segment download address therein also corresponding failure.In downloading process, for example according to the prompt information of pop-up The similar informations such as " failure of video source file address " or " error of video source file address ", or it is opposite with this event of address failure The prompt code answered, it can the reason of determining failed download is that file failure is described due to currently used m3u8.Further The TS segment of failed download can be determined by the intermediate file of other prompt informations or generation for generating in downloading.
When downloading Streaming Media, if due to the m3u8 of the Streaming Media describe file failure and cause include in the Streaming Media Several TS segments (i.e. the TS segment of the first number) failed download, then can to the website where the Streaming Media apply obtain again It takes the new m3u8 of the Streaming Media to describe file, and believes from the address of the new m3u8 TS segment for describing to obtain failed download in file Breath, replacement continue to download the TS segment into former download path.
Alternatively, other downloading resources of the Streaming Media can also be searched from the Streaming Media of other on internet website, and The download address information that the TS segment of failed download is obtained from other downloading resources, under after the replacement of the TS segment Set address information.
Step 102: after continuing downloading, if still there is the TS segment of the second number in the TS segment of first number Failed download, and the TS segment of second number meet it is preset abandon downloading condition, then abandon downloading second number TS segment.
If still some TS segment (i.e. the TS segment of the second number) failed download is then sentenced after continuing downloading Break this part failed download TS segment whether can abandon downloading, abandon downloading condition be this part of failed download TS segment accounts for the sub-fraction of entire Streaming Media, influences in viewing on the ornamental experience of user smaller.If abandoning downloading, Part TS segment will be skipped when playing the Streaming Media.Wherein, the first number is more than or equal to the second number.
The present embodiment re-replaces download address when certain TS segment failed downloads in Streaming Media, by failed download TS segment re-download, without re-downloading entire Streaming Media, to save time and bandwidth resources;And it is a part of wherein TS segment continues after downloading still in the case where failed download, if the TS segment of failed download meets and preset abandons lower carrier strip The ornamental continuity of part, i.e. the missing streaming media of the TS segment does not impact, or influence is smaller, in this case, puts Downloading this part TS segment is abandoned, to improve the downloading success rate of Streaming Media and the ornamental experience of user.
It in other embodiments of the invention, specifically can be according to the segment of the TS segment of the second number in above-mentioned steps 102 Information of number and/or clip durations information come judge its whether meet it is preset abandon downloading condition, for example, following two can be passed through Item judgement:
A): judging the segment number of the TS segment of second number whether less than the first preset number;
B): judging the total duration of the TS segment of second number whether less than the first preset duration;
If above-mentioned, a), b) two judging results are to be, it is preset to determine that the TS segment of second number meets Abandon downloading condition.
It optionally, can also be by judging to download whether successfully that a part of TS segment meets accordingly in the Streaming Media Preset condition, to judge whether the TS segment of the second number of the failed download can be abandoned downloading indirectly.
Preferably, in other embodiments of the invention, after abandoning downloading the TS segment of second number, in order to just The broadcasting Streaming Media that can be smooth in the player of client, can delete the m3u8 for playing the Streaming Media and describe file In include the second number TS segment information so that player is when describing file playing stream media according to the m3u8, from It is dynamic to skip part TS segment, continue other TS segments of played in order.
Alternatively, client can also be timely according to the number for downloading successful TS segment when needing to play the Streaming Media Long, available m3u8 describes file when being spliced into local play again.Specific method is, according to the piece for downloading successful TS segment The broadcasting end m3u8 that number of segment mesh, corresponding duration and indexed sequential establish the Streaming Media describes file;And according to the broadcasting end M3u8 describes file and plays the Streaming Media.
It in other embodiments of the invention, can be with specific reference to following sub-step 1011 to 1014 in above-mentioned steps 101 Obtain the download address information of the TS segment of first number:
Step 1011: obtaining the newly downloaded address information of the Streaming Media.
Specifically Streaming Media to be downloaded can be utilized according to source server or the similar information collecting server for taking off worm program is taken off Key message, the address of web page address information and/or the Streaming Media where such as duration information and/or the Streaming Media The name information of information and/or the Streaming Media is found the data source of the Streaming Media on major Streaming Media website, is being found When, target data source is matched or calibrated with above-mentioned key message, to determine whether it is same with Streaming Media to be downloaded One Streaming Media, if successful match, the address information of the target data source be the Streaming Media to be downloaded newly downloadedly Location information.
Step 1012: file is described according to the new m3u8 that the newly downloaded address information obtains the Streaming Media.
Step 1013: the newly downloaded address letter of the TS segment of the first number described in file acquisition is described according to the new m3u8 Breath.
Step 1014: the TS of first number is replaced according to the newly downloaded address information of the TS segment of first number The former download address information of segment.
With reference to background technique it is found that sometimes server may cut again Streaming Media, it is also possible to not cut again It cuts, and is only updated the download address information of certain TS segments therein.If it is the first situation, due to again Cutting, the TS that the TS segment and the Streaming Media to be downloaded for causing the Streaming Media of other loading sources obtained on the net to include include Segment is different, therefore possibility can not in the Streaming Media of other loading sources for the TS segment of the first number of failed download Accurately match.And it then can guarantee the complete phase of TS segment that the Streaming Media of other loading sources is included in the latter case Together, it can just describe to get the TS with the first number in file from the m3u8 of the Streaming Media of other loading sources in this case The download address information for the TS segment that segment matches completely, and by the download address change dump into former download path, after The continuous TS segment for downloading first number.
In practical applications, due to m3u8 describe the download address in file failure frequency it is very high, repeat Using the method for preset one or many above-mentioned steps 101, i.e., repeatedly replace the address information of the TS segment of failed download.
In other embodiments of the invention, it in above-mentioned steps 1013, can be obtained with specific reference to following steps c) and d) The newly downloaded address information of the TS segment of first number:
C): judging that the new m3u8 describes the m3u8 of the TS piece segment information for including in file and the Streaming Media to be downloaded and retouches State whether the correspondence TS piece segment information for including in file belongs to same TS segment, if so, thening follow the steps d).
D): the newly downloaded address information that the TS segment of first number is obtained in file is described in the new m3u8.
If the new m3u8 describes the TS piece segment information of the arbitrary number in file and the m3u8 of Streaming Media to be downloaded The TS piece segment information of reference numeral in description file belongs to the same TS segment, then it is believed that the new m3u8 is described in file The TS piece segment information for including belongs to same TS piece with the m3u8 of the Streaming Media corresponding TS piece segment information for describing to include in file Section.
More specifically, above-mentioned steps c) may also comprise following two and judge c1) and c2):
C1): judge the new m3u8 describe the TS piece segment information for including in file quantity and the Streaming Media to be downloaded M3u8 describe the TS piece segment information for including in file quantity it is whether equal.
C2): judging that the new m3u8 describes the m3u8 of the TS clip durations for including in file Yu the Streaming Media to be downloaded Whether the duration for the correspondence TS segment for including in description file is equal.
If above-mentioned c1) and c2) two judging results be it is equal, determine that the new m3u8 describes to include in file TS piece segment information belongs to same TS segment with the m3u8 of the Streaming Media corresponding TS piece segment information for describing to include in file.
For example, the m3u8 for being illustrated in figure 2 a streaming media video to be downloaded describes the schematic diagram of file, description text Entitled " video.m3u8 " of part, by the quantity, duration and each section of TS segment that can get the TS segment that the video includes in Fig. 2 Download address information.
The video is made of 11 TS segments, and " #EXTINF " subsequent number indicates the duration of corresponding TS segment, is write from memory Recognizing unit is " second ", and then the next section of storage address for the TS segment, in normally creation downloading task, can be retouched from m3u8 It states in file, reads the address, and corresponding TS segment is downloaded according to the address.
Assuming that in downloading, the 5th to 11 totally 7 TS segment failed downloads are then obtained according to the method in above-described embodiment The new m3u8 for getting the Streaming Media describes file as shown in figure 3, for " video_new.m3u8 ", by retouching with " video.m3u8 " File to be stated to compare it is found that the number for the TS segment that two description files include all is 11, the duration of each TS segment is equal to each other, All it is { 8,3,3,3,9,9,9,10,10,10,10 } that unit is " second ", then can confirms the TS for including in " video.m3u8 " The corresponding TS piece segment information for including in piece segment information and " video_new.m3u8 " belongs to same TS segment.
, specifically can be according to following steps d1 in above-mentioned steps d)) and d2) describe to obtain institute in file from the new m3u8 State the newly downloaded address information of the TS segment of the first number:
D1): the address information for obtaining the TS segment of first number describes file in the m3u8 of Streaming Media to be downloaded In index position information.
D2): being described to obtain the TS with first number in file from the new m3u8 according to the index position information The download address information of segment.
If the judging result of above-mentioned steps c) is "Yes", illustrate that the new m3u8 describes file and stream matchmaker to be downloaded The TS segment that the m3u8 of body describes File Mapping is consistent, therefore the download address information in the TS segment of first number It is also the same in the index position information that two describe in files, therefore can be under the TS segment according to first number Set address information describes the index position information in file in the m3u8 of Streaming Media to be downloaded and describes file from the new m3u8 In get the newly downloaded address information that the TS segment of first number matches.
Still by taking above-mentioned Fig. 2 and m3u8 shown in Fig. 3 describe file as an example, from description file " video_new.m3u8 " in from The download address of 5th to 11 TS segment is read out, and replaces with the address the 5th to the 11st in former downloading task The raw address of TS segment continues to download the video, and original is downloaded successful TS segment (the 1st to the 4th) and can be reused, no longer needs to down It carries.
Corresponding with the embodiment of the method for down loading of above-mentioned media data, the present invention also provides carry under media data The embodiment set is referring to fig. 4 the structural schematic diagram of one embodiment of the download apparatus of media data of the present invention, the dress Setting includes: acquiring unit 401, execution unit 402.
Wherein, the acquiring unit 401, if the TS segment failed download for the first number for including for Streaming Media, The newly downloaded address information of the TS segment of first number is obtained, and is continued described in downloading according to the newly downloaded address information The TS segment of first number;
Execution unit 402, for after continuing downloading, if still having the second number in the TS segment of first number TS segment failed download, and the TS segment of second number whether meet it is preset abandon downloading condition, then abandon downloading The TS segment of second number.
Preferably, the execution unit 402 includes: the first confirmation subelement (not shown), is used for:
If the segment number of the TS segment of second number is less than the first preset number, and second number The total duration of TS segment is less than the first preset duration, it is determined that the TS segment of second number, which meets, preset abandons lower carrier strip Part.
Preferably, described device further include:
Unit 403 is established, for establishing according to segment number, corresponding duration and the indexed sequential of downloading successful TS segment The broadcasting end m3u8 of the Streaming Media describes file;
Broadcast unit 404 plays the Streaming Media for describing file according to the broadcasting end m3u8.
As shown in figure 5, the structural schematic diagram of the acquiring unit 401 for the device of downloading Streaming Media, the acquiring unit 401 Include:
First obtains subelement 4011, for obtaining the newly downloaded address information of the Streaming Media;
Second obtains subelement 4012, and the new m3u8 for obtaining the Streaming Media according to the newly downloaded address information is retouched State file;
Third obtains subelement 4013, for describing the TS segment of the first number described in file acquisition according to the new m3u8 Newly downloaded address information;
Subelement 4014 is replaced, for the newly downloaded address information replacement according to the TS segment of first number described the The former download address information of the TS segment of one number.
Preferably, the first acquisition subelement 4011 is specifically used for:
The address of the same Streaming Media to match with the effective information of the Streaming Media is obtained on default Streaming Media website Information, the newly downloaded address information of the as described Streaming Media, the effective information include the duration information of the Streaming Media, and/ Or the web page address information and/or the Streaming Media where the Streaming Media address information and/or the Streaming Media name Claim.
Preferably, the third obtains subelement 4013 and is specifically used for:
If the new m3u8 describes the TS piece segment information for including in file and the m3u8 of the Streaming Media is described in file The correspondence TS piece segment information for including belongs to same TS segment, then describes to obtain first number in file in the new m3u8 The newly downloaded address information of TS segment.
Preferably, it includes: the second confirmation subelement (not shown) that the third, which obtains subelement, is used for:
If the former m3u8 of segment number and the Streaming Media that the new m3u8 describes the TS segment for including in file is retouched The segment number for stating the TS segment for including in file is equal, and
The new m3u8 describes the duration for the TS segment for including in file and the former m3u8 of the Streaming Media is described in file The duration for the correspondence TS segment for including is equal.
Then confirm that the new m3u8 describes the former m3u8 description text of the TS piece segment information for including in file and the Streaming Media The correspondence TS piece segment information for including in part belongs to same TS segment.
Above-described embodiment of the present apparatus re-replaces download address when certain TS segment failed downloads in Streaming Media, The TS segment of failed download is re-downloaded, without re-downloading entire Streaming Media, to save time and bandwidth resources.And A portion TS segment continues after downloading still in the case where failed download, if the TS segment of failed download meet it is preset Downloading condition is abandoned, i.e. the ornamental continuity of the missing streaming media of the TS segment does not impact, or influence is smaller, this In the case of, it abandons downloading this part TS segment, to improve the downloading success rate of Streaming Media and the ornamental experience of user.
It is required that those skilled in the art can be understood that the technology in the embodiment of the present invention can add by software The mode of common hardware realize that common hardware includes universal integrated circuit, universal cpu, general-purpose storage, universal elements Deng, naturally it is also possible to it by specialized hardware include specific integrated circuit, dedicated cpu, private memory, special components and parts etc. come real It is existing, but the former is more preferably embodiment in many cases.Based on this understanding, the technical solution sheet in the embodiment of the present invention The part that contributes to existing technology can be embodied in the form of software products in other words in matter, which produces Product can store in storage medium, as read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk, CD etc., including some instructions are used so that computer equipment (can be People's computer, server or network equipment etc.) it executes described in certain parts of each embodiment of the present invention or embodiment Method.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device and For system embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to method The part of embodiment illustrates.
The above is only the specific embodiment of the application, is made skilled artisans appreciate that or realizing this Shen Please.Various modifications to these embodiments will be apparent to one skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (8)

1. a kind of method for down loading of media data, the method is used to download the stream medium data of m3u8 format, which is characterized in that The described method includes:
If the TS segment failed download for the first number that Streaming Media includes, the newly downloaded of the TS segment of first number is obtained Address information, and continue according to the newly downloaded address information to download the TS segment of first number;Wherein, described the is obtained The newly downloaded address information of the TS segment of one number includes obtaining the newly downloaded address information of the Streaming Media;According to it is described it is new under The new m3u8 of Streaming Media described in set address acquisition of information describes file;The first number described in file acquisition is described according to the new m3u8 The newly downloaded address information of purpose TS segment;According to the newly downloaded address information of the TS segment of first number replacement described the The former download address information of the TS segment of one number;
After continuing downloading, if still there is the TS segment failed download of the second number in the TS segment of first number, and The TS segment of second number meets the preset TS segment abandoned downloading condition, then abandon downloading second number;Its In, it is described preset to abandon downloading condition are as follows: the segment number of the TS segment of second number less than the first preset number, and And the total duration of the TS segment of second number is less than the first preset duration;
Delete the Streaming Media broadcasting end m3u8 describe second number for including in file TS segment information or
The broadcasting end of the Streaming Media is established according to segment number, corresponding duration and the indexed sequential of downloading successful TS segment M3u8 describes file;
File, which is described, according to the broadcasting end m3u8 plays the Streaming Media.
2. the method according to claim 1, wherein the newly downloaded address information packet for obtaining the Streaming Media It includes:
The address information of the same Streaming Media to match with the effective information of the Streaming Media is obtained on default Streaming Media website, The newly downloaded address information of the as described Streaming Media;The effective information includes the duration information of the Streaming Media and/or described The address information of web page address information and/or the Streaming Media where Streaming Media and/or the title of the Streaming Media.
3. the method according to claim 1, wherein described describe described in file acquisition according to the new m3u8 The newly downloaded address information of the TS segment of one number includes:
If the new m3u8 describes the TS piece segment information for including in file and the former m3u8 of the Streaming Media describes to wrap in file The correspondence TS piece segment information contained belongs to same TS segment, then describes the TS that first number is obtained in file in the new m3u8 The newly downloaded address information of segment.
4. according to the method described in claim 3, it is characterised by comprising:
If the former m3u8 of segment number and the Streaming Media that the new m3u8 describes the TS segment for including in file describes file In include TS segment segment number it is equal, and the new m3u8 describe the duration of the TS segment for including in file with it is described The duration that the former m3u8 of Streaming Media describes the correspondence TS segment for including in file is equal, then the new m3u8 describe include in file TS piece segment information belong to same TS segment with the former m3u8 of the Streaming Media corresponding TS piece segment information for describing to include in file.
5. a kind of download apparatus of media data, described device is used to download the stream medium data of m3u8 format, which is characterized in that Described device includes:
Acquiring unit obtains first number if the TS segment failed download for the first number for including for Streaming Media The newly downloaded address information of TS segment, and continue according to the newly downloaded address information to download the TS segment of first number; Wherein, acquiring unit includes: the first acquisition subelement, for obtaining the newly downloaded address information of the Streaming Media;Second Subelement is obtained, the new m3u8 for obtaining the Streaming Media according to the newly downloaded address information describes file;Third obtains Subelement, the newly downloaded address information of the TS segment for describing the first number described in file acquisition according to the new m3u8;More Subelement is changed, the TS segment of first number is replaced for the newly downloaded address information according to the TS segment of first number Former download address information;
Execution unit, for after continuing downloading, if still there is the TS piece of the second number in the TS segment of first number Section failed download, and the TS segment of second number meet it is preset abandon downloading condition, then abandon downloading described second The TS segment of number;The execution unit includes: the first confirmation subelement, is used for:
If the segment number of the TS segment of second number is less than the first preset number, and the TS piece of second number The total duration of section then confirms that the TS segment of second number meets and preset abandons downloading condition less than the first preset duration; Further include:
Unit is established, for establishing the stream according to segment number, corresponding duration and the indexed sequential of downloading successful TS segment The broadcasting end m3u8 of media describes file;
Broadcast unit plays the Streaming Media for describing file according to the broadcasting end m3u8.
6. device according to claim 5, which is characterized in that described first obtains subelement, is specifically used for:
The address information of the same Streaming Media to match with the effective information of the Streaming Media is obtained on default Streaming Media website, The newly downloaded address information of the as described Streaming Media, the effective information include the duration information of the Streaming Media and/or described The address information of web page address information and/or the Streaming Media where Streaming Media and/or the title of the Streaming Media.
7. device according to claim 5, which is characterized in that the third obtains subelement and is used for:
If the new m3u8 describes the TS piece segment information for including in file and the former m3u8 of the Streaming Media describes to wrap in file The correspondence TS piece segment information contained belongs to same TS segment, then describes the TS that first number is obtained in file in the new m3u8 The newly downloaded address information of segment.
8. device according to claim 5, which is characterized in that it includes: that the second confirmation is single that the third, which obtains subelement, Member is used for:
If the new m3u8 describes the segment number for the TS segment for including in file and the former m3u8 description text of the Streaming Media The segment number for the TS segment for including in part is equal, and
The new m3u8 describes the duration for the TS segment for including in file and describes with the former m3u8 of the Streaming Media Correspondence TS segment duration it is equal, then confirm that the new m3u8 describes the TS piece segment information for including in file and the Streaming Media The former m3u8 correspondence TS piece segment information that describes to include in file belong to same TS segment.
CN201510312722.5A 2015-06-08 2015-06-08 The method for down loading and device of media data Active CN105635753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510312722.5A CN105635753B (en) 2015-06-08 2015-06-08 The method for down loading and device of media data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510312722.5A CN105635753B (en) 2015-06-08 2015-06-08 The method for down loading and device of media data

Publications (2)

Publication Number Publication Date
CN105635753A CN105635753A (en) 2016-06-01
CN105635753B true CN105635753B (en) 2019-03-29

Family

ID=56050181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510312722.5A Active CN105635753B (en) 2015-06-08 2015-06-08 The method for down loading and device of media data

Country Status (1)

Country Link
CN (1) CN105635753B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060124A (en) * 2016-05-21 2016-10-26 乐视控股(北京)有限公司 Application program downloading method and mobile terminal
CN109951446B (en) * 2019-01-30 2022-04-12 亦非云互联网技术(上海)有限公司 Method and system for stabilizing live stream, computer storage medium and electronic device
CN112312222A (en) * 2019-10-31 2021-02-02 北京字节跳动网络技术有限公司 Video sending method and device and electronic equipment
CN114401185A (en) * 2021-12-31 2022-04-26 宝宝巴士股份有限公司 Method for automatically switching download addresses

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217641B (en) * 2007-12-29 2010-08-18 腾讯科技(深圳)有限公司 An online media playing method, system, server and client
CN102695081A (en) * 2012-06-13 2012-09-26 百视通网络电视技术发展有限责任公司 Video resource scheduling method based on Internet television and television terminal
CN104125229A (en) * 2014-07-31 2014-10-29 合一网络技术(北京)有限公司 Streaming media playing method and streaming media playing device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702176B (en) * 2013-12-09 2017-02-15 乐视致新电子科技(天津)有限公司 HLS (http live streaming) protocol-based video downloading method and device
CN103685264A (en) * 2013-12-06 2014-03-26 乐视致新电子科技(天津)有限公司 Method, client side and system for broadcasting media fragmentations in turn

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217641B (en) * 2007-12-29 2010-08-18 腾讯科技(深圳)有限公司 An online media playing method, system, server and client
CN102695081A (en) * 2012-06-13 2012-09-26 百视通网络电视技术发展有限责任公司 Video resource scheduling method based on Internet television and television terminal
CN104125229A (en) * 2014-07-31 2014-10-29 合一网络技术(北京)有限公司 Streaming media playing method and streaming media playing device

Also Published As

Publication number Publication date
CN105635753A (en) 2016-06-01

Similar Documents

Publication Publication Date Title
CN104244079B (en) A kind of method for downloading video and device
CN104063460B (en) A kind of method and apparatus loading webpage in a browser
CN105635753B (en) The method for down loading and device of media data
CN106570157B (en) Picture pushing method and device and electronic equipment
CN103384275B (en) Cross-terminal downloading method, system cloud server and terminal
CN108124202B (en) Method for making stream media server support H L S protocol
US20140040026A1 (en) Systems and methods for including advertisements in streaming content
CN103716719A (en) Multimedia file downloading method and user terminal
CN104125229B (en) The player method of Streaming Media and playing device
CN103648019A (en) Video downloading method and device based on HLS protocol
CN104284238A (en) Video playing method and device based on two-dimension code
CN110557689B (en) Video playing method and device
CN102280132A (en) Online streaming audio play method based on HTTP (hyper text transfer protocol)
CN103702176A (en) HLS (http live streaming) protocol-based video downloading method and device
WO2018076664A1 (en) Voice broadcasting method and device
CN104768066A (en) Data downloading method and device and terminal
CN105975470A (en) Method and device for processing historical records
CN105187950A (en) Video file playing method, equipment and system
CN105872758A (en) Intelligent television channel operation and play method and corresponding device
CN106303577B (en) Download the method and device of Streaming Media
CN104618418A (en) Method and device for playing multimedia file
CN103678527A (en) Video filtering method and video filtering system both based on video titles and video content
WO2016019875A1 (en) Method and device for presenting content data from network
CN103747280B (en) A kind of method and electronic equipment for creating programme
CN107205177A (en) Video broadcasting method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200622

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping B radio 14 floor tower square

Patentee before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right