WO2017071604A1 - Playback method, device and storage medium - Google Patents

Playback method, device and storage medium Download PDF

Info

Publication number
WO2017071604A1
WO2017071604A1 PCT/CN2016/103479 CN2016103479W WO2017071604A1 WO 2017071604 A1 WO2017071604 A1 WO 2017071604A1 CN 2016103479 W CN2016103479 W CN 2016103479W WO 2017071604 A1 WO2017071604 A1 WO 2017071604A1
Authority
WO
WIPO (PCT)
Prior art keywords
code rate
rate
download
media
switched
Prior art date
Application number
PCT/CN2016/103479
Other languages
French (fr)
Chinese (zh)
Inventor
程子乾
陈洲
易鹤声
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017071604A1 publication Critical patent/WO2017071604A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • 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/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/23805Controlling the feeding rate to the network, e.g. by controlling the video pump
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Definitions

  • the present invention relates to the field of audio and video playback technologies for multimedia terminals, and in particular, to a playback method, device, and storage medium.
  • the m3u8 format is used to generate a playlist file for each bit rate to describe the index information of each slice in detail, which is used to guide the player how to play the file slice.
  • the slice-by-slice download play mode can be realized.
  • the code rate is updated in time to download the corresponding optimal slice rate, and the playback fluency and picture clarity are the most. Good playback effect.
  • the downloading process at the beginning of playback is a great performance consumption for the download resolution process of the primary index secondary index.
  • the invention provides a playing method, a device and a storage medium, which realize fast start of multimedia data.
  • the present invention provides a playing method, and the method includes:
  • Download playback starts from the first media slice of the code rate.
  • the method further includes:
  • the code rate needs to be switched, it is determined whether the address of the media slice to be switched has been stored, and if not, the secondary index file corresponding to the code rate to be switched is downloaded and parsed, and the code rate to be switched is obtained.
  • the next media slice is downloaded and played.
  • determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
  • the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  • determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
  • the download rate of the predetermined number of media fragments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the to-be-switched code rate is greater than the current Code rate.
  • determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
  • the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  • the downloading and parsing the secondary index file corresponding to any code rate includes:
  • the invention also provides a playback device, the device comprising:
  • the parsing module is configured to: after obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading and parsing the secondary index file corresponding to any code rate; and configuring to obtain the code rate The address of the media slice;
  • the processing module is configured to perform download playback from the first media slice of the code rate.
  • the device further includes a determining module, where the determining module includes:
  • the first determining sub-module is configured to determine, according to the download rate of the played media segment and the current code rate, whether to switch the code rate after the current media segment is played, before downloading the next media segment;
  • the second determining sub-module is configured to determine, if the code rate needs to be switched, whether there is an address of the media fragment of the to-be-switched code rate, and if not, download the secondary index file corresponding to the to-be-switched code rate. Parsing, obtaining the address of the media fragment to be switched, and downloading and playing the corresponding media fragment of the to-be-switched code rate; and configuring, if yes, downloading and playing the corresponding media fragment of the to-be-switched code rate;
  • the third determining sub-module is configured to download and play the next media slice if the switching code rate is not required.
  • the first determining submodule is configured to be based on the media segment that has been played.
  • the load rate and the current code rate determine whether the need to switch the code rate specifically means:
  • the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  • the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
  • the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
  • the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
  • the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  • the parsing module is configured to download and parse the secondary index file corresponding to any code rate.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the above playing method.
  • the above solution realizes fast start-up of multimedia data and reduces performance consumption.
  • adaptive switching can be performed according to the download rate of two consecutive media segments, ensuring the validity of the real-time network condition, and avoiding the unexpected network rate switching resulting in inappropriate rate switching.
  • FIG. 1 is a schematic diagram showing a processing flow of a playing method in Embodiment 1;
  • FIG. 2 is a schematic structural diagram of a playback apparatus in Embodiment 1.
  • this embodiment provides a playback method, where the method includes:
  • Step S11 After obtaining the request address of each secondary index file according to the primary index file of the multimedia data, download the secondary index file corresponding to any code rate and parse the file to obtain the address of each media fragment of the code rate. ;
  • Step S12 downloading and playing starts from the first media slice of the code rate.
  • step S12 the following steps are further included:
  • Step S13 After the current media slice is played, before downloading the next media slice, determine whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate;
  • Step S14 If the code rate needs to be switched, it is determined whether the address of the media fragment of the to-be-switched code rate exists, and if not, the secondary index file corresponding to the to-be-switched code rate is downloaded and parsed, and the to-be-switched is obtained.
  • the next media slice is downloaded and played.
  • determining whether to switch the code rate according to the download rate of the played media slice and the current code rate can be implemented by:
  • the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  • the download rate of the predetermined number of media segments played recently is greater than the current code rate, and If the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
  • the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  • the secondary index file corresponding to the minimum bit rate is first downloaded and parsed.
  • the embodiment further provides a playback device, where the device includes:
  • the parsing module 11 is configured to: after obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading and parsing the secondary index file corresponding to any code rate; and configuring the code rate to be obtained.
  • the processing module 12 is configured to perform download playback from the first media slice of the code rate.
  • the device further includes a determining module 13, and the determining module 13 includes:
  • the first determining sub-module 131 is configured to determine, according to the download rate of the played media segment and the current code rate, whether to switch the code rate after the current media slice is played, before downloading the next media slice;
  • the second determining sub-module 132 is configured to determine, if the code rate needs to be switched, whether there is an address of the media fragment of the to-be-switched code rate, and if not, download the secondary index file corresponding to the to-be-switched code rate. And parsing, obtaining the address of the media fragment of the to-be-switched code rate, downloading and playing the corresponding media fragment of the to-be-switched code rate; and configuring, if yes, downloading and playing the corresponding media fragment of the to-be-switched code rate;
  • the third determining sub-module 133 is configured to download and play the next media slice if the switching code rate is not required.
  • the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
  • the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  • the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
  • the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
  • the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
  • the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  • the parsing module 11 is configured to download and analyze the secondary index file corresponding to any code rate.
  • HLS HTTP Live Streaming, Dynamic Rate Adaptation Technology
  • the organization of adaptive streaming media content is as shown in Figure 1.
  • the content is composed of an adaptive stream.
  • the adaptive streaming media first level index records the adaptive streaming media content secondary index of different code rates, and the adaptive streaming media content secondary index records the media fragment file corresponding to the code rate.
  • the terminal When the terminal plays adaptive streaming media content, the terminal first passes the original Url (Uniform Resoure Locator) obtains a first-level index of adaptive streaming media content, and the first-level index of the terminal adaptive streaming media content includes content bandwidth information of each code rate, and a secondary index corresponding to the adaptive streaming media content. Request path. Then, the terminal may initiate a request for the secondary index, where the secondary index includes the media fragment file information of the corresponding code rate, for example, the fragmentation request path URL; and finally, the video content of the relevant code rate is requested by the fragmentation URL in the index.
  • Url Uniform Resoure Locator
  • the downloading process at the beginning of playback is a great performance consumption for the download resolution process of the primary index secondary index.
  • a secondary index file of a certain bit rate such as downloading the code rate of 1.m3u8 first, parsing the 1.m3u8 file after the download request is completed, and obtaining the media fragment address information of the current bit rate.
  • a secondary index file of a certain bit rate such as downloading the code rate of 1.m3u8 first, parsing the 1.m3u8 file after the download request is completed, and obtaining the media fragment address information of the current bit rate.
  • code rates may also be downloaded first in other embodiments.
  • the next conventional practice is to continue to download and parse 2.m3u8, 3.m3u8, 4.m3u8, and 5.m3u8, and then start downloading and playing the first starting media segment of the selected bitrate.
  • Slice download rate download fragment data reception total length / data reception time
  • This rate switching algorithm is based on the download rate of two consecutive slices, which ensures the validity of the network condition at all times. Avoiding sudden network effects leads to inappropriate rate switching. At the same time, it is more flexible to choose the download fragment rate as the basis for the reflection of the time bandwidth.
  • the above solution realizes fast start-up of multimedia data and reduces performance consumption.
  • adaptive switching can be performed according to the download rate of two consecutive media segments, ensuring the validity of the real-time network condition, and avoiding the unexpected network rate switching resulting in inappropriate rate switching.
  • the parsing module 11, the processing module 12, and the judging module 13 in the data receiving apparatus provided in the embodiment of the present invention may be implemented by a processor, and may also be implemented by a specific logic circuit; in practical applications, the processor may be Central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA).
  • CPU Central processing unit
  • MPU microprocessor
  • DSP digital signal processor
  • FPGA field programmable gate array
  • the above playing method is implemented in the form of a software function module and sold or used as a stand-alone product, it may also be stored in a computer readable storage medium.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • an embodiment of the present invention further provides a computer storage medium, and the computer storage medium
  • a computer program for performing the above-described playback method of the embodiment of the present invention is stored in the medium.

