HLS-based playback response speed optimization method, device and system

By generating new m3u8 lists and accurately locating video segments, the video download and playback process of the HTTP Live Streaming system is optimized, solving the response delay problem caused by long-term video storage or large-scale video streaming, and improving the instant response speed of video playback and user experience.

CN119071541BActive Publication Date: 2025-09-23XINTU HETEROGENEOUS TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411229771.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-09-23
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

When processing long-term video storage or large-scale video streams, existing HTTP Live Streaming (HLS) systems suffer from significant response delays due to the large playlists and video clips, which affects the user experience.

Method used

By generating a new m3u8 list and utilizing the total duration of the original m3u8 list and the relative offset time of the #EXT-X-DISCONTINUITY tag, the video download and playback process is optimized, the target segment is accurately located, and the required segment is directly extracted from the video file through a download request carrying the start and end offset point index values.

Benefits of technology

It significantly reduces the caching time before video playback, improves the instant response speed and user experience, and greatly improves the playback delay problem, especially when dealing with long-term video storage or large-scale video streams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071541B_ABST
    Figure CN119071541B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device and system for optimizing playback response speed based on HLS, which aims to solve the response delay problem of the HLS system when processing long-term video storage or large-scale video streams. The method includes determining the video content selected by the user, sending a query request to the server, and obtaining the total duration of the original m3u8 list and the offset time of all #EXT‑X‑DISCONTINUITY tags. Based on these data, a new m3u8 list is generated, and a download request is sent to the server to obtain a video file in TS format. In addition, the system also identifies the target video segment and generates an accurate download request, which carries the start and end offset point index values, and the server performs segment cropping and packaging based on this. This optimization significantly reduces the cache time before video playback, improves the playback response speed and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, device and system for optimizing playback response speed based on HLS. Background Art

[0002] With the rapid development of Internet technology and the significant growth in online video content consumption, users have increased their performance requirements for streaming media playback systems. Instantaneous response and high efficiency have become particularly important for streaming media playback. However, existing HTTP Live Streaming (HLS) systems face many challenges when processing video streams that require long-term video storage or large data volumes.

[0003] For example, in the security surveillance field, video storage can last up to 90 days or more, and the capacity of a single m3u8 playlist often exceeds 100MB. This massive playlist and the corresponding TS video segments must be downloaded and cached from the server before the video can be played, resulting in significant response delays. The player must spend considerable time loading these files before starting to play the video, and this lengthy caching process severely impacts the user experience. Summary of the Invention

[0004] The main purpose of the present invention is to provide a method, device and system for optimizing playback response speed based on HLS, so as to solve the problem that the existing HTTP Live Streaming (HLS) system, when processing video streams containing long-term video storage or large amounts of data, causes significant response delays due to the large playlists and video clips, thereby seriously affecting the user experience.

[0005] To achieve the above-mentioned object, the present invention provides a playback response speed optimization method based on HLS, which comprises the following steps: determining the video content selected by the user, and sending a query request to a server based on the video content; obtaining the total duration of an original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags; generating a new m3u8 list according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags; sending a download request to the server according to the new m3u8 list, and receiving a video file encapsulated in TS format returned by the server; and playing the video file fed back by the server according to the new m3u8 list.

[0006] Optionally, sending a query request to a server based on the video content includes: determining a unique identifier of the video content, and sending a query request to the server based on the unique identifier.

[0007] Optionally, a new m3u8 list is generated according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags, including: dividing the total duration of the original m3u8 list by a preset TS segment length to determine the total number of TS segments of the original m3u8 list; dividing the relative offset time of each #EXT-X-DISCONTINUITY tag by the total duration of the original m3u8 list to determine the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag; initializing a new m3u8 list according to the total number of TS segments and the TS segment corresponding to each #EXT-X-DISCONTINUITY tag.

[0008] Optionally, according to the total number of TS fragments and the TS fragments corresponding to each of the #EXT-X-DISCONTINUITY tags, a new m3u8 list is initialized, including: initializing a new m3u8 list, and determining the total target number of TS fragments that need to be listed in the new m3u8 list according to the total number of TS fragments; starting from the first fragment in the new m3u8 list, gradually listing the TS files of the total target number; identifying the target TS fragment in the new m3u8 list, and inserting the #EXT-X-DISCONTINUITY tag based on the starting offset point of the target TS fragment to obtain a final new m3u8 list.

