CN110149560B - Player optimization method and system based on HLS protocol, storage medium and terminal - Google Patents

Player optimization method and system based on HLS protocol, storage medium and terminal Download PDF

Info

Publication number
CN110149560B
CN110149560B CN201910487532.5A CN201910487532A CN110149560B CN 110149560 B CN110149560 B CN 110149560B CN 201910487532 A CN201910487532 A CN 201910487532A CN 110149560 B CN110149560 B CN 110149560B
Authority
CN
China
Prior art keywords
code rate
current
player
video stream
changed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910487532.5A
Other languages
Chinese (zh)
Other versions
CN110149560A (en
Inventor
张超
朱善宝
肖友能
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Otvcloud Internet Technology Shanghai Co ltd
Original Assignee
Otvcloud Internet Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Otvcloud Internet Technology Shanghai Co ltd filed Critical Otvcloud Internet Technology Shanghai Co ltd
Priority to CN201910487532.5A priority Critical patent/CN110149560B/en
Publication of CN110149560A publication Critical patent/CN110149560A/en
Application granted granted Critical
Publication of CN110149560B publication Critical patent/CN110149560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • 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/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • H04N21/26216Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints involving the channel capacity, e.g. network bandwidth
    • 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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • 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/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

Abstract

The invention provides a player optimization method and system based on an HLS protocol, a storage medium and a terminal, and the method comprises the following steps: when the player starts playing, judging whether the current video stream based on the HLS protocol can be detected forwards; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration; downloading a transmission stream media fragment file of the current video stream based on the current code rate; and replacing the current code rate based on the bandwidth change, and downloading the transport stream media fragment file of the current video stream based on the replaced current code rate. The player optimization method and system based on the HLS protocol, the storage medium and the terminal can select the proper code rate to play based on the current bandwidth, thereby ensuring the fluency of video playing and greatly improving the user experience.

Description

Player optimization method and system based on HLS protocol, storage medium and terminal
Technical Field
The present invention relates to the technical field of players, and in particular, to a player optimization method and system, a storage medium, and a terminal based on an HLS protocol.
Background
With the rise of the internet, devices such as internet televisions and television set-top boxes have been used as an infrastructure to reach various households. Users watch video programs on the Internet through the television, so that much pleasure is brought to life. However, the network environment of the internet varies greatly, so that the stability is not as stable as that of a wire network. Therefore, almost every hardware manufacturer develops a player for its own hardware in order to guarantee the fluency of the video watched by the user. These players, however, vary widely in performance, and some are even directly modified based on open source code.
In the prior art, an open source player based on the IJK is widely used. Being an open source player, it accommodates a wide variety of streaming situations. However, since the player is a general-purpose open source player, there is no limitation on the usage scenario, and therefore, it is impossible to optimize and customize for a certain scenario or a certain stream, resulting in a small difference in performance among all players.
Currently, in order to cope with the difference of bandwidth, many players enable users to independently and manually select viewing quality such as fluency, high definition, super definition and the like when viewing videos, and then play videos with different code rates such as 360P, 480P and 720P according to the quality selected by the users. But this method is only applicable to situations where the bandwidth does not change. If the bandwidth fluctuates and the user selects a higher bitrate, the player will frequently be stuck.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method and a system for optimizing a player based on an HLS protocol, a storage medium, and a terminal, which can select a proper bitrate to play based on a current bandwidth, thereby ensuring fluency of video playing and greatly improving user experience.
To achieve the above and other related objects, the present invention provides a player optimization method based on HLS protocol, including the following steps: when the player starts playing, judging whether the current video stream based on the HLS protocol can be detected forwards; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration; downloading a transmission stream media fragment file of the current video stream based on the current code rate; and replacing the current code rate based on the bandwidth change, and downloading the transport stream media fragment file of the current video stream based on the replaced current code rate.
In an embodiment of the present invention, the transport stream media segment file of the current video stream is detected forward based on a naming rule of the transport stream media segment file.
In an embodiment of the present invention, when downloading the transport stream media fragment file of the current video stream, the index file of the current video stream is downloaded first, and then the corresponding transport stream media fragment file is downloaded based on the index file.
In an embodiment of the present invention, when the current code rate is changed based on a bandwidth change, a mode of increasing gradually is adopted to change from a low code rate to a high code rate.
In an embodiment of the present invention, when the current bitrate is changed based on a bandwidth change and a high bitrate is changed to a low bitrate, the high bitrate is changed to a lowest bitrate first, and then the lowest bitrate is changed to the low bitrate.
In an embodiment of the present invention, when the current bit rate is changed based on a bandwidth change, the current bit rate is changed after at least downloading a preset number of transport stream media slicing files corresponding to the current bit rate.
In an embodiment of the present invention, when the current code rate is changed based on bandwidth change, if the cache is insufficient, the current code rate is directly reduced to a code rate matched with the current bandwidth.
Correspondingly, the invention provides a player optimization system based on the HLS protocol, which comprises a forward detection module, a download module and a replacement module;
the forward detection module is used for judging whether the current video stream based on the HLS protocol can be subjected to forward detection when the player starts playing; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration;
the downloading module is used for downloading the transmission stream media fragment file of the current video stream based on the current code rate;
and the replacing module is used for replacing the current code rate based on the bandwidth change and downloading the transport stream media slicing file of the current video stream based on the replaced current code rate.
The present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described player optimization method based on the HLS protocol.
Finally, the present invention provides a terminal comprising: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory, so as to enable the terminal to execute the above-mentioned player optimization method based on the HLS protocol.
As described above, the player optimization method and system, the storage medium, and the terminal based on the HLS protocol according to the present invention have the following advantages:
(1) the most suitable code rate can be selected according to the current bandwidth for playing, and the phenomenon of pause during playing is avoided through code rate self-adaption;
(2) the forward detection technology is adopted for the live Stream, when the player starts playing, a Transport Stream (TS) media fragment file which is generated before the live Stream is detected, and the content of the generated TS media fragment file is downloaded and added into a cache, so that the playing jam condition of the player caused by the network jitter problem is resisted;
(3) through delayed playing, the HLS protocol-based player sacrifices certain real-time performance, fluency is realized, and watching experience of users of live television and television set top boxes is greatly improved.
Drawings
FIG. 1 is a flow chart illustrating a method for optimizing a player based on an HLS protocol according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a player optimization system based on HLS protocol according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the invention.
Description of the element reference numerals
21 forward detection module
22 download module
23 replacement module
31 processor
32 memory
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
The player optimization method and system based on the HLS protocol, the storage medium and the terminal can adaptively select the proper code rate to play based on the current bandwidth, and meanwhile, the smoothness of video playing is ensured by adopting the delay cache and preloading technology, the pause phenomenon in the video playing process is avoided, the watching experience of a user is greatly improved, and the method and system are suitable for application scenes such as smart televisions, television boxes and the like.
As shown in fig. 1, in an embodiment, the method for optimizing a player based on the HLS protocol of the present invention includes the following steps:
step S1, when the player starts playing, judging whether the current video stream based on HLS protocol can be detected forward; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration.
Specifically, hls (HTTP Live streaming) is an HTTP-based streaming media network transport protocol proposed by apple inc. It works by dividing the entire stream into small HTTP-based files to download, only a few at a time. When the media stream is playing, the client can choose to download the same resource from many different backup sources at different rates, allowing the streaming media session to adapt to different data rates, including an M3U8 index file, TS media slice file, and key encryption string file.
Under the HLS protocol, an example of an M3U8 index file for a live video stream is as follows:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:1711
#EXTINF:2.000000,
2300/20181030/20181030T190311.ts
#EXTINF:2.000000,
2300/20181030/20181030T190313.ts
#EXTINF:2.000000,
2300/20181030/20181030T190315.ts
#EXTINF:2.000000,
2300/20181030/20181030T190317.ts
#EXTINF:2.000000,
2300/20181030/20181030T190319.ts
under the HLS protocol, an example of an M3U8 index file for an on-demand video stream is as follows:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:1711
#EXTINF:2.000000,
2300/20181030/20181030T190311.ts
#EXTINF:2.000000,
2300/20181030/20181030T190313.ts
#EXTINF:2.000000,
2300/20181030/20181030T190315.ts
#EXTINF:2.000000,
2300/20181030/20181030T190317.ts
#EXTINF:2.000000,
2300/20181030/20181030T190319.ts
#ENDLIST
from the above, the biggest difference between the live video stream and the on-demand video stream is: the on-demand video stream will have a word of # ENDLIST at the last end of M3U8, and the rest will be identical.
Since the on-demand video stream is to store all TS media segment files in the M3U8 file, there is no unstable playing caused by network jitter. Therefore, the player optimization method based on the HLS protocol is mainly performed aiming at live video streaming. As can be seen from the M3U8 of the live video stream, each TS file is 2 seconds, and there is a delay of about 10 seconds in the M3U8 file (2 seconds by 5 pieces to 10 seconds).
Video streaming according to the HLS protocol typically has several different bit rates, such as smooth, high definition, super definition, and different M3U8 files for different bit rates. The code rate is the number of data bits transmitted per unit time during data transmission. The bandwidth is the transfer rate or the maximum number of bytes transferred per second. Different bandwidths correspond to different code rates. Therefore, the player needs to acquire the current corresponding M3U8 file in real time according to the current network bandwidth, so as to acquire the corresponding TS media fragment file.
When the player plays the video, the buffer amount of the TS media fragment file determines whether the video playing is blocked or not. In the live broadcasting process, the player acquires a few TS media fragment files as much as possible. This is because the name of the subsequent TS media segment file cannot be known during the live broadcast process. As can be seen from the contents of the M3U8 file, the file format and the file name of the M3U8 file have certain rules. Therefore, the file format and file name of the previous M3U8 file can be calculated. Although there is a possibility of error in the estimation, the file name estimated according to the format has at least 95% accuracy. Therefore, the player optimization based on the HLS protocol adopts a delay cache mode to preload the TS media fragment file detected forward. Specifically, when the player starts playing, it is determined whether the current video stream based on the HLS protocol can be probed forward. If forward detection can be performed, forward detection is performed on the current video stream based on the naming rule of the TS media segment file to obtain a transport stream media segment file with a preset duration, such as a forward detection 6s TS media segment file. For example, a TS file named 2300/20190306/20190306t113028.TS, if the interval time is 2 seconds, the name of the resulting TS media segment file can be presumed to be:
2300/20190306/20190306T113026.ts
2300/20190306/20181030T113024.ts
2300/20190306/20181030T113022.ts
…………..
and preloading the TS media fragment file detected forwards, and storing the TS media fragment file in a cache. When the network is not good, the normal playing can still be carried out within a certain time, thereby realizing the purpose of resisting the network jitter.
It should be noted that if the forward probing cannot be performed, no operation is performed.
And step S2, downloading the transport stream media slicing file of the current video stream based on the current code rate.
Specifically, the matched code rate is adaptively selected according to the current bandwidth, so that the transport stream media fragment file of the current video stream is downloaded. When downloading the transport stream media fragment file of the current video stream, firstly downloading the index file of the current video stream, and then downloading the corresponding transport stream media fragment file based on the index file.
And step S3, replacing the current code rate based on the bandwidth change, and downloading the transport stream media slicing file of the current video stream based on the replaced current code rate.
Specifically, if the current bandwidth changes, the current bitrate needs to be changed according to the change condition of the bandwidth, so as to ensure the smoothness of video playing. Wherein, the replacement code rate needs to follow the following rules:
(1) and when the current code rate is changed based on the bandwidth change, changing from a low code rate to a high code rate in a step-by-step increasing mode. That is, the code rate must be increased one by one during the rising process. The video stream is set to have 3 code rates, namely 700 code rates, 1300 code rates and 2300 code rates. For example, the code rate 700, the code rate 1300, and the code rate 2300 must be sequentially passed from the code rate 700 to the code rate 2300. Specifically, TS (a) _ B is used for representing the code rate, TS is represented as a TS media slicing file, a represents a serial number, and B represents the code rate of the TS media slicing file. The code rate change corresponding to the user downloading the TS file is as follows: TS (1) _700 code rate, TS (2) _700 code rate, TS (3) _1300 code rate, TS (4) _1300 code rate, TS (5) _2300 code rate, TS (6) _2300 code rate.
(2) And when the current code rate is changed based on the bandwidth change, at least downloading the transport stream media slicing files corresponding to the preset number of the current code rate and then changing the current code rate. That is, the current code rate is maintained as much as possible, and an inertia principle is adopted for the change of the code rate. The change can be performed only after at least a preset number of TS media fragment files appear. Preferably, the preset number is 2. For example, when the bandwidth only satisfies the user playing 1300 bit rate, the bit rate corresponding to the user downloading the TS media segment file changes as follows: TS (1) _700 code rate, TS (2) _700 code rate, TS (3) _1300 code rate, TS (4) _1300 code rate, TS (5) _1300 code rate, TS (6) _1300 code rate.
(3) And when the current code rate is changed based on bandwidth change, if the cache is insufficient, directly reducing the current code rate to the code rate matched with the current bandwidth. Specifically, when the download buffer is insufficient, the lazy principle will not work, but directly reduce the current code rate to the most suitable code rate. For example, when the user is performing 2300-bit rate smooth playing, the network can only perform 700-bit rate playing when jitter occurs, and the bit rate changes as follows when the cache is insufficient: TS (N) _2300 code rate, TS (N +1) _2300 code rate, TS (N +2) _700 code rate, TS (N +3) _700 code rate.
(4) And when the current code rate is changed based on bandwidth change and the high code rate is changed to the low code rate, firstly, changing the high code rate to the lowest code rate, and then, changing the lowest code rate to the low code rate. For example, when the user network has jitter, the code rate changes from being able to smoothly view the 2300 code rate to being able to smoothly view the 1300 code rate as follows: TS (N) _2300 code rate, TS (N +1) _2300 code rate, TS (N +2) _700 code rate, TS (N +3) _700 code rate, TS (N +4) _1300 code rate, TS (N +5) _1300 code rate. When the user network shakes, the code rate changes from the code rate of 2300 capable of being watched smoothly to the code rate of 1300 capable of being played smoothly, and then the code rate changes when the code rate of 2300 capable of being played smoothly are as follows: TS (N) _2300 code rate, TS (N +1) _2300 code rate, TS (N +2) _700 code rate, TS (N +3) _700 code rate, TS (N +4) _1300 code rate, TS (N +5) _1300 code rate.
As shown in fig. 2, in an embodiment, the player optimization system based on the HLS protocol of the present invention includes a forward probing module 21, a downloading module 22, and a replacing module 23.
The forward detection module 21 is configured to determine whether a current video stream based on the HLS protocol can be forward detected when the player starts playing; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration;
the downloading module 22 is connected to the forward detection module 21, and configured to download the transport stream media fragment file of the current video stream based on the current bit rate;
the replacing module 23 is connected to the downloading module 22, and configured to replace the current bitrate based on a bandwidth change, and download the transport stream media fragment file of the current video stream based on the replaced current bitrate.
The structures and principles of the forward detection module 21, the download module 22 and the replacement module 23 all correspond to the optimization method of the player based on the HLS protocol one to one, and therefore, the details are not repeated herein.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And the modules can be realized in a form that all software is called by the processing element, or in a form that all the modules are realized in a form that all the modules are called by the processing element, or in a form that part of the modules are called by the hardware. For example: the x module can be a separately established processing element, and can also be integrated in a certain chip of the device. In addition, the x-module may be stored in the memory of the apparatus in the form of program codes, and may be called by a certain processing element of the apparatus to execute the functions of the x-module. Other modules are implemented similarly. All or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software. These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), and the like. When a module is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. These modules may be integrated together and implemented in the form of a System-on-a-chip (SOC).
The storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the above-described player optimization method based on the HLS protocol. The storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
As shown in fig. 3, in an embodiment, the terminal of the present invention includes: a processor 31 and a memory 32.
The memory 32 is used for storing computer programs.
The memory 32 includes: various media that can store program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
The processor 31 is connected to the memory 32, and is configured to execute the computer program stored in the memory 32, so that the terminal executes the above-mentioned player optimization method based on the HLS protocol.
Preferably, the Processor 31 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In summary, the player optimization method and system, the storage medium and the terminal based on the HLS protocol of the present invention can select the most suitable code rate according to the current bandwidth for playing, and avoid the pause phenomenon during playing through code rate adaptation; the forward detection technology is adopted for the live stream, TS media fragment files generated before the live stream are detected when the player starts playing, and the generated TS media fragment file contents are downloaded and added into the cache, so that the playing jam condition of the player caused by the network jitter problem is resisted; through delayed playing, the HLS protocol-based player sacrifices certain real-time performance, fluency is realized, and watching experience of users of live television and television set top boxes is greatly improved. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (8)

