Game live broadcast interaction method and device, equipment, storage medium and program product
By differentiating between gamers and non-gamers in cloud gaming live streaming and employing different encoding and transmission strategies, the problems of increased system costs and stuttering/frame drops caused by game screen encoding compression have been solved, thus improving system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-03-27
AI Technical Summary
In cloud gaming live streaming, the encoding and compression process of game footage increases system costs and can easily cause problems such as stuttering and frame drops.
Users in the game live stream are divided into gamers and non-gamers. Gamers are pushed streams with lower encoding latency and/or smaller quantization parameters, while non-gamers are pushed streams with higher encoding latency and/or larger quantization parameters.
It reduced system costs, decreased the occurrence of stuttering and frame drops, and improved system stability.
Smart Images

Figure CN116546231B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of network live broadcast processing, and in particular to a game live broadcast interaction method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] Live broadcast refers to using a camera and a recording device to obtain an event occurring live, and making the event occurring live into an audio and video signal, processing the audio and video signal, and then distributing the processed audio and video signal to a terminal through a signal transmission network, so that a user can see and hear the picture and sound corresponding to the event occurring live through the terminal in quasi real time.
[0003] Cloud gaming is a game in which a server processes the running logic and picture rendering of the game to obtain a game picture, and then transmits the game picture to a terminal, so that a user can watch the game picture and control the game through the terminal in a manner similar to watching live broadcast. When the user controls the game, the control instruction can be transmitted from the terminal to the server through the network, and the server can control the game instance program according to the control instruction, such as processing the running logic and picture rendering of the game, so as to obtain the game picture.
[0004] At present, in live broadcast based on cloud gaming, an anchor can control the cloud game, the server can generate a game picture according to the control operation of the anchor, encode and compress the game picture to obtain a game picture code stream, and then synchronously transmit the game picture code stream to the terminal of the anchor and the terminal of the audience. The terminal can decode the game picture code stream to obtain the game picture, so that the anchor and the audience can watch the game picture.
[0005] However, the encoding and compression process of the game picture not only increases the system cost, but also easily causes problems such as lag and frame loss. SUMMARY
[0006] The present application provides a game live broadcast interaction method, device, equipment, storage medium and program product to reduce system cost, reduce the occurrence of lag and frame loss, and improve system stability.
[0007] In a first aspect, the present application provides a game live interaction method, which comprises: obtaining game control instructions of at least one game player in a game live room; for any target game player in the at least one game player, generating game audio and video data corresponding to the target game player according to the game control instructions of the target game player; encoding the game audio and video data to obtain a first code stream and a second code stream, a first encoding delay corresponding to the first code stream being lower than a second encoding delay corresponding to the second code stream, and / or a first quantization parameter corresponding to the first code stream being smaller than a second quantization parameter corresponding to the second code stream; sending the at least one first code stream to a user terminal corresponding to the at least one game player, and sending the at least one second code stream to a user terminal corresponding to at least one non-game player in the game live room.
[0008] Optionally, the encoding of the game audio and video data to obtain the first code stream and the second code stream comprises: encoding the game audio and video data according to a first encoding method to obtain the first code stream; and converting the first code stream into the second code stream using a target transcoding method.
[0009] Optionally, the encoding of the game audio and video data to obtain the first code stream and the second code stream comprises: encoding the game audio and video data according to a second encoding method to obtain the first code stream; and encoding the game audio and video data according to a third encoding method to obtain the second code stream; wherein a third quantization parameter of the second encoding method is smaller than a fourth quantization parameter of the third encoding method, and / or a third encoding delay of the second encoding method is smaller than a fourth encoding delay of the third encoding method.
[0010] Optionally, the sending of the at least one first code stream to the user terminal corresponding to the at least one game player and the sending of the at least one second code stream to the user terminal corresponding to the at least one non-game player in the game live room comprises: sending the at least one first code stream to the user terminal corresponding to the at least one game player based on a first transmission protocol; and sending the at least one second code stream to the user terminal corresponding to the at least one non-game player based on a second transmission protocol; wherein a first transmission delay of the first transmission protocol is smaller than a second transmission delay of the second transmission protocol.
[0011] Optionally, the sending of the at least one first code stream to the user terminal corresponding to the at least one game player comprises: for any target game player in the at least one game player, sending the first code stream corresponding to the target game player to the user terminal corresponding to the target game player, and not sending the first code stream corresponding to each of the game players other than the target game player to the user terminal corresponding to the target game player.
[0012] Optionally, before the at least one second code stream is sent to the user terminal corresponding to the target non-game player in the at least one non-game player in the game live room, the method further includes: obtaining a target viewing request sent by the user terminal corresponding to the target non-game player in the at least one non-game player, the target viewing request being used to request to view the game audio and video data corresponding to the target game player in the at least one game player; and the at least one second code stream is sent to the user terminal corresponding to the target non-game player in response to the target viewing request.
[0013] Optionally, the encoding of the game audio and video data to obtain the first code stream and the second code stream includes: performing background recognition on the game audio and video data to determine background image data and foreground image data in the game audio and video data; encoding the background image data based on an intra-frame parallel coding technology according to key frames and unidirectional reference frames of the background image data to obtain a background data code stream; predicting difference data between the foreground image data and historical foreground image data according to the historical foreground image data generated before the generation time of the foreground image data; encoding the difference data to obtain a difference code stream; processing the code stream corresponding to the historical foreground image data and the difference code stream to obtain a foreground data code stream; and performing stream processing on the background data code stream and the foreground data code stream to obtain the first code stream and the second code stream.
[0014] In a second aspect, the present application provides a game live interaction device, which includes a first acquisition module, a generation module, an encoding module, and a sending module. The first acquisition module is configured to acquire game control instructions of at least one game player in a game live room. The generation module is configured to generate game audio and video data corresponding to a target game player in the at least one game player according to the game control instructions of the target game player. The encoding module is configured to encode the game audio and video data to obtain a first code stream and a second code stream, wherein a first encoding delay corresponding to the first code stream is lower than a second encoding delay corresponding to the second code stream, and / or a first quantization parameter corresponding to the first code stream is smaller than a second quantization parameter corresponding to the second code stream. The sending module is configured to send the at least one first code stream to a user terminal corresponding to the at least one game player, and send the at least one second code stream to a user terminal corresponding to at least one non-game player in the game live room.
[0015] Optionally, the encoding module is specifically configured to encode the game audio and video data according to a first encoding method to obtain the first code stream, and convert the first code stream into the second code stream using a target transcoding method.
[0016] Optionally, the encoding module is specifically configured to: encode the game audio and video data according to a second encoding method to obtain a first code stream; and encode the game audio and video data according to a third encoding method to obtain a second code stream; wherein a third encoding delay of the second encoding method is less than a fourth encoding delay of the third encoding method, and / or a third quantization parameter of the second encoding method is less than a fourth quantization parameter of the third encoding method.
[0017] Optionally, the sending module is specifically configured to: send the at least one first code stream to the user terminal corresponding to the at least one game player based on a first transmission protocol; and send the at least one second code stream to the user terminal corresponding to the at least one non-game player based on a second transmission protocol; wherein a first transmission delay of the first transmission protocol is less than a second transmission delay of the second transmission protocol.
[0018] Optionally, the sending module is specifically configured to: for any target game player in the at least one game player, send the first code stream corresponding to the target game player to the user terminal corresponding to the target game player, and not send the first code stream corresponding to each of the game players other than the target game player in the at least one game player to the user terminal corresponding to the target game player.
[0019] Optionally, the game live streaming interaction apparatus further comprises a second obtaining module, which is configured to: obtain a target viewing request sent by a user terminal corresponding to a target non-game player in the at least one non-game player, the target viewing request being used to request to view game audio and video data corresponding to a target game player in the at least one game player; and the sending module is specifically configured to: in response to the target viewing request, send the second code stream corresponding to the target game player to the user terminal corresponding to the target non-game player.
[0020] Optionally, the encoding module is specifically configured to: perform background recognition on the game audio and video data to determine background image data and foreground image data in the game audio and video data; encode the background image data based on an intra-frame parallel encoding technology according to key frames and single-direction reference frames of the background image data to obtain a background data code stream; predict difference data between the foreground image data and historical foreground image data generated before the foreground image data according to the historical foreground image data to obtain the difference data; encode the difference data to obtain a difference code stream; process a code stream corresponding to the historical foreground image data and the difference code stream to obtain a foreground data code stream; and perform stream combining processing on the background data code stream and the foreground data code stream to obtain the first code stream and the second code stream.
[0021] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, the memory being configured to store a computer program, and the processor being configured to invoke and run the computer program stored in the memory to execute the method in the first aspect or the implementation manners thereof.
[0022] In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program, the computer program causing a computer to execute the method in the first aspect or the implementation manners thereof.
[0023] In a fifth aspect, the present application provides a computer program product comprising computer program instructions, the computer program instructions causing a computer to execute the method in the first aspect or the implementation manners thereof.
[0024] In a sixth aspect, the present application provides a computer program, the computer program causing a computer to execute the method in the first aspect or the implementation manners thereof.
[0025] According to the technical scheme of the present application, the electronic device can first acquire the game control instructions of at least one game player in the game live room, then, for any target game player in the at least one game player, the electronic device can generate the game audio and video data corresponding to the target game player according to the game control instructions of the target game player, then, the electronic device can encode the game audio and video data to obtain a first code stream and a second code stream, the first encoding delay corresponding to the first code stream is lower than the second encoding delay corresponding to the second code stream, and / or the first quantization parameter corresponding to the first code stream is smaller than the second quantization parameter corresponding to the second code stream, finally, the electronic device can send the at least one first code stream to the user terminal corresponding to the at least one game player, and send the at least one second code stream to the user terminal corresponding to the at least one non-game player in the game live room. It can be understood that when the quantization parameter of the encoding method is larger, the generated code stream data will be smaller, and the cost of encoding and decoding and the transmission cost will be smaller, and the occurrence of unstable factors such as lag and frame loss in code stream transmission will also be reduced; when the encoding delay is higher, the cost of encoding and decoding will also be reduced. Since the non-game player does not participate in the game operation, the non-game player is less sensitive to the delay of the game audio and video data, therefore, the electronic device can divide the users in the game live room into game players and non-game players, for the game players, the electronic device can push the code stream with lower encoding delay and / or smaller quantization parameter to them, for the non-game players, the electronic device can push the code stream with higher encoding delay and / or larger quantization parameter to them, thereby reducing the system cost, reducing the occurrence of unstable factors such as lag and frame loss, and improving the system stability. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0027] Figure 1 An application scenario provided for an embodiment of the present application;
[0028] Figure 2 A flowchart of a game live interaction method provided for an embodiment of the present application;
[0029] Figure 3 A schematic diagram of a game live interaction method provided for an embodiment of the present application;
[0030] Figure 4 A schematic diagram of another game live interaction method provided for an embodiment of the present application;
[0031] Figure 5 A schematic diagram of a game live interaction apparatus 500 provided for an embodiment of the present application;
[0032] Figure 6 A schematic block diagram of an electronic device 600 provided for an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0034] It should be noted that the terms “first”, “second”, and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.
[0035] As described above, the encoding and compression process of the game screen in the prior art not only increases the system cost, but also easily causes problems such as lagging and frame loss.
[0036] To solve the above technical problems, the application concept is that the electronic device can divide users in a game live room into game players and non-game players, for the game players, the electronic device can push a code stream with a lower encoding delay and / or a smaller quantization parameter to the game players, for the non-game players, the electronic device can push a code stream with a higher encoding delay and / or a larger quantization parameter to the non-game players, thereby reducing system cost, reducing the occurrence of unstable factors such as lag and frame loss, and improving system stability.
[0037] It should be understood that the technical solutions of the application can be applied to the following scenarios, but are not limited to:
[0038] In some implementable manners, the application can be applied to cloud game-based live scenarios, such as mahjong and other card game scenarios with multiple players playing together, and game scenarios with multiple players playing together, and can also be applied to online examination scenarios, but is not limited thereto.
[0039] It should be noted that when the application is applied to an online examination scenario, the game players in the application can be examinees, and the non-game players can be invigilators, and the game live room can be an online examination room. The embodiments corresponding to the online examination scenario and the embodiments corresponding to the cloud game-based live scenario are similar, and the application will not be repeated here.
[0040] In some implementable manners, Figure 1 An application scenario provided by an embodiment of the application is shown in FIG. 1. Figure 1 As shown in the figure, the application scenario can include a terminal device 110, an electronic device 120, and a terminal device 130. The terminal device 110 can establish a connection with the electronic device 120 through a wired network or a wireless network, and the terminal device 130 can establish a connection with the electronic device 120 through a wired network or a wireless network.
[0041] For example, the terminal device 110 or the terminal device 130 can be a mobile phone, a desktop computer, a notebook computer, a tablet computer, etc., but is not limited thereto. The electronic device 120 can be a server, a server cluster composed of multiple servers, or a cloud platform control center, but is not limited thereto.
[0042] For example, the terminal device 110 can be a device used by a game player, the game player can control a game and watch game pictures based on the terminal device 110, the terminal device 130 can be a device used by a non-game player, the non-game player can watch game pictures based on the terminal device 130, and the electronic device 120 can obtain game control instructions of the game player sent by the terminal device 110 and generate game pictures according to the game control instructions.
[0043] In addition, Figure 1The number of electronic devices and terminal devices is merely exemplary and may actually include other numbers of electronic devices and terminal devices, which is not limited in this application.
[0044] After introducing the application scenarios of the embodiments of this application, the technical solution of this application will be described in detail below:
[0045] Figure 2 A flowchart illustrating a game live-streaming interactive method provided in this application embodiment, the method can be performed by, for example... Figure 1 The electronic device 120 shown performs, but is not limited to, its functions. For example... Figure 2 As shown, the method may include the following steps:
[0046] S210: Obtain game control commands from at least one player in the game live stream;
[0047] S220: For any target player among at least one game player, generate game audio and video data corresponding to the target game player based on the target game player's game control commands;
[0048] S230: Encode the game audio and video data to obtain a first bitstream and a second bitstream, wherein the first encoding delay corresponding to the first bitstream is lower than the second encoding delay corresponding to the second bitstream, and / or the first quantization parameter corresponding to the first bitstream is less than the second quantization parameter corresponding to the second bitstream;
[0049] S240: Send at least one first bitstream to at least one user terminal corresponding to a game player, and send at least one second bitstream to at least one user terminal corresponding to a non-game player in the game live streaming room.
[0050] In some implementations, when the technical solutions of the present application are applied to the cloud game live broadcast scene, the anchor and the audience can enter the game live broadcast room as non-game players based on their respective user terminals. Then, the electronic device can determine the respective non-game player identity (Identity Document, ID) of the anchor and the audience. Then, the distribution service module of the electronic device can obtain each non-game player ID and parse each non-game player ID. Then, the distribution service module can send a play address to each user terminal corresponding to the respective non-game player ID. The play address can include a streaming media address determined based on the Real Time Messaging Protocol (RTMP) provided by the Content Delivery Network (CDN) service provider, or the Hyper Text Transfer Protocol (HTTP) and Flash Video (FLV) protocol, for live streaming playback. After that, the electronic device can determine the game players and non-game players in the game live broadcast room from among the anchor and the audience, i.e., from among the users in the game live broadcast room. Specifically, the electronic device can determine the non-game players and game players from among the users in the game live broadcast room in any of the following ways, but is not limited thereto:
[0051] Method one, the electronic device can randomly determine the game players and non-game players from among the users in the game live broadcast room.
[0052] Method two, the electronic device can determine the non-game players and game players according to the selection of the users in the game live broadcast room for game operation permissions. For example, the electronic device can send an identity selection instruction to the respective user terminals of the users in the game live broadcast room. The identity selection instruction is used for the selection of game players and non-game players by the users in the game live broadcast room. After that, the electronic device can determine at least one user corresponding to a selection request for a game player as a game player in response to the selection request for the game player by at least one user, and determine at least one user corresponding to a selection request for a non-game player as a non-game player in response to the selection request for the non-game player by at least one user.
[0053] Method 3: The electronic device can first determine the game features of the current game and the individual user features of each user. Then, the electronic device can match the game features and each user feature to determine the matching degree between each user feature and the game features. Finally, the electronic device can identify users with matching degrees greater than a preset value as game players and users with matching degrees less than or equal to the preset value as non-game players. Among these methods, game features can be used to represent game types, such as strategy games and role-playing games, while user features can be used to represent the user's preference for each game type.
[0054] Method Four: The electronic device can pre-determine whether a user is a gamer or a non-gamer. After a user enters the live stream, the electronic device can determine the gamers and non-gamers among the current users in the live stream based on the pre-determined gamers and non-gamers. For example, before users 1, 2, and 3 enter the live stream, the electronic device can obtain a role pre-selection instruction. This instruction instructs the electronic device to store user type information, which indicates whether a user is a gamer or a non-gamer. For instance, when it is necessary to pre-determine users 1 and 2 as gamers and user 3 as a non-gamer, the user type information could be (User 1, gamer; User 2, gamer; User 3, non-gamer). After users 1, 2, and 3 enter the live stream, the electronic device can directly determine users 1 and 2 as gamers and user 3 as a non-gamer based on the stored user type information.
[0055] In other possible implementations, when the technical solution of this application is applied to an online examination scenario, the examinee is equivalent to a non-gamer, the invigilator is equivalent to a gamer, and the online examination room is equivalent to a game live streaming room. The corresponding embodiments can refer to the embodiments corresponding to the cloud game live streaming scenario, and this application does not limit them.
[0056] In some possible implementations, after the electronic device identifies the game player and the non-game player, the user terminal corresponding to the game player can display game operation buttons. The game player can operate the game based on the game operation buttons, and the user terminal can generate game control commands based on the game player's operation and send the game control commands to the electronic device, so that the electronic device can obtain the game control commands of the game player.
[0057] Specifically, after the electronic device identifies the game player from all users in the game livestream room, it first updates the non-game player ID corresponding to the game player to the game player ID. Then, the game player can operate the game using the game operation buttons displayed on the user terminal. The user terminal generates game control commands based on the game player's actions, encapsulates these commands, combines them with the corresponding game player ID, and sends them to the electronic device. Thus, the electronic device can obtain the game player's game control commands. The game player ID corresponding to the game control commands will be used in subsequent embodiments, and will not be elaborated upon here.
[0058] In the above embodiments, compared with the prior art which requires distinguishing between the streamer and the audience in the game live broadcast room, and which requires the current game player to transfer the game control to the non-game player before the non-game player can control the game, this application does not require the electronic device to distinguish between the users of the game live broadcast room as streamer and audience when determining the game player and the non-game player. All users can apply to operate the game without the need for the transfer of game control, thereby reducing the interaction cost of the game live broadcast room and realizing multiple people playing the same game online.
[0059] Furthermore, electronic devices can identify gamers and non-gamers through the aforementioned methods, thereby increasing the diversity of game interactions and enriching the ways in which game interactions can be conducted.
[0060] In some feasible implementations, for any target player among at least one game player, the electronic device can determine the source of the command based on the header data of the target player's game control commands. Based on the source of the command or the target player's player ID, the electronic device can determine the game being played and the character within the game. Then, the electronic device can input the game control commands into the game engine to control the game being played and the character within the game, thereby determining the corresponding game audio and video data for the target player. The game engine can be installed in the game service module of the electronic device.
[0061] For example, the aforementioned game audio and video data may include video data and audio data. The video data may include game footage generated based on the target player's actions in the game, and the audio data may include game audio data corresponding to the aforementioned game footage, but is not limited thereto.
[0062] In the following embodiments, this application will describe S230:
[0063] In some feasible methods, electronic devices can encode the game audio and video data corresponding to the target game player in any of the following ways to obtain a first bitstream and a second bitstream, but are not limited to these:
[0064] In a first mode, the electronic device can encode the game audio-video data corresponding to the target game player according to a first encoding method to obtain a first code stream, and then use a target transcoding method to convert the first code stream into a second code stream.
[0065] In a second mode, the electronic device can encode the game audio-video data according to a second encoding method to obtain a first code stream, and encode the game audio-video data according to a third encoding method to obtain a second code stream. The third encoding delay of the second encoding method is less than the fourth encoding delay of the third encoding method, and / or the third quantization parameter of the second encoding method is less than the fourth quantization parameter of the third encoding method.
[0066] In the second mode, the encoding delay of the second encoding method is the encoding delay corresponding to the first code stream, the quantization parameter of the second encoding method is the quantization parameter corresponding to the first code stream, the encoding delay of the third encoding method is the encoding delay corresponding to the second code stream, and the quantization parameter of the third encoding method is the quantization parameter corresponding to the second code stream. That is, the third encoding delay is equal to the first encoding delay, the fourth encoding delay is equal to the second encoding delay, the third quantization parameter is equal to the first quantization parameter, and the fourth quantization parameter is equal to the second quantization parameter.
[0067] It can be understood that audio-video encoding refers to encoding original audio-video data into compressed data to facilitate transmission of the audio-video data. Audio-video encoding will have a delay, and the delay will generally vary from 5 ms to 100 ms depending on the complexity of the encoding algorithm and the resolution and complexity of the video itself.
[0068] The game audio-video data can include audio data and video data. When the electronic device encodes the game audio-video data, it can simultaneously encode the audio data and the video data based on an audio-video encoding method to obtain a first code stream and a second code stream. Alternatively, the electronic device can first encode the audio data and the video data separately to obtain an audio code stream corresponding to the audio data and a video code stream corresponding to the video data, and then perform stream merging processing on the audio code stream and the video code stream to obtain the first code stream and the second code stream. For example, the electronic device can encode the audio data based on an audio encoding method to obtain an audio code stream, and encode the video data based on a video encoding method to obtain a video code stream, and then perform stream merging processing on the audio code stream and the video code stream to obtain the first code stream and the second code stream.
[0069] Video Transcoding refers to converting a video bitstream that has been compressed and encoded into another video bitstream to adapt to different network bandwidths, different terminal processing capabilities and different user needs. Transcoding is essentially a decoding and then encoding process, therefore, the bitstream before and after transcoding can follow the same video encoding standard, or can not follow the same video encoding standard. The converted encoding can use multi-reference frame, bi-directional reference frame and other compression technologies to obtain more compression efficiency. Audio transcoding is similar to video transcoding, which will not be described here.
[0070] When the target transcoding method is a transcoding method for transcoding the bitstream after the audio bitstream and the video bitstream are merged, the electronic device can directly transcode the first bitstream based on the target transcoding method to obtain the second bitstream; when the target transcoding method includes an audio transcoding method for the audio bitstream and a video transcoding method for the video bitstream, the electronic device can first transcode the audio bitstream in the first bitstream based on the audio transcoding method to obtain an audio transcoded bitstream, and transcode the video bitstream in the first bitstream based on the video transcoding method to obtain a video transcoded bitstream. Then, the electronic device can merge the audio transcoded bitstream and the video transcoded bitstream to obtain the second bitstream.
[0071] It should be noted that for different encoding methods, their corresponding encoding delays and quantization parameters are generally different; for the same encoding method, when the encoding parameters are different, their corresponding encoding delays and quantization parameters are also generally different. The quantization parameter can reflect the details of the encoding compression. When the quantization parameter of the encoding method is large, most of the details of the audio and video data will be lost in the encoding process, the distortion of the decoded audio and video data will increase, the quality will decrease, but the code stream data obtained by encoding will be smaller, the bandwidth consumed by transmission will also be smaller, and the cost of encoding and decoding and the transmission cost will be smaller. The occurrence of unstable factors such as frame freezing and frame loss in code stream transmission will also be reduced; when the encoding delay is high, the cost of encoding and decoding will also be reduced.
[0072] Therefore, as long as the third encoding delay is less than the fourth encoding delay, and / or the third quantization parameter is less than the fourth quantization parameter, the second encoding method and the third encoding method can be the same encoding method with different encoding parameters, or different encoding methods, which are not limited by the present application. The target transcoding method can convert low-delay data with high bandwidth and high cost into ordinary-delay data with low bandwidth and low cost, i.e., the transcoding method that converts audio and video data with lower delay and smaller quantization parameter into audio and video data with higher delay and larger quantization parameter, and the present application does not limit the target transcoding method.
[0073] For example, the first encoding method can include a video encoding method based on a High efficiency video coding (HEVC) standard and an Advanced Audio Coding (AAC), and the application does not limit the same. When the second encoding method includes a video encoding method based on the HEVC standard, the third encoding method can include a video encoding method based on an H.264 standard, wherein the video encoding method based on the HEVC standard has a lower encoding delay and a higher decoded picture quality than the video encoding method based on the H.264 standard; or the second encoding method and the third encoding method can both be the video encoding method based on the HEVC standard, but the encoding parameters corresponding to the second encoding method and the encoding parameters corresponding to the third encoding method are different, so that the third encoding delay is less than the fourth encoding delay, and / or the third quantization parameter is less than the fourth quantization parameter, so that the first encoding delay is lower than the second encoding delay, and / or the first quantization parameter is less than the second quantization parameter.
[0074] For example, for the H.264 standard, the encoding parameters mainly include a Profile, a Level, a bit rate, a resolution, and the like, wherein the Profile can be divided into a Baseline Profile, a Main Profile, and a High Profile, the Baseline Profile is generally used in a real-time communication field such as a video call, the Main Profile is commonly used in a streaming media field such as network video playing, and the High Profile is commonly used in a higher commercial occasion such as a movie and a high-definition television; the Level can limit the maximum macroblock processing rate and the maximum frame rate of a bitstream, and the Level values include 1, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, and 5.1; the bit rate refers to the number of bits of video data transmitted per unit of time, and when the resolution is the same, the larger the bit stream of a video file, the smaller the compression ratio, and the better the picture quality; the resolution can represent the size of a video, and generally, the larger the resolution of a video, the clearer the video.
[0075] In some implementations, when encoding the game audio-video data, the electronic device can first perform background recognition on the game audio-video data to determine background image data and foreground image data in the game audio-video data. Then, for the background image data, the electronic device can encode the background image data based on an intra-parallel coding technology according to key frames and unidirectional reference frames of the background image data to obtain a background data code stream; for the foreground image data, the electronic device can predict difference data between the foreground image data and historical foreground image data generated before the generation time of the foreground image data according to the historical foreground image data, then the electronic device can encode the difference data to obtain a difference code stream, process a code stream corresponding to the historical foreground image data and the difference code stream to obtain a foreground data code stream, and finally the electronic device can perform stream merging processing on the background data code stream and the foreground data code stream to obtain the first code stream and the second code stream.
[0076] It can be understood that many game pictures have the feature that the background in the picture is not moving or changes little, and the characters, objects and corresponding texts in the picture change greatly. Therefore, the electronic device can encode the game audio-video data based on a hierarchical coding mechanism, that is, the electronic device can separate the video data in the game audio-video data into background image data and foreground image data, and use two independent coding layers to perform targeted encoding processing on the background image data and the foreground image data, so as to obtain more compression rate while ensuring the picture quality and improve the coding efficiency. The hierarchical coding mechanism can be compatible with the first coding method, the second coding method, the third coding method and other coding methods.
[0077] For example, for any game screen in the game audio and video data, the electronic device can first identify the background screen and the foreground screen in the game screen using a background recognition algorithm. The foreground screen can include characters, objects, and other parts in a relative motion state. Then, for the background screen, the electronic device can label it as a Background Layer before encoding. For the foreground image, the electronic device can label it as a Foreground Layer before encoding, and set independent encoding parameters and reference frame systems for the foreground image and the background image. Specifically, during encoding, for the part labeled as the Background Layer, i.e., for the background screen, since the inter-frame change of the background screen is small, the residual data obtained by encoding calculation is small, and the encoding efficiency is high. Therefore, when encoding the background screen, only key frames and single-direction reference frames with small time consumption and small delay can be used instead of time-consuming and large-delay encoding frames such as multi-reference frames and bidirectional reference frames, so as to reduce delay and the occurrence of situations such as lag. After determining the key frames and the single-direction reference frames of the background screen, the electronic device can encode the background screen based on the intra-frame parallel encoding technology according to the key frames and the single-direction reference frames, to obtain a background data code stream. For example, as shown in FIG. 7, the electronic device can first identify the background screen and the foreground screen in the game screen using a background recognition algorithm, and then label the background screen as a Background Layer and the foreground screen as a Foreground Layer before encoding. After determining the key frames and the single-direction reference frames of the background screen, the electronic device can encode the background screen based on the intra-frame parallel encoding technology according to the key frames and the single-direction reference frames, to obtain a background data code stream. Figure 3As shown, the electronic device can divide the background picture into N slices, N being a positive integer, and the data coding of each slice is independent. When encoding, the electronic device can simultaneously encode the N slices in the background picture through multi-thread encoding, and the Coding Tree Unit (CTU) in each slice is encoded in raster scan order. When encoding each target slice in the current frame, i.e., the current background picture, the slice in the key frame or the single-reference frame corresponding to the position of the target slice in the current frame can be used as a reference for encoding. The reference frame can be used as a reference for other frames, such as subsequent frames, during encoding. For example, when determining the compressed data of the subsequent frame, i.e., the encoded subsequent frame, the reference frame can be used as a basis to calculate the difference data between the subsequent frame and the reference frame, and the compressed data of the subsequent frame can be obtained based on the reference frame and the difference data. The key frame refers to an encoded frame that does not need to refer to other frames, but can be used as a reference frame for other frames. The single-direction reference frame refers to a frame that only refers to frames in front of it in the time axis, and the single-direction reference frame can start encoding directly without waiting for subsequent frames. Obviously, the intra-frame parallel encoding technique can reduce the single-frame time consumption to less than 5 ms, and can further reduce the encoding time consumption. For the part marked as the Foreground Layer, i.e., for the foreground picture, the electronic device can only use the foreground layer image as a reference to determine the reference position from the foreground layer image using the motion vector search range method, and encode the foreground picture. For example, the electronic device can first determine a historical foreground picture generated before the generation time of the foreground picture, and determine a reference position from the historical foreground picture using the motion vector search range method, the difference between the picture at the reference position and the person or object in the foreground picture being less than a preset difference. Then, the electronic device can combine the reference position to predict the difference data between the foreground picture and the historical foreground picture, and then encode the difference data to obtain a difference code stream. The electronic device can combine the code stream corresponding to the historical foreground picture and the difference code stream to obtain a foreground data code stream.
[0078] In the aforementioned process, low latency and high image quality allow gamers to better control the game and ensure a smooth gaming experience. Non-gamers, however, do not participate in gameplay and are less sensitive to latency in game audio and video data. Low latency and high image quality encoding can lead to high bandwidth consumption, high system costs, and instability issues such as stuttering and frame drops. Therefore, sending low latency and high image quality game audio and video data to all users in a game livestream not only increases system costs and the occurrence of stuttering and frame drops, but also provides little difference in user experience between low latency and high image quality and normal latency and image quality for non-gamers. Therefore, electronic devices can generate two streams based on the game audio and video data. For gamers, the electronic device can push a stream with lower encoding latency and / or smaller quantization parameters; for non-gamers, the electronic device can push a stream with higher encoding latency and / or larger quantization parameters. This reduces system costs, minimizes stuttering and frame drops, and improves system stability.
[0079] In some possible implementations, S240 may specifically include: sending at least one first bitstream to at least one user terminal corresponding to a game player based on a first transmission protocol; sending at least one second bitstream to at least one user terminal corresponding to a non-game player based on a second transmission protocol; wherein, the first transmission delay of the first transmission protocol is less than the second transmission delay of the second transmission protocol.
[0080] Understandably, since gamers participate in game operations while non-gamers do not, gamers are more sensitive to the latency of game audio and video data, while non-gamers are less sensitive. However, a large transmission latency increases system costs. Therefore, electronic devices can use two transmission strategies to send separate bitstreams to gamers and non-gamers to reduce system costs.
[0081] For example, the first transport protocol can be Real-Time Communication (RTC) or User Datagram Protocol (UDP), and the second transport protocol can be Real-Time Message Protocol (RTMP) or Hypertext Transfer Protocol (HTTP). This application does not impose any restrictions on this. Since UDP messages lack reliability guarantees, order guarantees, and flow control fields, and have fewer control options, UDP has the advantages of low latency and high data transmission efficiency during data transmission.
[0082] In some implementations, the electronic device sends at least one first bitstream to the user terminal corresponding to at least one game player. This may include: for any target game player among the at least one game player, sending the first bitstream corresponding to the target game player to the user terminal corresponding to the target game player, while not sending the first bitstreams corresponding to each of the at least one game player other than the target game player to the user terminal corresponding to the target game player. In this way, each game player can only watch and hear the game audio and video data generated based on their own game operations, and cannot access the game audio and video data generated based on the game operations of other game players, thus ensuring the confidentiality of game operations.
[0083] For example, suppose the game in the game livestream is for testing the gaming skills of at least one player. The at least one player includes User 1 and User 2, and the at least one non-player includes User 3. After the electronic device receives game control commands 1 sent from User 1's user terminal 1 and game control commands 2 sent from User 2's user terminal 2, the electronic device can generate game audio / video data 1 based on game control commands 1 and game audio / video data 2 based on game control commands 2. Then, the electronic device can encode the game audio / video data 1 to obtain a first bitstream 1 and a second bitstream 1, and encode the game audio / video data 2 to obtain a first bitstream 2 and a second bitstream 2. Afterward, for User 1's user terminal 1, the electronic device can only send the first bitstream 1 to User 1, ensuring that User 1 can only obtain the game audio / video data according to the commands 1 and 2. The electronic device can only send the first stream 2 to user terminal 2, ensuring that user 2 can only access the game audio and video data generated by their own game operations, and not the game audio and video data generated by user 1's game operations, thus ensuring user 1's operation privacy. For user terminal 3, since user 3 is not a gamer, the electronic device can merge the second stream 1 and the second stream 2 and send the merged stream to user terminal 3, ensuring that user 3 can view the game screen generated by the operations of both user 1 and user 2, increasing the participation and interactive atmosphere of the game live stream.
[0084] In some implementable manners, before the electronic device sends the at least one second code stream to the user terminal corresponding to the at least one non-game player in the game live room, the electronic device can further include: obtaining a target watching request sent by the user terminal corresponding to a target non-game player in the at least one non-game player, the target watching request being used to request to watch the game audio and video data corresponding to a target game player in the at least one game player, and the sending of the at least one second code stream to the user terminal corresponding to the at least one non-game player in the game live room can include: in response to the target watching request, sending the second code stream corresponding to the target game player to the user terminal corresponding to the target non-game player. In this way, the non-game player can watch the game screen corresponding to the specified game player, and the interaction diversity is improved.
[0085] For example, assuming that the at least one game player includes: user 1 and user 2, and the at least one non-game player includes: user 3, the user terminal 3 of the user 3 can send a target watching request to the electronic device, the target watching request being used to request to watch the game audio and video data corresponding to the user 1, then the electronic device can obtain the target watching request, in response to the target watching request, the electronic device can generate the game audio and video data 3 according to the game control instruction 3 sent by the user terminal 1 of the user 1, encode the game audio and video data 3 to obtain the second code stream 3, and send the second code stream 3 to the user terminal 3.
[0086] In some implementable manners, as shown in Figure 4 The electronic device can include: a game instruction distribution service module, a game service module, an encoding service module, a stream media distribution service module, a low-latency audio and video distribution service module, and a normal audio and video distribution service module. The game instruction distribution service module can obtain the game control instruction sent by the user terminal of the game player, and send the game control instruction to the game service module; the game service module can provide the execution of the game, generate the game result, i.e., the game audio and video data, according to the game control instruction, and send the game audio and video data to the encoding service module; the encoding service module can encode the game audio and video data based on a low-latency and high-quality encoding method to obtain the first code stream, and send the first code stream to the stream media distribution service module; the stream media distribution service module can send the first code stream to the low-latency audio and video distribution service module based on the pass-through mode, and can transcode the first code stream based on the transcoding service to obtain the second code stream, and send the second code stream to the normal audio and video distribution service module; the low-latency audio and video distribution service module can send the first code stream to the user terminal of the game player based on the UDP, and the normal audio and video distribution service module can send the second code stream to the user terminal of the non-game player based on the RTMP or HTTP.
[0087] Figure 5A schematic diagram of a game live interaction device 500 is provided for an embodiment of the present application. As shown in the figure, the game live interaction device 500 comprises a first acquisition module 510, a generation module 520, an encoding module 530, and a sending module 540. Figure 5 The first acquisition module 510 is configured to acquire game control instructions of at least one game player in a game live room.
[0088] The first acquisition module 510 is configured to acquire game control instructions of at least one game player in a game live room.
[0089] The generation module 520 is configured to, for any target game player in the at least one game player, generate game audio and video data corresponding to the target game player according to the game control instructions of the target game player.
[0090] The encoding module 530 is configured to encode the game audio and video data to obtain a first code stream and a second code stream, a first encoding delay corresponding to the first code stream being lower than a second encoding delay corresponding to the second code stream, and / or a first quantization parameter corresponding to the first code stream being smaller than a second quantization parameter corresponding to the second code stream.
[0091] The sending module 540 is configured to send the at least one first code stream to a user terminal corresponding to the at least one game player, and send the at least one second code stream to a user terminal corresponding to at least one non-game player in the game live room.
[0092] In some implementable manners, the encoding module 530 is specifically configured to encode the game audio and video data according to a first encoding method to obtain the first code stream, and convert the first code stream into the second code stream using a target transcoding method.
[0093] In some implementable manners, the encoding module 530 is specifically configured to encode the game audio and video data according to a second encoding method to obtain the first code stream, and encode the game audio and video data according to a third encoding method to obtain the second code stream, wherein a third quantization parameter of the second encoding method is smaller than a fourth quantization parameter of the third encoding method, and / or a third encoding delay of the second encoding method is smaller than a fourth encoding delay of the third encoding method.
[0094] In some implementable manners, the sending module 540 is specifically configured to send the at least one first code stream to the user terminal corresponding to the at least one game player based on a first transmission protocol, and send the at least one second code stream to the user terminal corresponding to the at least one non-game player based on a second transmission protocol, wherein a first transmission delay of the first transmission protocol is smaller than a second transmission delay of the second transmission protocol.
[0095] In some implementable manners, the sending module 540 is specifically configured to: for any target game player in the at least one game player, send the first code stream corresponding to the target game player to the user terminal corresponding to the target game player, and not send the first code stream corresponding to each of the game players other than the target game player in the at least one game player to the user terminal corresponding to the target game player.
[0096] In some implementable manners, the game live interaction apparatus further comprises: a second obtaining module 550, configured to: obtain a target watching request sent by a user terminal corresponding to a target non-game player in the at least one non-game player, the target watching request being used to request to watch the game audio and video data corresponding to the target game player in the at least one game player; and the sending module 540 is specifically configured to: in response to the target watching request, send the second code stream corresponding to the target game player to the user terminal corresponding to the target non-game player.
[0097] In some implementable manners, the encoding module 530 is specifically configured to: perform background recognition on the game audio and video data, to determine background image data and foreground image data in the game audio and video data; encode the background image data based on an intra-frame parallel coding technology according to key frames and unidirectional reference frames of the background image data, to obtain a background data code stream; predict difference data between the foreground image data and historical foreground image data according to the historical foreground image data generated before the generation time of the foreground image data; encode the difference data, to obtain a difference code stream; process the code stream corresponding to the historical foreground image data and the difference code stream, to obtain a foreground data code stream; and perform stream processing on the background data code stream and the foreground data code stream, to obtain the first code stream and the second code stream.
[0098] It should be understood that the apparatus embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, no further description is given here. Specifically, Figure 5 The apparatus 500 shown can perform the method embodiments described above, and the foregoing and other operations and / or functions of each module in the apparatus 500 are respectively for realizing the corresponding processes in each of the methods described above. To be brief, no further description is given here.
[0099] The apparatus 500 of the embodiments of the present application is described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in a processor and / or instructions of software. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing for execution by a processor, or be executed by a combination of hardware and software modules in the processor. Alternatively, the software module can be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, and the like. The storage medium is located in a memory, and a processor reads information in the memory and combines hardware to complete the steps in the above method embodiments.
[0100] Figure 6 A schematic block diagram of an electronic device 600 is provided in the embodiments of the present application.
[0101] As shown in Figure 6 , the electronic device 600 can include:
[0102] The memory 610 is configured to store a computer program and transmit the program code to the processor 620. In other words, the processor 620 can call and run the computer program from the memory 610 to implement the method in the embodiments of the present application.
[0103] For example, the processor 620 can be configured to execute the above method embodiments according to the instructions in the computer program.
[0104] In some embodiments of the present application, the processor 620 can include but is not limited to:
[0105] A general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and the like.
[0106] In some embodiments of the present application, the memory 610 includes but is not limited to:
[0107] The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synch Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0108] In some embodiments of the present application, the computer program can be divided into one or more modules, which are stored in the memory 610 and executed by the processor 620 to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.
[0109] As shown in Figure 6 The electronic device can further include:
[0110] The transceiver 630 can be connected to the processor 620 or the memory 610.
[0111] The processor 620 can control the transceiver 630 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 630 can include a transmitter and a receiver. The transceiver 630 can further include an antenna, and the number of antennas can be one or more.
[0112] It should be understood that the various components within the electronic device are connected by a bus system, which includes, in addition to a data bus, a power bus, a control bus, and a state signal bus.
[0113] The application also provides a computer storage medium, which stores a computer program, and the computer program enables a computer to execute the method of the method embodiment when executed by the computer. Alternatively, the application embodiment also provides a computer program product containing instructions, and the instructions enable the computer to execute the method of the method embodiment when executed by the computer.
[0114] When implemented by using software, the computer program product can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer program instructions produce the flow or function of the embodiment of the application in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available media sets. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, digital video disc (DVD)), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0115] Those of ordinary skill in the art can realize that the modules and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.
[0116] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiments is only a logical function division, and there can be another division manner for the actual implementation, for example, multiple devices or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different parts can be indirect couplings or communication connections through some interfaces, devices or modules, and can be electrical, mechanical or in other forms.
[0117] The modules explained as separated components can or can not be physically separated, and the components shown as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. For example, the functional modules in the embodiments of the present application can be integrated into a processing module, or each module can be physically present separately, or two or more modules can be integrated into one module.
[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for interactive game live streaming, characterized in that, include: Obtain game control commands from at least one player in the game live stream; For any target player among the at least one game player, generate game audio and video data corresponding to the target game player according to the game control instructions of the target game player; The game audio and video data are encoded to obtain a first bitstream and a second bitstream. The first encoding delay corresponding to the first bitstream is lower than the second encoding delay corresponding to the second bitstream, and / or the first quantization parameter corresponding to the first bitstream is less than the second quantization parameter corresponding to the second bitstream. At least one of the first bitstreams is sent to the user terminal corresponding to the at least one game player, and at least one of the second bitstreams is sent to the user terminal corresponding to at least one non-game player in the game live broadcast room. The process of encoding the game audio and video data to obtain a first bitstream and a second bitstream includes: Perform background recognition on the game audio and video data to determine the background image data and foreground image data in the game audio and video data; Based on the keyframes and one-way reference frames of the background image data, the background image data is encoded using intra-frame parallel coding technology to obtain a background data bitstream; Based on historical foreground image data generated before the generation time of the foreground image data, predict the difference data between the foreground image data and the historical foreground image data; The difference data is encoded to obtain a difference bitstream; The bitstream corresponding to the historical foreground image data and the difference bitstream are processed to obtain the foreground data bitstream; The background data stream and the foreground data stream are merged to obtain the first stream and the second stream.
2. The method according to claim 1, characterized in that, The process of encoding the game audio and video data to obtain a first bitstream and a second bitstream includes: The game audio and video data are encoded according to the first encoding method to obtain the first bitstream; The first bitstream is converted into the second bitstream using the target transcoding method.
3. The method according to claim 1, characterized in that, The process of encoding the game audio and video data to obtain a first bitstream and a second bitstream includes: The game audio and video data are encoded according to the second encoding method to obtain the first bitstream; The game audio and video data are encoded according to the third encoding method to obtain the second bitstream; Wherein, the third encoding delay of the second encoding method is less than the fourth encoding delay of the third encoding method, and / or the third quantization parameter of the second encoding method is less than the fourth quantization parameter of the third encoding method.
4. The method according to any one of claims 1-3, characterized in that, The step of sending at least one of the first bitstreams to the user terminals corresponding to the at least one game player, and sending at least one of the second bitstreams to the user terminals corresponding to at least one non-game player in the game live stream, includes: Based on the first transmission protocol, at least one of the first bit streams is sent to the user terminal corresponding to the at least one game player; Based on the second transmission protocol, at least one of the second bit streams is sent to the user terminal corresponding to the at least one non-game player; Wherein, the first transmission delay of the first transmission protocol is less than the second transmission delay of the second transmission protocol.
5. The method according to any one of claims 1-3, characterized in that, Sending at least one of the first bitstreams to the user terminal corresponding to the at least one game player includes: For any target player among the at least one game player, the first bitstream corresponding to the target game player is sent to the user terminal corresponding to the target game player, but the first bitstreams corresponding to each of the at least one game player other than the target game player are not sent to the user terminal corresponding to the target game player.
6. The method according to any one of claims 1-3, characterized in that, Before sending at least one of the second bitstreams to at least one user terminal corresponding to a non-game player in the game live stream room, the method further includes: Obtain a target viewing request sent by the user terminal corresponding to the target non-gamer among the at least one non-gamer, the target viewing request being used to request to watch the game audio and video data corresponding to the target gamer among the at least one gamer; Sending at least one of the second bitstreams to at least one user terminal corresponding to a non-game player in the game live stream includes: In response to the target viewing request, the second bitstream corresponding to the target game player is sent to the user terminal corresponding to the target non-game player.
7. A game live streaming interactive device, characterized in that, The game live streaming interactive device includes: a first acquisition module, a generation module, an encoding module, and a sending module, wherein, The first acquisition module is used to: acquire game control commands from at least one player in the game live stream; The generation module is configured to: generate game audio and video data corresponding to any target game player among the at least one game player, based on the game control instructions of the target game player; The encoding module is used to: encode the game audio and video data to obtain a first bitstream and a second bitstream, wherein the first encoding delay corresponding to the first bitstream is lower than the second encoding delay corresponding to the second bitstream, and / or the first quantization parameter corresponding to the first bitstream is less than the second quantization parameter corresponding to the second bitstream. The sending module is configured to: send at least one of the first bitstreams to the user terminal corresponding to the at least one game player, and send at least one of the second bitstreams to the user terminal corresponding to at least one non-game player in the game live streaming room; The encoding module is specifically used for: Perform background recognition on the game audio and video data to determine the background image data and foreground image data in the game audio and video data; Based on the keyframes and one-way reference frames of the background image data, the background image data is encoded using intra-frame parallel coding technology to obtain a background data bitstream; Based on historical foreground image data generated before the generation time of the foreground image data, predict the difference data between the foreground image data and the historical foreground image data; The difference data is encoded to obtain a difference bitstream; The bitstream corresponding to the historical foreground image data and the difference bitstream are processed to obtain the foreground data bitstream; The background data stream and the foreground data stream are merged to obtain the first stream and the second stream.
8. The apparatus according to claim 7, characterized in that, The encoding module is specifically used for: The game audio and video data are encoded according to the first encoding method to obtain the first bitstream; The first bitstream is converted into the second bitstream using the target transcoding method.
9. The apparatus according to claim 7, characterized in that, The encoding module is specifically used for: The game audio and video data are encoded according to the second encoding method to obtain the first bitstream; The game audio and video data are encoded according to the third encoding method to obtain the second bitstream; Wherein, the third encoding delay of the second encoding method is less than the fourth encoding delay of the third encoding method, and / or the third quantization parameter of the second encoding method is less than the fourth quantization parameter of the third encoding method.
10. The apparatus according to any one of claims 7-9, characterized in that, The sending module is specifically used for: Based on the first transmission protocol, at least one of the first bit streams is sent to the user terminal corresponding to the at least one game player; Based on the second transmission protocol, at least one of the second bit streams is sent to the user terminal corresponding to the at least one non-game player; Wherein, the first transmission delay of the first transmission protocol is less than the second transmission delay of the second transmission protocol.
11. The apparatus according to any one of claims 7-9, characterized in that, The sending module is specifically used for: For any target player among the at least one game player, the first bitstream corresponding to the target game player is sent to the user terminal corresponding to the target game player, but the first bitstreams corresponding to each of the at least one game player other than the target game player are not sent to the user terminal corresponding to the target game player.
12. The apparatus according to any one of claims 7-9, characterized in that, The game live streaming interactive device also includes: a second acquisition module. The second acquisition module is used to: acquire a target viewing request sent by the user terminal corresponding to the target non-gamer among the at least one non-gamer, wherein the target viewing request is used to request to watch the game audio and video data corresponding to the target gamer among the at least one gamer; The sending module is specifically used to: in response to the target viewing request, send the second bitstream corresponding to the target game player to the user terminal corresponding to the target non-game player.
13. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-6 by executing the executable instructions.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-6.
15. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, the electronic device performs the method of any one of claims 1-6.
Citation Information
Patent Citations
Methods and systems for rendering and encoding content for online interactive gaming sessions
CN111417441A
Game data processing method and device and storage medium
CN113423018A