[0009] Optionally, after determining the video content selected by the user, the playback response speed optimization method further includes: determining a target segment in the video content selected by the user.

[0010] Furthermore, a download request is sent to the server according to the new m3u8 list, and a video file encapsulated in TS format is received as feedback from the server, including: in combination with the new m3u8 list, a download request is sent to the server according to the target segment, wherein the download request carries a starting offset point index value and an ending offset point index value; and the video file encapsulated in TS format is received as feedback from the server according to the starting offset point index value and the ending offset point index value.

[0011] Optionally, after receiving the download request, the server indexes to the corresponding target video segment according to the start offset point index value and the end offset point index value carried in the download request, and performs non-encoding cropping and TS format encapsulation on the target video segment to obtain a video file.

[0012] The present invention also provides an HLS-based playback response speed optimization device, comprising: a sending unit, used to determine the video content selected by the user, and to send an inquiry request to a server based on the video content; an acquiring unit, used to acquire the total duration of an original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags; a generating unit, used to generate a new m3u8 list according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags; a receiving unit, used to send a download request to the server according to the new m3u8 list, and to receive a video file encapsulated in TS format fed back by the server; and a playing unit, used to play the video file returned by the server according to the new m3u8 list.

[0013] The present invention also provides an HLS-based playback response speed optimization system, comprising: a client request processing module, configured to obtain the total duration of an original m3u8 list sent by a server and the relative offset times of all #EXT-X-DISCONTINUITY tags, and generate a new m3u8 list according to the total duration of the original m3u8 list and the relative offset times of all #EXT-X-DISCONTINUITY tags, and send a download request to the server according to the new m3u8 list, receive a video file encapsulated in TS format fed back by the server, and play the video file; a server video processing module, configured to obtain an inquiry request containing a unique identifier of video content sent by a client, and based on the total duration of the original m3u8 list corresponding to the video content fed back by the inquiry request and the relative offset times of the #EXT-X-DISCONTINUITY tags; and receive the download request sent by the client, and generate a video file encapsulated in TS format according to at least a starting offset point index value and an ending offset point index value in the download request, and return the video file to the client.

[0014] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0016] The HLS-based playback response speed optimization method, device, and system provided by the present invention significantly improve the instant response speed of video playback and user experience by generating a new m3u8 list to shorten the buffering time before video playback, reducing the need to load a large playlist. Specifically, it streamlines the download and playback process by analyzing and optimizing the original m3u8 list, ensuring that users can start watching videos more quickly. This greatly improves the playback delay problem, especially when dealing with long-term video storage or large-scale video streams.

[0017] In addition, by introducing the identification of target segments and directed download requests, the present invention significantly improves the playback response speed of the HLS system. After determining the video content selected by the user, the system can accurately locate the target segments in the video and generate download requests for these segments. This method can shorten the download time of a single video data. Specifically, by carrying a download request with the start and end offset point index values, the server can directly extract the required segments from the video file without encoding and processing the entire video file. This precise data cropping and packaging method ensures efficient transmission and fast decoding of video files, further reduces user waiting time, and improves the instant response performance of playback. Therefore, this optimization technology effectively solves the delay problem in long-term recording and large-scale video stream processing, and significantly improves the user's viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 1 is a schematic diagram of steps of a method for optimizing playback response speed based on HLS in one embodiment of the present invention;

[0019] Figure 2 1 is a flow chart of a method for optimizing playback response speed based on HLS according to an embodiment of the present invention;

[0020] Figure 3 This is a structural block diagram of a device for optimizing playback response speed based on HLS in one embodiment of the present invention;

[0021] Figure 4 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0022] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0024] Reference Figure 1 The embodiment of the present invention provides a method for optimizing playback response speed based on HLS, and the method for optimizing playback response speed includes the following steps:

[0025] S1, determining the video content selected by the user, and sending a query request to the server based on the video content;

[0026] S2, obtain the total duration of the original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags;

[0027] S3, generating a new m3u8 list according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags;

