Live broadcast transcoding method and system
By creating pre-transcoding tasks based on traffic information, the method addresses high bandwidth consumption during live broadcasts by generating transcoded streams in advance, ensuring efficient and immediate high-quality streaming upon broadcast initiation.
Patent Information
- Application Number
- CN202211686418.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-12-27
AI Technical Summary
Existing live broadcast transcoding methods fail to address high bandwidth consumption during live broadcasts, particularly before the start of a live broadcast when a large number of users are viewing the source material, as they do not initiate the transcoding process, resulting in excessive bandwidth consumption, as users watch the source stream until transcoding is initiated.
A live broadcast transcoding method that creates pre-transcoding tasks based on traffic information before the broadcast starts, generating transcoded streams in advance, allowing users to watch these streams immediately upon broadcast initiation, thereby reducing bandwidth consumption.
The method effectively reduces bandwidth consumption by generating transcoded streams in advance, ensuring users can watch high-quality streams without the delay of real-time transcoding, thus optimizing bandwidth usage and user experience.
Smart Images

Figure CN115967825B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and more particularly to a live broadcast transcoding method, a live broadcast transcoding system, a computing device, and a computer-readable storage medium. Background Art
[0002] With the rapid development and popularization of the Internet, live streaming has become a trend. More and more users are broadcasting or watching live broadcasts through mobile terminals. Live streaming has developed into a profession. At the same time, the bandwidth consumption caused by a large number of user-end streaming during the live broadcast process is also very high.
[0003] To solve the above problem, after the live broadcast room starts broadcasting, the source stream is provided for the users entering the live broadcast room. When the number of users entering reaches a certain number, the source stream is transcoded to obtain the transcoded stream, and the bit rate of the live broadcast stream is reduced. The transcoded stream is provided for the users who enter the live broadcast room later, so that the users can watch the live broadcast through the user terminal. Although the bandwidth consumption is saved to a certain extent, after the live broadcast room starts broadcasting, the users before a certain number are reached still watch the source stream, and the bandwidth consumption of this part of users is still very high. Therefore, a live broadcast transcoding method that saves bandwidth consumption is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a live broadcast transcoding method. The present application also relates to a live broadcast transcoding system, a computing device, and a computer-readable storage medium to solve the problem of excessive bandwidth consumption during live broadcast in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a live broadcast transcoding method is provided, comprising:
[0006] Before the live broadcast room starts broadcasting, obtain the traffic information of the live broadcast room;
[0007] When the traffic information satisfies the pre-transcoding condition, at least one pre-transcoding task is created, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream;
[0008] When the live broadcast room starts broadcasting, the source stream of the live broadcast room is pulled, and at least one transcoding stream is generated based on the source stream and the at least one pre-transcoding task.
[0009] According to a second aspect of an embodiment of the present application, a live broadcast transcoding system is provided, the live broadcast transcoding system comprising a stream state service and a transcoding service;
[0010] The stream status service is configured to obtain the flow information of the live broadcast room before the live broadcast room starts broadcasting, and determine whether the flow information meets the pre-transcoding condition;
[0011] The transcoding service is configured to create at least one pre-transcoding task when the traffic information meets the pre-transcoding conditions, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream; when the live broadcast room is started, pull the source stream of the live broadcast room, and generate at least one transcoding stream based on the source stream and the at least one pre-transcoding task.
[0012] According to a third aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the live broadcast transcoding method when executing the computer instructions.
[0013] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the computer instructions are executed by a processor, the steps of the live broadcast transcoding method are implemented.
[0014] The live broadcast transcoding method provided in the embodiment of the present application obtains the traffic information of the live broadcast room before the live broadcast room starts broadcasting; when the traffic information meets the pre-transcoding conditions, creates at least one pre-transcoding task, wherein the at least one pre-transcoding task is used to generate at least one transcoded stream; when the live broadcast room starts broadcasting, pulls the source stream of the live broadcast room, and generates at least one transcoded stream based on the source stream and at least one pre-transcoding task.
[0015] In one embodiment of the present application, before the live broadcast room is started, if it is determined that the traffic information of the live broadcast room meets the pre-transcoding conditions, a pre-transcoding task is created for the live broadcast room. When the live broadcast room is started, a transcoded stream can be generated directly based on the pre-transcoding task and the source stream. By pre-creating a pre-transcoding task based on the traffic information before the live broadcast room is started, and performing corresponding processing based on the pre-transcoding task when the broadcast is started, the transcoded stream live screen corresponding to each pre-transcoding task is generated within a short time after the source stream is pulled after the broadcast is started, and distributed to the corresponding user terminal, so that each user can directly watch the screen corresponding to the transcoded stream, avoiding the judgment of whether to generate the transcoded stream and transcoding at the start of the broadcast, reducing bandwidth consumption, and reducing the cost of live broadcast. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a logical framework diagram of live broadcast transcoding in the prior art;
[0017] Figure 2 This is a flow chart of a live broadcast transcoding method provided by an embodiment of the present application;
[0018] Figure 3 It is a processing flow chart of a live transcoding method applied to live video provided by an embodiment of the present application;
[0019] Figure 4aThis is a schematic diagram showing the candidate stream status in a live transcoding method provided by an embodiment of the present application;
[0020] Figure 4b This is a logical framework diagram of a live broadcast transcoding method provided by an embodiment of the present application before the live broadcast room starts broadcasting;
[0021] Figure 4c This is a logical framework diagram of a live broadcast transcoding method provided by an embodiment of the present application when a live broadcast room is started;
[0022] Figure 5 It is a structural diagram of a live broadcast transcoding system provided by an embodiment of the present application;
[0023] Figure 6 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0024] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0025] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0026] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0027] First, the terms involved in one or more embodiments of the present application are explained.
[0028] Live streaming: The transmission of live audio and video data, which can be transmitted to the audience as a stable and continuous stream through the network, such as source stream and transcoded stream. The bandwidth of the source stream is higher than that of the transcoded stream.
[0029] Live broadcast room: In the live broadcast service, each anchor will have a unique identifier, which can be used to enter the anchor's live broadcast viewing page. The relationship between the live broadcast room and the stream: Generally speaking, one room corresponds to one live broadcast stream. The stream is for the CDN, and the room is for the live broadcast platform.
[0030] Content Delivery Network (CDN): It is a content distribution network built on the Internet. It relies on edge nodes (i.e. edge servers) deployed in various places. Through the load balancing, content distribution, scheduling and other functional modules of the central scheduling server, users can obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate.
[0031] Pod: It is composed of one or more containers (such as Docker containers) and has the ability to share storage / network and specifications for running containers.
[0032] Edge computing: It is a distributed computing architecture that moves the computing of applications, data, and services from the central nodes of the network to the logical edge nodes of the network for processing.
[0033] Edge computing uplink: The server that receives user push streams. The server is used to respond to terminal service requests and process them.
[0034] Transcoding: refers to converting a compressed and encoded video stream into another video stream in order to adapt to different network bandwidths, different terminal processing capabilities and different user needs.
[0035] Bit rate: It is the amount of data transmitted per unit time of video or audio.
[0036] Streaming: refers to the process of pushing live content to the server.
[0037] Pulling stream: refers to the process of pulling live content from a server using a specified address.
[0038] See also Figure 1 , Figure 1 A logical framework diagram of live broadcast transcoding in the prior art is shown:
[0039] In order to save bandwidth consumption, the prior art performs live transcoding according to the following process: (1) The anchor starts broadcasting and pushes the stream (source stream) to the edge computing upstream; (2) After the edge computing upstream receives the source stream, it updates the status to the stream status service and pushes the source stream to the CDN. That is, the source stream has generated a picture (original picture) and can be scheduled. At this time, the schedulable stream states recorded in the stream status service are: [Original Picture]; (3) After the user enters the live broadcast room, he requests the viewing address from the scheduling system. The scheduling service inquires about the stream status from the stream status service and obtains the existing stream status of [Original Picture]. Then, the viewing address of the original picture is allocated to the user; (4) As the number of people entering the live broadcast room and using the source stream to watch increases, the live broadcast room reports the heartbeat to the number of people service. The number of people service determines that the number of people has reached a certain condition. Send information to the transcoding service. The transcoding service sends transcoding tasks to the transcoding cluster based on the information. The transcoding cluster includes multiple PODs, so that the transcoding task can produce multiple transcoding streams with different bit rates based on the source stream. After the generation is completed, push [transcoding stream: HD, Blu-ray, UHD] to the edge computing upstream. After the edge computing upstream receives [transcoding stream: HD, Blu-ray, UHD], it updates the status to the stream status service, that is, the transcoding stream has generated a picture. At this time, the schedulable stream states recorded in the stream status service are: [original picture, HD, Blu-ray, UHD]; (5) When a new user who enters the live broadcast room requests a viewing address from the scheduling system, the scheduling service inquires about the stream status from the stream status service and obtains the existing stream states of [original picture, HD, Blu-ray, UHD]. Then, the viewing address of the transcoding stream is allocated to the user.
[0040] In the above-mentioned prior art, there is no way to deal with the cost pressure of high bandwidth consumption caused by the fact that people watch the source stream before the transcoding task is started. For example, there are 10,000 people entering the live broadcast room before the live broadcast starts, and the threshold corresponding to the set transcoding condition is 2,000 people. However, in the prior art, the judgment on whether to transcode and the transcoding are performed after the broadcast starts. Accordingly, after the broadcast starts, 10,000 people watch the original picture corresponding to the source stream, and those who watch later will watch the picture corresponding to the transcoded stream. Even if the transcoding condition is set, since it is judged after the broadcast starts, the bandwidth consumption is still very large. Therefore, before the live broadcast room is started, the present application creates a pre-transcoding task for the live broadcast room if it is determined that the traffic information of the live broadcast room meets the pre-transcoding conditions. When the live broadcast room is started, the transcoded stream can be generated directly based on the pre-transcoding task and the source stream. The pre-transcoding task is created in advance based on the traffic information of the live broadcast room before the start of the broadcast, and corresponding processing is performed based on the pre-transcoding task when the broadcast starts. In this way, within a short period of time after the source stream is pulled after the broadcast starts, the live broadcast screen of the transcoded stream corresponding to each pre-transcoding task has been generated and distributed to the corresponding user terminal, so that each user can directly watch the screen corresponding to the transcoded stream, avoiding the judgment of whether to generate the transcoded stream and transcoding at the start of the broadcast, reducing bandwidth consumption, and reducing the cost of live broadcast.
[0041] In the present application, a live broadcast transcoding method is provided. The present application also relates to a live broadcast transcoding system, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0042] Figure 2 A flowchart of a live transcoding method provided according to an embodiment of the present application is shown, which is applied to a live transcoding system. The live transcoding system includes a stream state service, a transcoding service, and a scheduling service. Specifically, the following steps are included:
[0043] Step 202: Before the live broadcast room starts broadcasting, the traffic information of the live broadcast room is obtained.
[0044] Before the live broadcast room starts, the traffic information of the live broadcast room is obtained through the stream status service, so as to estimate the popularity of the live broadcast room based on the obtained traffic information, and then perform corresponding processing based on the estimated results.
[0045] Specifically, traffic information refers to information that characterizes the popularity of the live broadcast room, such as historical user visits, historical viewings, reservations, waiting times, etc. As an example, traffic information can generally include waiting information before the live broadcast room starts, attribute information of the live broadcast room host, etc.
[0046] In actual applications, when users are waiting for the broadcast to start in the live broadcast room, the room page will report heartbeats to the crowd service at regular intervals. The crowd service will aggregate the data and obtain the number of people waiting online in the live broadcast room. Because the resources of the transcoding cluster are limited, it is impossible to transcode the source stream of each anchor. Therefore, it is necessary to obtain and judge the traffic information of each anchor, determine the live broadcast room corresponding to the anchor with higher traffic, configure transcoding for the determined anchor's live broadcast room, and realize resource utilization in a more effective way.
[0047] In an embodiment of the present application, after obtaining the traffic information of the live broadcast room, the traffic information is judged to determine whether the traffic information of each live broadcast room meets certain requirements. If not, the live broadcast room will not be processed. If it is met, the source stream of the live broadcast room will be processed accordingly, thereby saving the bandwidth consumption of the live broadcast room during the live broadcast process.
[0048] Step 204: when the traffic information meets the pre-transcoding condition, create at least one pre-transcoding task, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream.
[0049] When the stream status service determines that the traffic information of the live broadcast room meets the pre-transcoding conditions, the stream status service notifies the transcoding system to perform pre-transcoding, and the transcoding service creates at least one pre-transcoding task.
[0050] Specifically, the pre-transcoding condition refers to a pre-set condition for transcoding the source stream. The pre-transcoding condition can be used to determine whether the popularity of the live broadcast room requires pre-transcoding. For example, if the pre-transcoding condition is that the number of people waiting online exceeds 1,000, then if the number of people waiting online in a live broadcast room exceeds 1,000, it is determined that the traffic information of the live broadcast room meets the pre-transcoding condition. The pre-transcoding task refers to a pre-transcoding task set when the pre-transcoding condition is met. The pre-transcoding task is usually used to transcode the source stream into a transcoded stream. The bit rate of the transcoded stream is usually lower than the bit rate of the source stream.
[0051] Exemplarily, the pre-transcoding task may be to transcode a source stream with a bit rate of 10M into a high-definition transcoded stream with a bit rate of 8M.
[0052] Optionally, at least one pre-transcoding task is used to generate at least one transcoded stream. It can be one pre-transcoding task used to generate one transcoded stream, such as setting one pre-transcoding task to output one transcoded stream, and setting multiple pre-transcoding tasks when multiple transcoded streams are needed; it can also be one pre-transcoding task used to generate multiple transcoded streams, such as setting multiple transcoded streams to be output in one pre-transcoding task; it can also be multiple pre-transcoding tasks used to generate one transcoded stream, such as setting multiple pre-transcoding tasks to transcode one transcoded stream.
[0053] In actual applications, traffic information and pre-transcoding conditions correspond to each other. If the traffic information is the number of people waiting online in the live broadcast room before the live broadcast starts, the pre-transcoding condition is the number threshold; if the traffic information is the number of times the system schedules before the live broadcast starts, the pre-transcoding condition is the number threshold; if the traffic information is the host attribute of the host corresponding to the live broadcast room, the pre-transcoding condition is the specified attribute.
[0054] When the traffic information meets the pre-transcoding conditions, at least one pre-transcoding task is created. The pre-transcoding task can be set based on the historical live broadcast records of the live broadcast room, or it can be set according to the requirements of the live broadcast platform. The specific setting can be determined according to the actual situation, and this application does not make any limitations here.
[0055] In a possible implementation of this embodiment, at least one pre-transcoding task may be created based on the transcoding stream information that appeared in the historical live broadcast of the live broadcast room. For example, if the live streams used by the user end for the first five live broadcasts of the live broadcast room are standard definition and smooth, then two pre-transcoding tasks are created based on the standard definition and smooth, one for transcoding to obtain standard definition, and the other for transcoding to obtain smooth.
[0056] In another possible implementation of this embodiment, at least one pre-transcoding task may be created based on the transcoding stream that the platform of the live broadcast room can support. For example, the platform played by the live broadcast room is platform A, and platform A only supports smooth and blue-ray. Then, based on smooth and blue-ray, two pre-transcoding tasks are created, one for transcoding to obtain smooth, and the other for transcoding to obtain blue-ray.
[0057] Optionally, creating at least a pre-transcoding task requires assigning a stream pulling address to the transcoding stream corresponding to the pre-transcoding task. The stream pulling address is pre-assigned based on the live broadcast room identifier of the live broadcast room. When creating the pre-transcoding task, the pre-assigned stream pulling address is assigned to the corresponding transcoding stream to create the pre-transcoding task.
[0058] In an optional implementation of this embodiment, the traffic information includes online waiting information, and the online waiting information includes the number of online waiting persons and the number of system scheduling times; before the above step 204, the following specific steps are also included:
[0059] When the number of online waiting persons exceeds a first set threshold value, and / or the number of system scheduling times exceeds a second set threshold value, it is determined that the traffic information meets the pre-transcoding condition.
[0060] The flow status service obtains the number of people waiting online from the number of people service and the number of system scheduling times from the scheduling service. When it is determined that the number of people waiting online exceeds the first set threshold and / or the number of system scheduling times exceeds the second set threshold, the flow status service can determine that the traffic information meets the pre-transcoding conditions.
[0061] Specifically, the online waiting information refers to the visit situation of the live broadcast room counted in real time before the live broadcast room starts broadcasting, which is used to characterize the popularity of the live broadcast room before it starts broadcasting. The online waiting information usually includes the number of online waiting people and the number of system scheduling times. The number of online waiting people refers to the number of people waiting in the live broadcast room counted in real time before the live broadcast room starts broadcasting. The number of system scheduling times refers to the number of times the user terminal initiates a scheduling request to the scheduling service per unit time before the live broadcast room starts broadcasting. The first set threshold refers to the quantitative threshold set in advance for the number of online waiting people. If the first set threshold is reached, it is determined that the traffic information meets the pre-transcoding condition. The second set threshold refers to the quantitative threshold set in advance for the number of system scheduling times. If the second set threshold is reached, it is determined that the traffic information meets the pre-transcoding condition.
[0062] In actual applications, after obtaining the number of online waiting people and the number of system scheduling times of the live broadcast room before the broadcast starts, the obtained information is compared with the pre-transcoding conditions. It can be that only the number of online waiting people is compared with the first preset threshold. If it meets the requirements, it is determined that the traffic information of the live broadcast room meets the pre-transcoding conditions; it can also be that only the number of system scheduling times is compared with the second preset threshold. If it meets the requirements, it is determined that the traffic information of the live broadcast room meets the pre-transcoding conditions; it can also be that when both of the above two situations meet the corresponding set thresholds, it is determined that the traffic information of the live broadcast room meets the pre-transcoding conditions. The specific judgment conditions can be determined according to the actual situation, and this application does not make any limitations here.
[0063] In an embodiment of the present application, the traffic information includes online waiting information, and the online waiting information includes the number of online waiting people and the number of system scheduling times. When the number of waiting people exceeds a first set threshold, and / or the number of system scheduling times exceeds a second set threshold, it is determined that the traffic information meets the pre-transcoding conditions, and then corresponding processing can be performed based on the determined result, so that the live broadcast room corresponding to the traffic information that meets the pre-transcoding conditions can create a pre-transcoding task before the broadcast starts, thereby reducing the consumption of bandwidth after the broadcast starts.
[0064] In an optional implementation of this embodiment, the traffic information includes the host attributes of the live broadcast room; before the above step 204, the following specific steps are also included:
[0065] When the host attribute is a specified attribute in the pre-transcoding condition, it is determined that the traffic information meets the pre-transcoding condition.
[0066] The stream status service obtains the host attributes of the live broadcast room from the host homepage or the location where the host attribute information is stored. When the host attributes are the attributes specified in the pre-transcoding conditions, it is determined that the traffic information meets the pre-transcoding conditions.
[0067] Specifically, the anchor attribute refers to the attribute that characterizes the anchor's traffic. For example, the anchor attribute can be a top anchor, a middle anchor, and a bottom anchor. The top anchor refers to the anchor with the top 20% of traffic among all anchors, the middle anchor refers to the anchor with the top 20% to 70% of traffic, and the bottom anchor refers to the anchor with the bottom 30% of traffic. It can be determined that the top anchor accounts for more traffic, that is, the top anchor has more users watching during the live broadcast. The specified attribute refers to a type of pre-transcoding condition. For example, the pre-transcoding condition refers to the top anchor. If the anchor corresponding to a certain live broadcast room is a top anchor, then the traffic information of the live broadcast room meets the pre-transcoding condition.
[0068] In an embodiment of the present application, the traffic information includes the host attributes. When the host attributes are the attributes specified in the pre-transcoding conditions, it means that the popularity of the host's live broadcast room is relatively high. At this time, it can be determined that the traffic information meets the pre-transcoding conditions. Then, corresponding processing can be performed based on the determined result, so that the live broadcast room corresponding to the traffic information that meets the pre-transcoding conditions can create a pre-transcoding task before the broadcast starts, thereby reducing the consumption of bandwidth after the broadcast starts.
[0069] In an optional implementation of this embodiment, the step of creating at least one pre-transcoding task in step 204 includes the following specific steps:
[0070] Obtain historical bit rate information of the live broadcast room and determine at least one bit rate;
[0071] For each bit rate, create a corresponding pre-transcoding task.
[0072] The transcoding service obtains the historical bitrate information of the live broadcast room, determines at least one bitrate, and creates a corresponding pre-transcoding task for each bitrate.
[0073] Specifically, historical bit rate information refers to information about the bit rate provided by the live broadcast room before the current moment. For example, historical bit rate information includes historical bit rate types and historical bit rate sizes, and may also include historical live broadcast times corresponding to historical bit rate types and historical bit rate sizes.
[0074] Exemplarily, the historical bit rate information of live broadcast room 1 is obtained as follows: at night, 4 types, and the historical bit rates are 10M, 8M, 5M, and 3M respectively; in the morning, 2 types, and the historical bit rates are 10M and 8M respectively, among which 10M is the bit rate corresponding to the source stream. Since the current time is at night, the bit rates are determined to be 8M, 5M, and 3M. Based on these bit rates, for each bit rate, 3 corresponding pre-transcoding tasks are created.
[0075] In an embodiment of the present application, at least one bit rate is determined based on the historical bit rate information of the live broadcast room obtained, and a corresponding pre-transcoding task is created for each bit rate, so that the pre-transcoding task is determined based on the historical bit rate information of the live broadcast room, so the determined bit rate is more accurate, thereby improving the accuracy of the creation of the pre-transcoding task.
[0076] In an optional implementation of this embodiment, after creating at least one pre-transcoding task in the above step 204, the following specific steps are also included:
[0077] According to the at least one pre-transcoding task, updating a candidate stream state, wherein the candidate stream state includes at least one transcoding stream corresponding to the at least one pre-transcoding task;
[0078] When the target user enters the live broadcast room, the current candidate stream status is queried, and based on the current candidate stream status, the target transcoded stream is determined from the at least one transcoded stream, and the storage address of the target transcoded stream is allocated to the target user, wherein the storage address of the target transcoded stream is used by the target user to pull and play the target transcoded stream.
[0079] The stream status service updates the candidate stream status according to at least one pre-transcoding service, wherein the candidate stream status includes at least one transcoded stream corresponding to at least one pre-transcoding task; when the target user enters the live broadcast room, the scheduling service queries the current candidate stream status from the stream status service, and based on the current candidate stream status, determines the target transcoded stream from at least one transcoded stream, and allocates the storage address of the target transcoded stream to the target user, wherein the storage address of the target transcoded stream is used for the target user to pull and play the target transcoded stream.
[0080] Specifically, the candidate stream state refers to the live stream identifier corresponding to the viewing address currently available in the live broadcast room. The candidate stream state can intuitively know which live streams can be selected. When the user terminal initiates a scheduling request to the scheduling service, the scheduling request can carry the transcoding stream identifier that the user wants to watch. The scheduling service searches for the corresponding storage address based on the transcoding stream identifier and allocates the storage address to the corresponding user terminal. The target transcoding stream refers to the transcoding stream corresponding to the user terminal determined from the transcoding stream corresponding to the pre-transcoding task. For example, if the scheduling request initiated by the user terminal carries a high-definition identifier, the scheduling service queries the current candidate stream state. If there is a high-definition transcoding stream in the current candidate stream state, the high-definition transcoding stream is determined as the target transcoding stream. The storage address refers to the preset address for storing the transcoding stream. Before the live broadcast, the target transcoding stream and the storage address corresponding to the target transcoding stream are allocated to the user. When the live broadcast starts, the target transcoding stream can be directly extracted from the corresponding storage address to generate the picture.
[0081] According to the at least one pre-transcoding task, the candidate stream state is updated. Specifically, before the pre-transcoding task is generated, the candidate stream state only has the source stream. After the pre-transcoding task is generated, the transcoded stream corresponding to the pre-transcoding task is also used as the stream that can be used to play the picture after the broadcast. Therefore, the candidate stream state is updated, that is, the corresponding transcoded stream in the pre-transcoding task is added to the candidate stream state to obtain the updated current candidate stream state. Then, when the user enters the live broadcast room, the target stream state corresponding to each user can be determined from the current candidate stream state.
[0082] When the target user enters the live broadcast room, the current candidate stream status is queried, and based on the current candidate stream status, the target transcoded stream is determined from the at least one transcoded stream, and the storage address of the target transcoded stream is allocated to the target user. Specifically, when the user enters the live broadcast room, it is necessary to request the scheduling service to pull the stream address. After receiving the request, the scheduling service determines a transcoded stream from the current candidate stream status as the target transcoded stream, and allocates the address of the transcoded stream to the user, so that the user can pull the corresponding transcoded stream from the allocated address to watch the live broadcast when the live broadcast starts.
[0083] Optionally, before the live broadcast room starts, when the user enters the live broadcast room, there are many ways to query the current candidate stream status, and based on the current candidate stream status, determine the target transcoded stream from the at least one transcoded stream. Among them, the user enters the live broadcast room usually by initiating a scheduling request to the scheduling service through the user terminal. The scheduling service determines the target transcoded stream based on the scheduling request and the current candidate stream status.
[0084] Optionally, based on different correspondences between the set pre-transcoding tasks and the generated transcoding streams, one pre-transcoding task may correspond to one transcoding stream, one pre-transcoding task may correspond to multiple transcoding streams, or multiple pre-transcoding tasks may correspond to one transcoding stream.
[0085] In one possible implementation of this embodiment, when a user enters a live broadcast room and waits, the user selects a live broadcast stream through the user terminal, and initiates a scheduling request to the scheduling service based on the clarity. The scheduling service determines a transcoded stream from the transcoded streams in the current candidate stream state as the target transcoded stream based on the scheduling request. In another possible implementation, the user has already selected live broadcast stream A in other live broadcast rooms through the user terminal. When entering the current live broadcast room, a scheduling request is directly initiated to the scheduling service based on the live broadcast stream A previously selected by the user. The scheduling service determines a transcoded stream from the transcoded streams in the current candidate stream state as the target transcoded stream based on the scheduling request. The carried live stream A is queried from the transcoded streams in the current candidate stream state. If there is a match, the target transcoded stream is directly determined. If not, the transcoded stream corresponding to the bit rate close to the bit rate of the previously selected transcoded stream is selected as the target transcoded stream. Another possible implementation method is that after the user enters the live broadcast room, the user directly initiates a scheduling request to the scheduling service through the user terminal. The scheduling request can carry the bit rate supported by the user terminal. The scheduling service allocates the transcoded stream corresponding to the clarity supported by the user terminal as the target transcoded stream according to the scheduling request and the bit rate supported by the user terminal.
[0086] In an embodiment of the present application, after creating at least one pre-transcoding task, the candidate stream status is updated according to the at least one pre-transcoding task. When the target user enters the live broadcast room, the current candidate stream status is queried, and based on the current candidate stream status, the target transcoded stream is determined from at least one transcoded stream, and the storage address of the target transcoded stream is allocated to the target user. When the live broadcast room is subsequently started, the live broadcast picture corresponding to the target stream status is obtained, so that the target user in the live broadcast room can watch the live broadcast picture corresponding to the transcoded stream when the live broadcast room is started, which not only saves bandwidth consumption but also avoids causing a bad user experience for the target user.
[0087] Step 206: When the live broadcast room starts broadcasting, pull the source stream of the live broadcast room, and generate at least one transcoding stream based on the source stream and the at least one pre-transcoding task.
[0088] When the live broadcast room starts, the host will push the source stream to the edge computing upstream. The transcoding system can pull the source stream pushed by the host from the edge computing upstream, and generate at least one transcoded stream based on the source stream and at least one pre-transcoding task.
[0089] In actual applications, the source stream of the live broadcast room is pulled, and at least one transcoded stream is generated based on the source stream and at least one pre-transcoding task. It is usually necessary to pull it from the storage address corresponding to the source stream of the live broadcast room, and determine which transcoded streams are included in at least one pre-transcoding task, and transcode the pulled source stream into the corresponding transcoded stream in at least one pre-transcoding task through transcoding technology.
[0090] Live transcoding usually makes full use of the characteristics of the required conversion encoding to minimize the image quality loss caused by encoding and decoding, while achieving a balance between time and resource consumption. Transcoding specifically decompresses the source stream to be transcoded into a single-frame image sequence, and then re-encodes it into the video data corresponding to the transcoded stream.
[0091] In an optional implementation of this embodiment, the step 206 of generating at least one transcoded stream based on the source stream and the at least one pre-transcoding task includes the following specific steps:
[0092] For a first pre-transcoding task, determining a target bit rate of the first pre-transcoding task, wherein the first pre-transcoding task is any one of the at least one pre-transcoding task;
[0093] The source stream is transcoded from the current bit rate to the target bit rate to obtain a transcoded stream corresponding to the first pre-transcoding task.
[0094] Specifically, the target bitrate refers to the bitrate corresponding to the first pre-transcoding task. For example, if the first pre-transcoding task is to convert a transcoded stream with an 8M bitrate, then 8M is determined as the target bitrate. The current bitrate refers to the bitrate corresponding to the source stream in the live broadcast room. For example, if the bitrate corresponding to the source stream is 10M, then the current bitrate is determined to be 10M.
[0095] For the first pre-transcoding task, determine the target bit rate of the first pre-transcoding task, convert the current bit rate of the source stream into the target bit rate, and obtain the transcoded stream corresponding to the first pre-transcoding task. Specifically, for any pre-transcoding task, determine the target bit rate corresponding to the pre-transcoding task, generate a transcoded stream corresponding to the target bit rate by transcoding the source stream from the current bit rate, and obtain the transcoded streams corresponding to the target bit rates of other pre-transcoding tasks in turn.
[0096] Exemplarily, the bit rate of the source stream of the live broadcast room is 10M, and there are two pre-transcoding tasks. The first pre-transcoding task is to convert the transcoded stream with a bit rate of 8M, and the second pre-transcoding task is to convert the transcoded stream with a bit rate of 5M. The source stream is transcoded from a bit rate of 10M to 8M to obtain the first transcoded stream, and the source stream is transcoded from a bit rate of 10M to 5M to obtain the second transcoded stream.
[0097] In an embodiment of the present application, for the first pre-transcoding task, the target bit rate of the first pre-transcoding task is determined, and the source stream is transcoded from the current bit rate to the target bit rate, thereby obtaining a transcoded stream corresponding to the first pre-transcoding task. Through transcoding technology, the high-bitrate source stream is transcoded into a low-bitrate transcoded stream, so that when the live broadcast starts, the user watches the live broadcast picture provided by the low-bitrate transcoded stream, thereby reducing the consumption of the live broadcast bandwidth.
[0098] In an optional implementation of this embodiment, in the above step 206, when the live broadcast room starts broadcasting, pulling the source stream of the live broadcast room includes the following specific steps:
[0099] When the live broadcast room starts broadcasting, the storage address of the source stream is obtained, and the stream pulling address of the at least one pre-transcoding task is updated to the storage address of the source stream;
[0100] Pull the source stream based on the storage address of the source stream.
[0101] Specifically, the stream pulling address refers to the address for pulling the live stream. If the pulled live stream is a source stream, the storage address of the source stream is determined as the stream pulling address.
[0102] In actual applications, when the live broadcast room starts, the anchor will push the source stream to the edge computing uplink. The edge computing uplink will report the source stream and the storage address of the source stream to the stream status service. The stream status service will send the storage address of the source stream to the transcoding service as the stream pulling address. The transcoding service will pull the stream from the stream pulling address, pull it to the source stream, and then transcode the source stream.
[0103] Optionally, before the live broadcast room starts broadcasting, any original address of the source stream can be set as the pull stream address for each pre-transcoding task, or the storage address of the source stream during the last live broadcast of the live broadcast room can be set as the pull stream address for each pre-transcoding task. When the live broadcast room starts broadcasting, the pull stream address set before the broadcast is updated based on the storage address of the currently pushed source stream.
[0104] In actual applications, when the anchor pushes the source stream, the specific push address can be determined according to the actual situation. When transcoding is started according to the pre-transcoding task, the stream pulling address of the pre-transcoding task will be updated to the push address of the source stream pushed by the anchor, that is, the storage address of the source stream, and then the stream will be pulled from the storage address of the source stream.
[0105] In an embodiment of the present application, when the live broadcast room starts broadcasting, the storage address of the acquired source stream is updated to the stream pulling address of at least one pre-transcoding task, and based on the updated stream pulling address, the source stream is pulled, so that when the broadcast starts, the transcoding corresponding to each pre-transcoding task is based on the currently pushed source stream, thereby improving the success rate of transcoding.
[0106] In an optional implementation of this embodiment, before generating at least one transcoded stream in the above step 206, the following specific steps are also included:
[0107] Receiving an address update request initiated by a user terminal, wherein the address update request carries a user terminal identifier;
[0108] Querying the current candidate flow state, and determining an update flow from each flow included in the current candidate flow state;
[0109] According to the user terminal identifier, a storage address of the update stream is allocated to the user terminal.
[0110] The scheduling service receives an address update request initiated by the user terminal, wherein the address update request carries the user terminal identifier, queries the current candidate flow state from the flow state service, determines the update flow from the various flows included in the current candidate flow state, and allocates the storage address of the update flow to the user terminal according to the user terminal identifier.
[0111] Specifically, the address update request can be a transcoding stream update request, that is, to update the storage address corresponding to the current transcoding stream, update the address corresponding to other transcoding streams, and then obtain other transcoding streams. The updated stream refers to a stream different from the stream before the update, which is used to display the live screen corresponding to the updated stream on the user side. The user side identifier refers to an identifier representing the user side, and the user side and the user side identifier are one-to-one corresponding.
[0112] Optionally, there are many reasons for the user end to initiate an address update request. In one possible implementation, when the live broadcast room is started, the user has not been able to watch the live broadcast picture from the user end for a long time. In this case, the user can select other transcoded streams on the user end, and then initiate an address update request based on the selected transcoded stream. In another possible implementation, the user end can determine that the live broadcast picture has not been played after a period of time, and then automatically trigger a scheduling request. The scheduling request can carry a storage address acquisition requirement for any transcoded stream other than the previous transcoded stream in the stream status service, so as to play the live broadcast picture on the user end.
[0113] The scheduling service queries the current candidate stream state and determines the update stream from the streams included in the current candidate stream state. Specifically, the scheduling service queries the transcoded streams in the current candidate stream state and selects a transcoded stream different from the original stream as the update stream.
[0114] The storage address of the update stream is allocated to the user terminal according to the user terminal identifier. Specifically, the user terminal initiates an address update request, and when the scheduling service returns a response, the storage address of the corresponding update stream is allocated to the corresponding user terminal based on the user terminal identifier.
[0115] In an embodiment of the present application, an address update request initiated by a user terminal is received, and the address update request carries a user terminal identifier. By querying the current candidate stream state, an update stream is determined from the various streams included in the current candidate stream state, and the storage address of the update stream is allocated to the user terminal according to the user terminal identifier. When the user terminal initiates an address update request, when a corresponding request feedback is generated, the user terminal, the address update request, and the request feedback are matched based on the user terminal identifier, thereby improving the accuracy of address allocation and further improving the efficiency of transcoding, so that the user terminal can obtain the live screen of the corresponding transcoded stream.
[0116] The following combination Figure 3 , taking the application of the live broadcast transcoding method provided by this application in live broadcast video as an example, the live broadcast transcoding method is further described. Figure 3 A processing flow chart of a live transcoding method applied to live video provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0117] Step 302: Before the live broadcast room starts broadcasting, the traffic information of the live broadcast room is obtained.
[0118] The first threshold is set to 500, and the second threshold is set to 100 times. Before the broadcast, the live broadcast room 1 is obtained: the number of people waiting online is 800, and the number of system scheduling times is 200; the live broadcast room 2: the number of people waiting online is 400, and the number of system scheduling times is 50; the live broadcast room 3: the number of people waiting online is 200, and the number of system scheduling times is 30.
[0119] Step 304: when the traffic information meets the pre-transcoding condition, create at least one pre-transcoding task, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream.
[0120] After judgment, it is determined that the number of online waiting people in Live Broadcast Room 1 is 800 and the number of system scheduling times is 200, which respectively meet the first set threshold of 500 and the second set threshold of 100 times. The bit rates used by Live Broadcast Room 1 in historical live broadcasts are 8M and 5M, so a pre-transcoding task is created for 8M and a pre-transcoding task is created for 5M.
[0121] Step 306: According to at least one pre-transcoding task, update the candidate stream status, wherein the candidate stream status includes at least one transcoding stream corresponding to at least one pre-transcoding task; when the target user enters the live broadcast room, query the current candidate stream status, and based on the current candidate stream status, determine the target transcoding stream from at least one transcoding stream, and assign the storage address of the target transcoding stream to the target user, wherein the storage address of the target transcoding stream is used for the target user to pull and play the target transcoding stream.
[0122] See also Figure 4a , Figure 4a A schematic diagram showing the status of candidate streams in a live transcoding method provided by an embodiment of the present application is shown. The bit rate of the source stream is 10M, (original picture). For the pre-transcoding tasks of 8M (ultra-high definition) and 5M (high definition), the candidate stream status is updated to: [original picture, ultra-high definition, high definition]. When the target user A enters the live broadcast room, through Figure 4a In the candidate stream status display schematic diagram shown, if ultra-high definition is selected as the target transcoded stream, the storage address corresponding to ultra-high definition is allocated to the target user A.
[0123] See also Figure 4b , Figure 4b A logical framework diagram of a live broadcast transcoding method provided by an embodiment of the present application before the live broadcast room starts broadcasting is shown.
[0124] Based on the above steps 302 to 306, before the live broadcast room starts broadcasting, some users enter the live broadcast room in advance to wait, and some users visit the live broadcast room by clicking on it (the scheduling service records the scheduling times asynchronously). The live broadcast room reports the heartbeat to the number service, and the flow state service obtains the flow information from the number service and the system scheduling times. When it is determined that the flow information of the live broadcast room meets the pre-transcoding conditions (that is, the live broadcast room is determined to be a hot flow), the flow state service notifies the transcoding service to perform transcoding, that is, to issue a pre-transcoding task. The transcoding service determines the required definition of ultra-high definition and high-definition. Based on the above two definitions, the transcoding service issues two-way pre-transcoding tasks of ultra-high definition and high-definition to the transcoding cluster. After the transcoding is completed, the transcoding service updates the flow state service, and the flow state is updated to [original picture, ultra-high definition, high definition]. The user enters the live broadcast room and requests a viewing address. The scheduling service asks the state flow service for the flow state, and obtains the flow state as [original picture, ultra-high definition, high definition]. Ultra-high definition and high definition will be scheduled by default.
[0125] Step 308: When the live broadcast room starts broadcasting, the storage address of the source stream is obtained, the stream pulling address of at least one pre-transcoding task is updated to the storage address of the source stream, and the source stream is pulled based on the storage address of the source stream.
[0126] When the live broadcast room starts, the anchor will push the source stream to the edge computing upstream. The edge computing upstream will push the storage address of the source stream to the transcoding service. The transcoding service will update the storage address to the stream pulling address corresponding to each pre-transcoding task, and pull the source stream at the updated stream pulling address.
[0127] Step 310: for a first pre-transcoding task, determine a target bit rate of the first pre-transcoding task, wherein the first pre-transcoding task is any one of at least one pre-transcoding task; transcode the source stream from the current bit rate to the target bit rate to obtain a transcoded stream corresponding to the first pre-transcoding task.
[0128] For the 8M ultra-clear pre-transcoding task, the target bit rate corresponding to the pre-transcoding task is determined to be 8M, and the source stream is transcoded from 10M to 8M to obtain the transcoded stream corresponding to the 8M ultra-clear pre-transcoding task; similarly, for the 5M ultra-clear pre-transcoding task, the target bit rate corresponding to the pre-transcoding task is determined to be 5M, and the source stream is transcoded from 10M to 5M to obtain the transcoded stream corresponding to the 5M high-definition pre-transcoding task.
[0129] Step 312: Play the live screen corresponding to the target transcoded stream for the target user.
[0130] See also Figure 4c , Figure 4c A logical framework diagram of a live broadcast transcoding method provided by an embodiment of the present application when a live broadcast room is started is shown.
[0131] Based on the above steps 308 to 312, at the beginning of the live broadcast, the anchor pushes the source stream to the edge computing uplink. After the edge computing uplink receives the source stream, it updates the stream status to the stream status service. The stream status service sends the stream pull address to the transcoding service. The transcoding service sends the stream pull address to the ultra-high definition and high-definition PODs. After the ultra-high definition and high-definition PODs obtain the stream pull address, they pull the source stream image from the edge computing uplink and transcode it. The transcoded stream is obtained after transcoding and stored in the corresponding storage address. The live broadcast room pulls the corresponding transcoded stream according to the allocated storage address so that users can watch the normal live broadcast image in the live broadcast room.
[0132] The scheme of the embodiment of the present application is applied, before the live broadcast room starts broadcasting, the traffic information of the live broadcast room is obtained; when the traffic information meets the pre-transcoding condition, at least one pre-transcoding task is created, wherein at least one pre-transcoding task is used to generate at least one transcoding stream; when the live broadcast room starts broadcasting, the source stream of the live broadcast room is pulled, and at least one transcoding stream is generated based on the source stream and at least one pre-transcoding task. That is, before the live broadcast room starts broadcasting, if it is determined that the traffic information of the live broadcast room meets the pre-transcoding condition, a pre-transcoding task is created for the live broadcast room, and when the live broadcast room starts broadcasting, the transcoding stream can be directly generated based on the pre-transcoding task and the source stream. By pre-creating the pre-transcoding task based on the traffic information before the live broadcast room starts broadcasting, corresponding processing is performed based on the pre-transcoding task at the time of broadcasting, so that within a short time after the source stream is pulled after the broadcasting, the transcoding stream live screen corresponding to each pre-transcoding task has been generated and distributed to the corresponding user terminal, so that each user can directly watch the screen corresponding to the transcoding stream, avoiding the judgment and transcoding of whether to generate the transcoding stream at the time of broadcasting, reducing the consumption of bandwidth, and reducing the cost of live broadcasting.
[0133] Corresponding to the above method embodiment, the present application also provides a live broadcast transcoding system embodiment. Figure 5 A schematic diagram of the structure of a live broadcast transcoding system provided by an embodiment of the present application is shown. As shown in FIG4 , the live broadcast transcoding system 510 includes a stream state service 502 , a transcoding service 504 , and a scheduling service 506 ;
[0134] The stream status service 502 is configured to obtain the traffic information of the live broadcast room before the live broadcast room starts broadcasting, and determine whether the traffic information meets the pre-transcoding condition;
[0135] The transcoding service 504 is configured to create at least one pre-transcoding task when the traffic information meets the pre-transcoding conditions, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream; when the live broadcast room is started, the source stream of the live broadcast room is pulled, and at least one transcoding stream is generated based on the source stream and at least one pre-transcoding task.
[0136] Optionally, the stream state service 502 is further configured to update the candidate stream state according to at least one pre-transcoding task created by the transcoding service 504, wherein the candidate stream state includes at least one transcoding stream corresponding to the at least one pre-transcoding task;
[0137] Optionally, the scheduling service 506 is configured to query the current candidate stream status from the stream status service 502 when the target user enters the live broadcast room, and based on the current candidate stream status, determine the target transcoded stream from at least one transcoded stream, and assign the storage address of the target transcoded stream to the target user.
[0138] Optionally, the traffic information includes online waiting information, and the online waiting information includes the number of people waiting online and the number of system scheduling times; the flow status service 502 is further configured to determine that the traffic information meets the pre-transcoding conditions when the number of people waiting online exceeds a first set threshold and / or the number of system scheduling times exceeds a second set threshold.
[0139] Optionally, the traffic information includes the host attributes of the live broadcast room; the stream state service 502 is further configured to determine that the traffic information meets the pre-transcoding condition when the host attributes are the specified attributes in the pre-transcoding condition.
[0140] Optionally, the transcoding service 504 is further configured to obtain historical bit rate information of the live broadcast room and determine at least one bit rate; for each bit rate, create a corresponding pre-transcoding task.
[0141] Optionally, the transcoding service 504 is further configured to determine a target bit rate of the first pre-transcoding task for the first pre-transcoding task, wherein the first pre-transcoding task is any one of at least one pre-transcoding task; transcode the source stream from the current bit rate to the target bit rate to obtain a transcoded stream corresponding to the first pre-transcoding task.
[0142] Optionally, the transcoding service 504 is further configured to obtain the storage address of the source stream when the live broadcast room starts broadcasting, update the stream pulling address of at least one pre-transcoding task to the storage address of the source stream; and pull the source stream based on the storage address of the source stream.
[0143] Optionally, the scheduling service 506 is further configured to receive an address update request initiated by a user terminal, wherein the address update request carries a user terminal identifier; query the current candidate flow state, and determine the update flow from the various flows included in the current candidate flow state; and allocate the storage address of the update flow to the user terminal according to the user terminal identifier.
[0144] The scheme of the embodiment of the present application is applied, before the live broadcast room starts broadcasting, the traffic information of the live broadcast room is obtained; when the traffic information meets the pre-transcoding condition, at least one pre-transcoding task is created, wherein at least one pre-transcoding task is used to generate at least one transcoding stream; when the live broadcast room starts broadcasting, the source stream of the live broadcast room is pulled, and at least one transcoding stream is generated based on the source stream and at least one pre-transcoding task. That is, before the live broadcast room starts broadcasting, if it is determined that the traffic information of the live broadcast room meets the pre-transcoding condition, a pre-transcoding task is created for the live broadcast room, and when the live broadcast room starts broadcasting, the transcoding stream can be directly generated based on the pre-transcoding task and the source stream. By pre-creating the pre-transcoding task based on the traffic information before the live broadcast room starts broadcasting, corresponding processing is performed based on the pre-transcoding task at the time of broadcasting, so that within a short time after the source stream is pulled after the broadcasting, the transcoding stream live screen corresponding to each pre-transcoding task has been generated and distributed to the corresponding user terminal, so that each user can directly watch the screen corresponding to the transcoding stream, avoiding the judgment and transcoding of whether to generate the transcoding stream at the time of broadcasting, reducing the consumption of bandwidth, and reducing the cost of live broadcasting.
[0145] The above is a schematic scheme of a live broadcast transcoding system of this embodiment. It should be noted that the technical scheme of the live broadcast transcoding system and the technical scheme of the live broadcast transcoding method described above are of the same concept, and the details not described in detail in the technical scheme of the live broadcast transcoding system can be referred to the description of the technical scheme of the live broadcast transcoding method described above.
[0146] Figure 6 The block diagram of a computing device according to an embodiment of the present application is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.
[0147] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0148] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0149] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.
[0150] Among them, when the processor 620 executes the computer instructions, the steps of the live broadcast transcoding method are implemented.
[0151] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the live transcoding method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the live transcoding method described above.
[0152] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the live broadcast transcoding method as described above.
[0153] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the live transcoding method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the live transcoding method described above.
[0154] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0155] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0156] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0157] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0158] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A live broadcast transcoding method, characterized in that: include: Before the live broadcast room starts broadcasting, obtain the traffic information of the live broadcast room; When the traffic information satisfies the pre-transcoding condition, at least one pre-transcoding task is created, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream; When the live broadcast room starts broadcasting, pull the source stream of the live broadcast room, and generate at least one transcoded stream based on the source stream and the at least one pre-transcoding task; Wherein, the traffic information includes online waiting information, and the online waiting information includes the number of people waiting online and the number of system dispatches; Before creating at least one pre-transcoding task when the traffic information meets the pre-transcoding condition, the method further includes: When the number of online waiting persons exceeds a first set threshold value, and / or the number of system scheduling times exceeds a second set threshold value, it is determined that the traffic information meets the pre-transcoding condition.
2. The method according to claim 1, characterized in that The traffic information includes the host attributes of the live broadcast room; Before creating at least one pre-transcoding task when the traffic information meets the pre-transcoding condition, the method further includes: When the host attribute is a specified attribute in the pre-transcoding condition, it is determined that the traffic information meets the pre-transcoding condition.
3. The method according to any one of claims 1 to 2, characterized in that: The creating at least one pre-transcoding task includes: Obtain historical bit rate information of the live broadcast room and determine at least one bit rate; For each bit rate, create a corresponding pre-transcoding task.
4. The method according to any one of claims 1 to 2, characterized in that: After creating at least one pre-transcoding task, the method further includes: According to the at least one pre-transcoding task, updating a candidate stream state, wherein the candidate stream state includes at least one transcoding stream corresponding to the at least one pre-transcoding task; When the target user enters the live broadcast room, the current candidate stream status is queried, and based on the current candidate stream status, the target transcoded stream is determined from the at least one transcoded stream, and the storage address of the target transcoded stream is allocated to the target user, wherein the storage address of the target transcoded stream is used by the target user to pull and play the target transcoded stream.
5. The method according to any one of claims 1 to 2, characterized in that: The step of generating at least one transcoding stream based on the source stream and the at least one pre-transcoding task comprises: For a first pre-transcoding task, determining a target bit rate of the first pre-transcoding task, wherein the first pre-transcoding task is any one of the at least one pre-transcoding task; The source stream is transcoded from the current bit rate to the target bit rate to obtain a transcoded stream corresponding to the first pre-transcoding task.
6. The method according to claim 1, characterized in that When the live broadcast room is broadcasted, pulling the source stream of the live broadcast room includes: When the live broadcast room starts broadcasting, the storage address of the source stream is obtained, and the stream pulling address of the at least one pre-transcoding task is updated to the storage address of the source stream; Pull the source stream based on the storage address of the source stream.
7. The method according to claim 1, characterized in that Before generating at least one transcoded stream, the method further includes: Receiving an address update request initiated by a user terminal, wherein the address update request carries a user terminal identifier; Querying the current candidate flow state, and determining an update flow from each flow included in the current candidate flow state; According to the user terminal identifier, a storage address of the update stream is allocated to the user terminal.
8. A live broadcast transcoding system, characterized in that: The live broadcast transcoding system includes a stream state service unit and a transcoding service unit; The stream status service unit is configured to obtain the flow information of the live broadcast room before the live broadcast room starts broadcasting, and determine whether the flow information meets the pre-transcoding condition; The transcoding service unit is configured to create at least one pre-transcoding task when the traffic information meets the pre-transcoding condition, wherein the at least one pre-transcoding task is used to generate at least one transcoding stream; when the live broadcast room is broadcasted, pull the source stream of the live broadcast room, and generate at least one transcoding stream based on the source stream and the at least one pre-transcoding task; Wherein, the traffic information includes online waiting information, and the online waiting information includes the number of people waiting online and the number of system dispatches; Before creating at least one pre-transcoding task when the traffic information meets the pre-transcoding condition, the method further includes: When the number of online waiting persons exceeds a first set threshold value, and / or the number of system scheduling times exceeds a second set threshold value, it is determined that the traffic information meets the pre-transcoding condition.
9. The live broadcast transcoding system according to claim 8, characterized in that: The live broadcast transcoding system also includes a scheduling service unit; The stream state service unit is further configured to update a candidate stream state according to at least one pre-transcoding task created by the transcoding service unit, wherein the candidate stream state includes at least one transcoding stream corresponding to at least one pre-transcoding task; The scheduling service unit is configured to query the current candidate stream state from the stream state service unit when the target user enters the live broadcast room, and based on the current candidate stream state, determine the target transcoded stream from the at least one transcoded stream, and allocate the storage address of the target transcoded stream to the target user.
10. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
