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 PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000005457 optimization Methods 0.000 title claims abstract description 25
- 239000012634 fragment Substances 0.000 claims abstract description 33
- 230000008859 change Effects 0.000 claims abstract description 28
- 238000001514 detection method Methods 0.000 claims abstract description 22
- 230000005540 biological transmission Effects 0.000 claims abstract description 13
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 description 4
- 230000003111 delayed effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000036316 preload Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management 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/262—Content 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/26208—Content 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/26216—Content 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management 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/266—Channel 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/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440281—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
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
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.
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 (5)
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 |
CN117793075A (en) * | 2023-12-28 | 2024-03-29 | 广州市维博网络信息科技有限公司 | Network computer multimedia video playing method and system |
Citations (6)
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)
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 |
CN102550038A (en) * | 2011-11-16 | 2012-07-04 | 华为技术有限公司 | Method, terminal, server and system for playing media files |
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 |
-
2019
- 2019-06-05 CN CN201910487532.5A patent/CN110149560B/en active Active
Patent Citations (6)
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 | |
WO2015009684A1 (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 | |
US10244016B1 (en) | Local cache for media content playback | |
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 | |
US11575975B2 (en) | Methods, systems, and apparatuses for improved content scoring and delivery | |
US11743535B2 (en) | Video fragment file processing | |
CN107566854B (en) | Method and device for acquiring and sending media content | |
CN110022498B (en) | Method and device for realizing code rate switching | |
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 | |
EP3664456A1 (en) | Apparatus and method for playing streamed media | |
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 | |
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 | |
US12028398B2 (en) | Management of the http adaptive streaming of an item of digital content in screen saver mode | |
US20230421821A1 (en) | Method for Managing Playback of Multimedia Content | |
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 |