[0028] S4, sends a download request to the server according to the new m3u8 list, and receives the video file encapsulated as TS format fed back by the server;

[0029] S5: Play the video file returned by the server according to the new m3u8 list.

[0030] It should be noted that the client can be a browser-supported system such as a smartphone, tablet computer, laptop computer or desktop computer; the server can be configured with a high-performance CPU and a large amount of RAM, as well as sufficient storage space to process and store large amounts of video data.

[0031] That is, in an embodiment of the present invention, first, the client needs to determine the video content selected by the user, and then sends a query request to the server to obtain the basic information about the video. This step is to obtain the original playback data of the video, and these data will be used for subsequent processing. Next, the client obtains the total duration of the original m3u8 list of the video content and the relative offset time of all #EXT-X-DISCONTINUITY tags from the server. The original m3u8 list contains all the information required for video playback, including the order and duration of the playback segments. The #EXT-X-DISCONTINUITY tag is used to indicate the time interval or other significant changes in the playlist, and it is most important for ensuring the continuity of playback. By obtaining this information, the client can accurately understand the playback structure and segment arrangement of the video, but does not need to download the entire m3u8 playlist, thereby reducing the amount of data transmission.

[0032] Based on this, the client generates a new m3u8 list based on the total duration of the original m3u8 list and the relative offset times of all #EXT-X-DISCONTINUITY tags. The client then uses this new m3u8 list to send a download request to the server and receives the video file encapsulated in TS (Transport Stream) format. Finally, the client plays the received video file according to the new m3u8 list. By parsing the new m3u8 list, the client understands the order and playback time of the video segments, achieving a smooth playback experience.

[0033] In summary, the embodiment of the present invention generates a virtual m3u8 playlist for a specific request on the client and downloads the video file from the server based on the virtual m3u8 playlist, thereby greatly reducing the time required to request the m3u8 playlist, thereby improving the response speed of video playback and achieving an efficient and fast video playback experience.

[0034] In one example, sending a query request to a server based on the video content includes: determining a unique identifier of the video content, and sending a query request to the server based on the unique identifier.

[0035] In this example, the client first needs to determine the unique identifier of the video content. This identifier is a unique code or identifier for the video content on the server, used to accurately represent and reference the video. For example, it could be a video ID, URL, or other unique code. This unique identifier ensures that the client can accurately locate the video content selected by the user without confusing or mistakenly accessing other videos. Next, the client uses this unique identifier to send a query request to the server. The purpose of this request is to obtain information related to the video content. Specifically, the client constructs a query request containing the unique identifier of the video content. This request is sent to the server, which identifies the corresponding video content based on the identifier and returns relevant playback information. This information typically includes the total duration of the original m3u8 list, the URL of the segment, the relative offset time of the #EXT-X-DISCONTINUITY tag, and so on.

[0036] Therefore, the key to this process is to make precise requests through unique identifiers in order to obtain the minimum data set related to the video content, which can optimize subsequent playback processing steps and improve playback response speed.

[0037] In one example, a new m3u8 list is generated according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags, including: dividing the total duration of the original m3u8 list by a preset TS segment length to determine the total number of TS segments of the original m3u8 list; dividing the relative offset time of each #EXT-X-DISCONTINUITY tag by the total duration of the original m3u8 list to determine the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag; and initializing a new m3u8 list according to the total number of TS segments and the TS segment corresponding to each #EXT-X-DISCONTINUITY tag.

[0038] In this example, the process of generating a new m3u8 list creates a new m3u8 list by combining the total length of the original m3u8 list and the relative offset time of the #EXT-X-DISCONTINUITY tag. The following is a detailed explanation:

[0039] First, you need to clarify the total duration of the original m3u8 list and the relative offset time of the #EXT-X-DISCONTINUITY tag. The total duration of the original m3u8 list is the complete playback time of the video, while the #EXT-X-DISCONTINUITY tag marks important time intervals or playback structure changes that may occur during playback.

