Live stream switching method, device, server, terminal and program product
The cloud server is used to switch live streams when the stream is interrupted or pulled, which solves the problem of stream interruption and mixed stream delay at the audience end when switching live streams, and achieves seamless switching and low hardware requirements for live stream switching effects.
Patent Information
- Application Number
- CN202280003882.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-10-28
AI Technical Summary
When the network is poor, the audience is prone to black screens or video freezes caused by interruptions when switching live streams. The existing technology has high requirements on terminal hardware and does not support the buffering function. The problem is even more serious.
The cloud server receives the live stream pushed by the host and the mixed-stream server in parallel, and switches the live stream when the stream is interrupted or pulled, ensuring that the audience continues to receive the Lianmai live content and avoiding interruption and mixed-stream delay.
It achieves seamless switching between ordinary live broadcast and continuous live broadcast, reduces the hardware requirements of the audience, avoids interruption and mixed flow delay, solves the problem of stuck or black screen on the audience side, and does not need to set up additional buffers to pull the stream in advance.
Smart Images

Figure CN115997384B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of live broadcast technology, and in particular to a live broadcast stream switching method, device, server, terminal and program product. Background Art
[0002] Live broadcast is a mode in which at least two hosts perform live broadcasts simultaneously in the same live broadcast room. The hosts can initiate live broadcast requests to the audience or other hosts to achieve live broadcast interaction. When switching from ordinary live broadcast to live broadcast or ending live broadcast and switching back to ordinary live broadcast, there is a switching of live broadcast streams. In the case of poor network, the audience client will fail to pull the stream and the screen will go black.
[0003] The current solution to the black screen after interruption is to add a buffer to the live streaming end to pull the stream in advance. However, this solution has high requirements on the terminal hardware. Since the audience's device hardware and network are diverse, once the stream is interrupted and re-pulled, most of them will have different degrees of black screen or video freeze, and the black screen phenomenon is more serious on the streaming end that does not support the buffer function. Summary of the invention
[0004] The embodiments of the present application provide a live stream switching method, device, server, terminal and program product. The technical solution is as follows:
[0005] On the one hand, the present application provides a live stream switching method, which is performed by a cloud server and includes:
[0006] receiving a first live stream sent by a first terminal and a second live stream sent by a stream mixing server, wherein the second live stream is a live mixed stream of the first terminal and at least one microphone-connected terminal, and the first terminal is used to continue to send the first live stream to the cloud server after microphone connection;
[0007] Based on the interruption of the first terminal or the streaming condition of the cloud server, the downlink live stream is switched from the first live stream to the second live stream. The downlink live stream is the live stream pulled by the second terminal from the cloud server. The second terminal is used to display the live broadcast content based on the second live stream.
[0008] On the other hand, an embodiment of the present application provides a live stream switching method, which is performed by a first terminal and includes:
[0009] Sending a first live stream to a cloud server, wherein the cloud server is used to forward the first live stream to a second terminal requesting live streaming;
[0010] In response to the microphone connection instruction, a third live stream is sent to the stream mixing server, the stream mixing server is used to mix the live stream sent by the microphone connection terminal to generate a second live stream, and the cloud server is used to switch the downlink live stream from the first live stream to the second live stream based on the interruption of the first terminal or the pulling of the stream by the cloud server when receiving the first live stream and the second live stream;
[0011] In response to the microphone connection duration reaching the stream overlap duration, stopping sending the first live stream to the cloud server.
[0012] On the other hand, the present application provides a live stream switching device, the device comprising:
[0013] a stream pulling module, configured to receive a first live stream sent by a first terminal and a second live stream sent by a stream mixing server, wherein the second live stream is a live mixed stream of the first terminal and at least one microphone-connected terminal, and the first terminal is configured to continue to send the first live stream to the cloud server after microphone connection;
[0014] The streaming module is used to switch the downlink live stream from the first live stream to the second live stream based on the interruption of the first terminal or the pulling of the stream by the cloud server. The downlink live stream is the live stream pulled by the second terminal from the cloud server. The second terminal is used to display the live broadcast content based on the second live stream.
[0015] On the other hand, the present application provides a live stream switching device, the device comprising:
[0016] A streaming module, used for sending a first live streaming stream to a cloud server, and the cloud server is used for forwarding the first live streaming stream to a second terminal requesting live streaming;
[0017] The microphone connection module is used to send a third live stream to a stream mixing server in response to a microphone connection instruction, wherein the stream mixing server is used to mix the live stream sent by the microphone connection terminal to generate a second live stream, and the cloud server is used to switch the downlink live stream from the first live stream to the second live stream based on the disconnection of the first terminal or the stream pulling of the cloud server when receiving the first live stream and the second live stream;
[0018] The control module is used to stop sending the first live stream to the cloud server in response to the microphone connection duration reaching the stream overlap duration.
[0019] On the other hand, the present application provides a server, which includes a processor and a memory; the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the live stream switching method performed by the cloud server as described in the above aspects.
[0020] On the other hand, the present application provides a terminal, which includes a processor and a memory; the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the live stream switching method performed by the first terminal as described in the above aspect.
[0021] On the other hand, the present application provides a computer-readable storage medium, in which at least one computer program is stored. The computer program is loaded and executed by a processor to implement the live stream switching method as described in the above aspects.
[0022] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a server reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the server executes the live stream switching method performed by the cloud server provided in various optional implementations of the above aspects; a processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the live stream switching method performed by the first terminal provided in various optional implementations of the above aspects.
[0023] The technical solution provided by the embodiment of the present application includes at least the following beneficial effects:
[0024] In the embodiment of the present application, during the process of switching from ordinary live broadcast to live broadcast with microphones connected, the host end pushes streams to the cloud server and the mixed stream server in parallel. The cloud server receives the first live stream and the second live stream at the same time within a period of time, and switches the streams based on the interruption of the first terminal or the pulling of the stream by the cloud server. The first live stream continues to flow before the cloud server receives the second live stream, thereby achieving seamless switching between ordinary live broadcast and live broadcast with microphones connected, and solving the problem of mixed stream delay or interruption caused by direct switching of the live stream by the host end, causing freezes or black screens on the viewer end. In addition, the solution of the embodiment of the present application has low hardware requirements on the viewer end, and there is no need to set up an additional buffer to pull the stream in advance. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An implementation environment provided by an exemplary embodiment of the present application is shown;
[0026] Figure 2 A flowchart of a live stream switching method provided by an exemplary embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram showing a process of switching from ordinary live broadcast to live broadcast with microphones provided by an exemplary embodiment of the present application is shown;
[0028] Figure 4 A flowchart of a live stream switching method provided by another exemplary embodiment of the present application is shown;
[0029] Figure 5 A schematic diagram showing a live broadcast interface switching process provided by an exemplary embodiment of the present application is shown;
[0030] Figure 6 A schematic diagram of live stream switching provided by an exemplary embodiment of the present application is shown;
[0031] Figure 7 A flowchart of a live stream switching method provided by another exemplary embodiment of the present application is shown;
[0032] Figure 8 A schematic diagram showing a process of switching from live broadcast with microphones to ordinary live broadcast provided by an exemplary embodiment of the present application is shown;
[0033] Fig. 9 A flowchart of a live stream switching method provided by another exemplary embodiment of the present application is shown;
[0034] Fig.10 A flowchart of a live stream switching method provided by another exemplary embodiment of the present application is shown;
[0035] Fig.11 A structural block diagram of a live stream switching device provided by an exemplary embodiment of the present application is shown;
[0036] Fig.12 A structural block diagram of a live stream switching device provided by another exemplary embodiment of the present application is shown;
[0037] Fig.13 A structural block diagram of a server provided by an exemplary embodiment of the present application is shown;
[0038] Fig.14 A structural block diagram of a terminal provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] 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.
[0040] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0041] Please refer to Figure 1 , which shows an implementation environment provided by an embodiment of the present application. The implementation environment includes: a first terminal, a mixed stream server, a cloud server, and a second terminal. Among them, an application with a live broadcast function runs in the first terminal and the second terminal. Optionally, the application installed on the first terminal and the second terminal is the same, or the application installed on the two terminals is the same type of application on different control system platforms.
[0042] The first terminal is the live streaming end, which generates and sends live streaming to the cloud server based on the collected live data (such as audio data and video data). The second terminal is the live streaming end, which sends a live streaming request to the cloud server based on the received live viewing operation. The cloud server is responsible for receiving the live stream sent by the streaming end of each live broadcast room, and live streaming to each streaming end corresponding to the live broadcast room. The mixing server is responsible for mixing the live streams corresponding to the live broadcast rooms that are connected to each other, and sending the mixed streams to the cloud server, which is responsible for forwarding the mixed streams to the second terminal of each live broadcast room involved in the connection.
[0043] Please refer to Figure 2 , which shows a flowchart of a live stream switching method provided by an exemplary embodiment of the present application. This embodiment is described by taking the method executed by a cloud server as an example. The method includes the following steps:
[0044] Step 201: receiving a first live stream sent by a first terminal and a second live stream sent by a stream mixing server.
[0045] In the embodiment of the present application, the first terminal is a live streaming end, which generates and sends live streaming to the cloud server based on the collected live data (such as audio data and video data). The second terminal is a live streaming end, which sends a live streaming request to the cloud server based on the received live viewing operation. The cloud server is responsible for receiving the live streaming sent by the streaming end of each live broadcast room, and streaming live to each streaming end corresponding to the live broadcast room.
[0046] Schematically, the cloud server implements live streaming and push streaming through the Content Delivery Network (CDN).
[0047] The first live stream in the embodiment of the present application refers to the live stream in the normal live broadcast mode, that is, the live stream corresponding to a live broadcast room.
[0048] The second live stream refers to the live mixed stream in the live broadcast mode with microphones connected, that is, the live mixed stream of the first terminal and at least one terminal connected with microphones. In the live broadcast mode with microphones connected, the terminals corresponding to the live broadcast rooms connected with microphones send their own live streams to the mixed stream server. The mixed stream server is responsible for mixing the live streams corresponding to the live broadcast rooms connected with microphones, and sending the live mixed streams to the cloud server, which is responsible for forwarding the live mixed streams to the audience terminals of each live broadcast room involved in the microphone connection.
[0049] In the related art, after the host enters the microphone connection, the first live stream sent to the cloud server is directly switched to the third live stream sent to the mixing server. Due to the asynchronous live streams of the live broadcast rooms connected to the microphone, the mixing delay occurs, or the network jitter of the mixing server occurs, the cloud server will be unable to pull the live stream for a period of time, which will cause a black screen or freeze on the viewer side.
[0050] Therefore, in a possible implementation, after the first terminal enters the microphone connection mode, while sending the first live stream to the mixing server, it still continues to send the first live stream to the cloud server, and does not immediately cut off the first live stream sent to the cloud server. The mixing server mixes the third live stream sent by the first terminal and the live stream of the corresponding microphone connection terminal, generates a second live stream and sends it to the cloud server. The cloud server can receive the first live stream and the second live stream at the same time within a period of time. Therefore, even if the live mixed stream does not reach the cloud server, the cloud server can continue to push the stream based on the first live stream to prevent the audience from having a black screen or freeze.
[0051] Step 202: based on the interruption of the first terminal or the pulling of the stream by the cloud server, the downlink live stream is switched from the first live stream to the second live stream.
[0052] The downlink live stream is the live stream pulled by the second terminal from the cloud server, and the second terminal is used to display the live broadcast content based on the second live stream. The uplink live stream refers to the live stream sent from the push end (anchor end, such as the first terminal) to the cloud server, and the downlink live stream refers to the live stream sent from the cloud server to the pull end (viewer end, such as the second terminal).
[0053] In one possible implementation, after the first terminal synchronously sends the first live stream and the third live stream for a period of time (for example, 5 seconds), it stops sending the first live stream to the cloud server and only sends the third live stream to the mixed stream server to reduce the data processing volume of the first terminal and the cloud server. The cloud server can receive the first live stream and the second live stream at the same time for a period of time when the microphone connection is turned on, thereby switching the live streams based on the downlink uninterrupted flow logic. The first live stream and the third live stream are sent synchronously by the first terminal, so that the mixed stream server and the cloud server can buffer the stream switching to avoid the interruption of the stream in the process of switching from ordinary live broadcast to microphone connection.
[0054] Optionally, the first live stream sent by the first terminal to the cloud server is the same as the third live stream sent by the first terminal to the mixed stream server. Alternatively, the first live stream sent by the first terminal to the cloud server is different from the third live stream sent by the first terminal to the mixed stream server, for example, in different resolutions, different encoding formats, etc. This embodiment of the application is not limited to this.
[0055] To summarize, in the embodiment of the present application, in the process of switching from ordinary live broadcast to live broadcast with microphones connected, the host end pushes streams to the cloud server and the mixed stream server in parallel. The cloud server receives the first live stream and the second live stream at the same time within a period of time, and switches the stream based on the interruption of the first terminal or the pulling of the stream by the cloud server. The first live stream continues to flow before the cloud server receives the second live stream, thereby achieving seamless switching between ordinary live broadcast and live broadcast with microphones connected, and solving the problem of the host end directly switching the live stream, causing mixed stream delays or interruptions, causing freezes or black screens on the viewer end. In addition, the solution of the embodiment of the present application has low hardware requirements on the viewer end, and there is no need to set up an additional buffer to pull the stream in advance.
[0056] In a possible implementation, the cloud server may perform two stream switching schemes, that is, the above step 202 specifically includes the following steps:
[0057] Step one, when receiving the first live stream and the second live stream, continue to send the first live stream to the second terminal; step two, when the first terminal cuts off the first live stream, switch the downlink live stream from the first live stream to the second live stream, and the first terminal stops sending the first live stream after the microphone connection time reaches the stream overlap time.
[0058] or,
[0059] Step three, when the second live stream is successfully received, the downlink live stream is switched from the first live stream to the second live stream.
[0060] That is, there are two implementation methods for the live stream switching method provided in the embodiment of the present application. The timing of cutting the stream in the first scheme depends on the interruption of the stream on the host side: the host side sends the live stream to the cloud server and the mixed stream server in parallel within the stream overlapping time after the start of the microphone connection; when the cloud side receives the first live stream and the second live stream at the same time, it does not cut the stream immediately and continues to download the first live stream; when the host side cuts off the first live stream, the cloud side downloads the second live stream. The timing of cutting the stream in the second scheme depends on the stream pulling situation of the cloud server: the host side sends the live stream to the cloud server and the mixed stream server in parallel within the stream overlapping time after the start of the microphone connection; when the cloud side receives the first live stream and the second live stream at the same time, it immediately switches the downstream live stream to the second live stream.
[0061] Since both solutions have a stream overlap duration, that is, the host end does not cut off the live stream sent to the cloud server within the stream overlap duration, ensuring that the cloud server can seamlessly switch the downstream live stream, both solutions can prevent the occurrence of interrupted stream and black screen.
[0062] For the first downlink uninterrupted flow solution mentioned above, Figure 3 The figure shows the process of the first terminal, cloud server, mixed stream server, corresponding connected microphone terminal and second terminal cooperating to complete the switching from ordinary live broadcast to connected microphone live broadcast. In the ordinary live broadcast stage, the first terminal (anchor end) pushes the first live stream A1 to the cloud server, and the cloud server forwards the first live stream A1 to the second terminal (audience end) corresponding to the live broadcast room. The switching process from ordinary live broadcast to connected microphone live broadcast includes two stages. One stage is the stage corresponding to the stream overlap duration. In the first stage, the first terminal sends the first live stream A1 to the cloud server while sending the third live stream A2 to the mixed stream server. The mixed stream server mixes the third live stream A2 sent by the first terminal and the connected microphone stream B sent by the connected microphone terminal to obtain the second live stream A2+B and push it to the cloud server. At this time, the cloud server receives the first live stream A1 and the second live stream A2+B, and continues to push the first live stream A1 to the second terminal. The second stage is the connected microphone stage after the stream overlap duration ends. At the beginning of the second stage, the first terminal stops sending the first live stream A1 to the cloud server. At this time, the cloud server receives the second live stream A2+B and seamlessly switches the downlink live stream from the first live stream A1 to the second live stream A2+B, completing the live stream switching process from ordinary live broadcast to live broadcast with microphones connected.
[0063] For the first downlink uninterrupted flow solution mentioned above, please refer to Figure 4 , which shows a flowchart of a live stream switching method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by a cloud server as an example. The method comprises the following steps:
[0064] Step 401: receiving a first live stream sent by a first terminal and a second live stream sent by a stream mixing server.
[0065] The specific implementation of step 401 can refer to the above step 201, and the embodiment of the present application will not be repeated here.
[0066] Step 402: upon receiving the first live stream and the second live stream, obtain a first identifier of the first live stream and a second identifier of the second live stream.
[0067] In a possible implementation, the live stream corresponds to a live stream identifier. The identifier is used to indicate the live broadcast room to which the live stream belongs. For example, the live stream push end (first terminal) generates a live stream identifier based on the current live broadcast account. After encoding the live stream, the live stream push end encapsulates the live stream identifier together with the live encoding data and sends them to the cloud server or the mixing stream server.
[0068] Step 403: In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, continue to send the first live stream to the second terminal.
[0069] Among them, the live stream identifier of the live stream corresponding to the same live broadcast room contains the same field.
[0070] In a possible implementation, in order to enable the cloud server to identify the common stream and mixed stream belonging to the same live broadcast room from a large number of live broadcast streams, the identifier of the co-hosted stream and the identifier of the common stream of the corresponding live broadcast room contain the same field.
[0071] Illustratively, the first identifier of the first live stream corresponding to live broadcast room A is STREAM_A_NORMAL, and the second identifier corresponding to the second live stream when live broadcast room A and live broadcast room B are connected is STREAM_A_ STREAM_B_PK. Since the first identifier and the second identifier contain the same field STREAM_A for indicating the live broadcast room, the cloud server determines that the first live stream and the second live stream belong to the normal stream and the mixed stream corresponding to live broadcast room A respectively.
[0072] The live stream in the normal live broadcast mode and the live stream in the live broadcast mode with microphones may use different audio encoding formats. In one possible implementation, in order to push the normal stream within the stream overlap time but the live broadcast effect displayed by the audience is the microphone effect, the cloud server re-encodes the audio of the first live stream. Step 403 includes the following steps 403a to 403c:
[0073] Step 403a, in response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, the audio encoding format of the first live stream and the audio encoding format of the second live stream are obtained.
[0074] After determining that the first live stream and the second live stream belong to the common stream and the mixed stream of the same live room respectively, the cloud server obtains the audio encoding formats of the two, wherein the audio encoding format may be Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Windows Media Audio (WMA), etc.
[0075] Step 403b: In response to the audio encoding format of the first live stream being consistent with the audio encoding format of the second live stream, continue to forward the first live stream to the second terminal.
[0076] If the audio encoding format of the first live stream is consistent with that of the second live stream, there is no need to adjust the audio encoding format of the first live stream. The cloud server continues to directly forward the first live stream.
[0077] Step 403c, in response to the inconsistency between the audio encoding formats of the first live stream and the second live stream, re-encode the audio of the first live stream according to the audio encoding format of the second live stream, and send the first live stream with the re-encoded audio to the second terminal.
[0078] If the audio encoding formats of the first live stream and the second live stream are inconsistent, the cloud server will re-encode the audio of the first live stream according to the audio encoding format of the second live stream, so that the audio encoding format of the first live stream in the downstream is consistent with the audio encoding format of the second live stream. In this way, the second terminal can display the effect of starting the live broadcast while continuing to push the first live stream.
[0079] Step 404: In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams in the same live broadcast room, second video header information of the second live stream is obtained.
[0080] The video header information includes the video resolution.
[0081] The above steps convert the encoding format through the cloud server, converting the encoding format of the ordinary stream into the encoding format of the microphone stream, so that the audio effect of the downlink live stream is consistent with the audio effect of the microphone live broadcast. When the live broadcast is a video live broadcast, the difference between the ordinary live broadcast picture and the microphone live broadcast picture also needs to be considered.
[0082] For example, the normal live broadcast screen is a horizontal screen with a resolution of 1280*720, and the live broadcast screen with microphone connection is a vertical screen with a resolution of 1080*2400. Or the normal live broadcast screen is a vertical screen, and the live broadcast screen with microphone connection is a horizontal screen.
[0083] Video header information is data used to describe video picture information, and is usually added to the header of each segment (or each frame) of the video stream, such as the sequence parameter set (SPS) and the picture parameter set (PPS). In a possible implementation, the cloud server sends the video header information of the second live stream to the second terminal, so that the second terminal renders and displays the content of the first live stream according to the resolution of the connected microphone screen.
[0084] Step 405: Send the second video header information to the second terminal, and the second terminal is used to adjust the video picture of the first live stream based on the second video header information.
[0085] Optionally, the second terminal may adjust the resolution of the first live stream by stretching, cropping, splicing, expanding the margins, etc.
[0086] like Figure 5 As shown, after the first terminal turns on the microphone connection, it sends a microphone connection notification to the second terminal through the cloud server. After receiving the microphone connection notification, the second terminal switches the style of the live broadcast interface from the ordinary live broadcast style to the microphone connection live broadcast style. In the ordinary live broadcast mode, the second terminal directly displays the video screen 501 of the first video stream. In the microphone connection live broadcast style, the second terminal displays the spliced screen of the two microphone connection live broadcast rooms, which includes the first display area 502 and the second display area 503. During the stream overlap duration, the second terminal still receives the first video stream. At this time, the second terminal adjusts the video screen according to the video header information of the second video stream to achieve the effect of entering the microphone connection. Since the mixed stream is not pulled at this time, the default background and the words "The other party is coming~" are displayed in the display area of the microphone connection live broadcast room (i.e., the second display area 503). When the stream overlap duration is reached, after the second terminal pulls the mixed stream, the final microphone connection screen is displayed.
[0087] In another possible implementation, corresponding to the audio encoding, the cloud server may also directly adjust the resolution of the first video stream and re-encode it to obtain the first live stream with updated resolution and send it down.
[0088] Step 406: When the first terminal disconnects the first live stream, the downlink live stream is switched from the first live stream to the second live stream.
[0089] The specific implementation of step 406 can refer to the above step 2, and the embodiment of the present application will not be repeated here.
[0090] In the embodiment of the present application, during the time of the stream overlap, the cloud server re-encodes the first video stream based on the audio encoding format of the second video stream, and on the other hand sends the video header information of the second video stream to the second terminal, so that the second terminal can display the live screen according to the audio encoding format and picture resolution of the microphone connection when only the first video stream is pulled. The effect of delayed streaming but synchronous display of the microphone live content is achieved.
[0091] In a possible implementation, when the second solution is used to switch the live stream, the cloud server can also identify the live stream based on its identifier. If it is identified that the first identifier of the first live stream and the second identifier of the second live stream indicate the same live room, the downlink live stream is directly switched from the first live stream to the second live stream without sending the video header information in advance or re-encoding the first live stream.
[0092] The above embodiment shows the process of switching from ordinary live broadcast to joint microphone. In a possible implementation, the solution of stream overlap is also adopted to end the joint microphone. Figure 6 As shown, in the process of switching from one stream to another, the stream overlap duration is set, and the two streams are sent in parallel within the stream overlap duration. After the stream overlap duration is reached, the new stream is switched and sent. Correspondingly, the stream overlap solution is also adopted in the reverse switching.
[0093] Please refer to Figure 7 , which shows a flowchart of a live stream switching method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by a cloud server as an example. The method comprises the following steps:
[0094] Step 701: receiving a first live stream sent by a first terminal and a second live stream sent by a stream mixing server.
[0095] Step 702: based on the interruption of the first terminal or the pulling of the stream by the cloud server, the downlink live stream is switched from the first live stream to the second live stream.
[0096] The specific implementation of steps 701 to 702 can refer to the above steps 201 to 202, and the embodiments of the present application will not be repeated here.
[0097] Correspondingly, the process of switching from live broadcast to ordinary live broadcast also includes two implementation methods of downlink uninterrupted streaming, one as shown in steps 703 to 704 below, and the other as shown in step 705 below.
[0098] Step 703: When the first live stream sent by the first terminal is received again, continue to send the second live stream to the second terminal.
[0099] In a possible implementation, when the microphone connection ends, the first terminal re-sends the first live stream to the cloud server within the stream overlap duration before the microphone connection ends. During the stream overlap duration (the microphone connection enters the countdown), the cloud server receives the first live stream and the second live stream, but continues to send the second live stream to the second terminal.
[0100] Step 704: In response to the second live stream being disconnected, the downlink live stream is switched to the first live stream.
[0101] When the stream overlap duration is reached (i.e. the microphone connection is officially ended), the first terminal stops sending the third live stream to the stream mixing server and continues to send the first live stream to the cloud server. If the second live stream is disconnected, the cloud server switches to sending the first live stream.
[0102] Step 705: When the first live stream sent by the first terminal is received again, the downlink live stream is switched to the first live stream.
[0103] In a second possible implementation, the cloud server immediately switches the stream after receiving the first live stream, switching the downlink live stream from the second live stream to the first live stream, and the audience end returns to the normal live mode.
[0104] In an embodiment of the present application, in the process of switching from live broadcast with microphones to ordinary live broadcast, the stream overlap duration is set. The host end pushes the streams to the cloud server and the mixed stream server in parallel within the stream overlap duration. The cloud server receives the first live stream and the second live stream within the stream overlap duration, and continues to push the second live stream to the audience end. After the stream overlap duration is reached, the host end cuts off the third live stream. Thereby achieving a seamless switch from live broadcast with microphones to ordinary live broadcast, solving the problem of the host end directly switching the live stream, causing mixed stream delays or interruptions, causing freezes or black screens on the audience end. In addition, the solution of the embodiment of the present application has low hardware requirements on the audience end, and there is no need to set up an additional buffer to pull the stream in advance.
[0105] Regarding the first solution of switching from live broadcast to ordinary live broadcast, Figure 8 The process of switching from live broadcast with live broadcast to ordinary live broadcast by cooperating with the first terminal, cloud server, mixed stream server, corresponding connected microphone terminal and second terminal is shown, which also includes two stages. The first stage corresponds to the stream overlap duration. In the first stage, when the first terminal ends the live broadcast with live broadcast after determining the stream overlap duration, it starts to send the first live stream A1 to the cloud server. At this time, the cloud server receives the first live stream A1 and the second live stream A2+B, and continues to push the second live stream A2+B to the second terminal. After the stream overlap duration ends, the live broadcast with live broadcast officially ends and enters ordinary live broadcast. At the beginning of the second stage, the first terminal stops sending the third live stream A2 to the mixed stream server, and the cloud server switches the downlink live stream from the second live stream A2+B to the first live stream A1.
[0106] The above embodiment shows the steps performed by the cloud server during the live streaming switching process. Correspondingly, the first terminal will also trigger the downlink uninterrupted flow logic during the streaming switching process to control the push of the two live streaming streams. Fig. 9 , which shows a flowchart of a live stream switching method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the first terminal as an example. The method includes the following steps:
[0107] Step 901: Send a first live stream to a cloud server, and the cloud server is used to forward the first live stream to a second terminal that requests live streaming.
[0108] The first terminal is the live streaming end, which generates and sends live streaming to the cloud server based on the collected live streaming data (such as audio data and video data). In the normal live streaming mode, the first terminal directly sends the first live streaming to the cloud server. The cloud server is responsible for receiving the live streaming sent by the streaming end of each live streaming room, and pushing live streaming to each streaming end corresponding to the live streaming room. The second terminal is the live streaming end, which sends a live streaming request to the cloud server based on the received live viewing operation.
[0109] Step 902: In response to the microphone connection instruction, send a third live stream to the stream mixing server.
[0110] The mixing stream server is used to mix the live stream sent by the microphone-connected terminal to generate a second live stream, and the cloud server is used to switch the downlink live stream from the first live stream to the second live stream based on the downlink uninterrupted flow logic when receiving the first live stream and the second live stream. The downlink uninterrupted flow logic is determined by the interruption of the first terminal or the pulling of the stream by the cloud server.
[0111] In the live broadcast mode, the terminals corresponding to the live broadcast rooms connected to each other send their own live streams to the mixing server. The mixing server is responsible for mixing the live streams corresponding to the live broadcast rooms connected to each other, and sending the live mixed stream to the cloud server, which is responsible for forwarding the live mixed stream to the audience terminals of each live broadcast room involved in the live broadcast mode.
[0112] Optionally, when a microphone connection operation or a microphone connection answer operation is received, the first terminal determines that a microphone connection instruction is received.
[0113] In the related art, after the host enters the microphone connection, the first live stream sent to the cloud server is directly switched to the third live stream sent to the mixing server. Due to the asynchronous live streams of the live broadcast rooms connected to the microphone, the mixing delay is caused, and the mixing server takes a certain amount of time to mix the streams. It may cause the cloud server to fail to pull the live stream for a period of time, which in turn causes the downlink live stream terminal, causing the audience end to freeze or black screen.
[0114] Therefore, in a possible implementation, after the first terminal enters the microphone connection mode, while sending the first live stream to the mixing server, it continues to send the first live stream to the cloud server, and does not immediately cut off the first live stream sent to the cloud server. The mixing server mixes the third live stream sent by the first terminal and the live stream of the corresponding microphone connection terminal, generates a second live stream and sends it to the cloud server. When the cloud server receives the first live stream and the second live stream at the same time, it switches the live stream sent to the second terminal based on the downlink uninterrupted flow logic.
[0115] Step 903: In response to the microphone connection duration reaching the stream overlap duration, stop sending the first live stream to the cloud server.
[0116] After the first terminal sends the first live stream and the third live stream synchronously until the stream overlap time (for example, 5 seconds) is reached, it stops sending the first live stream to the cloud server and only sends the third live stream to the mixed stream server. The cloud server switches the stream based on the logic of downlink continuous flow. By setting the stream overlap time, the mixed stream server and the cloud server can buffer the stream switching, avoiding the interruption of the stream when entering the microphone connection from the ordinary live broadcast.
[0117] Please refer to Fig.10 , which shows a flowchart of a live stream switching method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the first terminal as an example. The method includes the following steps:
[0118] Step 1001: Send a first live stream to a cloud server, and the cloud server is used to forward the first live stream to a second terminal that requests live streaming.
[0119] Step 1002: In response to the microphone connection instruction, send a third live stream to the stream mixing server.
[0120] Step 1003: In response to the microphone connection duration reaching the stream overlap duration, stop sending the first live stream to the cloud server.
[0121] The specific implementation of steps 1001 to 1003 can refer to the above steps 901 to 903, and the embodiments of the present application will not be repeated here.
[0122] Step 1004: within the stream overlap duration before the microphone connection ends, the first live stream is sent to the cloud server, and the cloud server is used to continue to send the second live stream to the second terminal when the first live stream is received again.
[0123] In a possible implementation, the first terminal determines the end time of the live broadcast in advance, and sends the first live broadcast stream to the cloud server within the stream overlap duration before the end of the live broadcast, so that the cloud server receives the live broadcast data in advance and prepares for the stream switching to prevent the stream from being interrupted.
[0124] Specifically, the first terminal may determine the microphone connection in advance in the following two ways:
[0125] In response to receiving the microphone connection termination operation, a timer is set based on the stream overlap duration, and a first live stream is sent to the cloud server.
[0126] or,
[0127] In response to reaching the target co-microphone duration after the stream overlap duration, sending the first live stream to the cloud server.
[0128] When the host or the other host manually terminates the live broadcast, the first terminal immediately sets a timer based on the stream overlap duration, and the live broadcast ends when the timer reaches the stream overlap duration. Alternatively, the live broadcast has a fixed duration limit (i.e., the target live broadcast duration). If the first terminal determines that the target live broadcast duration is reached after the stream overlap duration (e.g., after 5 seconds), the first live broadcast stream is sent to the cloud server.
[0129] Step 1005: in response to the end of the microphone connection, stop sending the third live stream to the stream mixing server.
[0130] The cloud server is used to switch the downlink live stream from the second live stream to the first live stream when the second live stream is disconnected. Since the first terminal sends the first live stream to the cloud server in advance, the cloud server can achieve seamless switching from microphone connection to ordinary live broadcast, avoiding freezes or black screens.
[0131] In the embodiment of the present application, in the process of switching from live broadcast with microphones to ordinary live broadcast, the stream overlap duration is set. The host end pushes the stream to the cloud server and the mixed stream server in parallel within the stream overlap duration. The cloud server receives the first live stream and the second live stream within the stream overlap duration, and continues to push the second live stream to the audience end. After the stream overlap duration is reached, the host end cuts off the third live stream, and the cloud server starts to push the first live stream to the audience end. Thereby, a seamless switch from live broadcast with microphones to ordinary live broadcast is achieved, and the problem of direct switching of the live stream by the host end causing mixed stream delays or interruptions, causing freezes or black screens on the audience end is solved. In addition, the solution of the embodiment of the present application has low hardware requirements on the audience end, and there is no need to set up an additional buffer to pull the stream in advance.
[0132] Fig.11 : is a structural block diagram of a live stream switching device provided by an exemplary embodiment of the present application, and the device includes the following structure:
[0133] The stream pulling module 1101 is used to receive a first live stream sent by a first terminal and a second live stream sent by a stream mixing server, where the second live stream is a live mixed stream of the first terminal and at least one microphone-connected terminal, and the first terminal is used to continue to send the first live stream to the cloud server after microphone connection;
[0134] The streaming module 1102 is used to switch the downlink live stream from the first live stream to the second live stream based on the interruption of the first terminal or the pulling of the stream by the cloud server. The downlink live stream is the live stream pulled by the second terminal from the cloud server. The second terminal is used to display the live broadcast content based on the second live stream.
[0135] Optionally, the streaming module 1102 is further used for:
[0136] When the first live stream and the second live stream are received, continue to send the first live stream to the second terminal; when the first terminal cuts off the first live stream, switch the downlink live stream from the first live stream to the second live stream, and the first terminal stops sending the first live stream after the microphone connection time reaches the stream overlap time;
[0137] or,
[0138] When the second live stream is successfully received, the downlink live stream is switched from the first live stream to the second live stream.
[0139] Optionally, the streaming module 1102 is further used for:
[0140] When the first live stream and the second live stream are received, obtaining a first identifier of the first live stream and a second identifier of the second live stream;
[0141] In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live room, continue to send the first live stream to the second terminal, wherein the live stream identifiers of the live streams corresponding to the same live room contain the same field.
[0142] Optionally, the streaming module 1102 is further used for:
[0143] In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, acquiring an audio encoding format of the first live stream and an audio encoding format of the second live stream;
[0144] In response to the audio encoding format of the first live stream being consistent with the audio encoding format of the second live stream, continue to forward the first live stream to the second terminal;
[0145] In response to the inconsistency between the audio encoding formats of the first live stream and the second live stream, the audio of the first live stream is re-encoded according to the audio encoding format of the second live stream, and the first live stream after audio re-encoding is sent to the second terminal.
[0146] Optionally, the device further comprises:
[0147] an information acquisition module, configured to acquire second video header information of the second live stream in response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, wherein the video header information includes video resolution;
[0148] The information sending module is used to send the second video header information to the second terminal, and the second terminal is used to adjust the video picture of the first live stream based on the second video header information.
[0149] Optionally, the streaming module 1102 is further used for:
[0150] When the first live stream sent by the first terminal is received again, continue to send the second live stream to the second terminal; in response to the second live stream being disconnected, switch the downlink live stream to the first live stream;
[0151] or,
[0152] When the first live stream sent by the first terminal is received again, the downlink live stream is switched to the first live stream.
[0153] Fig.12 : is a structural block diagram of a live stream switching device provided by another exemplary embodiment of the present application, the device includes the following structure:
[0154] The streaming module 1201 is used to send a first live streaming stream to a cloud server, and the cloud server is used to forward the first live streaming stream to a second terminal requesting live streaming;
[0155] The microphone connection module 1202 is used to send a third live stream to a stream mixing server in response to a microphone connection instruction, wherein the stream mixing server is used to mix the live stream sent by the microphone connection terminal to generate a second live stream, and the cloud server is used to switch the downlink live stream from the first live stream to the second live stream based on the disconnection of the first terminal or the stream pulling condition of the cloud server when receiving the first live stream and the second live stream;
[0156] The control module 1203 is used to stop sending the first live stream to the cloud server in response to reaching the stream overlap duration.
[0157] Optionally, the streaming module 1201 is further used for:
[0158] Within the stream overlap duration before the microphone connection ends, sending the first live stream to the cloud server, and the cloud server is used to continue sending the second live stream to the first terminal when the first live stream is received again;
[0159] The control module 1203 is further used for:
[0160] In response to the end of the microphone connection, the third live stream is stopped from being sent to the mixing server, and the cloud server is used to switch the downlink live stream to the first live stream when the second live stream is disconnected.
[0161] Optionally, the streaming module 1201 is further used for:
[0162] In response to receiving a microphone connection termination operation, setting a timer based on the stream overlap duration, and sending the first live stream to the cloud server;
[0163] or,
[0164] In response to reaching a target co-microphone duration after the stream overlap duration, sending the first live stream to the cloud server.
[0165] To summarize, in the embodiment of the present application, in the process of switching from ordinary live broadcast to live broadcast with microphones connected, the host end pushes streams to the cloud server and the mixed stream server in parallel. The cloud server receives the first live stream and the second live stream at the same time within a period of time, and switches the stream based on the interruption of the first terminal or the pulling of the stream by the cloud server. The first live stream continues to flow before the cloud server receives the second live stream, thereby achieving seamless switching between ordinary live broadcast and live broadcast with microphones connected, and solving the problem of the host end directly switching the live stream, causing mixed stream delays or interruptions, causing freezes or black screens on the viewer end. In addition, the solution of the embodiment of the present application has low hardware requirements on the viewer end, and there is no need to set up an additional buffer to pull the stream in advance.
[0166] Please refer to Fig.14 , which shows a schematic diagram of the structure of a server provided in one embodiment of the present application.
[0167] The server 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including a random access memory (RAM) 1402 and a read only memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the central processing unit 1401. The server 1400 also includes a basic input / output (I / O) controller 1406 for facilitating information transmission between various components in the computer, and a large-capacity storage device 1407 for storing an operating system 1413, application programs 1414, and other program modules 1415.
[0168] The basic input / output system 1406 includes a display 1408 for displaying information and an input device 1409 such as a mouse and a keyboard for user inputting information. The display 1408 and the input device 1409 are connected to the central processing unit 1401 through an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include an input / output controller 1410 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, a printer, or other types of output devices.
[0169] The mass storage device 1407 is connected to the central processing unit 1401 via a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable medium provide non-volatile storage for the server 1400. That is, the mass storage device 1407 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0170] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), flash memory or other solid-state storage technology, CD-ROM, Digital Video Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1404 and mass storage device 1407 can be collectively referred to as memory.
[0171] According to various embodiments of the present application, the server 1400 may also be connected to a remote computer on a network through a network such as the Internet. That is, the server 1400 may be connected to a network 1412 through a network interface unit 1411 connected to the system bus 1305, or the network interface unit 1311 may be used to connect to other types of networks or remote computer systems (not shown).
[0172] Please refer to Fig.13 , which shows a block diagram of a terminal 1300 provided by an exemplary embodiment of the present application. The terminal 1300 may be a portable mobile terminal, such as a smart phone, a tablet computer, a Moving Picture Experts Group Audio Layer III (MP3) player, or a Moving Picture Experts Group Audio Layer IV (MP4) player. The terminal 1300 may also be referred to as a user device, a portable terminal, or other names.
[0173] Typically, the terminal 1300 includes a processor 1301 and a memory 1302 .
[0174] Processor 1304 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. Processor 1301 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). Processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, processor 1301 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, processor 1301 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0175] The memory 1302 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is used to be executed by the processor 1301 to implement the method provided in the embodiment of the present application.
[0176] In some embodiments, the terminal 1300 may optionally further include: a peripheral device interface 1303 .
[0177] The peripheral device interface 1303 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1301 and the memory 1302. In some embodiments, the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1301, the memory 1302, and the peripheral device interface 1303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0178] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the live stream switching method described in the above embodiments.
[0179] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the live stream switching method provided in various optional implementations of the above aspects.
[0180] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0181] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the live stream, video header information, user account, etc. involved in this application are all obtained with full authorization.
[0182] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0183] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the live stream switching method described in the above embodiments.
[0184] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the live stream switching method provided in various optional implementations of the above aspects.
[0185] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0186] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the live stream, video header information, user account, etc. involved in this application are all obtained with full authorization.
[0187] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A live stream switching method, characterized in that: The method is performed by a cloud server, and includes: receiving a first live stream sent by a first terminal and a second live stream sent by a stream mixing server, wherein the first live stream is generated by the first terminal based on collected live data, and the second live stream is a live mixed stream of the first terminal and at least one microphone-connected terminal, and the first terminal is used to continue to send the first live stream to the cloud server after microphone connection; When the first live stream and the second live stream are received, obtaining a first identifier of the first live stream and a second identifier of the second live stream; In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams in the same live broadcast room, continue to send the first live stream to the second terminal, obtain second video header information of the second live stream, and send the second video header information to the second terminal, wherein the video header information includes a video resolution, and the second terminal is used to adjust the video picture of the first live stream based on the second video header information; In the case where the first terminal cuts off the first live stream, the downlink live stream is switched from the first live stream to the second live stream. The first terminal is used to stop sending the first live stream after the microphone connection duration reaches the stream overlap duration. The downlink live stream is the live stream pulled by the second terminal from the cloud server. The second terminal is used to display the microphone connection live content based on the second live stream.
2. The method according to claim 1, characterized in that In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, continuing to send the first live stream to the second terminal includes: In response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live broadcast room, acquiring an audio encoding format of the first live stream and an audio encoding format of the second live stream; In response to the audio encoding format of the first live stream being consistent with the audio encoding format of the second live stream, continue to forward the first live stream to the second terminal; In response to the inconsistency between the audio encoding formats of the first live stream and the second live stream, the audio of the first live stream is re-encoded according to the audio encoding format of the second live stream, and the first live stream after audio re-encoding is sent to the second terminal.
3. The method according to claim 1 or 2, characterized in that: After switching the downlink live stream from the first live stream to the second live stream, the method further includes: When the first live stream sent by the first terminal is received again, continue to send the second live stream to the second terminal; in response to the second live stream being disconnected, switch the downlink live stream to the first live stream; or, When the first live stream sent by the first terminal is received again, the downlink live stream is switched to the first live stream.
4. A live stream switching method, characterized in that: The method is applied to a first terminal, and the method includes: Sending a first live stream to a cloud server, wherein the cloud server is used to forward the first live stream to a second terminal requesting live streaming; In response to the microphone connection instruction, a third live stream is sent to the stream mixing server, the stream mixing server is used to mix the live stream sent by the microphone connection terminal to generate a second live stream, the cloud server is used to obtain a first identifier of the first live stream and a second identifier of the second live stream when receiving the first live stream and the second live stream, in response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live room, the server is used to continue to send the first live stream to the second terminal, obtain second video header information of the second live stream, and send the second video header information to the second terminal, wherein the video header information includes video resolution, the second terminal is used to adjust the video picture of the first live stream based on the second video header information, and switch the downlink live stream from the first live stream to the second live stream based on the interruption of the first terminal or the pulling of the stream by the cloud server; In response to the microphone connection duration reaching the stream overlap duration, stopping sending the first live stream to the cloud server; In response to receiving a microphone connection termination operation, setting a timer based on the stream overlap duration, and sending the first live stream to the cloud server; or, in response to reaching a target microphone connection duration after the stream overlap duration, sending the first live stream to the cloud server; the cloud server is configured to continue sending the second live stream to the second terminal when the first live stream is received again; In response to the end of the microphone connection, the third live stream is stopped from being sent to the mixing server, and the cloud server is used to switch the downlink live stream to the first live stream when the second live stream is disconnected.
5. A live stream switching device, characterized in that: The device comprises: A stream pulling module, configured to receive a first live stream sent by a first terminal and a second live stream sent by a stream mixing server, wherein the second live stream is a live mixed stream of the first terminal and at least one microphone-connected terminal, and the first terminal is configured to continue to send the first live stream to the cloud server after microphone connection; A streaming module is used to obtain a first identifier of the first live stream and a second identifier of the second live stream when the first live stream and the second live stream are received; in response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live room, continue to send the first live stream to the second terminal, obtain second video header information of the second live stream, and send the second video header information to the second terminal, wherein the video header information includes video resolution, and the second terminal is used to adjust the video picture of the first live stream based on the second video header information; when the first terminal cuts off the first live stream, switch the downlink live stream from the first live stream to the second live stream, the first terminal is used to stop sending the first live stream after the microphone connection time reaches the stream overlap time, the downlink live stream is a live stream pulled by the second terminal from the cloud server, and the second terminal is used to display the microphone connection live content based on the second live stream.
6. A live stream switching device, characterized in that: The device comprises: A streaming module, used for sending a first live streaming stream to a cloud server, and the cloud server is used for forwarding the first live streaming stream to a second terminal requesting live streaming; A microphone connection module, configured to send a third live stream to a stream mixing server in response to a microphone connection instruction, wherein the stream mixing server is configured to mix the live stream sent by the microphone connection terminal to generate a second live stream, wherein the cloud server is configured to obtain a first identifier of the first live stream and a second identifier of the second live stream upon receiving the first live stream and the second live stream, wherein in response to the first identifier and the second identifier indicating that the first live stream and the second live stream belong to different live streams of the same live room, the server is configured to continue to send the first live stream to the second terminal, obtain second video header information of the second live stream, and send the second video header information to the second terminal, wherein the video header information includes video resolution, and the second terminal is configured to adjust the video picture of the first live stream based on the second video header information, and switch the downlink live stream from the first live stream to the second live stream based on the interruption of the first terminal or the pulling of the stream by the cloud server; A control module, configured to stop sending the first live stream to the cloud server in response to the microphone connection duration reaching the stream overlap duration; The streaming module is further configured to, in response to receiving a microphone connection termination operation, set a timer based on the stream overlap duration and send the first live stream to the cloud server; or, in response to reaching a target microphone connection duration after the stream overlap duration, send the first live stream to the cloud server; the cloud server is configured to continue to send the second live stream to the second terminal when the first live stream is received again; The control module is further configured to stop sending the third live stream to the mixing stream server in response to the end of the microphone connection, and the cloud server is configured to switch the downlink live stream to the first live stream when the second live stream is disconnected.
7. A server, characterized in that: The server includes a processor and a memory; the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the live stream switching method as described in any one of claims 1 to 3.
8. A terminal, characterized in that: The terminal includes a processor and a memory; the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the live stream switching method as described in claim 4.
9. A computer-readable storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by the processor to implement the live stream switching method according to any one of claims 1 to 3, or the live stream switching method according to claim 4.
10. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the processor of the server reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the server executes the live stream switching method as described in any one of claims 1 to 3; the processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the live stream switching method as described in claim 4.
