CN109951446B - Method and system for stabilizing live stream, computer storage medium and electronic device - Google Patents

Method and system for stabilizing live stream, computer storage medium and electronic device Download PDF

Info

Publication number
CN109951446B
CN109951446B CN201910091978.6A CN201910091978A CN109951446B CN 109951446 B CN109951446 B CN 109951446B CN 201910091978 A CN201910091978 A CN 201910091978A CN 109951446 B CN109951446 B CN 109951446B
Authority
CN
China
Prior art keywords
stream
propagation
time
live
multimedia stream
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
CN201910091978.6A
Other languages
Chinese (zh)
Other versions
CN109951446A (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 CN201910091978.6A priority Critical patent/CN109951446B/en
Publication of CN109951446A publication Critical patent/CN109951446A/en
Application granted granted Critical
Publication of CN109951446B publication Critical patent/CN109951446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a method and a system for stabilizing a live stream, a computer storage medium and electronic equipment, wherein the method for stabilizing the live stream comprises the following steps: downloading an original multimedia stream; detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream; storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream, and outputting the multimedia stream buffered in the buffer queue in a live broadcast manner. The method, the system, the computer storage medium and the electronic equipment for stabilizing the live streaming perform various abnormal detections, filtering and caching on the input HLS live streaming, and output the stable HLS live streaming; the method has better steady flow effect on the condition of poor source stream video quality. Meanwhile, the time needing to be cached and delayed can be modified through configuration, and the delay requirement under a live broadcast scene is met. In addition, the embodiment meets the requirements of different processing modules, and outputs a uniform and stable HLS stream.

Description

Method and system for stabilizing live stream, computer storage medium and electronic device
Technical Field
The invention belongs to the technical field of multimedia live broadcast, relates to a current stabilization method and a current stabilization system, and particularly relates to a current stabilization method and a current stabilization system for live broadcast streams, a computer storage medium and electronic equipment.
Background
The more common protocols are the rtmp protocol and the HLS protocol. The HLS protocol has a great advantage: HTML5 can open the playback directly; this means can forward share through WeChat etc. a live link, need not install any independent APP, have the browser can, so the popularity is very high.
HLS, Http Live Streaming, is a Streaming media transfer protocol proposed by apple based on Http. The basic principle of HLS is that when the acquisition Stream pushing end pushes a video Stream to a streaming media server, the server packages the received Stream information into a new ts file (Transport Stream) every time the Stream information is cached for a while, and meanwhile, the server establishes an index file of m3u8 to maintain the index of the latest ts segments. When the playing end obtains the live broadcast, the playing end obtains the latest ts video file segment from the m3u8 index file to play, so that the user can see the newer content at any time when the user is connected, and the experience of similar live broadcast is realized. Compared with common streaming media live broadcast protocols, such as an RTMP protocol, an RTSP protocol, and the like, the HLS is different from a live broadcast client that acquires a continuous short-duration media file instead of a complete data stream, and the client continuously downloads and plays the small files. The theoretical minimum delay in this manner is the duration of one ts file, typically 2-3 ts files.
In an application scenario of audio/video processing, a flow of preprocessing, such as slicing, transcoding, etc., on an HLS stream is sometimes required. In these scenarios, the first step is to pull the original HLS source stream. Since the source of the HLS source stream is not controllable, the video parameters and the network conditions are different, which may cause certain influence on the subsequent processing.
Therefore, how to provide a method, a system, a computer storage medium and an electronic device for stabilizing a live stream to solve the problem that the prior art cannot handle various abnormal conditions of a source stream, which results in poor quality of a source stream silver video, has become a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method, a system, a computer storage medium, and an electronic device for stabilizing a live stream, which are used to solve the problem that the prior art cannot handle various abnormal conditions of a source stream, resulting in poor quality of a source stream silver video.
To achieve the above and other related objects, an aspect of the present invention provides a method for stabilizing a live stream, including: downloading an original multimedia stream; detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream; storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream, and outputting the multimedia stream buffered in the buffer queue in a live broadcast manner.
In an embodiment of the present invention, the step of downloading the original multimedia stream includes: pulling a first-level file index of the original multimedia stream; analyzing the first-level file index, and extracting the address of the second-level file index from the first-level file index; downloading a secondary file index of a code rate matched with the network bandwidth according to the network bandwidth; and downloading the corresponding propagation stream piece of the multimedia stream according to the file content of the secondary file index.
In an embodiment of the present invention, the abnormal condition existing in the original multimedia stream includes an abnormal time length of a propagated stream slice in the multimedia stream, an abnormal time length format of the propagated stream slice in the multimedia stream, and/or an abnormal download timeout of the propagated stream slice in the multimedia stream.
In an embodiment of the present invention, the step of detecting and processing the abnormal condition existing in the original multimedia stream to form a processed multimedia stream includes: detecting and processing the abnormal time length of the transmission stream slice in the multimedia stream in the abnormal condition; detecting and processing the time length format abnormity of the propagation stream slice in the multimedia stream in the abnormal condition; and/or detecting and processing the download timeout abnormity of the propagation stream slice in the multimedia stream in the abnormal condition.
In an embodiment of the present invention, the step of detecting and processing the time length abnormality of the stream slice propagating in the multimedia stream in the abnormal condition includes: and detecting the time length of the propagation stream slice in the multimedia stream, and comparing the time length of the propagation stream slice with the maximum time length value of the propagation stream slice to filter abnormal time length values of the propagation stream slice and form the processed propagation stream slice.
In an embodiment of the present invention, the step of detecting and processing the time format abnormality of the stream slice propagating in the multimedia stream in the abnormal condition includes: and detecting the time length format of the propagation stream slice in the multimedia stream, comparing the time length format with the standard time length format of the propagation stream slice, modifying the time length format of the propagation stream slice with abnormality into the standard time length format, and forming the processed propagation stream slice.
In an embodiment of the present invention, the step of detecting and processing the download timeout exception of the stream slice propagating in the multimedia stream in the exception condition includes: detecting the overtime download retry times of the propagation stream slice in the multimedia stream, comparing the overtime download retry times with an overtime download retry time threshold, if the overtime download retry times exceed the overtime download retry time threshold, determining that the download fails, skipping the propagation stream slice, and forming a processed propagation stream slice; if not, the downloading is considered to be successful.
In an embodiment of the present invention, the step of simulating output of the live stream includes: adding a piece of propagation stream slice at the head of the queue in the cache queue into the second-level file index, and deleting the last piece of propagation stream slice in the second-level file index so as to keep the number of the propagation stream slices in the second-level file index fixed; meanwhile, the waiting time of the output propagation stream slice is corrected.
In another aspect, the present invention provides a system for stabilizing a live stream, including: the downloading module is used for downloading the original multimedia stream;
the processing module is used for detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream; the simulation module is used for storing the processed multimedia stream into a preset buffer queue and simulating the output of the live stream; and the output module is used for outputting the multimedia stream cached in the cache queue in a live broadcast manner.
Yet another aspect of the invention provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method of steady flow of said live stream.
A final aspect of the present invention provides an electronic device, comprising: a processor and a memory; the memory is used for storing a computer program, and the processor is used for executing the computer program stored by the memory so as to enable the electronic equipment to execute the steady flow method of the live stream.
As described above, the method, system, computer storage medium and electronic device for stabilizing a live stream according to the present invention have the following advantages:
the method, the system, the computer storage medium and the electronic equipment for stabilizing the live streaming perform various abnormal detections, filtering and caching on the input HLS live streaming and output the stable HLS live streaming. Different input HLS flow cases can be handled, and the primary m3u8 and secondary m3u8 formats are compatible. The method has a good steady flow effect on the condition that the source stream video quality is not good, such as ts slice time length is not fixed, m3u8 updating is not uniform, file downloading is overtime, network jitter in a certain range and the like. Meanwhile, the time needing to be cached and delayed can be modified through configuration, and the delay requirement under a live broadcast scene is met. In addition, the embodiment meets the requirements of different processing modules, and outputs a uniform and stable HLS stream.
Drawings
Fig. 1 is a flow chart illustrating a method for stabilizing a live stream according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of S11 in the method for stabilizing a live stream according to the present invention.
Fig. 3 is a schematic structural diagram of a steady flow system of a live stream according to an embodiment of the present invention.
Description of the element reference numerals
3 Current stabilization system of live broadcast stream
31 Download module
32 Processing module
33 Analog module
34 Output module
S11~S13 Step (ii) of
S111~S114 Step (ii) of
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 invention provides
Example one
The embodiment provides a method for stabilizing a live stream, which includes:
downloading an original multimedia stream;
detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream;
storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream, and outputting the multimedia stream buffered in the buffer queue in a live broadcast manner.
The method for stabilizing the live stream provided by the present embodiment will be described in detail with reference to the drawings. Please refer to fig. 1, which is a flowchart illustrating a method for streaming live streaming according to an embodiment. As shown in fig. 1, the method for stabilizing the live stream specifically includes the following steps:
s11, downloading the original multimedia stream. In this embodiment, the original multimedia stream refers to an original HLS stream.
Please refer to fig. 2, which shows a flowchart of S11. As shown in fig. 2, the S11 includes the following steps:
s111, according to the configuration items, for example, the downloading code rate, the first-level file index of the original multimedia stream is pulled. In this embodiment, the primary file index is primary m3u 8.
Configuration items are for example:
# stream Rate for download (max min all)
bandwidth=max
For example, streams for a particular code rate are pulled according to a configuration
Primary m3u8 is as follows:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2300000
2300.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1300000
1300.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=700000
700.m3u8
and S112, analyzing the primary file index, and extracting the address of the secondary file index from the primary file index. In this embodiment, the secondary file index is secondary m3u 8.
For example, secondary m3u 8:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:122065
#EXTINF:2.000000,
2300/20190116/20190116T165009.ts
#EXTINF:2.000000,
2300/20190116/20190116T165011.ts
#EXTINF:2.000000,
2300/20190116/20190116T165013.ts
#EXTINF:2.000000,
2300/20190116/20190116T165015.ts
s113, downloading a secondary file index of a code rate matched with the network bandwidth according to the network bandwidth;
s114, according to the file content of the second-level file index, downloading the corresponding transmission stream slice (TS file) of the multimedia stream.
S12, detecting and processing the abnormal condition of the original multimedia flow to form the processed multimedia flow. In this embodiment, the abnormal condition existing in the original multimedia stream includes an abnormal time length for propagating a stream slice in the multimedia stream, an abnormal time length format for propagating a stream slice in the multimedia stream, and/or an abnormal download timeout for propagating a stream slice in the multimedia stream.
The S12 includes:
and detecting and processing the time length abnormity of the propagation stream slice in the multimedia stream in the abnormal condition to form the processed propagation stream slice in the multimedia stream.
Specifically, the time length of the propagation stream slice in the multimedia stream is detected, and the time length of the propagation stream slice is compared with the maximum time length value of the propagation stream slice to filter the abnormal time length value of the propagation stream slice and form the processed propagation stream slice.
For example, in the following two levels m3u8, an abnormal value occurs in the duration of the ts file:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:122065
#EXTINF:2.000000,
2300/20190116/20190116T165009.ts
#EXTINF:2.000000,
2300/20190116/20190116T165011.ts
#EXTINF:21563.000000,
2300/20190116/20190116T165013.ts
#EXTINF:2.000000,
2300/20190116/20190116T165015.ts
according to the configuration, the abnormal values are filtered, and the configuration items are as follows:
the maximum duration of the # ts slice is used to screen out the outlier # EXTINF:21563.000000, unit: second of
tsDurationMax=30
And detecting and processing the time length format abnormity of the propagation stream slice in the multimedia stream in the abnormal condition to form the processed propagation stream slice in the multimedia stream.
Specifically, the time length format of the propagation stream slice in the multimedia stream is detected, the time length format of the propagation stream slice is compared with the standard time length format of the propagation stream slice, the time length format of the propagation stream slice with the abnormality is modified into the standard time length format, and the processed propagation stream slice is formed.
For example, in the following two levels m3u8, the time format of the ts file is not the standard time format:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:1424
#EXTINF:4.000,4.440000000 2512000
2300/20190116/20190116T165559.ts
#EXTINF:4.000000,4.120000000 2512000
2300/20190116/20190116T165601.ts
#EXTINF:4.000000,3.980000000 2512000
2300/20190116/20190116T165603.ts
#EXTINF:4.000000,4.050000000 2512000
2300/20190116/20190116T165605.ts
where the time format of # EXTINF:4.000, 4.4400000002512000 is incorrect, i.e. the exact time value in the following is used.
And/or detecting and processing the download overtime exception of the propagation stream slice in the multimedia stream in the exception condition to form the processed propagation stream slice. In this embodiment, the file download timeout is due to live source problems and/or network jitter problems.
Specifically, detecting the number of times of retry of the overtime download of the propagation stream slice in the multimedia stream, comparing the number of times of retry of the overtime download with a threshold of the number of times of retry of the overtime download (in this embodiment, the threshold of the number of times of retry of the overtime download is set to 3 times), if the number of times of retry of the overtime download exceeds the threshold, determining that the download fails, skipping the propagation stream slice, and forming a processed propagation stream slice; if not, the downloading is considered to be successful. For file downloads that do not exceed 3 times, subsequent stable output may not be affected.
And S13, storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream, and outputting the multimedia stream buffered in the buffer queue in a live broadcast manner. In this embodiment, since the buffer queue is preset, network jitter in the buffer time can be resisted to ensure stable output.
Specifically, the S13 includes:
and under the condition that the preset cache queue is not empty, adding a piece of the propagation stream slice (ts slice) at the head of the queue in the cache queue into the second-level file index, and deleting the last piece of the propagation stream slice (ts slice) in the second-level file index (second-level m3u8) so as to keep the number of the propagation stream slices in the second-level file index fixed. In this embodiment, each time the update is completed, the time of the last ts pieces of time in the secondary file index (secondary m3u8) is waited, and the next secondary file index (secondary m3u8) is continuously updated to simulate the output of the secondary m3u8 of the live stream.
Since there may be a certain time consumption in outputting the live stream, if waiting according to the actual ts piece duration may result in an accumulated delay of the output stream, and the delay time will be longer and longer. Therefore, the latency of outputting the stream slice is corrected while simulating the output.
Specifically, first, the waiting time is calculated;
tlepase (time consumed) ═ tLogicEnd-time-lastlogiciend-time-lastSleep (last wait time);
tWaitModify, tWait, tlelapse (elapsed time);
lastlogiciend (last logic end time) ═ tLogicEnd (logic end time), lastSleep (last wait time) ═ tWaitModify (corrected wait time)
Then, a wait is started.
time.Sleep(time.Duration(tWaitModify)*time.Millisecond)
And finally, outputting the stable and accurate HLS live streaming processed by the steps.
The present embodiment also provides a computer storage medium (also referred to as computer-readable storage medium) having stored thereon a computer program which, when executed by a processor, implements a method of steady flow of the live stream.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the above method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The method for stabilizing the live streaming provided by this embodiment performs various kinds of anomaly detection, filtering, and caching on the input HLS live streaming, and outputs the stable HLS live streaming. Different input HLS flow cases can be handled, and the primary m3u8 and secondary m3u8 formats are compatible. The method has a good steady flow effect on the condition that the source stream video quality is not good, such as ts slice time length is not fixed, m3u8 updating is not uniform, file downloading is overtime, network jitter in a certain range and the like. Meanwhile, the time needing to be cached and delayed can be modified through configuration, and the delay requirement under a live broadcast scene is met. In addition, the embodiment meets the requirements of different processing modules, and outputs a uniform and stable HLS stream.
Example two
This embodiment provides a current stabilization system of live streaming, includes:
the downloading module is used for downloading the original multimedia stream;
the processing module is used for detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream;
the simulation module is used for storing the processed multimedia stream into a preset buffer queue and simulating the output of the live stream;
and the output module is used for outputting the multimedia stream cached in the cache queue in a live broadcast manner.
The current stabilization system for live streams provided by the present embodiment will be described in detail below with reference to the drawings. Please refer to fig. 3, which is a schematic structural diagram illustrating a steady flow system of a live stream in an embodiment. As shown in fig. 3, the current stabilization system 3 for live streaming includes a downloading module 31, a processing module 32, an analog module 33, and an output module 34.
The download module 31 is used for downloading the original multimedia stream. In this embodiment, the original multimedia stream refers to an original HLS stream.
The downloading module 31 is specifically configured to pull a first-level file index of the original multimedia stream; analyzing the first-level file index, and extracting the address of the second-level file index from the first-level file index; downloading a secondary file index of a code rate matched with the network bandwidth according to the network bandwidth; and downloading the corresponding propagation stream piece of the multimedia stream according to the file content of the secondary file index.
The processing module 32 coupled to the downloading module 31 is used for detecting and processing the abnormal condition existing in the original multimedia stream to form a processed multimedia stream. In this embodiment, the abnormal condition existing in the original multimedia stream includes an abnormal time length for propagating a stream slice in the multimedia stream, an abnormal time length format for propagating a stream slice in the multimedia stream, and/or an abnormal download timeout for propagating a stream slice in the multimedia stream.
Specifically, the processing module 32 is configured to detect and process a time length exception of a propagation stream slice in the multimedia stream in the exception condition, so as to form a processed propagation stream slice in the multimedia stream.
The processing module 32 is configured to detect a time length of a propagation stream slice in the multimedia stream, and compare the time length with a maximum time length value of the propagation stream slice to filter a time length abnormal value of the propagation stream slice, so as to form a processed propagation stream slice.
Specifically, the processing module 32 is configured to detect and process a time format exception of a propagation stream slice in the multimedia stream in the exception condition, so as to form a processed propagation stream slice in the multimedia stream.
The processing module 32 is configured to detect a time length format of a propagation stream slice in the multimedia stream, compare the time length format with a standard time length format of the propagation stream slice, modify the time length format of the propagation stream slice with an abnormality into the standard time length format, and form a processed propagation stream slice.
And/or the processing module 32 is configured to detect and process a download timeout exception of a propagation stream slice in the multimedia stream in the exception condition, so as to form a processed propagation stream slice. In this embodiment, the file download timeout is due to live source problems and/or network jitter problems.
The processing module 32 is configured to detect an overtime download retry number of the propagation stream slice in the multimedia stream, compare the overtime download retry number with an overtime download retry number threshold (in this embodiment, the overtime download retry number threshold is set to 3), and if the overtime download retry number exceeds the overtime download retry number threshold, consider that the download has failed, and skip the propagation stream slice to form a processed propagation stream slice; if not, the downloading is considered to be successful. For file downloads that do not exceed 3 times, subsequent stable output may not be affected.
The simulation module coupled to the download module 31 and the processing module 32 is configured to store the processed multimedia stream into a preset buffer queue, simulate output of a live stream, and finally output the multimedia stream buffered in the buffer queue live through the output module 34. In this embodiment, since the buffer queue is preset, network jitter in the buffer time can be resisted to ensure stable output.
Specifically, the simulation module 33 is configured to, in a case that the preset buffer queue is not empty, add a propagation stream slice (ts slice) at the head of the queue in the buffer queue to the second-level file index, and delete the last propagation stream slice (ts slice) in the second-level file index (second-level m3u8), so as to keep the number of propagation stream slices in the second-level file index fixed. In this embodiment, each time the update is completed, the time of the last ts pieces of time in the secondary file index (secondary m3u8) is waited, and the next secondary file index (secondary m3u8) is continuously updated to simulate the output of the secondary m3u8 of the live stream.
Since there may be a certain time consumption in outputting the live stream, if waiting according to the actual ts piece duration may result in an accumulated delay of the output stream, and the delay time will be longer and longer. Therefore, the simulation module 33 corrects the latency of outputting the propagation stream slice while simulating the output.
It should be noted that the division of the modules of the above current stabilizing system is only a division of logical functions, 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 processing element which is independently established, and can also be integrated in a certain chip of the current stabilizing system. In addition, the x module may also be stored in the memory of the current stabilization system in the form of program codes, and a certain processing element of the current stabilization system calls and executes 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).
EXAMPLE III
The present embodiment provides an electronic device, including: a processor, memory, transceiver, communication interface, or/and system bus; the memory is used for storing computer programs, the communication interface is used for communicating with other equipment, and the processor and the transceiver are used for operating the computer programs so as to enable the electronic equipment to execute the steps of the current stabilization method of the live streaming.
The above-mentioned system bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. The communication interface is used for realizing communication between the database access device and other equipment (such as a client, a read-write library and a read-only library). The Memory may include a Random Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
The protection scope of the electronic device method according to the present invention is not limited to the execution sequence of the steps illustrated in the embodiment, and all the solutions implemented by adding, subtracting, and replacing steps in the prior art according to the principles of the present invention are included in the protection scope of the present invention.
The present invention also provides an electronic device system, which can implement the electronic device method of the present invention, but the implementation apparatus of the electronic device method of the present invention includes, but is not limited to, the structure of the electronic device system recited in this embodiment, and all the structural modifications and substitutions in the prior art made according to the principle of the present invention are included in the scope of the present invention.
In summary, the method, the system, the computer storage medium and the electronic device for stabilizing the live streaming provided by the present invention perform various anomaly detection, filtering and caching on the input HLS live streaming, and output the stable HLS live streaming. Different input HLS flow cases can be handled, and the primary m3u8 and secondary m3u8 formats are compatible. The method has a good steady flow effect on the condition that the source stream video quality is not good, such as ts slice time length is not fixed, m3u8 updating is not uniform, file downloading is overtime, network jitter in a certain range and the like. Meanwhile, the time needing to be cached and delayed can be modified through configuration, and the delay requirement under a live broadcast scene is met. In addition, the embodiment meets the requirements of different processing modules, and outputs a uniform and stable HLS stream. 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 (7)