[0040] 1. Determine the total number of TS segments: In the original m3u8 list, the video content is divided into multiple TS (Transport Stream) segments, each of which has a fixed length. By dividing the total length of the original m3u8 list by the preset TS segment length, the total number of TS segments in the playlist can be calculated. The preset TS segment length refers to the standard length of each TS segment, for example, it may be set to 10 seconds, 15 seconds, or other values. The purpose of this step is to determine the number of all TS segments in the original playlist so that it can be further processed.

[0041] 2. Determine the target TS segment: According to the relative offset time of the #EXT-X-DISCONTINUITY tag, the target TS segment corresponding to the tag can be calculated. The relative offset time indicates the time position of the tag in the original playlist. By dividing this relative offset time by the total duration of the original m3u8 list, a ratio can be obtained to indicate the position of the tag relative to the total playback time. Then, by multiplying this ratio by the total number of TS segments, the corresponding target TS segment number can be found. The purpose of this step is to locate the TS segments that need attention so that these segments can be processed correctly when generating a new m3u8 list.

[0042] 3. Initialize a new m3u8 list: According to the calculated total number of TS segments and the TS segments corresponding to each #EXT-X-DISCONTINUITY tag, the client can initialize a new m3u8 list. The new m3u8 list will contain the key TS segments extracted from the original playlist, as well as necessary play order and tag information. Of course, preferably, this new list can only contain the data necessary for the current playback operation, remove unnecessary parts, thereby reducing the data volume and improving playback efficiency.

[0043] Furthermore, the technical solution of initializing a new m3u8 list according to the total number of TS fragments and the TS fragments corresponding to each of the #EXT-X-DISCONTINUITY tags can be implemented by the following steps: initializing a new m3u8 list, and determining the total target number of TS fragments that need to be listed in the new m3u8 list according to the total number of TS fragments; starting from the first fragment in the new m3u8 list, gradually listing the total target number of TS files; identifying the target TS fragment in the new m3u8 list, and inserting the #EXT-X-DISCONTINUITY tag based on the starting offset point of the target TS fragment to obtain the final new m3u8 list.

[0044] Here is a detailed explanation of the process:

[0045] ① Initialize a new m3u8 list: Based on the total length of the original m3u8 list and the TS segments corresponding to each #EXT-X-DISCONTINUITY tag, the client needs to initialize a new m3u8 list. The purpose of this step is to create a new playlist.

[0046] ② Determine the target number of TS segments: Based on the total number of TS segments calculated previously, the client needs to determine the target number of TS segments to include in the new m3u8 list. This means that the client must select and list a certain number of TS segments based on the calculation results to ensure that the new playlist covers the majority of the video while reducing data redundancy. This target number determines how many TS segment files should be included in the new m3u8 list.

[0047] ③. Progressive Listing of TS Segments: In a new m3u8 list, starting with the first segment, the client will progressively list the required TS segments. This process involves sequentially adding links or paths to TS segment files until the target number is reached. Each TS segment file link is added to the new m3u8 list, ensuring sequential and smooth playback.

[0048] ④. Inserting the #EXT-X-DISCONTINUITY tag: In the new m3u8 list, the client needs to identify the target TS segments that correspond to the locations of the #EXT-X-DISCONTINUITY tags in the original playlist. The #EXT-X-DISCONTINUITY tag is used to indicate time intervals or structural changes in the playlist, which is critical for ensuring playback continuity and accuracy. The client will adaptively insert the #EXT-X-DISCONTINUITY tag after the identified target TS segment to maintain video playback consistency and accuracy.

[0049] ⑤. Generate the final m3u8 list: The client receives a new m3u8 list containing optimized TS segments and appropriately inserted #EXT-X-DISCONTINUITY tags. This list is more streamlined and efficient than the original playlist, containing only the data required for actual playback and ensuring that time intervals and structural changes during playback are correctly handled. This improves the responsiveness of video playback, reduces the amount of data transmitted over the network, and enhances the user's viewing experience.

[0050] Overall, this process optimizes and streamlines the m3u8 playlist, creating a new, simplified list that enables clients to download and play video content more efficiently. Through calculation and positioning, the new m3u8 list not only improves the efficiency and smoothness of video playback, but also retains the necessary playback structure information to ensure coherent video playback. This optimization significantly reduces unnecessary download time and improves playback responsiveness, thereby improving the user viewing experience.

