Live video transmission method and system, and computing device cluster
By using the signaling server and the media server to work together in the cloud platform, the metadata of the live video is sent and updated in advance, which solves the problem of prolonged live video switching and improves user experience and video stability.
Patent Information
- Application Number
- CN202310609146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-10
- Filing Date
- 2023-05-26
- Publication Date
- 2024-09-17
AI Technical Summary
Existing live video transmission technology has a long first frame delay when users switch live videos, resulting in poor user experience and prone to black screens or freezes.
By introducing a signaling server and a media server into the cloud platform, the signaling server pre-stores the media metadata of the live video and sends the transmission metadata to the client in advance. The client establishes a transmission channel based on the transmission metadata, and the media server completes streaming. After parsing and updating the metadata, the signaling server verifies and updates the storage metadata to ensure that the client receives the latest media metadata to avoid decoding failure.
It shortens the transmission delay for the client to obtain live video, improves the user experience when switching live videos, reduces the probability of black screens and freezes, and ensures the stability and smoothness of the video.
Smart Images

Figure CN118660175A
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202310231482.0 filed on March 10, 2023, with invention name “Method and system for reducing first frame delay of live broadcast”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of cloud computing technology, and in particular to a method, system and computing device cluster for transmitting live video. Background Art
[0003] With the development of video live streaming technology, video live streaming has become more and more popular, and there are more and more types of video live streaming, such as game live streaming, e-commerce live streaming, talent live streaming, etc.
[0004] When watching live videos, users often need to switch the live videos they are watching. For example, in a live application, users can switch the live videos they are watching by swiping up on the screen of the live video.
[0005] In order to ensure the user's experience of watching live videos, when the user switches live videos, it is necessary to reduce the transmission delay of the switched live videos as much as possible to reduce the loading time when the user switches live videos. Summary of the invention
[0006] The embodiments of the present application provide a method, system and computing device cluster for transmitting live video, which can reduce the delay of receiving live video at the user end. The corresponding technical solutions are as follows:
[0007] In a first aspect, a method for transmitting live video is provided, the method being applied to a cloud platform, wherein the cloud platform includes a signaling server and at least one media server, the method comprising:
[0008] The signaling server receives a request sent by a user terminal, the request being used to request a live video, and in response to at least one media server being in a non-streaming state, determines the first media server that streams the live video among the media servers. The signaling server sends a stream pulling notification corresponding to the live video to the first media server, instructing the first media server to stream the live video. At the same time, the signaling server sends the receiving information corresponding to the live video to the user terminal, the receiving information carrying the transmission metadata corresponding to the first media server and the first media metadata corresponding to the live video pre-stored by the signaling server. The receiving information is used to instruct the user terminal to obtain the live video from the first media server according to the transmission metadata, and decode and display the live video according to the first media metadata.
[0009] Among them, the signaling server can manage each media server and monitor the load of each media server. For example, each media server can periodically report the CPU usage, memory usage, hard disk read and write rate, and network bandwidth usage to the signaling server. When the signaling server receives the acquisition request corresponding to the live video and determines that the live video needs to be streamed by the media server, the signaling server can determine the media server that streams the live video among the media servers based on the corresponding load conditions of each media server. For the media server that streams, the signaling server can also record the corresponding relationship between the media server and the live video it streams, for example, it can record the address of the media server and the video stream name of the live video it streams.
[0010] In the scheme shown in the present application, during the process of the user end obtaining the live video from the cloud platform, if the signaling server determines that at least one media server is in a non-streaming state, that is, there is currently no media server that streams the live video, the signaling server can determine the first media server that streams the live video. After determining the first media server that streams the live video, the signaling server can send it to the user end based on the media metadata corresponding to the live video pre-stored locally and the transmission metadata corresponding to the first media server, so that the user end receives and decodes the live video based on the media metadata and transmission metadata. It can be seen that in this scheme, the signaling server does not need to wait for the first media server to complete the streaming of the live video and parse the media metadata of the live video. The signaling server notifies the user end that the process of obtaining and decoding the live video can be executed in parallel with the process of the first media server streaming and parsing the live video. This shortens the transmission delay for the user end to obtain the live video.
[0011] In an achievable manner, before the signaling server sends the reception information corresponding to the live video to the user terminal, the signaling server also includes: determining the first media metadata corresponding to the first live identifier of the live video in the pre-stored correspondence between the live identifier and the media metadata.
[0012] In the scheme shown in the present application, since the media metadata corresponding to the live video is updated less frequently, the signaling server can store the acquired media metadata in correspondence with the live identification (such as the live stream name) of the corresponding live video after initially acquiring the media metadata corresponding to each live video. In this way, when the acquisition request for the live video is received again, the first media metadata corresponding to the live video requested by the user end can be determined in the correspondence between the stored live identification and the media metadata, without waiting for the first media server to complete the pulling and parsing of the live video. In addition, the media metadata corresponding to the live video can be sent to the user end in advance, shortening the transmission delay for the user end to acquire the live video.
[0013] In an achievable manner, the above-mentioned live video transmission method further includes: after the first media server pulls the live video stream, it parses the second media metadata corresponding to the live video and sends the second media metadata to the signaling server. The signaling server sends a first update notification carrying the second media metadata to the user terminal, wherein the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
[0014] In the solution shown in the present application, after the first media server completes the streaming and parsing of the live video, the second media metadata corresponding to the parsed live video can be sent to the signaling server. The signaling server determines whether the received second media metadata is consistent with the locally stored first media metadata (that is, the first media metadata sent to the user end). If they are inconsistent, the second media metadata can be sent to the user end to instruct the user end to decode and display the live video according to the second media metadata, so as to avoid the user end from failing to decode the live video.
[0015] In one achievable manner, the signaling server updates the stored first media metadata to the second media metadata.
[0016] In the solution shown in the present application, if the signaling server determines that the received second media metadata is inconsistent with the first media metadata stored locally, it means that the corresponding media metadata of the live video requested by the user end has been updated. Since the corresponding media metadata of the live video is updated less frequently, it is highly likely that the live video will still use the second media metadata later. Therefore, the signaling server can update the first media metadata to the second media metadata, and then provide accurate media metadata for the user end that subsequently requests the live video.
[0017] In one achievable manner, the first media metadata includes at least video resolution, frame rate, bit rate, audio sampling rate, and number of channels corresponding to the live video.
[0018] In an achievable manner, in response to the first media server satisfying the server replacement condition, the signaling server determines a second media server for pulling the live video stream from at least one media server. The signaling server sends a pull notification to the second media server, the pull notification being used to instruct the second media server to pull the live video stream. The signaling server sends a second update notification carrying the second transmission metadata to the user terminal, the second update notification being used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
[0019] In the solution shown in the present application, the signaling server can detect the operating data of each media server for monitoring, such as monitoring the load data and network data of the media server. After determining that the operating data corresponding to the first media server that pulls the live video meets the server replacement conditions, the signaling server can re-determine other media servers (i.e., second media servers) that pull the live video in the media server of the cloud platform, and notify the user end to obtain the live video from the second media server. In this way, it can be avoided that the first media server is overloaded, the network is blocked, and other problems cause the user end to be unable to receive the live video normally.
[0020] In an achievable manner, the server replacement condition includes that the first media server is overloaded or the first media server is down.
[0021] In a second aspect, a live video transmission system is provided, the system being configured on a cloud platform, the system comprising a signaling server and at least one media server, wherein:
[0022] The signaling server is used to receive a request sent by a user terminal, wherein the request is used to request a live video;
[0023] The signaling server is used to determine a first media server for pulling a stream of the live video in the at least one media server in response to at least one media server being in a non-streaming state;
[0024] The signaling server is used to send a stream pull notification corresponding to the live video to the first media server, where the stream pull notification is used to instruct the first media server to pull the live video;
[0025] The signaling server is used to send receiving information corresponding to the live video to the user terminal, where the receiving information carries the first transmission metadata corresponding to the first media server and the first media metadata corresponding to the live video pre-stored by the signaling server. The receiving information is used to instruct the user terminal to obtain the live video from the first media server according to the first transmission metadata, and decode and display the live video according to the first media metadata.
[0026] In an achievable manner, the signaling server is further configured to determine, from a pre-stored correspondence between live broadcast identifiers and media metadata, the first media metadata corresponding to the first live broadcast identifier of the live video.
[0027] In an achievable manner, the first media server is further configured to parse the second media metadata corresponding to the live video after streaming the live video;
[0028] The first media server is further configured to send the second media metadata to the signaling server;
[0029] The signaling server is further used to send a first update notification carrying the second media metadata to the user terminal, where the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
[0030] In an achievable manner, the signaling server is further configured to update the pre-stored first media metadata to the second media metadata.
[0031] In one achievable manner, the media metadata includes at least the video resolution, frame rate, bit rate, audio sampling rate, and number of channels corresponding to the live video.
[0032] In an achievable manner, the signaling server is further configured to determine, in response to the first media server satisfying the server replacement condition, a second media server for pulling the live video stream from at least one media server;
[0033] The signaling server is further used to send a stream pulling notification to the second media server, where the stream pulling notification is used to instruct the second media server to pull the live video;
[0034] The signaling server is further used to send a second update notification carrying second transmission metadata to the user terminal, where the second update notification is used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
[0035] In an achievable manner, the server replacement condition includes that the first media server is overloaded or the first media server is down.
[0036] In a third aspect, a computing device cluster is provided, which includes at least one computing device, each computing device including a processor and a memory, wherein the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method described in the first aspect.
[0037] According to a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to the first aspect.
[0038] In a fifth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster can execute the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of the transmission of live video between a traditional cloud platform and a user terminal;
[0040] Figure 2This is a flow chart of a method for transmitting live video provided in an embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of a process for a user terminal to obtain a live video provided by an embodiment of the present application;
[0042] Figure 4 This is a schematic diagram of a process for a user terminal to obtain a live video provided by an embodiment of the present application;
[0043] Figure 5 This is a flow chart of a method for transmitting live video provided in an embodiment of the present application;
[0044] Figure 6 It is a structural diagram of a live video transmission system provided in an embodiment of the present application;
[0045] Figure 7 is a structural schematic diagram of a computer device provided in an embodiment of the present application;
[0046] Figure 8 It is a structural diagram of a computer device cluster provided in an embodiment of the present application;
[0047] Fig. 9 It is a structural diagram of a computer device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0049] In order to support large-scale low-latency live broadcast services such as e-commerce live broadcast and sports event live broadcast, low-latency live broadcast (LLL) products (such as live broadcast software) based on real-time communication (RTC) low-latency transmission technology have emerged, such as various shopping live broadcast software, sports event live broadcast software, short video live broadcast software, etc.
[0050] When watching live broadcasts through live broadcast software running on the user end, users often need to switch the live broadcast room they are watching, and the setting will continuously switch the live broadcast room they are watching. For example, when the user first opens the live broadcast software, they need to keep switching the live broadcast room they are watching until they switch to the live broadcast room they are interested in.
[0051] Every time the user switches the live broadcast room, the user needs to request the cloud platform for the live video corresponding to the switched live broadcast room. After receiving the user's request for live video, the cloud platform may need to pull the live video of the user from the live broadcast source station. After pulling the live video, the live video requested by the user can be returned to the user. If the time required for the user to request the live video from the cloud platform to the user receiving the live video sent by the cloud platform is long, that is, the first frame delay is long, when the user operates the user to switch the live broadcast room, the user may not receive the switched live video in time, resulting in a black screen or freeze, which will affect the user's experience of watching live videos.
[0052] Figure 1 This is a flow chart of the traditional transmission of live video between the cloud platform and the user end. Figure 1 As shown, the cloud platform includes at least a signaling server (which may be referred to as a signaling service) and a media server (which may be referred to as a media service). The signaling server is used to interact with the user end through the Session Description Protocol (SDP), determine and notify the media server that pulls the live video requested by the user end, etc. The media server is used to pull the live video from the live source station, and send the pulled live video to the user end for decoding and display through the media transmission channel established with the user end.
[0053] See also Figure 1 ,The traditional live video transmission process includes:
[0054] S1. After the user terminal switches the live broadcast room, it sends an SDP offer to the signaling service, where the SDP offer may include the session name, live stream name, media type (audio, video, etc.), media format (coding method, transmission protocol, etc.), media source address and port, media connection information (such as transmission protocol and address type) and other session description information (such as bandwidth limit, security settings).
[0055] S2. The signaling service determines, based on the information provided in the SDP offer, whether there is a media service that streams the live video requested by the user at the current time. If not, the signaling service can determine the media service that streams the live video requested by the user based on the set strategy (such as load balancing) and send a stream notification to the media service.
[0056] S3: The media service pulls the live video from the live source station and parses the pulled live video to obtain the media metadata corresponding to the live video. The media metadata may include the video resolution, frame rate, bit rate, audio sampling rate, number of channels, etc. of the live video. In addition, it may also include encoder type, encoding parameters, media stream status information (such as packet loss rate, network delay, etc.).
[0057] S4. The media service sends the parsed media metadata to the signaling service.
[0058] S5. The signaling service sends an SDP answer to the user end, wherein the SDP answer may include the propagation metadata of the media service for pulling the live video (such as the address information and interface information of the media service), and the parsed media metadata of the media service.
[0059] S6. The user end may establish a transmission channel with a media service that streams the live video according to the received propagation metadata, and receive the live video through the transmission channel.
[0060] S7. The user end decodes and displays the live video according to the received media metadata.
[0061] From the above transmission process, it can be seen that the signaling service needs to wait for the media service to pull the live video from the live source station and parse the live video before completing the SDP interaction with the user end. With such serial operation, the user end has a high latency in obtaining the live video, and when the user end switches the live video, it is easy to encounter black screen and freeze problems.
[0062] Figure 2 The present application provides a flow chart of a method for transmitting live video, which can be applied in a cloud platform and implemented by a server in the cloud platform, and can reduce the latency of a user end obtaining live video. The cloud platform can include at least a signaling server and a media server, and the number of signaling servers and media servers is not limited. The signaling server and media server can be physical hosts, or virtual machines or containers implemented based on virtual machine technology or container technology. For ease of description, the signaling server is referred to as a signaling service, and the media server is referred to as a media service. Figure 2 The present application provides a method for transmitting live video:
[0063] Step 201: The signaling server receives a request sent by a user terminal, where the request is used to request a live video.
[0064] The user terminal may run live broadcast software or log in to a live broadcast webpage. After the user operates the user terminal to switch the live broadcast room currently being watched, in response to the user's switching operation, the user terminal may send a request to the signaling server to obtain the live broadcast video corresponding to the switched live broadcast room. The request may carry the identifier of the live broadcast room, or the stream name corresponding to the live broadcast video, etc. The request may be an SDP Offer request.
[0065] Step 202: When the signaling server determines that the live video meets the streaming condition, a first media server for streaming the live video is determined from at least one media server.
[0066] In one achievable manner, the streaming condition may be that at least one media server is in a non-streaming state, that is, there is no media server in the current cloud platform that streams the live video.
[0067] In practice, if the live video requested by the user is also watched by other users, it means that there is a media service in the cloud platform that pulls the live video requested by the user, and the signaling service can record the current pull information of each media service in the cloud platform, such as recording the correspondence between the media service and the live stream name being pulled. Therefore, when the signaling service receives the acquisition request corresponding to the live video sent by the user, it can first determine whether there is a media service in the cloud platform that pulls the live video requested by the user.
[0068] If there is currently a media service that pulls the live video requested by the user end, the signaling service can send the transmission metadata corresponding to the media service that pulls the live video and the media metadata corresponding to the live video to the user end. The media metadata is sent to the signaling service after the media service that pulls the live video parses the live video.
[0069] If there is currently no media service that pulls the live video requested by the user, the signaling service can determine the first media service that pulls the live video from the multiple media services provided by the cloud platform according to a preset strategy. For example, the signaling server can use the load of each media service, the number of cluster devices, the live stream name, the device weight, etc. as input parameters to calculate the first media service that pulls the live video.
[0070] Step 203: The signaling server sends a stream pulling notification corresponding to the live video to the first media server, where the stream pulling notification is used to instruct the first media server to pull the live video.
[0071] After determining the first media service to pull the live video, the signaling service can send a pull notification to the first media service, and the pull notification can carry the live stream name corresponding to the live video to be pulled. After receiving the pull notification, the first media service can pull the live video from the live source station according to the live stream name.
[0072] Step 204: The signaling server sends reception information corresponding to the live video to the user terminal, wherein the reception information carries the transmission metadata corresponding to the first media server and the first media metadata corresponding to the live video pre-stored by the signaling server. The reception information is used to instruct the user terminal to obtain the live video from the first media server according to the transmission metadata, and decode and display the live video according to the first media metadata.
[0073] After determining the first media service to stream the live video, the signaling service can add the pre-stored media metadata corresponding to the live video and the propagation metadata corresponding to the first media service to the receiving information corresponding to the live video, and send it to the user end.
[0074] The media metadata corresponding to the live video stored in the signaling service can be sent to the signaling service after any media service in the cloud platform performs the first streaming and parsing of the live video. After receiving the media metadata corresponding to the live video sent by the media service for the first time, the signaling service can store the received media metadata in correspondence with the live stream name of the live video. After the media service stops streaming the live video, the media metadata stored in the signaling service will not be deleted. Since the media metadata corresponding to the live video is updated less frequently, it may not even be updated. Therefore, when the media service is needed to stream the live video again in the future, as shown in step 204, there is no need to wait for the media service to parse the live video and send the parsed media metadata to the signaling service. The signaling service can directly add the locally stored media metadata corresponding to the live video to the received information sent to the user end.
[0075] After receiving the reception information sent by the signaling service, the user end can establish a transmission channel with the media service that pulls the live video according to the received propagation metadata, receive the live video through the transmission channel, and decode and display the live video according to the received media metadata.
[0076] In one achievable manner, after receiving the acquisition request corresponding to the live video sent by the user end, the signaling service can determine whether there is a live stream name corresponding to the live video requested by the user end in the correspondence relationship between the live stream name and the media metadata stored this time. If so, it means that the media metadata corresponding to the live video requested by the user end is stored locally. In this case, the signaling service does not need to wait for the media service to pull the live video requested by the user end and parse the media metadata. After determining the first media service to pull the live video, the signaling service can complete the SDP interaction with the user end according to the media metadata stored in the correspondence relationship.
[0077] In an embodiment of the present application, during the process of transmitting live video from the cloud platform to the user end, the pre-stored media metadata of the live video and the first transmission metadata of the first media service can be sent to the user end in advance. The user end can establish the delay of the transmission channel with the first media service in advance through the first transmission metadata. After the first media service completes the stream pulling, it can transmit the live video to the user end through the transmission channel. This saves the time for the media service to parse the live video and send the parsed media metadata to the signaling service, which can reduce the delay for the user end to obtain the live video.
[0078] Figure 3 This is a schematic diagram of a process for a user terminal to obtain a live video provided by an embodiment of the present application. Figure 3 In the example, the user end includes a signaling negotiation module, a data receiving module, and a media rendering module. The process of the user end obtaining live video is as follows:
[0079] S1. After the user switches the live broadcast room to be watched on the user end, the signaling negotiation module can send an SDP offer to the signaling service of the cloud platform. The SDP offer can include the live stream name corresponding to the live video requested by the user end.
[0080] S2. The signaling service calculates the media service that provides the streaming service based on the load on the media service side, the number of cluster devices, the live stream name, and the device weight as input parameters, notifies the media service to negotiate the media transmission channel, and sends a streaming notification to the media service to instruct the media service to stream the live video.
[0081] S3. The signaling service constructs the SDP Answer data using the locally cached media stream metadata.
[0082] S4. The signaling service forwards the SDP Answer instruction to the signaling negotiation module of the user end.
[0083] S5. The signaling negotiation module forwards the media and transmits metadata to the data receiving module.
[0084] S6. The data receiving module and the media service establish a media transmission channel through an interactive connectivity establishment (ICE) hole punching process, and receive the live video sent by the media server.
[0085] S7. The data receiving module receives the frame data of the live video, sends the frame data to the media rendering module, and displays it on the UI.
[0086] By the above Figure 3 It can be seen from the step S3 shown that when the signaling service returns the SDP Answer instruction to the user end, there is no need to wait for the media service to parse the live video stream and send the parsed media metadata to the signaling service. The processing of the above steps S3, S4, S5 and S6 can be performed in parallel with the stream pulling processing of the media service. This can reduce the delay of the data receiving module receiving the live data, improve the efficiency of the media rendering module in rendering and displaying the live data, and reduce the probability of a black screen when the user switches the live room.
[0087] In one achievable manner, after step 203, the first media service can pull the stream from the live broadcast source station in response to the pull notification sent by the signaling service. Similarly, the pulled live video can be parsed to obtain the media metadata corresponding to the live video. The media metadata parsed by the media service may be referred to as the second media metadata below. After parsing the second media metadata, the media service can verify the first media metadata stored in the signaling service. The corresponding processing is as follows:
[0088] Step 2031: After pulling the live video stream, the first media server parses the second media metadata corresponding to the live video.
[0089] Step 2032: The first media server sends the second media metadata to the signaling server.
[0090] Step 2033: In response to the inconsistency between the second media metadata and the first media metadata, the signaling server sends a first update notification carrying the second media metadata to the user terminal, where the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
[0091] After receiving the second media metadata sent by the media service, the signaling service can verify whether the second media metadata is consistent with the first media metadata. If the second media metadata is consistent with the first media metadata, it means that the user end can decode the received live video according to the first media metadata. If the second media metadata is inconsistent with the first media metadata, it means that the media metadata corresponding to the live video requested by the user end has been updated, so the signaling service can send a first update notification to the user end, so that the user end can decode and display the live video according to the second media metadata.
[0092] It should be noted that even if the second media metadata is inconsistent with the first media metadata, the delay of the user end receiving and displaying the live video will be lower than the traditional live video transmission method. Because in the case where the second media metadata is inconsistent with the first media metadata, the time when the user end receives the second media metadata in the embodiment of the present application is consistent with the time when the user end receives the media metadata in the traditional method, both of which are obtained after the media service parses the media metadata of the live video and forwards it through the signaling service. However, in the embodiment of the present application, the user end has already established a transmission channel with the media service in advance based on the transmission metadata. Therefore, in the embodiment of the present application, there is no need to establish a transmission channel between the user end and the media service, and the live video can be obtained one step in advance, and the live video can be decoded and displayed based on the updated second media metadata.
[0093] In addition, in response to the inconsistency between the second media metadata and the first media metadata, the signaling server updates the first media metadata stored to the second media metadata. Since the corresponding media metadata of the live video is updated at a low frequency, it is highly likely that the live video will still use the second media metadata later. Therefore, the signaling server can update the first media metadata to the second media metadata, and can provide accurate media metadata to the user terminal that subsequently requests the live video.
[0094] like Figure 4 The embodiment of the present application and the process flow diagram of the user end obtaining live video are shown in FIG. Figure 4 In the example, the user end includes a signaling negotiation module, a data receiving module, and a media rendering module. The process of the user end obtaining live video is as follows:
[0095] S1. After the user switches the live broadcast room to be watched on the user end, the signaling negotiation module can send an SDP offer to the signaling service of the cloud platform. The SDP offer can include the live stream name corresponding to the live video requested by the user end.
[0096] S2. The signaling service calculates the media service that provides the streaming service based on the load on the media service side, the number of cluster devices, the live stream name, and the device weight as input parameters, notifies the media service to negotiate the media transmission channel, and sends a streaming notification to the media service to instruct the media service to stream the live video.
[0097] S3. The signaling service constructs the SDP Answer data using the locally cached media metadata.
[0098] S4. The signaling service forwards the SDP Answer instruction to the signaling negotiation module of the user end.
[0099] S5. The signaling negotiation module forwards the media and transmits metadata to the data receiving module.
[0100] S6. The data receiving module and the media service establish a media transmission channel through the ICE hole punching process and receive the live broadcast data sent by the media server.
[0101] S7: The media service pulls the live video stream, parses the media metadata, and sends the parsed media metadata to the signaling service.
[0102] S8. The signaling service verifies the locally cached media metadata. If the locally cached media metadata is inconsistent with the media metadata parsed by the media service, the SDP Update process is triggered to forward the media metadata parsed by the media service to the user-side signaling negotiation module.
[0103] S9. The signaling negotiation module synchronously updates the media metadata to the data receiving module.
[0104] S10. The data receiving module receives the frame data of the live video, sends the frame data to the media rendering module, and displays it on the UI.
[0105] By the above Figure 4 It can be seen that the signaling service can send media metadata to the user end in advance, which can reduce the delay of the user end receiving live video. If it is determined later that the media metadata parsed by the media service has been updated, the updated media metadata can be sent to the user end. In this way, even if the media metadata is updated, the user end can establish a transmission channel with the media service in advance, receive the live video in advance, and use the updated media metadata for decoding and rendering, etc., which can improve the efficiency of the user end in receiving and displaying live video and reduce the probability of a black screen when the user switches between live broadcast rooms.
[0106] In one achievable manner, the signaling service can monitor the operation data of the media service. If it is determined that the media service may not be able to provide the live video streaming service normally, the media service that streams the live video can be switched to improve the stability of the user end watching the live video. The corresponding processing is as follows: Figure 5 As shown, including:
[0107] Step 501: In response to a first media server satisfying a server replacement condition, a signaling server determines a second media server for pulling a live video stream from at least one media server.
[0108] During implementation, the signaling service can detect the operating data of each media service for monitoring, such as monitoring the load data, network data, etc. of the media service. The signaling service can determine whether the first media server can normally provide services such as live video streaming and transmission based on the detected operating data. If it is determined that the operating data corresponding to the first media server meets the server replacement conditions, it means that the first media server may not be able to normally provide services such as live video streaming and transmission. Therefore, the signaling server can re-determine other media servers (i.e., the second media server) that stream live video in the media servers of the cloud platform. Among them, the server replacement conditions include the first media server being overloaded or the first media server being down.
[0109] Step 502: The signaling server sends a stream pulling notification to the second media server, where the stream pulling notification is used to instruct the second media server to pull the live video.
[0110] Step 503: The signaling server sends a second update notification carrying second transmission metadata to the user terminal, where the second update notification is used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
[0111] In an embodiment of the present application, when the first media server is unable to normally provide services such as live video streaming and transmission due to problems such as overload and network congestion, the media server that provides services such as live video streaming and transmission can be switched, thereby improving the stability of live video playback on the user end.
[0112] Generally, the user end needs to request the signaling service to change the media service after the live video is stuck, dropped frames, etc., but this cannot completely avoid the user end from playing the live video stuck, and the user end may also request the signaling service to change the media service when there is a problem with the non-media service, which will also cause a waste of processing and transmission resources. In the embodiment of the present application, the signaling server perceives the running status of the media service, which can improve the timeliness and accuracy of the media service and improve the stability of the live video playback on the user end.
[0113] This application also provides a live video transmission system, such as Figure 6 As shown, the system includes a signaling server 610 and at least one media server 620, wherein:
[0114] The signaling server 610 is used for the signaling server to receive a request sent by a user terminal, wherein the request is used to request a live video;
[0115] The signaling server 610 is configured to determine, in response to the at least one media server being in a non-streaming state, a first media server for streaming the live video from among the at least one media server;
[0116] The signaling server 610 is used to send a stream pull notification corresponding to the live video to the first media server, where the stream pull notification is used to instruct the first media server to pull the live video;
[0117] The signaling server 610 is used to send receiving information corresponding to the live video to the user terminal. The receiving information carries the first transmission metadata corresponding to the first media server and the first media metadata corresponding to the live video pre-stored by the signaling server. The receiving information is used to instruct the user terminal to obtain the live video from the first media server according to the first transmission metadata, and decode and display the live video according to the first media metadata.
[0118] Optionally, the signaling server 610 is further configured to determine, from a pre-stored correspondence between live broadcast identifiers and media metadata, first media metadata corresponding to a first live broadcast identifier of the live video.
[0119] Optionally, the first media server 620 is further configured to parse the second media metadata corresponding to the live video after pulling the live video stream;
[0120] The first media server 620 is further configured to send the second media metadata to the signaling server;
[0121] The signaling server 610 is further used to send a first update notification carrying the second media metadata to the user terminal, where the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
[0122] Optionally, the signaling server 610 is further configured to update the pre-stored first media metadata to the second media metadata.
[0123] Optionally, the first media metadata includes at least video resolution, frame rate, bit rate, audio sampling rate, and number of channels corresponding to the live video.
[0124] Optionally, the signaling server 610 is further configured to determine, in response to the first media server satisfying the server replacement condition, a second media server for pulling the live video stream from at least one media server;
[0125] The signaling server 610 is further configured to send a stream pulling notification to the second media server, where the stream pulling notification is used to instruct the second media server to pull the live video;
[0126] The signaling server 610 is further used to send a second update notification carrying the second transmission metadata to the user terminal, where the second update notification is used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
[0127] Optionally, the server replacement condition includes that the first media server is overloaded or the first media server is down.
[0128] The signaling server 610 and the media server 620 can be implemented by software or hardware. As an example, the implementation of the signaling server 610 is introduced below. Similarly, the implementation of the media server 620 can refer to the implementation of the signaling server 610.
[0129] As an example of a software functional unit, the signaling server 610 may include code running on a computing instance. Among them, the computing instance may be at least one of a physical host (computing device), a virtual machine, a container and other computing devices. Furthermore, the above-mentioned computing device may be one or more. For example, the signaling server 610 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same available zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.
[0130] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same VPC or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway must be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0131] As an example of a hardware functional unit, the signaling server 610 may include at least one computing device. Alternatively, the signaling server 610 may also be a device implemented using ASIC or PLD, etc. The PLD may be implemented using CPLD, FPGA, GAL or any combination thereof.
[0132] The multiple computing devices included in the signaling server 610 can be distributed in the same region or in different regions. The multiple computing devices included in the signaling server 610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the signaling server 610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0133] The present application also provides a computing device 100. Figure 7 As shown, the computing device 100 includes: a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other through the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 100.
[0134] The bus 102 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus 102 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 102 may include a path for transmitting information between various components of the computing device 100 (eg, the memory 106, the processor 104, and the communication interface 108).
[0135] The processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0136] The memory 106 may include a volatile memory, such as a random access memory (RAM). The memory 106 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0137] The memory 106 stores executable codes, and the processor 104 executes the executable codes to respectively implement the functions of the aforementioned signaling server 610 and the media server 620, thereby implementing the live video transmission method. That is, the memory 106 stores instructions for executing the live video transmission method.
[0138] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0139] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0140] like Figure 8 As shown, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the method for transmitting live video.
[0141] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for transmitting live video. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the method for transmitting live video.
[0142] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions, and the instructions stored in the memory 106 in different computing devices 100 may implement the functions of the signaling server 610 and the media server 620 .
[0143] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig. 9 A possible implementation is shown. Fig. 9 As shown, two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the signaling server 610. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the media server 620.
[0144] Fig. 9 The connection method between the computing device clusters shown may be based on the consideration that the live video transmission method provided in the present application requires a large amount of computing power, and therefore it is considered that the functions implemented by the signaling server 610 are handed over to the computing device 100B for execution.
[0145] It should be understood that Fig. 9 The functions of the computing device 100A shown in FIG. 1 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.
[0146] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Figure 7 and Figure 8 The connection mode of the computing device cluster is different in that the memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the live video transmission method.
[0147] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method for transmitting live video. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the method for transmitting live video.
[0148] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions for executing some functions of the live video transmission system. That is, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more servers in the signaling server 610 and the media server 620.
[0149] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method for transmitting live video.
[0150] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the method for transmitting live video, or instruct the computing device to execute the method for transmitting live video.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for transmitting live video, characterized in that: Applied to a cloud platform, the cloud platform includes a signaling server and at least one media server, the method includes: The signaling server receives a request sent by a user terminal, where the request is used to request a live video; In response to the at least one media server being in a non-streaming state, the signaling server determines, among the at least one media server, a first media server for streaming the live video; The signaling server sends a stream pulling notification corresponding to the live video to the first media server, where the stream pulling notification is used to instruct the first media server to pull the live video; The signaling server sends reception information corresponding to the live video to the user terminal, wherein the reception information carries first transmission metadata corresponding to the first media server and first media metadata corresponding to the live video pre-stored by the signaling server, and the reception information is used to instruct the user terminal to obtain the live video from the first media server according to the first transmission metadata, and decode and display the live video according to the first media metadata.
2. The method according to claim 1, characterized in that Before the signaling server sends the reception information corresponding to the live video to the user terminal, the method further includes: The signaling server determines the first media metadata corresponding to the first live broadcast identifier of the live video from the pre-stored correspondence between the live broadcast identifier and the media metadata.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: After pulling the live video, the first media server parses the second media metadata corresponding to the live video; The first media server sends the second media metadata to a signaling server; The signaling server sends a first update notification carrying the second media metadata to the user terminal, where the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
4. The method according to claim 3, characterized in that The method further comprises: The signaling server updates the pre-stored first media metadata to second media metadata.
5. The method according to any one of claims 1 to 4, characterized in that: The first media metadata includes at least the video resolution, frame rate, bit rate, audio sampling rate, and number of channels corresponding to the live video.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to the first media server satisfying a server replacement condition, the signaling server determines, from the at least one media server, a second media server for pulling the live video stream; The signaling server sends a stream pulling notification to the second media server, where the stream pulling notification is used to instruct the second media server to pull the live video; The signaling server sends a second update notification carrying the second transmission metadata to the user terminal, where the second update notification is used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
7. The method according to claim 6, characterized in that The server replacement condition includes that the first media server is overloaded or the first media server is down.
8. A live video transmission system, characterized in that: Configured on a cloud platform, the system includes a signaling server and at least one media server, wherein: The signaling server is used to receive a request sent by a user terminal, wherein the request is used to request a live video; The signaling server is used to determine, in response to the at least one media server being in a non-streaming state, a first media server for streaming the live video among the at least one media server; The signaling server is used to send a stream pulling notification corresponding to the live video to the first media server, where the stream pulling notification is used to instruct the first media server to pull the live video; The signaling server is used to send reception information corresponding to the live video to the user terminal, wherein the reception information carries first transmission metadata corresponding to the first media server and first media metadata corresponding to the live video pre-stored by the signaling server, and the reception information is used to instruct the user terminal to obtain the live video from the first media server according to the first transmission metadata, and decode and display the live video according to the first media metadata.
9. The system according to claim 8, characterized in that The signaling server is further configured to determine, from a pre-stored correspondence between live broadcast identifiers and media metadata, first media metadata corresponding to a first live broadcast identifier of the live video.
10. The system according to claim 8 or 9, characterized in that The first media server is further configured to parse second media metadata corresponding to the live video after streaming the live video; The first media server is further configured to send the second media metadata to a signaling server; The signaling server is further used to send a first update notification carrying the second media metadata to the user terminal, where the first update notification is used to instruct the user terminal to decode and display the live video according to the second media metadata.
11. The system according to claim 10, characterized in that The signaling server is further configured to update the pre-stored first media metadata to second media metadata.
12. The system according to any one of claims 8 to 11, characterized in that: The first media metadata includes at least the video resolution, frame rate, bit rate, audio sampling rate, and number of channels corresponding to the live video.
13. The system according to any one of claims 8 to 12, characterized in that The signaling server is further configured to determine, in response to the first media server satisfying a server replacement condition, a second media server for pulling the live video stream from the at least one media server; The signaling server is further used to send a stream pulling notification to the second media server, where the stream pulling notification is used to instruct the second media server to pull the live video; The signaling server is further used to send a second update notification carrying the second transmission metadata to the user terminal, where the second update notification is used to instruct the user terminal to obtain the live video from the second media server according to the second transmission metadata.
14. The system according to claim 13, characterized in that The server replacement condition includes that the first media server is overloaded or the first media server is down.
15. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.
16. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 7.
17. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 7.