1. A player optimization method based on HLS protocol is characterized by comprising the following steps:
when the player starts playing, judging whether the current video stream based on the HLS protocol can be detected forwards; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration;
downloading a transmission stream media fragment file of the current video stream based on the current code rate;
changing the current code rate based on the bandwidth change, and downloading the transport stream media fragment file of the current video stream based on the changed current code rate;
when the current code rate is changed based on bandwidth change and the high code rate is changed to the low code rate, firstly, the high code rate is changed to be the lowest code rate, and then, the lowest code rate is changed to be the low code rate;
and when the current code rate is changed based on the bandwidth change, at least downloading the transport stream media slicing files corresponding to the preset number of the current code rate and then changing the current code rate.
2. The method of claim 1, wherein the transport stream media slice file of the current video stream is probed forward based on a naming rule of the transport stream media slice file.
3. The method of claim 1, wherein when downloading the transport stream media slice file of the current video stream, the method first downloads the index file of the current video stream, and then downloads the corresponding transport stream media slice file based on the index file.
4. The optimization method of player based on HLS protocol according to claim 1, wherein when the current bitrate is changed based on a bandwidth change, it is changed from a low bitrate to a high bitrate in a stepwise increasing manner.
5. The optimization method of player based on HLS protocol according to claim 1, wherein when the current bitrate is changed based on a bandwidth change, if the cache is insufficient, the current bitrate is directly reduced to a bitrate matched with the current bandwidth.
6. The player optimization system based on the HLS protocol is characterized by comprising a forward detection module, a download module and a replacement module;
the forward detection module is used for judging whether the current video stream based on the HLS protocol can be subjected to forward detection when the player starts playing; if yes, forward detection is carried out on the current video stream to obtain a transmission stream media fragment file with preset duration;
the downloading module is used for downloading the transmission stream media fragment file of the current video stream based on the current code rate;
the replacing module is used for replacing the current code rate based on bandwidth change and downloading the transport stream media slicing file of the current video stream based on the replaced current code rate;
when the current code rate is changed based on bandwidth change and the high code rate is changed to the low code rate, firstly, the high code rate is changed to be the lowest code rate, and then, the lowest code rate is changed to be the low code rate;
and when the current code rate is changed based on the bandwidth change, at least downloading the transport stream media slicing files corresponding to the preset number of the current code rate and then changing the current code rate.
7. A storage medium on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method for player optimization based on the HLS protocol of any one of claims 1 to 5.
8. A terminal, comprising: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory to cause the terminal to execute the HLS protocol-based player optimization method according to any one of claims 1 to 5.
CN201910487532.5A 2019-06-05 2019-06-05 Player optimization method and system based on HLS protocol, storage medium and terminal Active CN110149560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910487532.5A CN110149560B (en) 2019-06-05 2019-06-05 Player optimization method and system based on HLS protocol, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910487532.5A CN110149560B (en) 2019-06-05 2019-06-05 Player optimization method and system based on HLS protocol, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110149560A CN110149560A (en) 2019-08-20
CN110149560B true CN110149560B (en) 2021-11-16