[0051] In one example, based on the starting offset point of the target TS segment, the #EXT-X-DISCONTINUITY tag is inserted to obtain the final new m3u8 list, which can be achieved by the following two methods: comparing the relative offset time of the #EXT-X-DISCONTINUITY tag with the starting offset point of the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag to obtain a comparison result; according to the comparison result, the #EXT-X-DISCONTINUITY tag is inserted to obtain the final new m3u8 list.

[0052] Furthermore, according to the comparison result, the #EXT-X-DISCONTINUITY tag is inserted, which may be in the following two cases:

[0053] First, if the relative offset time of the #EXT-X-DISCONTINUITY tag is consistent with the starting offset point of the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag, then add the #EXT-X-DISCONTINUITY tag before the target TS segment;

[0054] Second, if the relative offset time of the #EXT-X-DISCONTINUITY tag is inconsistent with the starting offset point of the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag, the target TS file is split according to the relative offset time of the #EXT-X-DISCONTINUITY tag, and the #EXT-X-DISCONTINUITY tag is added before the second TS sub-file after the split.

[0055] In one example, after determining the video content selected by the user, the playback response speed optimization method further includes: determining a target segment in the video content selected by the user.

[0056] And, sending a download request to the server according to the new m3u8 list, and receiving the video file encapsulated in TS format fed back by the server, including: combining the new m3u8 list, sending a download request to the server according to the target segment, wherein the download request carries a starting offset point index value and an ending offset point index value; receiving the video file encapsulated in TS format fed back by the server according to the starting offset point index value and the ending offset point index value.

[0057] In this example, the playback response speed optimization method involves further optimizing the data request and reception steps after determining the video content selected by the user. First, after determining the video content selected by the user, the client will carry the identification information of the video content, such as the video ID, and request the total duration of the original m3u8 list and the offset positions of all EXT-X-DISCONTINUITY tags from the server, thereby improving efficiency and reducing unnecessary data transmission.

[0058] Next, the client generates a new m3u8 list based on the original m3u8 list information returned by the server. This list lists the necessary playback information including the target segment. After generating the new m3u8 list, the client sends a download request to the server based on the list. To optimize the download process, the client carries two important parameters in the request: the starting offset point index value and the ending offset point index value. These two index values ​​indicate the specific range of the TS segments that need to be downloaded in the request, thereby ensuring that only the necessary segments are downloaded rather than the entire video file. After receiving these requests, the server will feedback the corresponding TS format video file based on the starting and ending index values. In this way, the client can efficiently obtain video data, reduce download time, and improve the playback response speed, thereby optimizing the user's viewing experience.

[0059] In one example, after receiving a download request, the server indexes to the corresponding target video segment based on the start offset point index value and the end offset point index value carried in the download request, and performs non-encoding cropping and TS format encapsulation on the target video segment to obtain a video file.

[0060] In this example, the server's processing involves responding to a download request to provide the specific video clips requested by the user. The specific operation is as follows: When the server receives a download request from a client, the request includes two key parameters: the starting offset index and the ending offset index. These two indexes specify the specific location range of the video clips that the client wishes to download.

[0061] The server first uses these index values ​​to locate the target video segment within its stored video files. Specifically, the start and end offset index values ​​are used to accurately locate the start and end points of the video data. This step is accomplished by looking up the corresponding locations in an index table or video data structure to ensure that the desired segment is correctly extracted.

[0062] Next, the server crops these target video segments. Cropping does not involve re-encoding the video content; instead, the specified segments are directly cut from the original video data. This operation ensures fast processing without compromising video quality, as the video is not re-encoded or compressed. The cropped segments are then converted into the TS (Transport Stream) format, a standard video transmission format suitable for streaming media playback.

[0063] Finally, after cropping and TS format encapsulation, the server generates a video file that is sent back to the client. This video file contains the specific segment requested by the client and is encapsulated in TS format, ensuring correct parsing and playback. This processing method allows the server to efficiently respond to download requests and provide accurate video content while maintaining good video quality and playback performance.