1. A method for stabilizing a live stream, comprising:
downloading an original multimedia stream;
detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream; detecting and processing the abnormal condition of the original multimedia stream, wherein the detecting and processing the abnormal condition of the time length of the propagation stream piece in the original multimedia stream comprises the steps of detecting the time length of the propagation stream piece in the multimedia stream, and comparing the time length of the propagation stream piece with the maximum value of the time length of the propagation stream piece to filter out the abnormal value of the time length of the propagation stream piece so as to detect and process the abnormal value of the time length of the propagation stream piece in the abnormal condition; detecting and processing the time length format abnormity of the propagation stream in the multimedia stream by detecting the time length format of the propagation stream in the multimedia stream, comparing the time length format with the standard time length format of the propagation stream, and modifying the time length format of the abnormal propagation stream into the standard time length format; and/or detecting the overtime download retry times of the propagation streaming pieces in the multimedia stream, comparing the overtime download retry times with an overtime download retry time threshold, if the overtime download retry times exceed the overtime download retry time threshold, determining that the download fails, and skipping the propagation streaming pieces to detect and process the download overtime exception of the propagation streaming pieces in the multimedia stream in the abnormal condition; storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream, correcting the waiting time of outputting the transmission stream film, and outputting the multimedia stream buffered in the buffer queue in a live mode; the step of correcting the latency of the output transport stream slice comprises: calculating the waiting time; starting to wait;
wherein, the consumption time is the logic end time, the last logic end time, and the last waiting time;
corrected wait time ═ wait time-elapsed time;
the last logic end time is the logic end time, and the last waiting time is the corrected waiting time.
2. A method for streaming live media according to claim 1, wherein said step of downloading an original multimedia stream comprises:
pulling a first-level file index of the original multimedia stream;
analyzing the first-level file index, and extracting the address of the second-level file index from the first-level file index;
downloading a secondary file index of a code rate matched with the network bandwidth according to the network bandwidth;
and downloading the corresponding propagation stream piece of the multimedia stream according to the file content of the secondary file index.
3. The method for streaming live streaming according to claim 2, wherein the abnormal condition existing in the original multimedia stream includes an abnormal time length of a broadcast stream slice in the multimedia stream, an abnormal time length format of the broadcast stream slice in the multimedia stream, and/or an abnormal download timeout of the broadcast stream slice in the multimedia stream.
4. A method of streaming live streams according to claim 1, wherein the step of simulating the output of live streams comprises:
adding a piece of propagation stream slice at the head of the queue in the cache queue into the second-level file index, and deleting the last piece of propagation stream slice in the second-level file index so as to keep the number of the propagation stream slices in the second-level file index fixed;
meanwhile, the waiting time of the output propagation stream slice is corrected.
5. A system for steady flow of a live stream, comprising:
the downloading module is used for downloading the original multimedia stream;
the processing module is used for detecting and processing the abnormal condition of the original multimedia stream to form a processed multimedia stream; the processing module detects and processes the abnormal time length of the propagation stream piece in the abnormal condition by detecting the time length of the propagation stream piece in the multimedia stream and comparing the time length with the maximum time length value of the propagation stream piece to filter the abnormal time length value of the propagation stream piece so as to form the processed propagation stream piece;
the simulation module is used for storing the processed multimedia stream into a preset buffer queue, simulating the output of the live stream and correcting the waiting time of the output transmission stream; the process of correcting the waiting time of the output propagation stream chip by the analog module comprises the following steps: calculating the waiting time; starting to wait; wherein, the consumption time is the logic end time, the last logic end time, and the last waiting time; corrected wait time ═ wait time-elapsed time; the last logic end time is the logic end time, and the last waiting time is the corrected waiting time;
and the output module is used for outputting the multimedia stream cached in the cache queue in a live broadcast manner.
6. A computer storage medium having a computer program stored thereon, the computer program, when being executed by a processor, implementing a method of stream stabilization of a live stream as claimed in any one of claims 1 to 4.
7. An electronic device, comprising: a processor and a memory;
the memory is configured to store a computer program, and the processor is configured to execute the computer program stored by the memory to cause the electronic device to perform a method of streaming a live stream according to any one of claims 1 to 4.
CN201910091978.6A 2019-01-30 2019-01-30 Method and system for stabilizing live stream, computer storage medium and electronic device Active CN109951446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910091978.6A CN109951446B (en) 2019-01-30 2019-01-30 Method and system for stabilizing live stream, computer storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910091978.6A CN109951446B (en) 2019-01-30 2019-01-30 Method and system for stabilizing live stream, computer storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN109951446A CN109951446A (en) 2019-06-28
CN109951446B true CN109951446B (en) 2022-04-12

Family

ID=67007410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910091978.6A Active CN109951446B (en) 2019-01-30 2019-01-30 Method and system for stabilizing live stream, computer storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN109951446B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104918108A (en) * 2015-06-09 2015-09-16 烽火通信科技股份有限公司 Video accurate positioning device and method based on HLS (HTTP Live Streaming) protocol
CN105491400A (en) * 2015-11-24 2016-04-13 腾讯科技(深圳)有限公司 Video stream downloading method and device
CN105635753A (en) * 2015-06-08 2016-06-01 广州市动景计算机科技有限公司 Media data downloading method and device
CN106993236A (en) * 2017-04-01 2017-07-28 青岛海信电器股份有限公司 A kind of video broadcasting method and terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146221B (en) * 2007-10-18 2010-06-02 中兴通讯股份有限公司 Dynamic adjusting method and system for playing pointer in P2P direct broadcasting
CN102098571B (en) * 2009-12-14 2013-06-19 中国电信股份有限公司 Method and system for dynamically pushing data
CN104244033B (en) * 2014-09-03 2017-12-08 乐视致新电子科技(天津)有限公司 Video broadcasting method and device, intelligent terminal
US9407968B2 (en) * 2014-12-22 2016-08-02 Verizon Patent And Licensing Inc. Multicast and unicast adaptive bitrate services

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105635753A (en) * 2015-06-08 2016-06-01 广州市动景计算机科技有限公司 Media data downloading method and device
CN104918108A (en) * 2015-06-09 2015-09-16 烽火通信科技股份有限公司 Video accurate positioning device and method based on HLS (HTTP Live Streaming) protocol
CN105491400A (en) * 2015-11-24 2016-04-13 腾讯科技(深圳)有限公司 Video stream downloading method and device
CN106993236A (en) * 2017-04-01 2017-07-28 青岛海信电器股份有限公司 A kind of video broadcasting method and terminal

