Live video processing method and device, electronic equipment and storage medium
By obtaining the number of viewers and video quality parameters, combining the video encoding format of the downlink device, and determining the target transcoding rules, the problem of inaccurate transcoding of live videos is solved, and successful playback and cost optimization are achieved on different devices.
Patent Information
- Application Number
- CN202410011682.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the number of viewers, video quality parameters and video encoding format supported by the downlink device are not effectively considered when transcoding live videos, resulting in the video being unable to be played normally on the audience side after transcoding, affecting the transcoding accuracy of live videos and increasing the transcoding cost.
By obtaining the number of viewers in the target live broadcast room, video quality parameters and video encoding format supported by the downlink device, the target transcoding rules are determined, and the original video stream is transcoding according to the rules to generate a target video stream suitable for the downlink device.
Improve the accuracy of live video transcoding, ensure that the video is successfully played on different downlink devices, reduce the cost of transcoding, and avoid invalid upward transcoding and changes in video encoding format.
Smart Images

Figure CN120264024A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a live video processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of computer technology and network technology, live broadcasts have been widely popularized and have gradually become an indispensable entertainment activity for the public.
[0003] In a live broadcast, the host side can push the collected live video to the viewer side through a server so that the viewers in the live broadcast room can watch the live video of the host. To reduce the occupied bandwidth and ensure the smoothness of playing the live video on the viewer side, the server needs to transcode the live video pushed by the host side and then push the transcoded live video to the viewer side.
[0004] Therefore, how to improve the accuracy of live video transcoding and reduce the transcoding cost is a technical problem that needs to be solved. Summary of the Invention
[0005] Embodiments of this application provide a live video processing method, apparatus, electronic device, and storage medium to improve the accuracy of live video transcoding.
[0006] The specific technical solutions provided by the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a live video processing method, which includes:
[0008] In response to a live viewing request from a downstream device, obtain the number of viewers and video quality parameters of the corresponding target live broadcast room at the current moment, and the downstream video coding format supported by the downstream device;
[0009] Based on the number of viewers, video quality parameters, and downstream video coding format, determine the target transcoding rule corresponding to the downstream device;
[0010] Transcode the original video stream generated by the target live broadcast room according to the target transcoding rule to obtain the target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
[0011] In a second aspect, embodiments of this application further provide a live video processing apparatus, which includes:
[0012] An obtaining module, configured to obtain the number of viewers and video quality parameters of the corresponding target live broadcast room at the current moment, and the downstream video coding format supported by the downstream device in response to a live viewing request from the downstream device;
[0013] A determination module, configured to determine a target transcoding rule corresponding to a downstream device based on the number of viewers, video quality parameters, and downstream video encoding format;
[0014] A transcoding module, configured to transcode the original video stream generated by the target live broadcast room according to the target transcoding rule, obtain a target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
[0015] In a possible implementation, when determining the target transcoding rule corresponding to the downstream device based on the number of viewers, video quality parameters, and downstream video encoding format, the determination module is further configured to:
[0016] Based on the video quality parameters, determine the candidate live broadcast gears corresponding to each candidate transcoding rule of the downstream device;
[0017] Based on the number of viewers, video quality parameters, downstream video encoding format, and each candidate live broadcast gear, determine the candidate video encoding formats corresponding to each candidate transcoding rule;
[0018] Based on the target live broadcast gear of the downstream device, select a target transcoding rule from each candidate transcoding rule, where the target live broadcast gear represents: the live broadcast gear for the downstream device to enter the target live broadcast room.
[0019] In a possible implementation, when determining the candidate live broadcast gears corresponding to each candidate transcoding rule of the downstream device based on the video quality parameters, the determination module is further configured to:
[0020] Based on the upstream resolution included in the video quality parameters and a preset candidate resolution condition, determine the candidate live broadcast gears included in each candidate transcoding rule;
[0021] Wherein, each candidate live broadcast gear corresponds to a candidate resolution, and each candidate resolution is not greater than the upstream resolution.
[0022] In a possible implementation, when determining the candidate video encoding formats corresponding to each candidate transcoding rule based on the number of viewers, video quality parameters, downstream video encoding format, and each candidate live broadcast gear, the determination module is further configured to:
[0023] When the downstream video encoding format includes a first video encoding format, and the upstream video encoding format included in the video quality parameters is a second video encoding format, and the number of viewers is greater than a preset number threshold, respectively based on each candidate live broadcast gear, and in combination with the upstream bit rate included in the video quality parameters, determine the candidate video encoding formats corresponding to each candidate transcoding rule;
[0024] Wherein, the data compression rate of the first video encoding format is greater than that of the second video encoding format.
[0025] In a possible implementation, when determining the candidate video coding format of each candidate transcoding rule based on each candidate live gear and combining the uplink bitrate included in the video quality parameter, the determining module is further configured to:
[0026] For each candidate transcoding rule among the candidate transcoding rules, perform the following operations respectively:
[0027] When the uplink bitrate is less than the preset change bitrate threshold and the candidate live gear of the candidate transcoding rule is a high candidate live gear, set the candidate video coding format of the candidate transcoding rule to the second video coding format, where the candidate resolution of the high candidate live gear meets the preset first resolution condition.
[0028] In a possible implementation, when determining the candidate video coding format of each candidate transcoding rule, the determining module is further configured to:
[0029] When the downlink video coding format does not include the first video coding format, set the candidate video coding format of each candidate transcoding rule to the second video coding format.
[0030] In a possible implementation, when selecting a target transcoding rule from the candidate transcoding rules based on the historical viewing information of the downlink device, the determining module is further configured to:
[0031] When the historical viewing information of the downlink device includes a historical live gear, use the historical live gear as the target live gear, and the historical viewing information is the historical information of the downlink device watching the live broadcast;
[0032] Screen out the target transcoding rule corresponding to the target live gear from the candidate transcoding rules.
[0033] In a possible implementation, when transcoding the original video stream generated by the target live room according to the target transcoding rule to obtain the target video stream corresponding to the downlink device, the transcoding module is further configured to:
[0034] If the target video coding format of the target transcoding rule is the same as the uplink video coding format, the target live gear of the target transcoding rule is a high target live gear, and the uplink bitrate included in the video quality parameter is less than the preset conversion bitrate threshold, then use the original video stream as the target video stream, where the target resolution of the high target live gear meets the preset second resolution condition.
[0035] In a possible implementation, when sending the target video stream to the downlink device, the transcoding module is further configured to:
[0036] When the heat value of the intermediate node corresponding to the downstream device is greater than a preset heat threshold, forward the target video stream to the downstream device through the intermediate node, where the heat value represents the number of devices connecting to the target live broadcast room through the intermediate node, and the intermediate node is a node in the content distribution network whose distance from the downstream device meets the preset distance condition;
[0037] When the heat value of the intermediate node is not greater than the heat threshold, forward the target video stream to the downstream device through the main node in the content distribution network.
[0038] In a possible implementation manner, after sending the target video stream to the downstream device, the apparatus further includes a gear shifting module, and the gear shifting module is used for:
[0039] Send a gear display instruction to the downstream device, where the gear display instruction carries each candidate live gear corresponding to each candidate transcoding rule, and instructs the downstream device to display the gear options corresponding to each candidate live gear;
[0040] Receive the gear selection information sent by the downstream device, and determine the updated transcoding rule corresponding to the updated live gear selected by the downstream device according to the gear selection information;
[0041] Transcode the original video stream according to the updated transcoding rule to obtain an updated video stream corresponding to the updated live gear, and send the updated video stream to the downstream device.
[0042] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the steps of any of the above live video processing methods are implemented.
[0043] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above live video processing methods are implemented.
[0044] In a fifth aspect, an embodiment of the present application further provides a computer program product, including computer instructions, and the computer instructions are executed by a processor to implement the steps of any of the above live video processing methods.
[0045] The beneficial effects of the present application are as follows:
[0046] In the embodiment of the present application, based on the number of viewers of the target live broadcast room at the current moment, video quality parameters, and the downstream video coding format supported by the downstream device, determine the target transcoding rule, then transcode the original video stream generated by the target live broadcast room according to the target transcoding rule, and send the target video stream to the downstream device.
[0047] In this way, targeted transcoding can be performed in real time for the number of viewers, video quality parameters, and downstream video encoding format at the current moment. Since the downstream video transcoding format only supports the second video encoding format and the target video stream in the first video encoding format cannot be played on the downstream device, considering the downstream video encoding format can avoid the situation of transcoding into a video encoding format not supported by the downstream video encoding format, thereby enabling the target video stream to be successfully played on different downstream devices. Additionally, since the downstream video transcoding format supports the first video encoding format and the target video stream in the second video encoding format can be successfully played on the downstream device, when the downstream video transcoding format supports the first video encoding format, changes in the video transcoding format can be avoided, reducing the transcoding cost while ensuring successful playback.
[0048] Moreover, since the video quality parameters are the actual video quality parameters of the target live broadcast room and determine the upper limit of the video clarity of the transcoded target video stream, considering the video quality parameters can avoid ineffective upward transcoding and reduce the cost of upward transcoding. Description of the Drawings
[0049] Figure 1 An optional schematic diagram of an application scenario in an embodiment of the present application;
[0050] Figure 2 The implementation flowchart of a live video processing method provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of responding to a live viewing request in an embodiment of the present application;
[0052] Figure 4 The first flowchart schematic diagram of obtaining a target transcoding rule in an embodiment of the present application;
[0053] Figure 5 The first flowchart schematic diagram of obtaining each candidate video encoding format in an embodiment of the present application;
[0054] Figure 6 The first schematic diagram of determining a candidate video encoding format in an embodiment of the present application;
[0055] Figure 7 The second flowchart schematic diagram of obtaining each candidate video encoding format in an embodiment of the present application;
[0056] Figure 8 The second schematic diagram of determining a candidate video encoding format in an embodiment of the present application;
[0057] Figure 9 The third schematic diagram of determining a candidate video encoding format in an embodiment of the present application;
[0058] Figure 10 It is a schematic diagram of the second process for obtaining the target transcoding rule in the embodiments of the present application;
[0059] Figure 11 It is a schematic diagram for obtaining the target transcoding rule in the embodiments of the present application;
[0060] Figure 12 It is a schematic diagram of the process for obtaining the target video stream in the embodiments of the present application;
[0061] Figure 13 It is a schematic diagram for obtaining the target video stream in the embodiments of the present application;
[0062] Figure 14 It is a schematic diagram of the process for obtaining and sending the target video stream in the embodiments of the present application;
[0063] Figure 15 It is a schematic diagram for sending the target video stream in the embodiments of the present application;
[0064] Figure 16 It is a schematic diagram of the process for updating the video stream in the embodiments of the present application;
[0065] Figure 17 It is a schematic diagram for sending the updated video stream in the embodiments of the present application;
[0066] Figure 18 It is a schematic diagram of the structure of a live video processing device provided in the embodiments of the present application;
[0067] Figure 19 It is a schematic diagram of the hardware composition structure of a computer device in the embodiments of the present application;
[0068] Figure 20 It is a schematic diagram of the hardware composition structure of another computer device in the embodiments of the present application. Detailed implementation manners
[0069] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0070] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0071] To facilitate the understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here first:
[0072] Live broadcast room: In a live broadcast service, each anchor will have a unique identifier, and viewers can enter the live viewing page of the anchor using the identifier.
[0073] Live broadcast quality level: Refers to the clarity level at which viewers watch a live broadcast, including: standard definition, high definition, ultra high definition, Blu-ray and other levels.
[0074] H.264: It is a digital video compression format.
[0075] H.265: It is also known as High Efficiency Video Coding (HEVC), and it is a standard for digital video coding. It provides a higher data compression ratio than H.264. It can provide a smaller file size under the same video quality, or a higher video quality under the same file size.
[0076] Content Delivery Network (CDN): It is a content delivery network built on a network. Relying on edge nodes deployed everywhere (i.e., intermediate servers closest to users), through functional modules such as load balancing, content distribution, and scheduling of the central scheduling server, users can obtain the required content nearby, reducing network congestion and improving the user access response speed and hit rate.
[0077] Bitrate: It is the amount of data transmitted per unit time for video or audio.
[0078] Resolution: It refers to the number of pixels per row or per column in a video image.
[0079] The design concept of the embodiments of the present application is briefly introduced below:
[0080] At present, with the development of computer technology and network technology, live streaming has been widely popularized and has gradually become an indispensable entertainment activity for the public. Live streaming refers to the viewing object receiving the live audio and video in real time at a remote end through the network, such as live events, conferences, teaching, surgeries, etc. Since video live streaming can reproduce the live audio and video at the remote end locally, the videos received by users have high real-time performance.
[0081] In live streaming, the host side can push the captured live video to the viewer side through the server, so that the viewers in the live streaming room can watch the host's live video. In order to reduce the occupied bandwidth and ensure the smoothness of playing the live video at the viewer side, the server needs to transcode the live video pushed by the host side and then push the transcoded live video to the viewer side.
[0082] In the related art, when transcoding a live video, if the number of viewers in the live streaming room at the current moment is large, the original stream of the live video is converted into a low-bitrate stream and pushed to the viewer side. If the number of viewers in the live streaming room at the current moment is low, the original stream of the live video is pushed to the viewer side.
[0083] However, since the attribute configurations of each viewer side are different and the video coding formats supported by each viewer side are different, if the live video is transcoded only based on the number of viewers, the transcoded live video may not be playable on the viewer side. For example, when the video coding format of the live video before transcoding is the H.265 standard, the video coding format of the transcoded live video is still the HEVC standard, and the transcoded live video cannot be played on a viewer side that only supports the H.264 standard, resulting in the failure of playing the transcoded live video.
[0084] In view of this, in the embodiments of the present application, a live video processing method, device, electronic device, and storage medium are provided. In response to a live viewing request from a downstream device, the number of viewers and video quality parameters of the corresponding target live streaming room at the current moment, as well as the downstream video coding format supported by the downstream device, are obtained. Then, based on the number of viewers, video quality parameters, and downstream video coding format, the target transcoding rule corresponding to the downstream device is determined. Finally, according to the target transcoding rule, the original video stream generated by the target live streaming room is transcoded to obtain the target video stream corresponding to the downstream device, and the target video stream is sent to the downstream device.
[0085] In this way, when determining the target transcoding rule, not only the number of viewers is considered, but also the video quality parameters and the downstream video coding format are considered, and the best target transcoding rule is comprehensively determined, improving the accuracy of live video transcoding, reducing the transcoding cost, and enabling the target video stream to be successfully played on different downstream devices.
[0086] The preferred embodiments of the present application will be described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only for the purpose of illustrating and explaining the present application, and are not used to limit the present application. And without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0087] Referring to Figure 1 As shown, it is a schematic diagram of a possible application scenario in an embodiment of the present application. In this application scenario diagram, it includes an upstream device 110, a server 120, multiple CDN servers 130, and a downstream device 140.
[0088] Among them, the upstream device 110 is a user terminal on the host side. The user terminal includes, but is not limited to, intelligent terminals with multimedia data processing functions (such as video data playback function, music data playback function, text data playback function) such as smart phones, tablet computers, laptop computers, desktop computers, smart TVs, smart speakers, desktop computers, smart watches, and smart vehicles. A target application can be installed on the user terminal. Among them, the target application can include applications with functions of displaying data information such as text, images, audio, and video. The application can be any application that may perform live broadcasts. For example, the application can be a social application, a live broadcast application, a short video application, and an online meeting application, etc. The application form can be application forms such as web pages, software, and applets. The embodiments of the present application do not limit this.
[0089] The server 120 is used to convert the original video stream provided by the upstream device into a target video stream. The server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0090] Multiple CDN servers 130 are used to distribute the target video stream to the downstream device. The multiple CDN servers 130 include a central node and several intermediate nodes.
[0091] The downstream device 140 is a user terminal on the viewer side, and is used to play the target video stream.
[0092] Next, in combination with the above-described application scenario, the live video processing method provided by the exemplary embodiment of the present application will be described with reference to the drawings. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard.
[0093] Referring toFigure 2 As shown in the figure, it is a flowchart of the implementation of a live video processing method provided by an embodiment of the present application. Here, the server is taken as an example of the execution entity for introduction. The specific implementation process of this method is as follows:
[0094] Step 20: In response to the live viewing request of the downstream device, obtain the number of viewers and video quality parameters of the corresponding target live room at the current moment, as well as the downstream video encoding format supported by the downstream device.
[0095] Among them, the video quality parameters at least include: upstream resolution, upstream bit rate, upstream video encoding format, etc. The downstream video encoding format supported by the downstream device can be multiple video encoding formats.
[0096] In the embodiment of the present application, when the downstream device is in the live broadcast hall or the target live room is browsed on the current interface, the server responds to the live viewing request of the downstream device and obtains the number of viewers and video quality parameters of the target live room at the current moment, as well as the downstream video encoding format supported by the downstream device.
[0097] For example, refer to Figure 3 As shown in the figure, it is a schematic diagram of responding to a live viewing request in an embodiment of the present application. The first case: preview mode, the target live room is displayed on the current interface of the downstream device A, and the server responds to the live viewing request of the downstream device A. The second case: preloading mode: the downstream device B enters the live broadcast hall, and the server responds to the live viewing request of the downstream device B.
[0098] In addition, it is worth noting that in the embodiment of the present application, since the number of people in the target live room is dynamically changing, the number of viewers of the target live room is refreshed in real time through the viewer entering and leaving the room message notification and the memory to obtain the number of viewers of the target live room at the current moment.
[0099] In the embodiment of the present application, when receiving the live broadcast start message of the target live room from the upstream device, the video quality parameters of the target live room are refreshed regularly. Since the live broadcast mode and network quality of the upstream device will change, the video quality parameters of the target live room will change, and it is necessary to obtain the real video quality parameters in real time.
[0100] For example, the live broadcast mode of the upstream device can be switched from portrait to landscape, and the network quality used by the upstream device can change from good to bad.
[0101] Step 21: Determine the target transcoding rule corresponding to the downstream device based on the number of viewers, video quality parameters, and downstream video encoding format.
[0102] Specifically, when executing step 21, the server specifically performs the following operations. Refer to Figure 4As shown, it is the first process schematic diagram for obtaining the target transcoding rule in the embodiment of the present application. The following will be described in detail with reference to the attached Figure 4 , the specific operations will be described in detail:
[0103] Step 210: Based on the video quality parameters, determine the respective candidate live streaming gears of each candidate transcoding rule corresponding to the downstream device.
[0104] Specifically, in the embodiment of the present application, based on the uplink resolution included in the video quality parameters and the preset candidate resolution conditions, determine the candidate live streaming gears included in each candidate transcoding rule.
[0105] Among them, each candidate live streaming gear corresponds to a candidate resolution, and each candidate resolution is not greater than the uplink resolution. The preset candidate resolution condition can be: the candidate resolution corresponding to the candidate live streaming gear is not greater than the uplink resolution.
[0106] In the embodiment of the present application, based on the uplink resolution included in the video quality parameters, determine the candidate resolutions that meet the candidate resolution conditions, and use the live streaming gears corresponding to the candidate resolutions as the candidate live streaming gears.
[0107] For example, assume the uplink resolution is 1080P, then determine the candidate live streaming gears as Blu-ray (1080P), Ultra HD (720P), High Definition (540P), and Standard Definition (360P).
[0108] Another example, assume the uplink resolution is 720P, then determine the candidate live streaming gears as Ultra HD (720P), High Definition (540P), and Standard Definition (360P).
[0109] In this way, since transcoding upward in terms of clarity is ineffective, it is ensured that each candidate resolution is not greater than the uplink resolution, avoiding ineffective upward transcoding and reducing the cost of upward transcoding.
[0110] Step 211: Based on the number of viewers, video quality parameters, downstream video coding format, and each candidate live streaming gear, determine the candidate video coding formats of each candidate transcoding rule.
[0111] Among them, a candidate transcoding rule is composed of a candidate live streaming gear and a candidate video coding format.
[0112] Specifically, when executing Step 211, the server specifically performs the following operations. Refer to Figure 5 As shown, it is the first process schematic diagram for obtaining each candidate video coding format in the embodiment of the present application. The following will be described in detail with reference to the attached Figure 5 , the specific operations will be described in detail:
[0113] Step 2110: Determine whether the downlink video encoding format includes the first video encoding format. If so, execute Step 2111; otherwise, execute Step 2114.
[0114] Step 2111: Determine whether the uplink video encoding format included in the video quality parameter is the second video encoding format. If so, execute Step 2112; otherwise, execute Step 2115.
[0115] Step 2112: Determine whether the number of viewers is greater than a preset number threshold. If so, execute Step 2113; otherwise, execute Step 2114.
[0116] Step 2113: Based on each candidate live gear, and in combination with the uplink bit rate included in the video quality parameter, determine the candidate video encoding format for each candidate transcoding rule.
[0117] In the embodiments of the present application, determine whether the downlink video encoding format includes the first video encoding format, whether the uplink video encoding format included in the video quality parameter is the second video encoding format, and whether the number of viewers is greater than a preset number threshold. When the downlink video encoding format includes the first video encoding format, the uplink video encoding format included in the video quality parameter is the second video encoding format, and the number of viewers is greater than the preset number threshold, based on each candidate live gear, and in combination with the uplink bit rate included in the video quality parameter, determine the candidate video encoding format for each candidate transcoding rule.
[0118] Among them, the data compression rate of the first video encoding format is greater than that of the second video encoding format. The first video encoding format may be H.265, and the second video encoding format may be H.264.
[0119] For example, refer to Figure 6 As shown, it is the first schematic diagram for determining the candidate video encoding format in the embodiments of the present application. Assume that the first video encoding format is H.265, the second video encoding format is H.264, the preset number threshold is 10000, the downlink video encoding format includes H.265 and H.264, the uplink video encoding format included in the video quality parameter is H.264, and the number of viewers is 20000. Then the downlink video encoding format includes the first video encoding format, the uplink video encoding format is the second video encoding format, and the number of viewers 20000 is greater than the number threshold 10000. Based on each candidate live gear, and in combination with the uplink bit rate included in the video quality parameter, determine the candidate video encoding format for each candidate transcoding rule.
[0120] Specifically, when executing Step 2113, for each candidate transcoding rule among the candidate transcoding rules, perform the following operations respectively. Refer to Figure 7As shown, it is a schematic diagram of the second process for obtaining each candidate video coding format in the embodiments of the present application. The following will combine with the attached Figure 7 , and elaborate on the specific operations performed:
[0121] Step 2113-1: Determine whether the uplink bitrate is less than the preset change bitrate threshold, and whether the candidate live gear of the candidate transcoding rule is a high candidate live gear. If so, execute Step 2113-2; otherwise, execute Step 2113-3.
[0122] Step 2113-2: Set the candidate video coding format of the candidate transcoding rule to the second video coding format.
[0123] Among them, the candidate resolution of the high candidate live gear meets the preset first resolution condition. The preset first resolution condition can be: the candidate resolution is the maximum resolution. For example, the candidate resolution is 1080P.
[0124] In the embodiments of the present application, it is determined whether the uplink bitrate included in the video quality parameter is less than the change bitrate threshold, and whether the candidate live gear of the candidate transcoding rule is the first live gear. When the uplink bitrate included in the video quality parameter is less than the change bitrate threshold and the candidate live gear of the candidate transcoding rule is the first live gear, set the candidate video coding format of the candidate transcoding rule to the second video coding format.
[0125] For example, referring to Figure 8 As shown, it is the second schematic diagram for determining the candidate video coding format in the embodiments of the present application. Assume that the second video coding format is H.264, the change bitrate threshold is 4M, the high candidate live gear is Blu-ray (1080P), the uplink bitrate included in the video quality parameter is 3M, and the candidate live gear of the candidate transcoding rule A is Blu-ray (1080P). Then the uplink bitrate of 3M is less than the change bitrate threshold of 4M, and the candidate live gear of the candidate transcoding rule A is a high candidate live gear. Set the candidate video coding format of the candidate transcoding rule A to H.264.
[0126] In this way, when the downstream device supports the first video coding format, the downstream device can parse the target video stream of the second video coding format. Since the uplink bitrate is less than the change bitrate threshold and the candidate live gear is Blu-ray, the uplink resolution is better. Therefore, the candidate video coding format of the candidate transcoding rule can be set to the second video coding format, which ensures the clarity of the target video stream while avoiding changes in the video coding format and saving transcoding costs.
[0127] Step 2113-3: Set the candidate video coding format to the first video coding format.
[0128] In the embodiment of the present application, it is determined whether the uplink bitrate included in the video quality parameter is less than the change bitrate threshold, and whether the candidate live gear of the candidate transcoding rule is a high candidate live gear. When the uplink bitrate is not less than the change bitrate threshold, or the candidate live gear is not a high candidate live gear, the candidate video coding format is set to the first video coding format.
[0129] For example, as Figure 8 shown, assuming that the first video coding format is H.265, the change bitrate threshold is 4M, and the uplink bitrate included in the video quality parameter is 5M, then the uplink bitrate of 5M is greater than the change bitrate threshold of 4M, and the candidate video coding format of candidate transcoding rule B is set to H.265.
[0130] Another example, as Figure 8 shown, assuming that the high candidate live gear is Blu-ray (1080P), and the candidate live gear of candidate transcoding rule C is HD (480P), then the candidate live gear of HD is not the high candidate live gear of Blu-ray, and the candidate video coding format of candidate transcoding rule C is set to H.265.
[0131] Step 2114: Set the candidate video coding format of each candidate transcoding rule to the second video coding format.
[0132] In the embodiment of the present application, it is determined whether the downlink video coding format includes the first video coding format. When the downlink video coding format does not include the first video coding format, the candidate video coding format of each candidate transcoding rule is set to the second video coding format.
[0133] For example, referring to Figure 9 shown, it is the third schematic diagram for determining the candidate video coding format in the embodiment of the present application. Assuming that the first video coding format is H.265 and the second video coding format is H.264, and the downlink video coding format includes H.264, then the downlink video coding format does not include the first video coding format, and the candidate video coding format of each candidate transcoding rule is set to H.264.
[0134] In this way, when the downlink device does not support the first video coding format, the candidate video coding format of each candidate transcoding rule is set to the second video coding format, avoiding the problem that the target video stream after transcoding cannot be played on the downlink device, improving the accuracy of transcoding, and thus improving the playback effect.
[0135] In an embodiment of the present application, it is determined whether the downlink video coding format includes a first video coding format, whether the uplink video coding format included in the video quality parameter is a second video coding format, and whether the number of viewers is greater than a preset number threshold. When the downlink video coding format includes the first video coding format, the uplink video coding format included in the video quality parameter is the second video coding format, and the number of viewers is not greater than the preset number threshold, the candidate video coding format of each candidate transcoding rule is set to the second video coding format.
[0136] For example, as Figure 9 shown, assume that the preset number threshold is 10,000, the first video coding format is H.265, the second video coding format is H.264, the downlink video coding format includes H.265, the uplink video coding format is H.264, and the number of viewers in the target live broadcast room is 1,000. Then the downlink video coding format includes the first video coding format, the uplink video coding format is the second video coding format, and the number of viewers 1,000 is less than the preset number threshold 10,000. The candidate video coding format of each candidate transcoding rule is set to H.264.
[0137] In this way, when the uplink device supports the first video coding format, the transcoded target video stream can be played on the downlink device. However, since the uplink video coding format is the second video coding format, in order to reduce the transcoding cost, the candidate video coding format of each candidate transcoding rule can be set to the second video coding format, avoiding the change of the video coding format and saving the transcoding cost.
[0138] Step 2115: Set the candidate video coding format of each candidate transcoding rule to the first video coding format.
[0139] In an embodiment of the present application, it is determined whether the downlink video coding format includes a first video coding format and whether the uplink video coding format included in the video quality parameter is a second video coding format. When the downlink video coding format includes the first video coding format and the uplink video coding format is the first video coding format, the candidate video coding format of each candidate transcoding rule is set to the first video coding format.
[0140] For example, as Figure 9 shown, assume that the first video coding format is H.265, the second video coding format is H.264, the downlink video coding format includes H.265 and H.264, and the uplink video coding format is H.265. Then the downlink video coding format includes the first video coding format, the uplink video coding format is the first video coding format, and the candidate video coding format of each candidate transcoding rule is set to H.265.
[0141] In this way, when both the upstream video coding format and the downstream video coding format support the first video coding format, the transcoded target video stream can be played on the downstream device. The candidate video coding format of each candidate transcoding rule can be directly set to the first video coding format, so that only the live gear of the original video stream needs to be changed without changing the video coding format, reducing the transcoding cost.
[0142] In the embodiments of the present application, considering the number of viewers, video quality parameters, and downstream video coding format comprehensively, the transcoding rules are determined. In various cases, the parameters of the candidate transcoding rules are shown in Table 1:
[0143] Table 1
[0144]
[0145]
[0146] Step 212: Based on the target live gear of the downstream device, select a target transcoding rule from each candidate transcoding rule.
[0147] Among them, the target live gear represents the live gear for the downstream device to enter the target live broadcast room.
[0148] Specifically, when executing Step 212, the server specifically performs the following operations. Refer to Figure 10 shown, which is the second process schematic diagram for obtaining the target transcoding rule in the embodiments of the present application. Below, in conjunction with the attached Figure 10 , the specific operations performed will be described in detail:
[0149] Step 2120: Determine whether the historical viewing information of the downstream device includes a historical live gear. If so, execute Step 2121; otherwise, execute Step 2122.
[0150] Step 2121: Use the historical live gear as the target live gear.
[0151] In the embodiments of the present application, it is determined whether the historical viewing information of the downstream device includes a historical live gear. If the historical viewing information of the downstream device includes a historical live gear, the historical live gear is used as the target live gear.
[0152] Among them, the historical viewing information is the historical information of the downstream device watching the live broadcast. Among them, the historical live gear can be the live gear used by the downstream device when watching the live broadcast last time, or the live gear commonly used by the downstream device when watching the live broadcast. The embodiments of the present application do not limit this.
[0153] For example, refer to Figure 11As shown in the figure, it is a schematic diagram of obtaining the target transcoding rule in the embodiment of the present application. Assume that the historical viewing information of the downstream device includes the historical live gear, and the historical live gear is the live gear used by the downstream device during the most recent live viewing. If the live gear used by the downstream device during the most recent live viewing is ultra high definition, then the ultra high definition is used as the target live gear.
[0154] For another example, as Figure 11 shown, assume that the historical live gear is the live gear commonly used by the downstream device during live viewing, and the live gear commonly used by the downstream device during live viewing is high definition, then the high definition is used as the target live gear.
[0155] In this way, according to the historical viewing information of the downstream device, the historical live gear is selected, and for the historical behavior of the viewing object, the target live gear suitable for the viewing object is selected, improving the viewing experience of the viewing object.
[0156] Step 2122: Use the general live gear as the target live gear.
[0157] Among them, the general live gear is: the playback quality of the transcoded video stream, the live gear that meets the quality conditions, and the quality conditions are higher clarity and smaller bit rate.
[0158] In the embodiment of the present application, it is judged whether the historical viewing information of the downstream device includes the historical live gear. If the historical viewing information of the downstream device is empty, then the general live gear is used as the target live gear.
[0159] For example, as Figure 11 shown, assume that the historical viewing information of the downstream device is empty and the general live gear is ultra high definition, then the ultra high definition is used as the target live gear.
[0160] Step 2123: From each candidate transcoding rule, screen out the target transcoding rule corresponding to the target live gear.
[0161] In the embodiment of the present application, after obtaining the target live gear, from each candidate transcoding rule, screen out the target transcoding rule whose candidate live gear is the target live gear.
[0162] For example, assume that the target live gear is ultra high definition, and the candidate live gears of each candidate transcoding rule are: blue ray, ultra high definition, high definition, and standard definition. Then, from each candidate transcoding rule, screen out the target transcoding rule whose candidate live gear is ultra high definition.
[0163] Step 22: Transcode the original video stream generated by the target live room according to the target transcoding rule to obtain the target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
[0164] In the embodiments of the present application, the original video stream generated by the target live broadcast room is transcoded according to the target live broadcast gear and the target video coding format of the target transcoding rule to obtain a target video stream, which is then sent to the downstream device.
[0165] Specifically, when obtaining the target video stream corresponding to the downstream device, the server specifically performs the following operations. Refer to Figure 12 shown in the figure, which is a schematic flowchart of obtaining the target video stream in the embodiments of the present application. The following combines the attached Figure 12 drawings to elaborate on the specific operations performed:
[0166] Step 220: Determine whether the target video coding format of the target transcoding rule is the same as the upstream video coding format, whether the target live broadcast gear of the target transcoding rule is the high target live broadcast gear, and whether the upstream bit rate included in the video quality parameter is less than the preset conversion bit rate threshold. If so, execute Step 221; otherwise, execute Step 222.
[0167] Step 221: Use the original video stream as the target video stream.
[0168] Among them, the target resolution of the high target live broadcast gear meets the preset second resolution condition. The preset second resolution condition can be: the target resolution is the maximum resolution. For example, the target resolution is 1080P.
[0169] In the embodiments of the present application, if the target video coding format of the target transcoding rule is the same as the upstream video coding format, the target live broadcast gear of the target transcoding rule is the high target live broadcast gear, and the upstream bit rate included in the video quality parameter is less than the conversion bit rate threshold, then use the original video stream as the target video stream.
[0170] For example, refer to Figure 13 shown in the figure, which is a schematic diagram of obtaining the target video stream in the embodiments of the present application. Assume that the upstream video coding format is H.264, the target video coding format of the target transcoding rule A is H.264, the target live broadcast gear of the target transcoding rule A is Blu-ray (1080P), the upstream bit rate included in the video quality parameter is 3M, and the conversion bit rate threshold is 4M. Then the target video coding format is the same as the upstream video coding format, the target live broadcast gear is the high target live broadcast gear, and the upstream bit rate of 3M is less than the conversion bit rate threshold of 4M. Use the original video stream as the target video stream.
[0171] In this way, under the above conditions, using the original video stream as the target video stream not only achieves the expected playback effect but also saves transcoding costs.
[0172] Step 222: Convert the original video stream into the target video stream corresponding to the target transcoding rule.
[0173] In the embodiments of the present application, if at least one of the following conditions is met, the original video stream is converted into a target video stream corresponding to the target transcoding rule.
[0174] Condition 1: The target video encoding format of the target transcoding rule is different from the upstream video encoding format.
[0175] Condition 2: The target live gear of the target transcoding rule is not the high target live gear.
[0176] Condition 3: The upstream bitrate is not less than the conversion bitrate threshold.
[0177] For example, assume that the upstream video encoding format is H.265 and the target video encoding format of the target transcoding rule B is H.264. Then, the target video encoding format of the target transcoding rule B is different from the upstream video encoding format, and the original video stream is converted into a target video stream corresponding to the target transcoding rule.
[0178] Another example, assume that the target live gear of the target transcoding rule C is high definition (540P). Then, the target live gear of the target transcoding rule C is not the high target live gear, and the original video stream is converted into a target video stream corresponding to the target transcoding rule.
[0179] Another example, assume that the upstream bitrate included in the video quality parameter is 5M and the conversion bitrate threshold is 4M. Then, the upstream bitrate of 5M is greater than the conversion bitrate threshold of 4M, and the original video stream is converted into a target video stream corresponding to the target transcoding rule.
[0180] In the embodiments of the present application, in various cases, the parameters of the target video stream are shown in Table 2:
[0181] Table 2
[0182]
[0183]
[0184] Specifically, when sending the target video stream to the downstream device, the server specifically performs the following operations. Refer to Figure 14 As shown, it is a schematic flow diagram of obtaining the process of sending the target video stream in the embodiments of the present application. The following combines the attached Figure 14 , and details the specific operations performed:
[0185] Step 223: Determine whether the heat value of the intermediate node corresponding to the downstream device is greater than the preset heat threshold. If so, execute Step 224; otherwise, execute Step 225.
[0186] Step 224: Forward the target video stream to the downstream device through the intermediate node.
[0187] Among them, the heat value characterizes the number of devices connecting to the target live broadcast room through intermediate nodes, where the intermediate nodes are nodes in the content delivery network whose distance from the downstream devices meets the preset distance condition.
[0188] In the embodiments of the present application, it is determined whether the heat value of the intermediate node corresponding to the downstream device is greater than a preset heat threshold. If the heat value of the intermediate node corresponding to the downstream device is greater than the preset heat threshold, the target video stream is forwarded to the downstream device through the intermediate node.
[0189] For example, refer to Figure 15 As shown, it is a schematic diagram of sending a target video stream in the embodiments of the present application. Assume that the main node in the content delivery network is node A, and each edge node includes: node B, node C, and node D. The main node distributes content to each edge node. The intermediate node corresponding to the downstream device B is node B, and the heat value of node B is 200. Then, the heat value 200 of node B is greater than the heat threshold 100, and the target video stream is forwarded to the downstream device B through node B.
[0190] Step 225: Forward the target video stream to the downstream device through the main node in the content delivery network.
[0191] Among them, the main node in the content delivery network is the source station.
[0192] In the embodiments of the present application, it is determined whether the heat value of the intermediate node corresponding to the downstream device is greater than a preset heat threshold. If the heat value of the intermediate node is not greater than the heat threshold, the target video stream is forwarded to the downstream device through the main node in the content delivery network.
[0193] For example, as Figure 15 shown, assume that the intermediate node corresponding to the downstream device C is node C, and the heat value of node C is 50. Then, the heat value 50 of node C is less than the heat threshold 100, and the target video stream is forwarded to the downstream device C through node A.
[0194] In this way, the video stream of the upstream device is divided into cold streams and hot streams according to the heat value; the video streams with high heat values are distributed, and the downstream devices access the nearby nodes to obtain the video stream, which can reduce latency, improve video quality, and also reduce the load on the source server. For the video streams with low heat values, the number of distribution nodes is reduced, and the downstream devices directly access the source station of the content delivery network to obtain the video stream, reducing the CDN bandwidth cost.
[0195] Further, after the downstream device plays the target video stream, when the viewing object watches in the target live broadcast room, a dynamic playback gear can be provided to the viewing object so that the viewing object can adjust the clarity of the live broadcast room through the switch button. Refer to Figure 16 shown, which is a schematic diagram of the process of updating the video stream in the embodiments of the present application. The following combines the appendixFigure 16 Describe in detail the operations to be specifically executed:
[0196] Step 1601: Send a gear display instruction to the downstream device.
[0197] Among them, the gear display instruction carries each candidate live gear corresponding to each candidate transcoding rule, and instructs the downstream device to display the gear options corresponding to each candidate live gear.
[0198] In the embodiment of the present application, when the downstream device is watching a live broadcast in the target live broadcast room, in response to the gear switching request of the downstream device, a gear display instruction is sent to the downstream device, and the gear options corresponding to each candidate live gear are displayed in the setting interface.
[0199] For example, refer to Figure 17 As shown, it is a schematic diagram of sending an updated video stream in the embodiment of the present application. Each candidate live gear is: Blu-ray (1080P), Ultra HD (720P), High Definition (540P). A gear display instruction is sent to the downstream device B, and the gear options corresponding to Blu-ray (1080P), Ultra HD (720P), and High Definition (540P) are displayed in the setting interface.
[0200] Step 1602: Receive the gear selection information sent by the downstream device, and determine the updated transcoding rule corresponding to the updated live gear selected by the downstream device according to the gear selection information.
[0201] Among them, the gear selection information includes: the updated live gear selected by the downstream device.
[0202] In the embodiment of the present application, after the viewing object selects a gear option, the downstream device sends the gear selection information to the server. The server receives the gear selection information sent by the downstream device, and according to the gear selection information, obtains the updated live gear selected by the downstream device, and filters out the updated transcoding rule whose candidate live gear is the updated live gear from each candidate transcoding rule.
[0203] For example, as Figure 17 shown, the gear option selected by the viewing object is Blu-ray. The gear selection information sent by the downstream device B to the server includes that the updated live gear is Blu-ray. The server filters out the updated transcoding rule whose candidate live gear is Blu-ray from each candidate transcoding rule.
[0204] Step 1603: Transcode the original video stream according to the updated transcoding rule to obtain the updated video stream corresponding to the updated live gear, and send the updated video stream to the downstream device.
[0205] In an embodiment of the present application, after obtaining the updated transcoding rule, transcoding the original video stream generated by the target live broadcast room according to the updated live broadcast gear and updated video coding format of the updated transcoding rule to obtain an updated video stream, and sending it to the downstream device.
[0206] For example, as Figure 17 shown, transcoding the original video stream generated by the target live broadcast room to obtain an updated video stream, and forwarding it to the downstream device B through the content delivery network.
[0207] Specifically, when obtaining the updated video stream, if the updated video coding format of the updated transcoding rule is the same as the upstream video coding format, and the updated live broadcast gear of the updated transcoding rule is the second live broadcast gear, and the upstream bit rate included in the video quality parameter is less than the second preset bit rate threshold, then the original video stream is used as the updated video stream. If at least one of the following conditions is met, the original video stream is converted into the updated video stream corresponding to the updated transcoding rule:
[0208] Condition 1: The updated video coding format of the updated transcoding rule is different from the upstream video coding format.
[0209] Condition 2: The updated live broadcast gear of the updated transcoding rule is not the second live broadcast gear.
[0210] Condition 3: The upstream bit rate is not less than the second preset bit rate threshold.
[0211] Specifically, when sending the updated video stream, if the heat value of the intermediate node corresponding to the downstream device is greater than the preset heat threshold, the updated video stream is forwarded to the downstream device through the intermediate node. If the heat value of the intermediate node is not greater than the heat threshold, the updated video stream is forwarded to the downstream device through the main node in the content delivery network.
[0212] Based on the same inventive concept as the above method embodiment, an embodiment of the present application further provides a live video processing device. Refer to Figure 18 shown, which is a schematic structural diagram of a live video processing device provided by an embodiment of the present application. The live video processing device 1800 includes:
[0213] An obtaining module 1801, configured to obtain the number of viewers and video quality parameters of the corresponding target live broadcast room at the current moment, and the downstream video coding format supported by the downstream device in response to the live viewing request of the downstream device;
[0214] A determining module 1802, configured to determine the target transcoding rule corresponding to the downstream device based on the number of viewers, video quality parameters, and downstream video coding format;
[0215] The transcoding module 1803 is used to transcode the original video stream generated by the target live broadcast room according to the target transcoding rule, obtain the target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
[0216] In a possible implementation manner, when determining the target transcoding rule corresponding to the downstream device based on the number of viewers, video quality parameters, and downstream video coding format, the determining module 1802 is further configured to:
[0217] Based on the video quality parameters, determine the candidate live broadcast gears corresponding to the respective candidate transcoding rules for the downstream device;
[0218] Based on the number of viewers, video quality parameters, downstream video coding format, and each candidate live broadcast gear, determine the candidate video coding formats corresponding to the respective candidate transcoding rules;
[0219] Based on the target live broadcast gear of the downstream device, select the target transcoding rule from the respective candidate transcoding rules, where the target live broadcast gear represents: the live broadcast gear for the downstream device to enter the target live broadcast room.
[0220] In a possible implementation manner, when determining the candidate live broadcast gears corresponding to the respective candidate transcoding rules for the downstream device based on the video quality parameters, the determining module 1802 is further configured to:
[0221] Based on the upstream resolution included in the video quality parameters and the preset candidate resolution conditions, determine the candidate live broadcast gears included in the respective candidate transcoding rules;
[0222] Wherein, each candidate live broadcast gear corresponds to a candidate resolution, and each candidate resolution is not greater than the upstream resolution.
[0223] In a possible implementation manner, when determining the candidate video coding formats corresponding to the respective candidate transcoding rules based on the number of viewers, video quality parameters, downstream video coding format, and each candidate live broadcast gear, the determining module 1802 is further configured to:
[0224] When the downstream video coding format includes the first video coding format, and the upstream video coding format included in the video quality parameters is the second video coding format, and the number of viewers is greater than the preset number threshold, respectively based on each candidate live broadcast gear, and in combination with the upstream bit rate included in the video quality parameters, determine the candidate video coding formats corresponding to the respective candidate transcoding rules;
[0225] Wherein, the data compression rate of the first video coding format is greater than that of the second video coding format.
[0226] In a possible implementation, when determining the candidate video coding format of each candidate transcoding rule based on each candidate live gear and combining the uplink bitrate included in the video quality parameter, the determining module 1802 is further configured to:
[0227] For each candidate transcoding rule among the candidate transcoding rules, perform the following operations respectively:
[0228] When the uplink bitrate is less than the preset change bitrate threshold and the candidate live gear of the candidate transcoding rule is the high candidate live gear, set the candidate video coding format of the candidate transcoding rule to the second video coding format, where the candidate resolution of the high candidate live gear meets the preset first resolution condition.
[0229] In a possible implementation, when determining the candidate video coding format of each candidate transcoding rule, the determining module 1802 is further configured to:
[0230] When the downlink video coding format does not include the first video coding format, set the candidate video coding format of each candidate transcoding rule to the second video coding format.
[0231] In a possible implementation, when selecting a target transcoding rule from the candidate transcoding rules based on the historical viewing information of the downlink device, the determining module 1802 is further configured to:
[0232] When the historical viewing information of the downlink device includes the historical live gear, use the historical live gear as the target live gear, and the historical viewing information is the historical information of the downlink device viewing the live broadcast;
[0233] Select the target transcoding rule corresponding to the target live gear from the candidate transcoding rules.
[0234] In a possible implementation, when transcoding the original video stream generated by the target live room according to the target transcoding rule to obtain the target video stream corresponding to the downlink device, the transcoding module 1803 is further configured to:
[0235] If the target video coding format of the target transcoding rule is the same as the uplink video coding format, the target live gear of the target transcoding rule is the high target live gear, and the uplink bitrate included in the video quality parameter is less than the preset conversion bitrate threshold, then use the original video stream as the target video stream, where the target resolution of the high target live gear meets the preset second resolution condition.
[0236] In a possible implementation, when sending the target video stream to the downlink device, the transcoding module 1803 is further configured to:
[0237] When the heat value of the intermediate node corresponding to the downstream device is greater than a preset heat threshold, forward the target video stream to the downstream device through the intermediate node, where the heat value represents the number of devices connecting to the target live broadcast room through the intermediate node, and the intermediate node is a node in the content distribution network whose distance from the downstream device satisfies a preset distance condition;
[0238] When the heat value of the intermediate node is not greater than the heat threshold, forward the target video stream to the downstream device through the main node in the content distribution network.
[0239] In a possible implementation, after sending the target video stream to the downstream device, the device further includes a gear shifting module 1804, and the gear shifting module 1804 is used for:
[0240] Send a gear display instruction to the downstream device, where the gear display instruction carries each candidate live gear corresponding to each candidate transcoding rule, and instructs the downstream device to display the gear options corresponding to each candidate live gear;
[0241] Receive the gear selection information sent by the downstream device, and determine the updated transcoding rule corresponding to the updated live gear selected by the downstream device according to the gear selection information;
[0242] Transcode the original video stream according to the updated transcoding rule to obtain the updated video stream corresponding to the updated live gear, and send the updated video stream to the downstream device.
[0243] Based on the same inventive concept as the above method embodiment, an embodiment of the present application also provides a computing device. In one embodiment, the computing device may be a server, such as Figure 1 the server 120 shown. In this embodiment, the structure of the computer device 1900 is as Figure 19 shown, and may at least include a memory 1901, a communication module 1903, and at least one processor 1902.
[0244] The memory 1901 is used to store the computer program executed by the processor 1902. The memory 1901 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and programs required to run the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0245] The memory 1901 can be a volatile memory, such as a random-access memory (RAM); the memory 1901 can also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or the memory 1901 is any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1901 can be a combination of the above memories.
[0246] The processor 1902 can include one or more central processing units (CPUs) or be a digital processing unit, etc. The processor 1902 is used to implement the above live video processing method when calling the computer program stored in the memory 1901.
[0247] The communication module 1903 is used to communicate with the terminal device and other servers.
[0248] In the embodiments of the present application, the specific connection medium between the above memory 1901, communication module 1903, and processor 1902 is not limited. In the embodiments of the present application Figure 19 it is described that the memory 1901 and the processor 1902 are connected through a bus 1904, and the bus 1904 is described with a thick line in Figure 19 The connection manners between other components are only for illustrative purposes and are not to be taken as limiting. The bus 1904 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of description, Figure 19 only a thick line is used to describe it in
[0249] The memory 1901 stores a computer storage medium, and the computer storage medium stores computer-executable instructions, and the computer-executable instructions are used to implement the live video processing method of the embodiments of the present application. The processor 1902 is used to execute the above live video processing method.
[0250] In another embodiment, the computing device can also be other computing devices, such as Figure 1 the uplink device 110 and the downlink device 140 shown. In this embodiment, the structure of the computing device can be as shown in Figure 20As shown, it includes components such as a communication component 2010, a memory 2020, a display unit 2030, a camera 2040, a sensor 2050, an audio circuit 2060, a Bluetooth module 2070, and a processor 2080.
[0251] The communication component 2010 is used to communicate with a server. In some embodiments, it may include a Wireless Fidelity (WiFi) module. The WiFi module belongs to short - range wireless transmission technology, and through the WiFi module, the electronic device can help the user send and receive information.
[0252] The memory 2020 can be used to store software programs and data. The processor 2080 executes various functions and data processing of the terminal by running the software programs or data stored in the memory 2020. The memory 2020 may include high - speed random - access memory, and may also include non - volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non - volatile solid - state storage devices. The memory 2020 stores an operating system that enables the terminal to run. In this application, the memory 2020 can store the operating system and various application programs, and can also store the computer program for implementing the live video processing method of the embodiments of this application.
[0253] The display unit 2030 can also be used to display the information input by the user or the information provided to the user, as well as the graphical user interface (GUI) of various menus of the terminal. Specifically, the display unit 2030 may include a display screen 2032 disposed on the front of the terminal. Among them, the display screen 2032 can be configured in the form of a liquid crystal display, a light - emitting diode, etc. The display unit 2030 can be used to display the live video interface, input interface, and setting interface in the embodiments of this application.
[0254] The display unit 2030 can also be used to receive input digital or character information, and generate signal inputs related to the user settings and function controls of the terminal. Specifically, the display unit 2030 may include a touch screen 2031 disposed on the front of the terminal, which can collect touch operations of the user on or near it, such as clicking buttons, dragging scroll boxes, etc.
[0255] Among them, the touch screen 2031 can cover the display screen 2032, or the touch screen 2031 and the display screen 2032 can be integrated to implement the input and output functions of the physical terminal. After integration, it can be simply called a touch display screen. In this application, the display unit 2030 can display application programs and corresponding operation steps.
[0256] The camera 2040 can be used to capture static images, and the object can publish the images captured by the camera 2040 through the application. There can be one or more cameras 2040. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal and then transmits the electrical signal to the processor 2080 to be converted into a digital image signal.
[0257] The physical terminal device may further include at least one sensor 2050, such as an acceleration sensor 2051, a distance sensor 2052, a fingerprint sensor 2053, and a temperature sensor 2054. The terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0258] The audio circuit 2060, the speaker 2061, and the microphone 2062 can provide an audio interface between the object and the terminal. The audio circuit 2060 can transmit the electrical signal converted from the received audio data to the speaker 2061, and the speaker 2061 converts it into a sound signal for output. The physical terminal may also be configured with volume buttons for adjusting the volume of the sound signal. On the other hand, the microphone 2062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 2060 and then converted into audio data. The audio data is then output to the communication component 2010 to be sent to, for example, another physical terminal, or the audio data is output to the memory 2020 for further processing.
[0259] The Bluetooth module 2070 is used to interact with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the physical terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 2070 to perform data interaction.
[0260] The processor 2080 is the control center of the physical terminal device, connecting various parts of the entire terminal using various interfaces and lines. By running or executing software programs stored in the memory 2020 and invoking data stored in the memory 2020, it performs various functions of the terminal device and processes data. In some embodiments, the processor 2080 may include one or more processing units; the processor 2080 may also integrate an application processor and a baseband processor, where the application processor mainly processes the operating system, user interface, application programs, etc., and the baseband processor mainly processes wireless communication. It can be understood that the above baseband processor may not be integrated into the processor 2080. In this application, the processor 2080 can run the operating system, application programs, user interface display and touch response, as well as the live video processing method of the embodiments of this application. Additionally, the processor 2080 is coupled to the display unit 2030.
[0261] In some possible implementation manners, various aspects of the live video processing method provided in this application can also be implemented in the form of a program product, which includes a computer program. When the program product runs on a computing device, the computer program is used to cause the computing device to execute the steps in the live video processing method according to various exemplary embodiments of this application described above in this specification.
[0262] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0263] The program product of the embodiments of this application can adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can run on an electronic device. However, the program product of this application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with a command execution system, apparatus, or device.
[0264] A readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0265] The computer program contained on the readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the above.
[0266] The computer program for performing the operations of this application can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The computer program can be executed entirely on the user's computer device, partially on the user's computer device, executed as a stand-alone software package, partially on the user's computer device and partially on a remote computer device, or entirely on the remote computer device. In the case of a remote computer device, the remote computer device can be connected to the user's computer device through any type of network including a local area network (LAN) or a wide area network (WAN), or, can be connected to an external computer device (e.g., by using an Internet service provider to connect through the Internet).
[0267] It should be noted that although several units or subunits of the apparatus are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more of the above-mentioned units can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0268] In addition, although the operations of the method of this application are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0269] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0270] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0271] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0272] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0273] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A live video processing method, characterized in that, Including: In response to a live viewing request of a downstream device, obtain the number of viewers and video quality parameters of a corresponding target live broadcast room at the current moment, as well as the downstream video coding format supported by the downstream device; Based on the number of viewers, the video quality parameters, and the downstream video coding format, determine a target transcoding rule corresponding to the downstream device; Transcode the original video stream generated by the target live broadcast room according to the target transcoding rule to obtain a target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
2. The method according to claim 1, wherein The determining the target transcoding rule corresponding to the downstream device based on the number of viewers, the video quality parameters, and the downstream video coding format includes: Based on the video quality parameters, determine the candidate live broadcast gears of each candidate transcoding rule corresponding to the downstream device; Based on the number of viewers, the video quality parameters, the downstream video coding format, and each candidate live broadcast gear, determine the candidate video coding formats of each candidate transcoding rule; Based on the target live broadcast gear of the downstream device, select a target transcoding rule from the candidate transcoding rules, where the target live broadcast gear represents the live broadcast gear for the downstream device to enter the target live broadcast room.
3. The method according to claim 2, characterized in that, The determining the candidate live broadcast gears of each candidate transcoding rule corresponding to the downstream device based on the video quality parameters includes: Based on the uplink resolution included in the video quality parameters and a preset candidate resolution condition, determine the candidate live broadcast gears included in each candidate transcoding rule; Wherein, each candidate live broadcast gear corresponds to a candidate resolution, and each candidate resolution is not greater than the uplink resolution.
4. The method according to claim 2, wherein The determining the candidate video coding formats of each candidate transcoding rule based on the number of viewers, the video quality parameters, the downstream video coding format, and each candidate live broadcast gear includes: When the downstream video coding format includes the first video coding format, the uplink video coding format included in the video quality parameters is the second video coding format, and the number of viewers is greater than a preset number threshold, respectively based on each candidate live broadcast gear, and in combination with the uplink bitrate included in the video quality parameters, determine the candidate video coding formats of each candidate transcoding rule; Wherein, the data compression rate of the first video coding format is greater than that of the second video coding format.
5. The method according to claim 4, wherein The respectively determining the candidate video coding formats of each candidate transcoding rule based on each candidate live broadcast gear and in combination with the uplink bitrate included in the video quality parameters includes: For each candidate transcoding rule among the candidate transcoding rules, respectively perform the following operations: When the uplink bitrate is less than a preset change bitrate threshold and the candidate live broadcast gear of the candidate transcoding rule is a high candidate live broadcast gear, set the candidate video coding format of the candidate transcoding rule to the second video coding format, where the candidate resolution of the high candidate live broadcast gear satisfies a preset first resolution condition.
6. The method according to claim 2, characterized in that, The determining the candidate video coding formats of each candidate transcoding rule further includes: When the downlink video coding format does not include the first video coding format, set the candidate video coding format of each candidate transcoding rule to the second video coding format.
7. The method according to claim 2, characterized in that Selecting a target transcoding rule from the candidate transcoding rules based on the historical viewing information of the downlink device includes: When the historical viewing information of the downlink device includes a historical live gear, use the historical live gear as the target live gear, where the historical viewing information is the historical information of the downlink device watching live broadcasts; Filter out the target transcoding rule corresponding to the target live gear from the candidate transcoding rules.
8. The method according to any one of claims 1 to 7, characterized in that, Transcoding the original video stream generated by the target live room according to the target transcoding rule to obtain the target video stream corresponding to the downlink device, including: If the target video coding format of the target transcoding rule is the same as the uplink video coding format, and the target live gear of the target transcoding rule is a high target live gear, and the uplink bitrate included in the video quality parameter is less than a preset conversion bitrate threshold, then use the original video stream as the target video stream, where the target resolution of the high target live gear meets the preset second resolution condition.
9. The method according to any one of claims 1-7, characterized in that, Sending the target video stream to the downlink device includes: When the heat value of the intermediate node corresponding to the downlink device is greater than a preset heat threshold, forward the target video stream to the downlink device through the intermediate node, where the heat value represents the number of devices connecting to the target live room through the intermediate node, and the intermediate node is a node in the content delivery network whose distance from the downlink device meets the preset distance condition; When the heat value of the intermediate node is not greater than the heat threshold, forward the target video stream to the downlink device through the main node in the content delivery network.
10. The method according to any one of claims 2-7, characterized in that, After sending the target video stream to the downlink device, it further includes: Sending a gear display instruction to the downlink device, where the gear display instruction carries the candidate live gears corresponding to the candidate transcoding rules, instructing the downlink device to display the gear options corresponding to the candidate live gears; Receiving the gear selection information sent by the downlink device, and determining the updated transcoding rule corresponding to the updated live gear selected by the downlink device according to the gear selection information; Transcoding the original video stream according to the updated transcoding rule to obtain the updated video stream corresponding to the updated live gear, and sending the updated video stream to the downlink device.
11. A live video processing device, characterized in that, Includes: An acquisition module for, in response to a live viewing request of a downlink device, acquiring the number of viewers and video quality parameters of a corresponding target live room at the current moment, as well as the downlink video coding format supported by the downlink device; A determination module for determining the target transcoding rule corresponding to the downlink device based on the number of viewers, the video quality parameters, and the downlink video coding format. A transcoding module, configured to transcode the original video stream generated by the target live broadcast room according to the target transcoding rule, obtain the target video stream corresponding to the downstream device, and send the target video stream to the downstream device.
12. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product, characterized in that, It includes a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.