Family

ID=67590550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910487532.5A Active CN110149560B (en) 2019-06-05 2019-06-05 Player optimization method and system based on HLS protocol, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110149560B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064979B (en) * 2019-12-30 2023-02-28 广州市百果园网络科技有限公司 Webpage live broadcasting method and device, webpage terminal and storage medium
CN111432246B (en) * 2020-03-23 2022-11-15 广州市百果园信息技术有限公司 Method, device and storage medium for pushing video data
CN113411643B (en) * 2021-05-26 2022-11-11 中国人民解放军国防科技大学 Video quality optimization method, system, electronic equipment and storage medium
CN114173145A (en) * 2021-12-08 2022-03-11 四川启睿克科技有限公司 HLS protocol-based dynamic code rate low-delay live broadcast method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747296A (en) * 2013-12-31 2014-04-23 深圳市同洲电子股份有限公司 Video playing method and system
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
CN107071529A (en) * 2017-03-29 2017-08-18 咪咕视讯科技有限公司 A kind of HLS video broadcasting methods, terminal and server
CN107438202A (en) * 2016-05-26 2017-12-05 中兴通讯股份有限公司 A kind of method and device for realizing code check switching
CN108668146A (en) * 2017-03-27 2018-10-16 华为技术有限公司 A kind of method and apparatus of adjustment streaming media bit rate
CN109547846A (en) * 2019-01-31 2019-03-29 青岛海信电器股份有限公司 A kind of HLS bitstreams switching method, apparatus and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4284369B2 (en) * 2007-03-07 2009-06-24 株式会社東芝 VIDEO REPRODUCTION DEVICE, CONTROLLED DEVICE, VIDEO REPRODUCTION CONTROL METHOD, AND PROGRAM
WO2012167558A1 (en) * 2011-11-16 2012-12-13 华为技术有限公司 Method, terminal, server and system for playing media file
US9596281B2 (en) * 2014-03-18 2017-03-14 Qualcomm Incorporated Transport accelerator implementing request manager and connection manager functionality
CN105992016A (en) * 2015-02-05 2016-10-05 天脉聚源(北京)科技有限公司 HLS on-line transcoding method and system
US20180103271A1 (en) * 2016-10-10 2018-04-12 Qualcomm Incorporated Systems and methods for signaling missing or corrupted video data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
CN103747296A (en) * 2013-12-31 2014-04-23 深圳市同洲电子股份有限公司 Video playing method and system
CN107438202A (en) * 2016-05-26 2017-12-05 中兴通讯股份有限公司 A kind of method and device for realizing code check switching
CN108668146A (en) * 2017-03-27 2018-10-16 华为技术有限公司 A kind of method and apparatus of adjustment streaming media bit rate
CN107071529A (en) * 2017-03-29 2017-08-18 咪咕视讯科技有限公司 A kind of HLS video broadcasting methods, terminal and server
CN109547846A (en) * 2019-01-31 2019-03-29 青岛海信电器股份有限公司 A kind of HLS bitstreams switching method, apparatus and equipment