Landscapes

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

Abstract

Provided is a playback method. The method comprises: after the request addresses of various secondary index files are obtained according to the parsing of first level index files of multimedia data, downloading a secondary index file corresponding to any code rate and parsing same, and obtaining the addresses of various media fragments of the code rate; and downloading and playing back starting from the first media fragment of the code rate. Also provided is a playback device and a computer storage medium.

Description

一种播放方法、装置及存储介质Play method, device and storage medium 技术领域Technical field
本发明涉及多媒体终端音视频播放技术领域,具体涉及一种播放方法、装置及存储介质。The present invention relates to the field of audio and video playback technologies for multimedia terminals, and in particular, to a playback method, device, and storage medium.
背景技术Background technique
随着移动互联网的迅猛发展,通过互联网向用户提供各种应用服务(Over The Top,OTT)技术的推广以及各种智能终端设备的出现,通过手机、掌上电脑、机顶盒等视频终端在线收看视频,成为人们越来越普遍的休闲娱乐方式。针对网络带宽的时时状况达不到码率完美适配带宽的情况,苹果公司推出了用于实时流(Http Live Streaming,HLS)传输的协议规范,一个片源做不同码率的区分,同时使用流切片技术将一个完整的片源切成若干小片,通常是10秒每片,不同的码率片源,切割成相同数量的分片,不同码率中相同的分片序对应相同的视频内容,同时使用m3u8格式分别对各码率生成播放列表文件详细描述每个分片的索引信息,用来指导播放器如何播放文件切片。这样在播放过程中,可以实现逐分片下载播放模式,当一旦检测到网络发生变动,及时调整码率下载新的最优码率的对应分片,从播放流畅度和画面清晰度方面达到最佳的播放效果。With the rapid development of the mobile Internet, the promotion of various application services (Over The Top, OTT) technology and the emergence of various intelligent terminal devices are provided to users through the Internet, and video is watched online through video terminals such as mobile phones, PDAs, and set-top boxes. Become a more and more popular way of entertainment. In view of the fact that the current bandwidth of the network bandwidth does not reach the perfect fit of the bit rate, Apple has introduced a protocol specification for real-time streaming (HLS) transmission, which uses a different source rate to distinguish between different sources. The stream slicing technique cuts a complete source into a number of small slices, usually 10 seconds per slice, with different code rate sources, and cuts into the same number of slices. The same slice order in different bitrates corresponds to the same video content. At the same time, the m3u8 format is used to generate a playlist file for each bit rate to describe the index information of each slice in detail, which is used to guide the player how to play the file slice. In this way, during the playback process, the slice-by-slice download play mode can be realized. When the network is detected to change, the code rate is updated in time to download the corresponding optimal slice rate, and the playback fluency and picture clarity are the most. Good playback effect.
由于HLS规范采用一级、二级索引文件的方式做具体媒体分片的索引导航。因此在播放开始的起播过程对一级索引二级索引的下载解析过程是一个很大的性能消耗。特别是码率越多需要下载和解析的二级索引文件就越多,性能消耗就越大越耗时。 Because the HLS specification uses the primary and secondary index files to do index navigation of specific media fragments. Therefore, the downloading process at the beginning of playback is a great performance consumption for the download resolution process of the primary index secondary index. In particular, the more the bit rate, the more secondary index files that need to be downloaded and parsed, and the more performance is consumed, the more time consuming.
发明内容Summary of the invention
本发明提供一种播放方法、装置及存储介质,实现了多媒体数据的快速起播。The invention provides a playing method, a device and a storage medium, which realize fast start of multimedia data.
为解决上述技术问题,本发明提供一种播放方法,所述方法包括:To solve the above technical problem, the present invention provides a playing method, and the method includes:
根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析,获取该码率的各媒体分片的地址;After obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading the secondary index file corresponding to any code rate and parsing, and obtaining the address of each media fragment of the code rate;
从该码率的第一个媒体分片开始进行下载播放。Download playback starts from the first media slice of the code rate.
上述方案中,从该码率的第一个媒体分片开始进行下载播放后还包括:In the above solution, after the downloading and playing starts from the first media segment of the code rate, the method further includes:
在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;After the current media slice is played, before downloading the next media slice, it is determined whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate;
如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;如果已存在则下载并播放待切换码率的相应的媒体分片;If the code rate needs to be switched, it is determined whether the address of the media slice to be switched has been stored, and if not, the secondary index file corresponding to the code rate to be switched is downloaded and parsed, and the code rate to be switched is obtained. The address of the media slice, download and play the corresponding media slice of the code rate to be switched; if it exists, download and play the corresponding media slice of the code rate to be switched;
如果不需要切换码率,则下载和播放所述下一媒体分片。If the switching rate is not required, the next media slice is downloaded and played.
上述方案中,所述根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率包括:In the above solution, determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
上述方案中,所述根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率包括:In the above solution, determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前 码率。If the download rate of the predetermined number of media fragments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the to-be-switched code rate is greater than the current Code rate.
上述方案中,所述根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率包括:In the above solution, determining whether to switch the code rate according to the download rate of the played media slice and the current code rate includes:
如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
上述方案中,所述下载任一码率对应的二级索引文件并进行解析包括:In the foregoing solution, the downloading and parsing the secondary index file corresponding to any code rate includes:
下载最小码率对应的二级索引文件并进行解析。Download the secondary index file corresponding to the minimum bit rate and parse it.
本发明还提供一种播放装置,所述装置包括:The invention also provides a playback device, the device comprising:
解析模块,配置为根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析;还配置为获取该码率的各媒体分片的地址;The parsing module is configured to: after obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading and parsing the secondary index file corresponding to any code rate; and configuring to obtain the code rate The address of the media slice;
处理模块,配置为从该码率的第一个媒体分片开始进行下载播放。The processing module is configured to perform download playback from the first media slice of the code rate.
上述方案中,所述装置还包括判断模块,所述判断模块包括:In the above solution, the device further includes a determining module, where the determining module includes:
第一判断子模块,配置为在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;The first determining sub-module is configured to determine, according to the download rate of the played media segment and the current code rate, whether to switch the code rate after the current media segment is played, before downloading the next media segment;
第二判断子模块,配置为如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;还配置为如果已存在则下载并播放待切换码率的相应的媒体分片;The second determining sub-module is configured to determine, if the code rate needs to be switched, whether there is an address of the media fragment of the to-be-switched code rate, and if not, download the secondary index file corresponding to the to-be-switched code rate. Parsing, obtaining the address of the media fragment to be switched, and downloading and playing the corresponding media fragment of the to-be-switched code rate; and configuring, if yes, downloading and playing the corresponding media fragment of the to-be-switched code rate;
第三判断子模块,配置为如果不需要切换码率,则下载和播放所述下一媒体分片。The third determining sub-module is configured to download and play the next media slice if the switching code rate is not required.
上述方案中,所述第一判断子模块配置为根据已播放的媒体分片的下 载速率以及当前码率判断是否需要切换码率具体是指:In the above solution, the first determining submodule is configured to be based on the media segment that has been played. The load rate and the current code rate determine whether the need to switch the code rate specifically means:
如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
上述方案中,所述第一判断子模块配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:In the above solution, the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前码率。If the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
上述方案中,所述第一判断子模块配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:In the above solution, the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
上述方案中,所述解析模块配置为下载任一码率对应的二级索引文件并进行解析具体是指:In the above solution, the parsing module is configured to download and parse the secondary index file corresponding to any code rate.
下载最小码率对应的二级索引文件并进行解析。Download the secondary index file corresponding to the minimum bit rate and parse it.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令用于执行上述的播放方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the above playing method.
上述方案实现了多媒体数据的快速起播,降低的性能消耗。同时可以根据连续两个媒体分片的下载速率进行自适应切换,保证实时网络状况的有效性,避免了突发的网络影响导致不适当的码率切换。The above solution realizes fast start-up of multimedia data and reduces performance consumption. At the same time, adaptive switching can be performed according to the download rate of two consecutive media segments, ensuring the validity of the real-time network condition, and avoiding the unexpected network rate switching resulting in inappropriate rate switching.
附图说明DRAWINGS
图1为实施例一中的播放方法的处理流程示意图;1 is a schematic diagram showing a processing flow of a playing method in Embodiment 1;
图2为实施例一中的播放装置的结构示意图。 FIG. 2 is a schematic structural diagram of a playback apparatus in Embodiment 1.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚明白,下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the objects, technical solutions and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一Embodiment 1
如图1所示,本实施例提供一种播放方法,所述方法包括:As shown in FIG. 1 , this embodiment provides a playback method, where the method includes:
步骤S11:根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析,获取该码率的各媒体分片的地址;Step S11: After obtaining the request address of each secondary index file according to the primary index file of the multimedia data, download the secondary index file corresponding to any code rate and parse the file to obtain the address of each media fragment of the code rate. ;
步骤S12:从该码率的第一个媒体分片开始进行下载播放。Step S12: downloading and playing starts from the first media slice of the code rate.
上述方案中,步骤S12后还包括以下步骤:In the above solution, after step S12, the following steps are further included:
步骤S13:在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;Step S13: After the current media slice is played, before downloading the next media slice, determine whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate;
步骤S14:如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;如果已存在则下载并播放待切换码率的相应的媒体分片;Step S14: If the code rate needs to be switched, it is determined whether the address of the media fragment of the to-be-switched code rate exists, and if not, the secondary index file corresponding to the to-be-switched code rate is downloaded and parsed, and the to-be-switched is obtained. The address of the media slice of the code rate, download and play the corresponding media slice of the code rate to be switched; if it exists, download and play the corresponding media slice of the code rate to be switched;
如果不需要切换码率,则下载和播放所述下一媒体分片。If the switching rate is not required, the next media slice is downloaded and played.
具体的,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率可以通过以下方式实现:Specifically, determining whether to switch the code rate according to the download rate of the played media slice and the current code rate can be implemented by:
如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且 当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前码率。If the download rate of the predetermined number of media segments played recently is greater than the current code rate, and If the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
上述方案中,在本实施例中,首先下载最小码率对应的二级索引文件并进行解析。In the above solution, in this embodiment, the secondary index file corresponding to the minimum bit rate is first downloaded and parsed.
如图2所示,本实施例还提供一种播放装置,所述装置包括:As shown in FIG. 2, the embodiment further provides a playback device, where the device includes:
解析模块11,配置为根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析;还配置为获取该码率的各媒体分片的地址;The parsing module 11 is configured to: after obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading and parsing the secondary index file corresponding to any code rate; and configuring the code rate to be obtained. The address of each media segment;
处理模块12,配置为从该码率的第一个媒体分片开始进行下载播放。The processing module 12 is configured to perform download playback from the first media slice of the code rate.
上述方案中,所述装置还包括判断模块13,所述判断模块13包括:In the above solution, the device further includes a determining module 13, and the determining module 13 includes:
第一判断子模块131,配置为在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;The first determining sub-module 131 is configured to determine, according to the download rate of the played media segment and the current code rate, whether to switch the code rate after the current media slice is played, before downloading the next media slice;
第二判断子模块132,配置为如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;还配置为如果已存在则下载并播放待切换码率的相应的媒体分片;The second determining sub-module 132 is configured to determine, if the code rate needs to be switched, whether there is an address of the media fragment of the to-be-switched code rate, and if not, download the secondary index file corresponding to the to-be-switched code rate. And parsing, obtaining the address of the media fragment of the to-be-switched code rate, downloading and playing the corresponding media fragment of the to-be-switched code rate; and configuring, if yes, downloading and playing the corresponding media fragment of the to-be-switched code rate;
第三判断子模块133,配置为如果不需要切换码率,则下载和播放所述下一媒体分片。The third determining sub-module 133 is configured to download and play the next media slice if the switching code rate is not required.
上述方案中,所述第一判断子模块131配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指: In the above solution, the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
上述方案中,所述第一判断子模块131配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:In the above solution, the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前码率。If the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
上述方案中,所述第一判断子模块131配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:In the above solution, the first determining sub-module 131 is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
上述方案中,所述解析模块11配置为下载任一码率对应的二级索引文件并进行解析具体是指:In the above solution, the parsing module 11 is configured to download and analyze the secondary index file corresponding to any code rate.
下载最小码率对应的二级索引文件并进行解析。Download the secondary index file corresponding to the minimum bit rate and parse it.
实施例二Embodiment 2
首先简单阐述一下HLS规范的整体策略:First, briefly explain the overall strategy of the HLS specification:
策略一:HLS(HTTP Live Streaming,动态码率自适应技术)规范需要终端设备和流媒体配合,针对一个片源,自适应流媒体内容组织方式如图1所示,内容共由一个自适应流媒体内容一级索引和多个自适应流媒体内容二级索引和自适应流媒体内容分片组成。自适应流媒体一级索引记录多个不同码率的自适应流媒体内容二级索引,自适应流媒体内容二级索引记录对应码率的媒体分片文件。Strategy 1: HLS (HTTP Live Streaming, Dynamic Rate Adaptation Technology) specification requires the cooperation of terminal devices and streaming media. For a single source, the organization of adaptive streaming media content is as shown in Figure 1. The content is composed of an adaptive stream. A media content level index and a plurality of adaptive streaming media content secondary indexes and adaptive streaming media content segments. The adaptive streaming media first level index records the adaptive streaming media content secondary index of different code rates, and the adaptive streaming media content secondary index records the media fragment file corresponding to the code rate.
策略二:在终端播放自适应流媒体内容时,终端先通过原始Url (Uniform Resoure Locator,统一资源定位器)获取自适应流媒体内容的一级索引,终端自适应流媒体内容的一级索引包含着各码率内容带宽信息,以及对应自适应流媒体内容二级索引请求路径。然后终端可以对二级索引发起请求,二级索引中包含对应码率各媒体分片文件信息,例如分片请求路径URL;最后通过索引中分片URL请求相关码率的视频内容。Strategy 2: When the terminal plays adaptive streaming media content, the terminal first passes the original Url (Uniform Resoure Locator) obtains a first-level index of adaptive streaming media content, and the first-level index of the terminal adaptive streaming media content includes content bandwidth information of each code rate, and a secondary index corresponding to the adaptive streaming media content. Request path. Then, the terminal may initiate a request for the secondary index, where the secondary index includes the media fragment file information of the corresponding code rate, for example, the fragmentation request path URL; and finally, the video content of the relevant code rate is requested by the fragmentation URL in the index.
策略三:终端在播放过程中检测到带宽状况和计算资源的负载情况发生变化时,则从先前获取的索引中重新选择合适的码率内容进行播放。Strategy 3: When the terminal detects the bandwidth status and the load condition of the computing resource changes during the playing, the terminal reselects the appropriate code rate content from the previously acquired index for playing.
由于HLS规范采用一级、二级索引文件的方式做具体媒体分片的索引导航。因此在播放开始的起播过程对一级索引二级索引的下载解析过程是一个很大的性能消耗。特别是码率越多需要下载和解析的二级索引文件就越多,性能消耗就越大越耗时。Because the HLS specification uses the primary and secondary index files to do index navigation of specific media fragments. Therefore, the downloading process at the beginning of playback is a great performance consumption for the download resolution process of the primary index secondary index. In particular, the more the bit rate, the more secondary index files that need to be downloaded and parsed, and the more performance is consumed, the more time consuming.
下面进一步说明本发明的技术方案。The technical solution of the present invention is further explained below.
1、首先下载解析自适应流媒体一级所引文件index.m3u8并解析。假设存在五中不同的码率。解析一级索引文件获取到码率从低到高五个不同的二级索引文件请求地址--1.m3u8、2.m3u8、3.m3u8、4.m3u8、5.m3u8,分别对应码率一、码率二、码率三、码率四、码率五。1. First download and parse the index file index.m3u8 of the adaptive streaming media level and parse it. Suppose there are five different code rates. Parsing the first-level index file to obtain five different secondary index file request addresses from low to high -1.m3u8, 2.m3u8, 3.m3u8, 4.m3u8, 5.m3u8, respectively corresponding to the code rate , code rate two, code rate three, code rate four, code rate five.
2、然后请求某一种码率的二级索引文件,如首先下载码率一1.m3u8,下载请求完成后对1.m3u8文件进行解析,获取记录当前码率的各媒体分片地址信息等,如1.ts、2.ts、3.ts。需要说明的是,在其它实施例中还可以先下载其它码率。2. Then request a secondary index file of a certain bit rate, such as downloading the code rate of 1.m3u8 first, parsing the 1.m3u8 file after the download request is completed, and obtaining the media fragment address information of the current bit rate. Such as 1.ts, 2.ts, 3.ts. It should be noted that other code rates may also be downloaded first in other embodiments.
3、接下来的常规做法是依次继续对2.m3u8、3.m3u8、4.m3u8、5.m3u8下载解析,然后再对选定码率的第一个起始媒体分片开始下载播放。3. The next conventional practice is to continue to download and parse 2.m3u8, 3.m3u8, 4.m3u8, and 5.m3u8, and then start downloading and playing the first starting media segment of the selected bitrate.
而在本发明中,在下载解析完1.m3u8索引文件后,先跳过对2.m3u8、3.m3u8、4.m3u8、5.m3u8的下载解析,直接对码率一的第一个媒体分片1.ts开始请求。起播后,当检测到需要切换码率时,再根据需要对2.m3u8、 3.m3u8、4.m3u8、5.m3u8进行下载解析,这样可以实现对二级索引的按需求分阶段下载,避免了集中在播放一开始执行这个耗能操作,达到提高起播速度的优化。例如,1.ts起播后,检测到需要切换到码率二,此时再对2.m3u8进行下载解析,在2.m3u8的各媒体分片播放完毕后还可以再次切换到码率一的2.ts继续播放。In the present invention, after downloading and parsing the 1.m3u8 index file, skip the download analysis of 2.m3u8, 3.m3u8, 4.m3u8, and 5.m3u8, directly to the first media of the code rate one. Fragment 1.ts starts the request. After the broadcast, when it is detected that the switching code rate needs to be switched, then according to the need, 2.m3u8, 3.m3u8, 4.m3u8, 5.m3u8 download and parse, so that the secondary index can be downloaded in stages according to the demand, avoiding the centralized operation of the energy-consuming operation at the beginning of the playback, to improve the optimization of the starting speed. For example, after the 1.ts broadcast, it is detected that it needs to switch to the code rate two. At this time, the download analysis of 2.m3u8 is performed, and after the media slices of 2.m3u8 are played, the code rate can be switched again. 2.ts continue to play.
此外,在判断是否需要进行码率切换时,首先统计每个分片的下载速率,通过最新两个分片的下载速率同当前的播放码率比较,然后决定提高码率还是降低码率。在本发明中可以采用以方法:In addition, when judging whether it is necessary to perform rate switching, firstly, the download rate of each fragment is counted, and the download rate of the latest two fragments is compared with the current playback rate, and then it is decided to increase the code rate or reduce the code rate. In the present invention, a method can be employed:
分片下载速率=下载分片数据接收总长度/数据接收时间;Slice download rate = download fragment data reception total length / data reception time;
当将要下载最新分片时,以最近下载两个分片的分片下载速率以及当前播放码率作为衡量指标,是否进行码率切换。倒数第二下载分片的下载速率记为”下载速率一”,倒数第一个下载分片的下载速率记为“下载速率二”。When the latest shard is to be downloaded, whether the shard downloading rate of the two shards and the current playing tempo rate are downloaded as the metrics, whether the rate switching is performed. The download rate of the penultimate download slice is recorded as "download rate one", and the download rate of the first countdown download slice is recorded as "download rate two".
基本算法用下面两个表达式:The basic algorithm uses the following two expressions:
表达式一:Expression one:
if((当前播放码率>下载速率一)&&(当前播放码率>下载速率二))If ((current play rate > download rate one) && (current play rate > download rate two))
{{
降低播放码率,直到降为最低码率;Reduce the playback bit rate until it is reduced to the lowest code rate;
}}
表达式二:Expression two:
If((当前播放码率<下载速率一)&&(当前播放码率<下载速率二))If ((current play rate <download rate one) && (current play rate <download rate two))
{{
提高播放码率,直到提高到最高码率;Increase the playback rate until it reaches the highest code rate;
}}
下面分别对两个表达式做简单阐述:The following two statements are briefly explained:
针对表达式一,当将要下载最新分片时,当倒数第一和第二个分片的 下载速率都小于当前播放码率时,说明当前处于持续低带宽已有一段时间。这时选择降低码率,适应低带宽保证播放流畅度。For expression one, when the latest slice is to be downloaded, when the first and second fragments are When the download rate is less than the current playback bit rate, it indicates that it is currently in a low bandwidth for a while. At this time, you choose to reduce the bit rate and adapt to the low bandwidth to ensure smooth playback.
针对表达式二,当将要下载最新分片时,当倒数第一第二分片的下载速率都大于当前播放码率时,说明当前处于持续高带宽已有一段时间。这是选择升高码率,高带宽下的视频清晰度。For the second expression, when the latest fragment is to be downloaded, when the download rate of the first and second fragments is greater than the current playback rate, it indicates that the current high bandwidth has been in the current period. This is the choice of elevated bit rate, high definition video clarity.
此码率切换算法通过连续两个分片的下载速率为依据,可以保证时时网络状况的有效性。避免突发的网络影响导致不适当的码率切换。同时选择下载分片速率作为时时带宽的反映依据更加灵活。This rate switching algorithm is based on the download rate of two consecutive slices, which ensures the validity of the network condition at all times. Avoiding sudden network effects leads to inappropriate rate switching. At the same time, it is more flexible to choose the download fragment rate as the basis for the reflection of the time bandwidth.
上述方案实现了多媒体数据的快速起播,降低的性能消耗。同时可以根据连续两个媒体分片的下载速率进行自适应切换,保证实时网络状况的有效性,避免了突发的网络影响导致不适当的码率切换。The above solution realizes fast start-up of multimedia data and reduces performance consumption. At the same time, adaptive switching can be performed according to the download rate of two consecutive media segments, ensuring the validity of the real-time network condition, and avoiding the unexpected network rate switching resulting in inappropriate rate switching.
本发明实施例中提出的数据接收装置中的解析模块11、处理模块12、判断模块13都可以通过处理器来实现,当然也可通过具体的逻辑电路实现;在实际应用中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等。The parsing module 11, the processing module 12, and the judging module 13 in the data receiving apparatus provided in the embodiment of the present invention may be implemented by a processor, and may also be implemented by a specific logic circuit; in practical applications, the processor may be Central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA).
本发明实施例中,如果以软件功能模块的形式实现上述播放方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。In the embodiment of the present invention, if the above playing method is implemented in the form of a software function module and sold or used as a stand-alone product, it may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
相应地,本发明实施例还提供一种计算机存储介质,该计算机存储介 质中存储有计算机程序,该计算机程序用于执行本发明实施例的上述播放方法。Correspondingly, an embodiment of the present invention further provides a computer storage medium, and the computer storage medium A computer program for performing the above-described playback method of the embodiment of the present invention is stored in the medium.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.