[0064] In order to explain the technical solution of the present invention more clearly, an embodiment is now provided. Figure 2 As shown in the figure, the user selects the video content to play and initiates a play request, which includes the video ID. At this point, the client requests the server for the total duration of the m3u8 playlist for the video and the relative offset time points of all #EXT-X-DISCONTINUITY tags based on the video ID. After receiving the client's request, the server uses the video ID to retrieve the total duration of the m3u8 playlist and the relative offset time points of all #EXT-X-DISCONTINUITY tags from the m3u8 cache.

[0065] The client dynamically generates a virtual m3u8 playlist using the total duration of the received m3u8 list and the relative offset time information in the #EXT-X-DISCONTINUITY tag, combined with the preset TS video segment length. The player parses the virtual m3u8 list generated by the client and then sends a request to the server for the TS video segment, which explicitly specifies the start and end time points of the required video segment.

[0066] Finally, upon receiving the TS segment request, the server quickly locates the original TS video segment in the video's m3u8 cache based on the provided time point. It then calculates the start and end times of the cropped video based on the TS segment duration recorded in the TS segment's #EXTINF tag in the original m3u8 list. The server crops the requested short TS file segment and sends it back to the client. Upon receiving the video segment, the client immediately begins playback, ensuring efficient and smooth video playback for the user.

[0067] In other words, this solution generates a virtual m3u8 playlist for a specific request on the client side, downloading only the necessary m3u8 playlist description information from the server, rather than the complete m3u8 playlist. This significantly reduces the time it takes to request the m3u8 playlist before playing a video clip. At the same time, the system optimizes the processing of video clips. By shortening the length of TS video clips, it significantly improves the speed of caching TS clips during video playback and significantly increases the startup speed. This solution is particularly suitable for application scenarios that require fast access to large amounts of video content, such as security surveillance playback scenarios.

[0068] Reference Figure 3 The embodiment of the present invention further provides a device for optimizing playback response speed based on HLS, comprising:

[0069] A sending unit 1, configured to determine the video content selected by the user and send a query request to the server based on the video content;

[0070] Acquisition unit 2 is used to obtain the total duration of the original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags;

[0071] Generating unit 3, for generating a new m3u8 list according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags;

[0072] Receiving unit 4 is used for sending a download request to the server according to the new m3u8 list, and receiving the video file encapsulated as TS format fed back by the server;

[0073] The playback unit 5 is configured to play the video file returned by the server according to the new m3u8 list.

[0074] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0075] In addition, an embodiment of the present invention further provides an HLS-based playback response speed optimization system, comprising:

[0076] Client request processing module, for obtaining the total duration of the original m3u8 list sent by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags, and according to the total duration of the original m3u8 list and the relative offset time of all #EXT-X-DISCONTINUITY tags, a new m3u8 list is generated, and according to the new m3u8 list, a download request is sent to the server, and the video file encapsulated as TS format that the server feedback is received, and the video file is played;

[0077] The server video processing module is configured to obtain a query request sent by a client containing a unique identifier of the video content, and based on the total duration and relative offset time of the original m3u8 list corresponding to the video content fed back by the query request and the #EXT-X-DISCONTINUITY tag; and receive a download request sent by the client, and generate a video file encapsulated in TS format based on at least the starting offset point index value and the ending offset point index value in the download request, and return the video file to the client.

[0078] Reference Figure 4 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, memory, display screen, input device, network interface and database connected via a system bus. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above method is implemented.

[0079] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0080] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-described method when executed by a processor. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0081] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media provided herein and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM.

[0082] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, apparatus, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, apparatus, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, apparatus, article, or method comprising the element.

[0083] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for optimizing playback response speed based on HLS, characterized in that: The playback response speed optimization method comprises the following steps: Determining the video content selected by the user, and sending a query request to the server based on the video content; Obtain the total duration of the original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags; Adopt the total duration of described original m3u8 list divided by preset TS fragment length, determine the total number of TS fragments of described original m3u8 list; Adopt the relative offset time of each #EXT-X-DISCONTINUITY label divided by the total duration of described original m3u8 list, determine the target TS fragment corresponding to the #EXT-X-DISCONTINUITY label; Initialize a new m3u8 list, according to described TS fragment total number, determine the total target number of TS fragments that described new m3u8 list needs to list; Starting from the first fragment in described new m3u8 list, progressively select and list the TS files of described total target number; Identify described target TS fragment in described new m3u8 list, and based on the starting offset point of described target TS fragment, insert described #EXT-X-DISCONTINUITY label, obtain final new m3u8 list; Send a download request to the server according to the new m3u8 list, and receive the video file encapsulated in TS format fed back by the server; According to the new m3u8 list, the video file returned by the server is played.