Also Published As

Publication number Publication date
CN110149560A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
CN110149560B (en) Player optimization method and system based on HLS protocol, storage medium and terminal
US10623785B2 (en) Streaming manifest quality control
EP3210385B1 (en) Dynamic programming across multiple streams
US8837586B2 (en) Bandwidth-friendly representation switching in adaptive streaming
US10291681B2 (en) Directory limit based system and method for storing media segments
US20090282162A1 (en) Optimized client side rate control and indexed file layout for streaming media
EP3022884A1 (en) Quality optimization with buffer and horizon constraints in adaptive streaming
WO2012033766A1 (en) Method and apparatus for adaptive bit rate switching
CN106803968B (en) Method for adaptively adjusting video resolution based on bandwidth of HLS protocol
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
CN110022498B (en) Method and device for realizing code rate switching
US10244016B1 (en) Local cache for media content playback
US20160028594A1 (en) Generating and Utilizing Contextual Network Analytics
CN106105145B (en) Method for operating a buffer arranged along a transmission path between a client terminal and at least one server, and corresponding buffer
US11743535B2 (en) Video fragment file processing
CN107566854B (en) Method and device for acquiring and sending media content
US11575975B2 (en) Methods, systems, and apparatuses for improved content scoring and delivery
TW201601493A (en) Method for operating a network equipment arranged along a transmission path between a client terminal and at least one server, and corresponding network equipment
EP3664456A1 (en) Apparatus and method for playing streamed media
TW201501527A (en) Method for retrieving, by a client terminal, a content part of a multimedia content
EP3926929B1 (en) Process for managing the playback of digital content within a multimedia content player terminal connected to a restitution device
US20230421821A1 (en) Method for Managing Playback of Multimedia Content
US20220417311A1 (en) Management of the http adaptive streaming of an item of digital content in screen saver mode
FR3096210A1 (en) A method of transmitting digital content having several versions accessible from a content server to a playback terminal.
FR3114719A1 (en) Method for managing the reading of digital content within a multimedia content player terminal connected to a rendering device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant