CN112911322B - Live broadcast cloud transcoding elastic expansion method and device - Google Patents
Live broadcast cloud transcoding elastic expansion method and device Download PDFInfo
- Publication number
- CN112911322B CN112911322B CN202110105529.XA CN202110105529A CN112911322B CN 112911322 B CN112911322 B CN 112911322B CN 202110105529 A CN202110105529 A CN 202110105529A CN 112911322 B CN112911322 B CN 112911322B
- Authority
- CN
- China
- Prior art keywords
- cloud
- transcoder
- transcoding
- hardware resources
- channel
- 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 63
- 239000011159 matrix material Substances 0.000 claims abstract description 44
- 230000008602 contraction Effects 0.000 claims abstract description 20
- 238000013508 migration Methods 0.000 claims abstract description 10
- 230000005012 migration Effects 0.000 claims abstract description 10
- 102100037812 Medium-wave-sensitive opsin 1 Human genes 0.000 claims description 9
- 238000004891 communication Methods 0.000 claims description 7
- 238000009499 grossing Methods 0.000 claims description 5
- 230000008569 process Effects 0.000 abstract description 21
- 238000012937 correction Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 4
- 230000007704 transition Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000012546 transfer Methods 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/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234309—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
-
- 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/440218—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 transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application relates to a live broadcast cloud transcoding elastic expansion method, which comprises the following steps: determining a current cloud transcoding expansion state; when the current cloud transcoding expansion state is determined to be the contraction state, determining a live channel to be migrated currently, and selecting a cloud transcoder from a cloud transcoder list as a target transcoder; uploading parameters of a live channel to be migrated to a target transcoder, and starting transcoding output of the target transcoder; the transcoding output of the target transcoder is set as the backup input of the live channel on the IP code stream switching matrix, and the transcoding output of the original cloud transcoder of the live channel is set as the main input on the IP code stream switching matrix; when a transcoding channel of a primary cloud transcoder of a live channel as a main input is closed, the transcoding channel is switched to a target transcoder, and a code stream output by the target transcoder is selected as current output data. The method and the device can automatically switch the live channel to the backup input source in the migration process, so that the switching process is not interrupted.
Description
Technical Field
The application relates to the technical field of live video, in particular to a live cloud transcoding elastic contraction method and device.
Background
Video transcoding mainly comprises two forms of off-line transcoding (file transcoding) and live transcoding (real-time stream transcoding). With the rapid development of the video and live broadcast industry, the live broadcast of the video changes the life style of people, and meanwhile, the user experience of the terminal needs to be improved by continuously improving the resolution, the video quality, the fluency and the like. In this process, cloud transcoding is an important method.
The live broadcast cloud transcoding service enables a client to perform various real-time transcoding processing on live broadcast streams to obtain corresponding transcoded streams, and accordingly control and adjustment of video resolution, video code rate, video frame rate and audio related parameters are achieved. In addition, the conversion and pushing of the appointed video live stream, the pulling and conversion and pushing of the external network and the like can be conveniently realized. And by adopting a cloud transcoding mode, the scale advantage is easy to realize, the unit cost is reduced, and meanwhile, the computing resources can be dynamically distributed according to the requirements, so that the optimal allocation and use of software and hardware resources are realized. For live cloud transcoding, the capability of elastic scaling is provided. In the dynamic flexible process of live cloud transcoding, the process of dynamic extension can be smoothly completed, and the process of dynamic contraction needs to transfer a transcoding task from one device to another device, so that the live task is short in time, and the fluency of video live at the terminal is influenced.
Disclosure of Invention
In view of this, the application provides a live broadcast cloud transcoding elastic expansion method, which can effectively improve the fluency of live video at a terminal in a cloud transcoding dynamic expansion process.
According to one aspect of the application, a live broadcast cloud transcoding elastic expansion method is provided, and the method comprises the following steps:
determining a current cloud transcoding expansion state;
when the current cloud transcoding expansion state is determined to be the contraction state, determining a live channel to be migrated currently, and selecting a cloud transcoder from a cloud transcoder list as a target transcoder;
uploading parameters of the live channel to be migrated to the target transcoder, and starting transcoding output of the target transcoder to acquire a code stream output by transcoding of the target transcoder;
setting the transcoding output of the target transcoder as the backup input of the live channel on an IP code stream switching matrix, and setting the transcoding output of the original cloud transcoder of the live channel as the main input on the IP code stream switching matrix;
and when a transcoding channel of a primary cloud transcoder of the live channel as the main input is closed, switching the transcoding channel to the target transcoder, and selecting the code stream output by the target transcoder as the current output data.
In a possible implementation manner, when one cloud transcoder is selected from the cloud transcoder list as a target transcoder, a cloud transcoder which has the highest current load and currently has the remaining hardware resources greater than or equal to the hardware resources required to be consumed by the live channel to be migrated is selected as the target transcoder.
In a possible implementation manner, when the current cloud transcoding expansion state is determined, the current task load and the remaining hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by the live channel to be newly added are determined.
In a possible implementation manner, determining a current cloud transcoding expansion state based on a current task load and remaining hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and total hardware resources to be consumed by a live channel to be newly added includes:
acquiring the current task load and the residual hardware resources of each cloud transcoder according to a preset period;
calculating to obtain total residual hardware resources of all the cloud transcoders according to the residual hardware resources of all the cloud transcoders;
acquiring total hardware resources required to be consumed by a live channel to be newly added within preset time by the task scheduling list;
and when the total remaining hardware resources of all the cloud transcoders are larger than the total hardware resources required to be consumed by the live channel to be newly added within the preset time, determining that the current cloud transcoding state is a contraction state.
In a possible implementation manner, when determining that a current cloud transcoding expansion state is a collapsible state and determining a current live channel to be migrated, the method includes:
determining a current recyclable cloud transcoder according to the relation among total hardware resources required to be consumed by the live channel to be newly added within the preset time, hardware resources consumed by the cloud transcoder with the lowest current task load among all the cloud transcoders, and total remaining hardware resources of all the cloud transcoders;
each live channel in the currently recoverable cloud transcoder is a live channel which needs to be migrated currently.
In a possible implementation manner, determining a currently recoverable cloud transcoder according to a relationship among total hardware resources required to be consumed by a live channel to be newly added within the preset time, hardware resources consumed by a cloud transcoder with a lowest current task load among all cloud transcoders, and total remaining hardware resources of all cloud transcoders includes:
calculating the sum of the total hardware resources required to be consumed by the live channel to be newly added in the preset time and the hardware resources consumed by the cloud transcoder with the lowest task load;
and when the sum of the total hardware resources required to be consumed by the live channel to be newly added and the hardware resources consumed by the cloud transcoder with the lowest task load is less than the total remaining hardware resources of all other cloud transcoders except the cloud transcoder with the lowest task load in the preset time, determining the cloud transcoder with the lowest task load as the current recyclable cloud transcoder.
In one possible implementation manner, the method further includes:
when the total remaining hardware resources of all the cloud transcoders are less than or equal to the total hardware resources required to be consumed by the live broadcast channel to be newly added within the preset time, determining that the current cloud transcoding state is a dynamic expansion state;
when the current cloud transcoding state is determined to be the dynamic expansion state, the live channel to be newly added is directly distributed to the cloud transcoder with the highest residual hardware resources.
In a possible implementation manner, when a transcoding channel of a cloud transcoder serving as a main input is closed, the transcoding channel is switched to the target transcoder, and when a code stream output by the target transcoder is selected as current output data, the method further includes a step of smoothing the code stream output by the target transcoder.
In a possible implementation manner, setting the transcoding output of the target transcoder as a backup input of the live channel on an IP code stream switching matrix, and setting the transcoding output of the original cloud transcoder of the live channel as a main input on the IP code stream switching matrix, further includes:
and dividing the output code stream of the cloud transcoder serving as the main input and the output code stream of the target transcoder serving as the backup input according to GOPs, and storing the divided output code streams to a data buffer.
According to another aspect of the application, a live broadcast cloud transcoding elastic expansion device is further provided, and the device comprises an expansion state determination module, a migration channel determination module, a target transcoder selection module, a target transcoder configuration module and a target transcoder switching module;
the scaling state determination module is configured to determine a current cloud transcoding scaling state;
the migration channel determination module is configured to determine a live channel to be migrated currently when the current cloud transcoding expansion state is determined to be a retractable state;
the target transcoder selection module is configured to select one cloud transcoder from the cloud transcoder list as a target transcoder;
the target transcoder configuration module is configured to upload parameters of the live channel to be currently migrated to the target transcoder, start transcoding output of the target transcoder, and acquire a code stream output by transcoding of the target transcoder;
the target transcoder configuration module is further configured to set the transcoding output of the target transcoder as a backup input of the live channel on an IP code stream switching matrix, and set the transcoding output of the original cloud transcoder of the live channel as a main input on the IP code stream switching matrix;
and the target transcoder switching module is configured to switch a transcoding channel to the target transcoder when the transcoding channel of the original cloud transcoder of the live channel as the main input is closed, and select the code stream output by the target transcoder as the current output data.
In the live broadcast cloud transcoding elastic expansion method of the embodiment of the application, after a live broadcast channel to be currently migrated is determined in a contraction stage in the live broadcast cloud transcoding elastic expansion process, a cloud transcoder is selected from a cloud transcoder list as a target transcoder, then parameters of the live broadcast channel to be currently migrated are uploaded to the target transcoder, simultaneously, transcoding output of the target transcoder is started to obtain a code stream transcoded and output by the target transcoder, then transcoding output of the target transcoder is set as backup input of the live broadcast channel on an IP code stream switching matrix, transcoding output of a live broadcast cloud transcoder of the live broadcast channel is set as main input on the IP code stream switching matrix, so that when the live broadcast channel is migrated, a transcoding channel of the live broadcast channel as the main input is directly closed, the transcoding channel is switched to the target transcoder, and therefore the live broadcast channel is migrated, the method can automatically switch to the backup input source, so that the switching process cannot be interrupted.
Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the application and, together with the description, serve to explain the principles of the application.
Fig. 1 shows a flowchart of a live cloud transcoding elastic scaling method according to an embodiment of the present application;
fig. 2 illustrates a system architecture diagram for implementing a live cloud transcoding elastic scaling method according to an embodiment of the present application;
fig. 3 shows a flowchart of a live cloud transcoding elastic scaling method according to another embodiment of the present application;
fig. 4 shows a block diagram of a live broadcast cloud transcoding elastic expansion device according to an embodiment of the present application.
Detailed Description
Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present application. It will be understood by those skilled in the art that the present application may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present application.
Fig. 1 shows a flowchart of a live cloud transcoding elastic scaling method according to an embodiment of the present application. Fig. 2 shows a system architecture diagram for implementing the live cloud transcoding elastic scaling method according to an embodiment of the present application. It should be noted that the live broadcast cloud transcoding elastic expansion method in the embodiment of the application mainly switches live broadcast channels through the set IP code stream switching matrix, so that the live broadcast cloud transcoding can realize seamless transition and smooth migration of the live broadcast channels in the dynamic expansion process, and further improve the end user experience and the live broadcast quality.
When the IP code stream switching matrix broadcasts a live channel, referring to fig. 2, a live signal source firstly enters a cloud transcoder for transcoding and then does not directly output, but outputs a TS-encapsulated code stream to the IP code stream switching matrix through a UDP protocol, and finally outputs the TS-encapsulated code stream from the IP code stream switching matrix.
Specifically, the IP code stream matrix receives input of a TS code stream of a UDP protocol, then the input TS code stream is divided according to GOP and stored in a data buffer, then an output module obtains data from the GOP data buffer, and after the TS-encapsulated data is converted into formats such as FLV (flash video) according to requirements, a plurality of protocols are output according to requirements: UDP/HTTP/RTMP/HLS, etc.
It should be noted that, in the present application, in addition to the above basic functions, the IP code stream switching matrix can also implement flexible scaling of cloud transcoding in the live broadcast process. Specifically, referring to fig. 1, when the live broadcast cloud transcoding elastic expansion method according to an embodiment of the present application is implemented based on the IP code stream switching matrix, the method mainly includes the following steps:
first, through step S100, a current cloud transcoding scaling state is determined. Namely, in the process that the IP code stream switching matrix outputs the code stream of each live broadcast channel in the above manner, step S100 is also executed at the same time, and the expansion state of the current live broadcast cloud transcoding is determined. And judging whether the current stage needs to be subjected to a cloud transcoding dynamic expansion stage or a contraction stage.
When the current cloud transcoding expansion state is determined to be the contraction state, the cloud transcoders connected to the IP code stream switching matrix at the moment are indicated to have recoverable cloud transcoders. Accordingly, step S200 of determining the live channels to be currently migrated (i.e., determining the currently recoverable cloud transcoders) and step S300 of selecting one cloud transcoder from the cloud transcoder list as the target transcoder may be performed. Then, through step S400, the parameters of the live channel to be currently migrated are uploaded to the target transcoder, and the transcoding output of the target transcoder is started, so as to obtain the code stream output by the transcoding of the target transcoder. Meanwhile, by step S500, the transcoding output of the target transcoder is set as the backup input of the live channel on the IP code stream switching matrix, and the transcoding output of the native cloud transcoder of the live channel (i.e., the determined currently recoverable cloud transcoder) is set as the main input on the IP code stream switching matrix. Finally, when the transcoding channel of the cloud transcoder as the main input live channel is closed, the transcoding channel is switched to the target transcoder in step S600, and the code stream output by the target transcoder is selected as the current output data.
Therefore, in the live broadcast cloud transcoding elastic expansion method of the embodiment of the application, in the contraction stage in the live broadcast cloud transcoding elastic expansion process, after a live broadcast channel to be migrated is determined, one cloud transcoder is selected from a cloud transcoder list to be used as a target transcoder, then parameters of the live broadcast channel to be migrated are uploaded to the target transcoder, the transcoding output of the target transcoder is started to obtain a code stream transcoded and output by the target transcoder, then the transcoding output of the target transcoder is set as backup input of the live broadcast channel on an IP code stream switching matrix, the transcoding output of the original cloud transcoder of the live broadcast channel is set as main input on the IP code stream switching matrix, so that when the live broadcast channel is migrated, the transcoding channel of the original cloud transcoder of the live broadcast channel as the main input is directly closed, the transcoding channel is switched to the target transcoder, and the live broadcast channel is migrated in the live broadcast channel, the method can automatically switch to the backup input source, so that the switching process cannot be interrupted.
Meanwhile, in the live broadcast cloud transcoding scaling method in the embodiment of the application, when the transcoding channel of the original cloud transcoder of the live broadcast channel as the main input is closed and the transcoding channel is switched to the target transcoder, the operation of smoothing the code stream output by the target transcoder is further included. Namely, the output code stream is subjected to smooth processing in the switching process, so that the purposes of uninterrupted output code stream and smooth transition are further ensured.
It should be noted that, in one possible implementation, the smoothing processing performed on the output code stream includes, but is not limited to, the following cases: at least one of PMT PID remapping, video PID remapping, audio PID remapping, PCR PID remapping, Service ID remapping, PCR time reference correction, PTS time reference correction, DTS time reference correction, and continuous count correction.
The PID remapping means that if the PID after the code stream switching is different from the PID before the switching, PID data in the code stream after the switching and a corresponding PSI information table are modified, the PID is the same as the PID before the switching, and the Service ID remapping means that if the Service ID after the code stream switching is different from the Service ID before the switching, PAT, PMT and SDT tables in the code stream after the switching are modified, the Service ID is the same as the Service ID before the switching, time reference correction means that the difference between the first time stamp after the switching and the corresponding time stamp under the condition that the switching is not supposed to occur is calculated as correction offset, the correction offset is subtracted from all the time stamps, continuous counting correction means that the last continuous counting of each PID is recorded before the code stream switching, and after the code stream switching, each TS packet is sequentially added with 1 on the basis of the recorded continuous counting.
Further, as can be understood by those skilled in the art, the live cloud transcoding scaling method includes a dynamic expansion process and a contraction process. The process of dynamically expanding the transcoding capability of the live broadcast cloud is relatively simple, corresponding hardware resources are added when needed, transcoding software is deployed, and then the newly added live broadcast channel is allocated to new resources. In the contraction phase, the live channels on the cloud transcoder to be recovered need to be migrated to other transcoders. Therefore, in the contraction phase, the cloud transcoder to be currently recovered needs to be determined, and then the determined live channel on the cloud transcoder to be currently recovered needs to be allocated to other transcoders.
When the current cloud transcoding expansion state is determined, the current cloud transcoding expansion state can be determined based on the current task load and the residual hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by the live channel to be newly added.
Here, the hardware resource refers to the sum of CPU computational resources and GPU computational resources required for performing video transcoding.
Specifically, firstly, the current task load and the remaining hardware resources of each cloud transcoder are obtained according to a preset period. Here, it should be noted that the preset period can be flexibly set according to practical situations, such as: every 1 hour or every 30min, etc. may be set. That is, the value of the preset period may be set as: 30 min-5 h.
And then, calculating to obtain the total residual hardware resources of all the cloud transcoders according to the residual hardware resources of all the cloud transcoders. Here, as can be understood by those skilled in the art, the sum operation may be performed on the remaining hardware resources of each cloud transcoder, so as to obtain the total remaining hardware resources of all cloud transcoders, which is denoted as Sr.
And then, acquiring the total hardware resources required to be consumed by the live broadcast channel to be newly added within the preset time by the task scheduling list. Here, it should be noted that the preset time may be 5min to 10 min. Such as: and calculating the sum of the hardware resources required to be consumed by preparing a newly added task in the next 5 minutes by maintaining a task scheduling list, and recording the sum as Sn.
And then determining the current cloud transcoding expansion state according to the obtained relationship between the total remaining hardware resources Sr of all the cloud transcoders and the total hardware resources Sn required to be consumed by the live channel to be newly added within the preset time.
Specifically, when Sn > Sr, it indicates that more cloud transcoders need to be applied to complete the required task, i.e., the current phase is the dynamic extension phase. At this stage, it is sufficient to allocate the newly added live channel to the cloud transcoder with the highest remaining hardware resources.
When Sn < Sr, it indicates that the current phase may need to be resource-recycled, i.e., the dynamic contraction phase. Therefore, at this time, the relation among the total hardware resources required to be consumed by the live channel to be newly added within the preset time, the hardware resources consumed by the cloud transcoder with the lowest current task load among all the cloud transcoders, and the total remaining hardware resources of all the cloud transcoders can be executed to determine the currently recoverable cloud transcoder. As can be understood by those skilled in the art from the foregoing description, each live channel in the currently recyclable cloud transcoder is a live channel that needs to be currently migrated.
More specifically, when the currently recyclable cloud transcoder is determined according to the relationship among the total hardware resources required to be consumed by the live channel to be newly added within the preset time, the hardware resources consumed by the cloud transcoder with the lowest current task load among all the cloud transcoders, and the total remaining hardware resources of all the cloud transcoders, the determination can be performed in the following manner.
That is, first, the sum of the total hardware resources Sn required to be consumed by the live channel to be newly added within a preset time and the hardware resources Lm consumed by the cloud transcoder with the lowest task load at present (i.e., Sn + Lm) is calculated. And recording the residual hardware resources of the cloud transcoder with the lowest task load as Rm. Then, the relationship between Sn + Lm and Sr-Rm is determined.
When the sum of the total hardware resources required to be consumed by the live broadcast channel to be newly added and the hardware resources consumed by the cloud transcoder with the lowest task load is less than the total remaining hardware resources of all other cloud transcoders except the cloud transcoder with the lowest task load in the preset time, namely (Sn + Lm) < (Sr-Rm), the cloud transcoder with the lowest task load can be determined as the current recyclable cloud transcoder. All live channels on the currently recyclable cloud transcoder are live channels which need to be migrated currently. Migration may be performed on a per live channel basis on a currently reclaimable cloud transcoder.
And if the (Sn + Lm) > - (Sr-Rm), the cloud transcoder cannot be recovered at the moment, stopping the current detection, and continuing to perform the next round of detection whether the cloud transcoder can be recovered or not after waiting for the next preset period.
After the current recyclable cloud transcoder is determined in the above manner, one of the live channels on the current recyclable cloud transcoder can be selected as the live channel which needs to be migrated currently. Then, the live channel is migrated in the manner described above.
Here, when a live channel is migrated, it is necessary to specify a target transcoder to which the live channel is migrated. That is, it is necessary to select one cloud transcoder from the cloud transcoder list as a target transcoder through step S300.
In one possible implementation manner, a cloud transcoder which has the highest current load and the current remaining hardware resources are greater than or equal to the hardware resources required to be consumed by the live channel to be currently migrated may be selected as the target transcoder.
Through the selection mode, the live broadcast channels can be quickly concentrated on the residual cloud transcoders in the dynamic contraction stage of the live broadcast cloud transcoding elastic expansion, and the frequency of channel migration can be reduced.
After the target transcoder is determined, the parameters of the live channel to be migrated are uploaded to the target transcoder in step S400, and the transcoding output of the target transcoder is started to obtain the code stream transcoded and output by the target transcoder. Meanwhile, through step S500, the transcoding output of the target transcoder is set as the backup input of the live channel on the IP code stream switching matrix, and the transcoding output of the original cloud transcoder of the live channel is set as the main input on the IP code stream switching matrix.
Through the setting of the main input and the backup input, the live broadcast channel has two paths of input streams on the IP code stream switching matrix. Referring to fig. 3, after two corresponding inputs (i.e., main input and backup input) are set for the same live channel on the IP code stream switching matrix, the two input streams are divided according to the GOP and then are cached in the data buffer (i.e., step S510 and step S510 '), and simultaneously, the main input and the backup input are respectively detected by interrupting through step S520 and step S520'. And step S530 is executed to select the GOP buffer of the main input as the current output data when the main input is detected to be normal. And in step S600, the main input GOP buffer data is encapsulated and then output.
When the main input is detected to be abnormal, the transcoding channel of the main input is closed at the moment, so that the step S530 'is used for directly switching to the backup input, the GOP cache of the backup input is used as the current output data, and then the step S600' is used for packaging and outputting the GOP cache of the backup input as the output data.
Therefore, according to the live broadcast cloud transcoding elastic expansion method, the IP code stream switching matrix judges whether each currently accessed cloud transcoder can be recycled or not according to the current task load and the residual hardware resources of each currently accessed cloud transcoder and the sum of the hardware resources required to be consumed by a task to be newly added within a period of time, when the recycled cloud transcoder is judged to exist, the cloud transcoding contraction stage can be entered, and resource recovery is realized by migrating live broadcast channels on the recycled cloud transcoder to other cloud transcoders. When the live channel is migrated, two paths of input streams are set on the IP code stream switching matrix of the live channel, and proper code stream smoothing processing is also performed in the switching process by switching between the two paths of input streams, so that the output code stream is not interrupted in the switching process, and the effect of smooth transition is achieved.
It should be noted that, although the live cloud transcoding elastic scaling method described above is described by taking fig. 1 to fig. 3 as an example, those skilled in the art can understand that the present application should not be limited thereto. In fact, the user can flexibly set the specific implementation manner of each step according to personal preference and/or actual application scene, as long as the smooth transition of the output code stream without interruption can be realized in the live channel switching process.
Correspondingly, based on any one of the live cloud transcoding elastic expansion and contraction methods, the application also provides a live cloud transcoding elastic expansion and contraction device. Because the working principle of the live broadcast cloud transcoding elastic expansion device provided by the application is the same as or similar to the principle of the live broadcast cloud transcoding elastic expansion method provided by the application, repeated parts are not repeated.
Referring to fig. 4, the live cloud transcoding elastic scaling device 100 provided by the present application includes a scaling state determination module 110, a migration channel determination module 120, a target transcoder selection module 130, a target transcoder configuration module 140, and a target transcoder switching module 150. Wherein, the scaling state determination module 110 is configured to determine a current cloud transcoding scaling state. And the migration channel determination module 120 is configured to determine a live channel to be currently migrated when the current cloud transcoding scaling state is determined to be the retractable state. A target transcoder selection module 130 configured to select one cloud transcoder from the cloud transcoder list as a target transcoder. And the target transcoder configuration module 140 is configured to upload the parameters of the live channel to be currently migrated to the target transcoder, start transcoding output of the target transcoder, and acquire a code stream output by transcoding of the target transcoder. The target transcoder configuration module 140 is further configured to set the transcoding output of the target transcoder as a backup input of the live channel on the IP code stream switching matrix, and set the transcoding output of the native cloud transcoder of the live channel as a main input on the IP code stream switching matrix. And the target transcoder switching module 150 is configured to switch the transcoding channel to the target transcoder when the transcoding channel of the cloud transcoder as the main input live channel is closed, and select the code stream output by the target transcoder as the current output data.
The foregoing description of the embodiments of the present application has been presented for purposes of illustration and description and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (8)
1. A live broadcast cloud transcoding elastic expansion method is characterized by comprising the following steps:
determining a current cloud transcoding expansion state;
when the current cloud transcoding expansion state is determined to be the contraction state, determining a live channel to be migrated currently, and selecting a cloud transcoder from a cloud transcoder list as a target transcoder;
uploading parameters of the live channel to be migrated to the target transcoder, and starting transcoding output of the target transcoder to acquire a code stream output by transcoding of the target transcoder;
setting the transcoding output of the target transcoder as the backup input of the live channel on an IP code stream switching matrix, and setting the transcoding output of the original cloud transcoder of the live channel as the main input on the IP code stream switching matrix;
when a transcoding channel of a primary cloud transcoder of the live channel as a main input is closed, switching the transcoding channel to the target transcoder, and selecting a code stream output by the target transcoder as current output data;
when the current cloud transcoding expansion state is determined, the current task load and the residual hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by the live channel to be newly added are determined;
determining a current cloud transcoding telescopic state based on the current task load and the residual hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by a live channel to be newly added, wherein the method comprises the following steps:
acquiring the current task load and the residual hardware resources of each cloud transcoder according to a preset period;
calculating to obtain total residual hardware resources of all the cloud transcoders according to the residual hardware resources of all the cloud transcoders;
acquiring total hardware resources required to be consumed by a live channel to be newly added within preset time by using a task scheduling list;
and when the total remaining hardware resources of all the cloud transcoders are larger than the total hardware resources required to be consumed by the live channel to be newly added within the preset time, determining that the current cloud transcoding state is a contraction state.
2. The method of claim 1, wherein when one cloud transcoder in the cloud transcoder list is selected as a target transcoder, a cloud transcoder with a current highest load and a current remaining hardware resource greater than or equal to a hardware resource required to be consumed by the live channel to be currently migrated is selected as the target transcoder.
3. The method of claim 1, wherein when determining that the current live channel to be migrated is determined when determining that the current cloud transcoding scaling state is a scalable state, the method comprises:
determining a current recyclable cloud transcoder according to the relation among total hardware resources required to be consumed by the live channel to be newly added within the preset time, hardware resources consumed by the cloud transcoder with the lowest current task load among all the cloud transcoders, and total remaining hardware resources of all the cloud transcoders;
each live channel in the currently recoverable cloud transcoder is a live channel which needs to be migrated currently.
4. The method of claim 3, wherein determining currently recoverable cloud transcoders according to the relationship among total hardware resources required to be consumed for the live channel to be added within the preset time, hardware resources consumed by the cloud transcoders with the lowest current task load among all cloud transcoders, and total remaining hardware resources of all cloud transcoders comprises:
calculating the sum of the total hardware resources required to be consumed by the live channel to be newly added in the preset time and the hardware resources consumed by the cloud transcoder with the lowest task load;
and when the sum of the total hardware resources required to be consumed by the live channel to be newly added and the hardware resources consumed by the cloud transcoder with the lowest task load is less than the total remaining hardware resources of all other cloud transcoders except the cloud transcoder with the lowest task load within the preset time, determining the cloud transcoder with the lowest task load as the current recyclable cloud transcoder.
5. The method of claim 1, further comprising:
when the total remaining hardware resources of all the cloud transcoders are less than or equal to the total hardware resources required to be consumed by the live broadcast channel to be newly added within the preset time, determining that the current cloud transcoding state is a dynamic expansion state;
when the current cloud transcoding state is determined to be the dynamic expansion state, the live channel to be newly added is directly distributed to the cloud transcoder with the highest residual hardware resources.
6. The method according to any one of claims 1 to 5, wherein when a transcoding channel of the cloud transcoder serving as a main input is closed, the transcoding channel is switched to the target transcoder, and when the code stream output by the target transcoder is selected as the current output data, the method further comprises the step of smoothing the code stream output by the target transcoder.
7. The method of claim 1, wherein setting the transcoded output of the target transcoder as a backup input for the live channel on an IP stream switching matrix and setting the transcoded output of the live channel original cloud transcoder as a primary input on the IP stream switching matrix, further comprises:
and dividing the output code stream of the cloud transcoder serving as the main input and the output code stream of the target transcoder serving as the backup input according to GOPs, and storing the divided output code streams to a data buffer.
8. A live broadcast cloud transcoding elastic expansion device is characterized by comprising an expansion state determining module, a migration channel determining module, a target transcoder selecting module, a target transcoder configuring module and a target transcoder switching module;
the scaling state determination module is configured to determine a current cloud transcoding scaling state;
the migration channel determination module is configured to determine a live channel to be migrated currently when the current cloud transcoding expansion state is determined to be a retractable state;
the target transcoder selecting module is configured to select one cloud transcoder from the cloud transcoder list as a target transcoder;
the target transcoder configuration module is configured to upload parameters of the live channel to be currently migrated to the target transcoder, start transcoding output of the target transcoder, and acquire a code stream output by the transcoding of the target transcoder;
the target transcoder configuration module is further configured to set the transcoding output of the target transcoder as a backup input of the live channel on an IP code stream switching matrix, and set the transcoding output of the original cloud transcoder of the live channel as a main input on the IP code stream switching matrix;
the target transcoder switching module is configured to switch a transcoding channel to the target transcoder when a transcoding channel of a cloud transcoder of the live channel as a main input is closed, and select a code stream output by the target transcoder as current output data;
when the current cloud transcoding expansion state is determined, the current task load and the residual hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by the live channel to be newly added are determined;
determining the current cloud transcoding stretching state based on the current task load and the residual hardware resources of each cloud transcoder in communication connection with the IP code stream switching matrix and the total hardware resources required to be consumed by the live channel to be newly added, wherein the determining comprises the following steps:
acquiring the current task load and the residual hardware resources of each cloud transcoder according to a preset period;
calculating to obtain total residual hardware resources of all the cloud transcoders according to the residual hardware resources of all the cloud transcoders;
acquiring total hardware resources required to be consumed by a live channel to be newly added within preset time by using a task scheduling list;
and when the total remaining hardware resources of all the cloud transcoders are larger than the total hardware resources required to be consumed by the live channel to be newly added within the preset time, determining that the current cloud transcoding state is a contraction state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110105529.XA CN112911322B (en) | 2021-01-26 | 2021-01-26 | Live broadcast cloud transcoding elastic expansion method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110105529.XA CN112911322B (en) | 2021-01-26 | 2021-01-26 | Live broadcast cloud transcoding elastic expansion method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112911322A CN112911322A (en) | 2021-06-04 |
CN112911322B true CN112911322B (en) | 2022-09-16 |
Family
ID=76120344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110105529.XA Active CN112911322B (en) | 2021-01-26 | 2021-01-26 | Live broadcast cloud transcoding elastic expansion method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112911322B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108235059A (en) * | 2018-03-09 | 2018-06-29 | 网宿科技股份有限公司 | A kind of method and system for distributing transcoding task |
CN108845882A (en) * | 2018-06-07 | 2018-11-20 | 网宿科技股份有限公司 | The method and apparatus for realizing cpu load equilibrium based on transcoding task schedule |
CN108965884A (en) * | 2018-07-13 | 2018-12-07 | 网宿科技股份有限公司 | A kind of distribution method and controlling equipment, transcoding device of transcoding task |
CN110213617A (en) * | 2019-04-01 | 2019-09-06 | 腾讯科技(深圳)有限公司 | Video stream transcoding moving method, device and system |
CN110879749A (en) * | 2018-09-06 | 2020-03-13 | 阿里巴巴集团控股有限公司 | Scheduling method and scheduling device for real-time transcoding task |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI519967B (en) * | 2015-03-25 | 2016-02-01 | 財團法人工業技術研究院 | Cloud operation resource dynamic allocation system and method thereof |
-
2021
- 2021-01-26 CN CN202110105529.XA patent/CN112911322B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108235059A (en) * | 2018-03-09 | 2018-06-29 | 网宿科技股份有限公司 | A kind of method and system for distributing transcoding task |
CN108845882A (en) * | 2018-06-07 | 2018-11-20 | 网宿科技股份有限公司 | The method and apparatus for realizing cpu load equilibrium based on transcoding task schedule |
CN108965884A (en) * | 2018-07-13 | 2018-12-07 | 网宿科技股份有限公司 | A kind of distribution method and controlling equipment, transcoding device of transcoding task |
CN110879749A (en) * | 2018-09-06 | 2020-03-13 | 阿里巴巴集团控股有限公司 | Scheduling method and scheduling device for real-time transcoding task |
CN110213617A (en) * | 2019-04-01 | 2019-09-06 | 腾讯科技(深圳)有限公司 | Video stream transcoding moving method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN112911322A (en) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10375156B2 (en) | Using worker nodes in a distributed video encoding system | |
US10063872B2 (en) | Segment based encoding of video | |
US10341561B2 (en) | Distributed image stabilization | |
US10602153B2 (en) | Ultra-high video compression | |
US10602157B2 (en) | Variable bitrate control for distributed video encoding | |
US10506235B2 (en) | Distributed control of video encoding speeds | |
US8335262B2 (en) | Dynamic rate adjustment to splice compressed video streams | |
US10499070B2 (en) | Key frame placement for distributed video encoding | |
KR102087987B1 (en) | Master device, client device, and method for screen mirroring thereof | |
US9654804B2 (en) | Replacing video frames in a transport stream | |
US20170078671A1 (en) | Accelerated uploading of encoded video | |
KR20160110472A (en) | Streaming multiple encodings encoded using different encoding parameters | |
CN105144727A (en) | Codec techniques for fast switching | |
TW202123717A (en) | Dynamic playout of transition frames while transitioning between playout of media streams | |
US10097746B2 (en) | Method and system for dynamically adjusting a camera setting for a video stream | |
CN112911322B (en) | Live broadcast cloud transcoding elastic expansion method and device | |
US8483289B2 (en) | Method and system for fast channel change | |
KR101640452B1 (en) | Apparatus and method for preventing stoppage of streaming media | |
JP2020113922A (en) | Video distribution device, video distribution method, and program | |
US10270832B1 (en) | Method and system for modifying a media stream having a variable data rate | |
US10986156B1 (en) | Quality prediction apparatus, quality prediction method and program | |
JP2001359071A (en) | Data distributor and method, and data distribution system | |
US10097609B1 (en) | Method and system for dynamically adjusting a data rate of a video stream | |
US11303940B2 (en) | Transmission apparatus, transmission method, and non-transitory computer-readable storage medium | |
JP2019029931A (en) | Video transmitter, video receiver, video transmission/reception system, control method, and program |
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 |