2. The playback response speed optimization method according to claim 1, characterized in that: Sending a query request to the server based on the video content includes: A unique identifier of the video content is determined, and a query request is sent to the server based on the unique identifier.

3. The playback response speed optimization method according to claim 1, characterized in that: After determining the video content selected by the user, the playback response speed optimization method further includes: determining a target segment in the video content selected by the user; Send a download request to the server according to the new m3u8 list, and receive the video file encapsulated in TS format fed back by the server, including: In combination with the new m3u8 list, a download request is sent to the server according to the target segment, wherein the download request carries a start offset point index value and an end offset point index value; Receive the video file encapsulated in TS format fed back by the server according to the start offset point index value and the end offset point index value.

4. The playback response speed optimization method according to claim 1, characterized in that: After receiving the download request, the server indexes to the corresponding target video segment according to the start offset point index value and the end offset point index value carried in the download request, and performs non-encoding cropping and TS format encapsulation processing on the target video segment to obtain a video file.

5. A device for optimizing playback response speed based on HLS, characterized in that: include: a sending unit, configured to determine the video content selected by the user and send a query request to the server based on the video content; An acquisition unit is used to obtain the total duration of the original m3u8 list corresponding to the video content fed back by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags; A generation unit is used to divide the total duration of the original m3u8 list by the preset TS segment length to determine the total number of TS segments of the original m3u8 list; the relative offset time of each #EXT-X-DISCONTINUITY tag is divided by the total duration of the original m3u8 list to determine the target TS segment corresponding to the #EXT-X-DISCONTINUITY tag; initialize a new m3u8 list, and determine the total target number of TS segments that the new m3u8 list needs to list according to the total number of TS segments; Starting from the first fragment in the new m3u8 list, gradually select and list the TS files of the total target number; Identify the target TS fragment in the new m3u8 list, and insert the #EXT-X-DISCONTINUITY tag based on the starting offset point of the target TS fragment to obtain the final new m3u8 list; A receiving unit is used for sending a download request to the server according to the new m3u8 list, and receiving the video file encapsulated in TS format fed back by the server; The playback unit is configured to play the video file returned by the server according to the new m3u8 list.

6. A playback response speed optimization system based on HLS, characterized in that: include: Client request processing module, for obtaining the total duration of the original m3u8 list sent by the server and the relative offset time of all #EXT-X-DISCONTINUITY tags, and adopting the total duration of the original m3u8 list divided by the preset TS segment length, determining the total number of TS segments of the original m3u8 list; adopting the relative offset time of each #EXT-X-DISCONTINUITY tag divided by the total duration of the original m3u8 list, determining the corresponding target TS segment with the #EXT-X-DISCONTINUITY tag; Initialize a new m3u8 list, according to the total number of TS segments, determine the total target number of TS segments that the new m3u8 list needs to enumerate; Starting from the first fragment in the new m3u8 list, gradually select and list the TS files of the total target number; Identify the target TS fragment in the new m3u8 list, and insert the #EXT-X-DISCONTINUITY tag based on the starting offset point of the target TS fragment to obtain the final new m3u8 list, and send a download request to the server according to the new m3u8 list, receive the video file encapsulated in TS format fed back by the server, and play the video file; The server video processing module is used to obtain a query request containing a unique identifier of the video content sent by the client, and feedback the total duration of the original m3u8 list corresponding to the video content fed back based on the query request and the relative offset time of the #EXT-X-DISCONTINUITY tag; And, receiving the download request sent by the client, and generating a video file encapsulated in TS format based on at least the starting offset point index value and the ending offset point index value in the download request, and returning the video file to the client.

7. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Online video playing method and system as well as play application proxy equipment

    CN104581207A

  • Video data accelerated downloading method and device based on HLS (HTTP Live Streaming)stream media

    CN105611328A