Claims (13)

  1. 一种播放方法,所述方法包括:A playing method, the method comprising:
    根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析,获取该码率的各媒体分片的地址;After obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading the secondary index file corresponding to any code rate and parsing, and obtaining the address of each media fragment of the code rate;
    从该码率的第一个媒体分片开始进行下载播放。Download playback starts from the first media slice of the code rate.
  2. 如权利要求1所述的方法,其中,从该码率的第一个媒体分片开始进行下载播放后,所述方法还包括:The method of claim 1, wherein after the downloading of the first media segment of the code rate, the method further comprises:
    在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;After the current media slice is played, before downloading the next media slice, it is determined whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate;
    如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;如果已存在则下载并播放待切换码率的相应的媒体分片;If the code rate needs to be switched, it is determined whether the address of the media slice to be switched has been stored, and if not, the secondary index file corresponding to the code rate to be switched is downloaded and parsed, and the code rate to be switched is obtained. The address of the media slice, download and play the corresponding media slice of the code rate to be switched; if it exists, download and play the corresponding media slice of the code rate to be switched;
    如果不需要切换码率,则下载和播放所述下一媒体分片。If the switching rate is not required, the next media slice is downloaded and played.
  3. 如权利要求2所述的方法,其中,所述根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率,包括:The method of claim 2, wherein the determining whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate comprises:
    如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media slices that are played recently is less than the current code rate, and the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  4. 如权利要求2所述的方法,其中,所述根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率,包括:The method of claim 2, wherein the determining whether the code rate needs to be switched according to the download rate of the played media slice and the current code rate comprises:
    如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前码率。If the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
  5. 如权利要求2所述的方法,其中,所述根据已播放的媒体分片的下 载速率以及当前码率判断是否需要切换码率,包括:The method of claim 2 wherein said sub-segment based on played media The load rate and the current code rate determine whether the code rate needs to be switched, including:
    如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  6. 如权利要求1至5任一所述的方法,其中,所述下载任一码率对应的二级索引文件并进行解析,包括:The method according to any one of claims 1 to 5, wherein the downloading and parsing the secondary index file corresponding to any code rate comprises:
    下载最小码率对应的二级索引文件并进行解析。Download the secondary index file corresponding to the minimum bit rate and parse it.
  7. 一种播放装置,所述装置包括:解析模块和处理模块,其中,A playback device, the device comprising: a parsing module and a processing module, wherein
    所述解析模块,配置为根据多媒体数据的一级索引文件解析获取到各二级索引文件的请求地址后,下载任一码率对应的二级索引文件并进行解析;还配置为获取该码率的各媒体分片的地址;The parsing module is configured to: after obtaining the request address of each secondary index file according to the primary index file of the multimedia data, downloading and parsing the secondary index file corresponding to any code rate; and configuring to obtain the code rate The address of each media segment;
    所述处理模块,配置为从该码率的第一个媒体分片开始进行下载播放。The processing module is configured to perform download playback from the first media slice of the code rate.
  8. 如权利要求7所述的装置,其中,所述装置还包括判断模块,所述判断模块包括:The device of claim 7, wherein the device further comprises a determining module, the determining module comprising:
    第一判断子模块,配置为在当前媒体分片播放完毕后,下载下一媒体分片前,根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率;The first determining sub-module is configured to determine, according to the download rate of the played media segment and the current code rate, whether to switch the code rate after the current media segment is played, before downloading the next media segment;
    第二判断子模块,配置为如果需要切换码率,则判断是否已存在待切换码率的媒体分片的地址,如果不存在则对所述待切换码率对应的二级索引文件进行下载和解析,获取待切换码率的媒体分片的地址,下载并播放待切换码率的相应的媒体分片;还配置为如果已存在则下载并播放待切换码率的相应的媒体分片;The second determining sub-module is configured to determine, if the code rate needs to be switched, whether there is an address of the media fragment of the to-be-switched code rate, and if not, download the secondary index file corresponding to the to-be-switched code rate. Parsing, obtaining the address of the media fragment to be switched, and downloading and playing the corresponding media fragment of the to-be-switched code rate; and configuring, if yes, downloading and playing the corresponding media fragment of the to-be-switched code rate;
    第三判断子模块,配置为如果不需要切换码率,则下载和播放所述下一媒体分片。The third determining sub-module is configured to download and play the next media slice if the switching code rate is not required.
  9. 如权利要求8所述的装置,其中,所述第一判断子模块配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:The apparatus according to claim 8, wherein the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
    如果最近播放的预定个数的媒体分片的下载速率都小于当前码率,且 当前码率不是最小码率,则判断需要切换码率,待切换码率小于所述当前码率。If the download rate of the predetermined number of media segments played recently is less than the current code rate, and If the current code rate is not the minimum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is smaller than the current code rate.
  10. 如权利要求8所述的装置,其中,所述第一判断子模块配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:The apparatus according to claim 8, wherein the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
    如果最近播放的预定个数的媒体分片的下载速率都大于当前码率,且当前码率不是最大码率,则判断需要切换码率,待切换码率大于所述当前码率。If the download rate of the predetermined number of media segments that are played recently is greater than the current code rate, and the current code rate is not the maximum code rate, it is determined that the code rate needs to be switched, and the code rate to be switched is greater than the current code rate.
  11. 如权利要求8所述的装置,其中,所述第一判断子模块配置为根据已播放的媒体分片的下载速率以及当前码率判断是否需要切换码率具体是指:The apparatus according to claim 8, wherein the first determining sub-module is configured to determine whether the need to switch the code rate according to the download rate of the played media slice and the current code rate, specifically:
    如果最近播放的预定个数的媒体分片的下载速率不都小于当前码率,并且最近播放的媒体分片的下载速率不都大于当前码率则判断不需要切换码率。If the download rate of the predetermined number of media segments played recently is not less than the current code rate, and the download rate of the recently played media segments is not greater than the current code rate, it is determined that the switching code rate is not required.
  12. 如权利要求7至11任一所述的装置,其中,所述解析模块配置为下载任一码率对应的二级索引文件并进行解析具体是指:The device according to any one of claims 7 to 11, wherein the parsing module is configured to download and analyze the secondary index file corresponding to any code rate.
    下载最小码率对应的二级索引文件并进行解析。Download the secondary index file corresponding to the minimum bit rate and parse it.
  13. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令用于执行权利要求1至6任一项所述的播放方法。 A computer storage medium having stored therein computer executable instructions for performing the playback method of any one of claims 1 to 6.