Also Published As

Publication number Publication date
CN109951446A (en) 2019-06-28

Similar Documents

Publication Publication Date Title
US11074312B2 (en) System and method for dynamic imagery link synchronization and simulating rendering and behavior of content across a multi-client platform
US10110694B1 (en) Adaptive transfer rate for retrieving content from a server
EP2957103B1 (en) Cloud-based video delivery
CN110636340B (en) Video file uploading method, storage device, terminal device and storage medium
US20160234293A1 (en) Downloading Media Objects
US20160021164A1 (en) Live media stream validation
US10326704B2 (en) Enabling continuous content playback
US11212332B2 (en) Dynamic archiving of streaming content
CN110149560B (en) Player optimization method and system based on HLS protocol, storage medium and terminal
US20200128304A1 (en) Video Management
US20180324238A1 (en) A System and Methods Thereof for Auto-playing Video Content on Mobile Devices
US20150296014A1 (en) Picture download method and apparatus
US8667080B2 (en) Computer-implemented method, a computer program product and an embedded system for increasing the speed of data retrieval by a client on the embedded system
US20160036883A1 (en) Systems and methods for selective transport accelerator operation
US20220167043A1 (en) Method and system for playing streaming content
WO2015143854A1 (en) Data acquisition and interaction method, set top box, server and multimedia system
US20240171797A1 (en) Techniques for providing a content stream based on a delivered stream of content
CN109951446B (en) Method and system for stabilizing live stream, computer storage medium and electronic device
WO2016209366A1 (en) Managing data requests
US20200374337A1 (en) Transmitting data over a network in representational state transfer (rest) applications
US20170163555A1 (en) Video file buffering method and system
KR102577210B1 (en) Method and apparatus for editing adaptive media
US20110252455A1 (en) Method and System for Comparing Media Assets
CN107580256B (en) Linear channel replacement film system and method thereof
US20170104848A1 (en) Multi-request aggregation

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