PCT/CN2016/103479 2015-10-28 2016-10-27 Playback method, device and storage medium WO2017071604A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510711876.1A CN106658226B (en) 2015-10-28 2015-10-28 Playing method and device
CN201510711876.1 2015-10-28

Publications (1)

Publication Number Publication Date
WO2017071604A1 true WO2017071604A1 (en) 2017-05-04

Family

ID=58631318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/103479 WO2017071604A1 (en) 2015-10-28 2016-10-27 Playback method, device and storage medium

Country Status (2)

Country Link
CN (1) CN106658226B (en)
WO (1) WO2017071604A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383638A (en) * 2020-11-27 2021-02-19 北京小米移动软件有限公司 Method, device and medium for downloading fragments
CN113014981A (en) * 2019-12-19 2021-06-22 海信视像科技股份有限公司 Video playing method and device, electronic equipment and readable storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108933764B (en) * 2017-05-26 2022-04-22 中兴通讯股份有限公司 Method and device for realizing quick broadcast starting
CN110049355A (en) * 2018-01-17 2019-07-23 华为技术有限公司 Method for broadcasting multimedia file and device
CN108540868B (en) * 2018-05-16 2019-04-16 北京百度网讯科技有限公司 Processing method, device, server, terminal and the storage medium of HLS live streaming
CN110519656B (en) * 2018-05-22 2021-11-26 中国电信股份有限公司 Self-adaptive streaming media playing method, system and server
CN110933516B (en) * 2018-09-19 2022-06-10 华为技术有限公司 Multimedia live broadcasting method, device and equipment
CN109413456B (en) * 2018-10-08 2021-05-18 山东大学 Dynamic self-adaptive streaming media multi-hypothesis code rate self-adaptive system and method based on HTTP
CN110213653B (en) * 2019-06-14 2022-03-04 北京奇艺世纪科技有限公司 Method and device for playing video

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088620A (en) * 2010-12-01 2011-06-08 中兴通讯股份有限公司 Method for downloading media file in content distribution network and client
CN102957672A (en) * 2011-08-25 2013-03-06 中国电信股份有限公司 Method, client side and system for self-adaptive playing of FLV (flash video) media streams
CN103561283A (en) * 2013-10-30 2014-02-05 乐视致新电子科技(天津)有限公司 Method and device for code rate switch of smart television
WO2014173110A1 (en) * 2013-04-23 2014-10-30 华为技术有限公司 Streaming media data obtaining method, device, and system
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088620A (en) * 2010-12-01 2011-06-08 中兴通讯股份有限公司 Method for downloading media file in content distribution network and client
CN102957672A (en) * 2011-08-25 2013-03-06 中国电信股份有限公司 Method, client side and system for self-adaptive playing of FLV (flash video) media streams
WO2014173110A1 (en) * 2013-04-23 2014-10-30 华为技术有限公司 Streaming media data obtaining method, device, and system
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
CN103561283A (en) * 2013-10-30 2014-02-05 乐视致新电子科技(天津)有限公司 Method and device for code rate switch of smart television

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014981A (en) * 2019-12-19 2021-06-22 海信视像科技股份有限公司 Video playing method and device, electronic equipment and readable storage medium
CN112383638A (en) * 2020-11-27 2021-02-19 北京小米移动软件有限公司 Method, device and medium for downloading fragments
CN112383638B (en) * 2020-11-27 2023-12-05 北京小米移动软件有限公司 Fragment downloading method, device and medium

Also Published As

Publication number Publication date
CN106658226B (en) 2020-12-11
CN106658226A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
WO2017071604A1 (en) Playback method, device and storage medium
US10123059B2 (en) Fast start of streaming digital media playback with deferred license retrieval
US8516144B2 (en) Startup bitrate in adaptive bitrate streaming
TWI623226B (en) Directory limit based system and method for storing media segments
US8947596B2 (en) Alignment of closed captions
KR100492567B1 (en) Http-based video streaming apparatus and method for a mobile communication system
US8510460B2 (en) Reduced video player start-up latency in HTTP live streaming and similar protocols
CN108933764B (en) Method and device for realizing quick broadcast starting
WO2015169172A1 (en) Network video playing method and device
US11973996B2 (en) Staggered key frame video encoding
WO2017092327A1 (en) Playing method and apparatus
US10326704B2 (en) Enabling continuous content playback
WO2018103696A1 (en) Media file playback method, server, client, and system
CN110149560B (en) Player optimization method and system based on HLS protocol, storage medium and terminal
CN110022498B (en) Method and device for realizing code rate switching
WO2017101418A1 (en) Method and device for playing multiple streaming media
US20160072864A1 (en) Method and client terminal for receiving a multimedia content split into at least two successive segments, and corresponding computer program product and computer readable mediium
WO2013185514A1 (en) System and method for playing streaming media
US10200433B2 (en) Client device, a method for receiving a streaming media data and a streaming media data transmission system
CN107005743B (en) Video bitstream processing for enabling call-in
US20150172347A1 (en) Presentation of content based on playlists
US20140142955A1 (en) Encoding Digital Media for Fast Start on Digital Media Players
CN114124941B (en) m3u8 format file downloading method, playing method and m3u8 format file downloading system
WO2024125249A1 (en) Bitrate adaptation method and apparatus, and server
CN115834925A (en) Video transcoding method, device, equipment and medium

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: 16859039

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16859039

Country of ref document: EP

Kind code of ref document: A1