Live broadcast data processing method, apparatus and device, and computer readable storage medium
By receiving the decoding capability information of the audience terminal and the number of viewers in the live broadcast room, it determines whether to perform encoding standard transcoding, which solves the problem of bandwidth resource waste in live broadcast technology, achieves efficient use of bandwidth and reduces transcoding costs.
Patent Information
- Application Number
- CN202310281573.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2024-09-24
AI Technical Summary
Existing live broadcast technology wastes bandwidth resources, especially in scenarios where it is difficult to identify areas of interest, and the bandwidth saving effect is limited.
By receiving the decoding capability information of the audience terminal, it is determined whether to perform transcoding processing according to the encoding standard, and based on the number of viewers in the live broadcast room, it is decided whether to send a transcoding request to the transcoding server to obtain a higher compression rate live data stream and reduce bandwidth usage. .
While ensuring the quality of live broadcast, it effectively saves bandwidth resources, improves bandwidth utilization, and reduces transcoding costs.
Smart Images

Figure CN118694989A
Abstract
Description
Technical Field
[0001] The present application relates to live broadcast technology, and in particular to a live broadcast data processing method, device, equipment and computer-readable storage medium. Background Art
[0002] With the development of streaming media technology and the widespread popularity of live streaming, live streaming has gradually entered people's lives as a popular form of entertainment. With the continuous development of the live streaming industry, the demand for bandwidth resources is also increasing. However, since the live streaming technologies currently available on the market all waste bandwidth resources, it is necessary to develop a live streaming technology that efficiently utilizes bandwidth resources. In related technologies, the bandwidth can be reduced by using video encoding technology for the area of interest, but for scenes where the area of interest is not easy to identify, the bandwidth saving effect is limited. Summary of the invention
[0003] The embodiments of the present application provide a live broadcast data processing method, device and computer-readable storage medium, which can save bandwidth resources while ensuring the quality of live broadcast.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a method for processing live broadcast data, the method comprising:
[0006] During the live broadcast process, receiving a stream pulling request sent by a viewer terminal, wherein the stream pulling request carries decoding capability information of the viewer terminal;
[0007] When it is determined based on the decoding capability information that the viewer terminal supports playing the live data stream corresponding to the first coding standard, and the live data stream corresponding to the current first stream pulling address is the second coding standard, obtaining the current number of viewers in the live broadcast room, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard;
[0008] In response to the number of viewers being greater than a preset number threshold, sending a first transcoding request to a transcoding server to request the transcoding server to perform transcoding processing on the current live broadcast data stream based on the first encoding standard to obtain a transcoded live broadcast data stream;
[0009] Obtain a second stream pulling address corresponding to the transcoded live broadcast data stream, and send the second stream pulling address to the viewer terminal.
[0010] The present application provides a live broadcast data processing device, including:
[0011] A first receiving module is used to receive a stream pulling request sent by a viewer terminal during a live broadcast, wherein the stream pulling request carries decoding capability information of the viewer terminal;
[0012] A first acquisition module is used to determine, based on the decoding capability information, that the audience terminal supports playing the live data stream corresponding to the first coding standard, and when the live data stream corresponding to the current first stream pulling address is the second coding standard, obtain the current number of viewers in the live broadcast room, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard;
[0013] A first sending module, configured to send a first transcoding request to a transcoding server in response to the number of viewers being greater than a preset number threshold, so as to request the transcoding server to perform transcoding processing on the current live data stream based on the first encoding standard to obtain a transcoded live data stream;
[0014] The second sending module is used to obtain a second stream pulling address corresponding to the transcoded live broadcast data stream, and send the second stream pulling address to the viewer terminal.
[0015] An embodiment of the present application provides an electronic device, the electronic device comprising:
[0016] A memory for storing computer executable instructions;
[0017] The processor is used to implement the live broadcast data processing method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0018] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for implementing the live broadcast data processing method provided in the embodiment of the present application when executed by a processor.
[0019] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the live broadcast data processing method provided in the embodiment of the present application is implemented.
[0020] The embodiments of the present application have the following beneficial effects:
[0021] During the live broadcast process, after receiving the stream pulling request sent by the audience terminal, it is determined based on the decoding capability information carried in the stream pulling request that the audience terminal supports the playback of the live data stream corresponding to the first encoding standard, and when the live data stream corresponding to the first stream pulling address is the second encoding standard, the current number of viewers in the live broadcast room is obtained, and the compression rate of the first encoding standard is greater than the compression rate of the second encoding standard. If the number of viewers is greater than the preset number threshold, a first transcoding request is sent to the transcoding server to request the transcoding server to transcode the current live data stream based on the first encoding standard to obtain the transcoded live data stream, and obtain the second stream pulling address corresponding to the transcoded live data stream, and finally send the second stream pulling address to the audience terminal. In this way, by counting the number of online viewers and controlling whether to transcode the live data stream, it is possible to reduce the playback bandwidth and improve the utilization rate of bandwidth resources, and also reduce the transcoding cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a schematic diagram of the network architecture of the live broadcast system provided in an embodiment of the present application;
[0023] Figure 2 It is a schematic diagram of the structure of the server provided in the embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of an implementation flow of the live broadcast data processing method provided in an embodiment of the present application;
[0025] Figure 4A This is another implementation flow diagram of the live broadcast data processing method provided in the embodiment of the present application;
[0026] Figure 4B It is a schematic diagram of an implementation flow of determining target coding information provided by an embodiment of the present application;
[0027] Figure 5A This is another implementation flow diagram of the live broadcast data processing method provided in the embodiment of the present application;
[0028] Figure 5B It is a schematic diagram of an implementation flow of determining a target coding standard provided in an embodiment of the present application;
[0029] Figure 6 is another network architecture diagram of the live broadcast system provided in an embodiment of the present application;
[0030] Figure 7 This is another implementation flow chart of the live broadcast data processing method provided in the embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0032] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0033] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0035] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0036] 1) Anchor, or anchor user, refers to a user who performs and shares performances in a live broadcast service.
[0037] 2) Live audience: the audience of the host user's performance in the live broadcast business.
[0038] 3) Live data stream: the video and audio collected by the anchor user are encoded into a code stream suitable for transmission in the network, which supports instant decoding and playback by the receiving end without having to wait for receiving all the data.
[0039] 4) Live broadcast room, corresponding to the anchor user, is an application in the live broadcast platform for the anchor user to publish different live broadcast services.
[0040] 5) Live broadcast service, which refers to the video and / or audio content performed by the anchor user in the live broadcast room. According to the business rules of the live broadcast platform, the live broadcast service is subject to restrictions in terms of time length, capacity, etc.
[0041] 6) Streaming: refers to the process of transmitting the packaged content in the acquisition stage to the server. It is the process of transmitting the audio and video signals on site to the network.
[0042] 7) Live streaming: The host uses a third-party streaming tool, such as a hardware encoder or OBS streaming software, and uploads content using the Real Time Messaging Protocol (RTMP) as the live source for live streaming.
[0043] 8) Streaming address: The uniform locator (URL, Uniform Resource Locator) used for streaming.
[0044] 9) Streaming address: The URL used for streaming.
[0045] The embodiments of the present application provide a live broadcast data processing method, apparatus, device, and computer-readable storage medium, which can solve the problems of poor bandwidth saving effect and high cost in related technologies. The following describes an exemplary application of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as a server. The following describes an exemplary application when the device is implemented as a server.
[0046] See also Figure 1 , Figure 1 A schematic diagram of the network architecture of the live broadcast processing system 100 provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the live broadcast processing system 100 includes an anchor terminal 200, an audience terminal 300, a live broadcast server 400, an audio and video server 500, and a transcoding server 600. When implemented, the anchor terminal 200 and the live broadcast server 400, the anchor terminal 200 and the audio and video server 500, the audience terminal 300 and the live broadcast server 400, the audience terminal 300 and the audio and video server 500, the audio and video server 500 and the live broadcast server 400, and the transcoding server 600 and the audio and video server 500 communicate with each other through a network ( Figure 1 A communication connection is established (not shown), and the network can be a wide area network or a local area network, or a combination of the two.
[0047] The anchor terminal 200 can make an appointment for live broadcasting through a live broadcasting App or an instant messaging App, a shopping App, etc., and after completing the live broadcasting appointment, the live broadcasting server will assign a live broadcasting ID and a push stream address and a pull stream address corresponding to the live broadcasting ID to the live broadcasting. After the live broadcasting starts, the anchor terminal 200 collects audio and video data and encodes the audio and video data to obtain an audio and video data stream, and then pushes the audio and video data stream to the audio and video server 500 through the push stream address. The anchor terminal 200 can share the live broadcasting card with other users through a session message. When the audience terminal 300 needs to watch the live broadcast corresponding to the anchor terminal, the live broadcast server 400 sends a stream pulling request to the live broadcast server 400. Based on the decoding capability information carried in the stream pulling request, the live broadcast server 400 determines that the audience terminal 300 supports the playback of the live broadcast data stream corresponding to the first coding standard, and when the live broadcast data stream corresponding to the first stream pulling address is the second coding standard, the current number of viewers in the live broadcast room is obtained. Here, the compression rate of the first coding standard is greater than the compression rate of the second coding standard, which means that the current live broadcast data stream can be transcoded to save bandwidth resources. At this time, the live broadcast server 400 obtains the number of viewers in the current live broadcast room. If the number of viewers is greater than the preset number threshold, the first transcoding request is sent to the transcoding server 600. After receiving the first transcoding request, the transcoding server 600 obtains the current live broadcast data stream from the audio and video server 500, and transcodes the current live broadcast data stream based on the first coding standard to obtain the transcoded live broadcast data stream. The transcoding server 600 sends the second streaming address corresponding to the transcoded live data stream to the live server 400, so that the live server 400 sends the second streaming address to the audience terminal 300, and the audience terminal 300 pulls the transcoded live data stream from the transcoding server 600 based on the second streaming address and plays it.
[0048] In some embodiments, if the audience terminal 300 only supports playing the current live data stream corresponding to the second coding standard, or the number of viewers does not reach the threshold, then after receiving the stream pull request from the audience terminal, the live broadcast server 400 sends the first stream pull address corresponding to the current live data stream to the audience terminal 300, and the audience terminal 300 pulls the live data stream from the audio and video server 500 based on the first stream pull address and plays it. In this way, by counting the number of online viewers and controlling whether to transcode the live data stream, it can not only reduce the playback bandwidth, improve the utilization rate of bandwidth resources, but also reduce the transcoding cost.
[0049] In some embodiments, the live broadcast server 400, the audio and video server 500, and the transcoding server 600 can be independent servers or the same server, for example, an independent physical server, a server cluster or a 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, CDN, and big data and artificial intelligence platforms. The live broadcast server 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiments of the present application.
[0050] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the live broadcast server 400 provided in an embodiment of the present application, Figure 2 The live broadcast server 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the live broadcast server 400 are coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .
[0051] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0052] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0053] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0054] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0055] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0056] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0057] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0058] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);
[0059] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.
[0060] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The live data processing device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a first receiving module 4551, a first obtaining module 4552, a first sending module 4553 and a second sending module 4554. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0061] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the live data processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0062] In some embodiments, the terminal or server can implement the live broadcast data processing method provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a live broadcast APP or an instant messaging APP; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.
[0063] The live broadcast data processing method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.
[0064] The following describes the live data processing method provided by the embodiment of the present application. As mentioned above, the electronic device implementing the live data processing method of the embodiment of the present application may be a server. Therefore, the execution subject of each step will not be repeatedly described below.
[0065] See also Figure 3 , Figure 3 is a flowchart of a live broadcast data processing method provided in an embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.
[0066] In step 101, during the live broadcast process, a stream pulling request sent by a viewer terminal is received.
[0067] The stream pull request carries the decoding capability information of the viewer terminal, and the decoding capability can ensure the image processing capability of the terminal when outputting the video stream locally. The decoding capability information includes all encoding standards that the viewer terminal can decode, and can also include only the highest encoding standard that the viewer terminal can decode. For example, when the viewer terminal can decode video streams encoded according to H.264 and can also decode video streams encoded according to H.265, the decoding capability information of the viewer terminal can be H.265.
[0068] In step 102, when it is determined based on the decoding capability information that the viewer terminal supports playing the live data stream corresponding to the first coding standard and the live data stream corresponding to the current first stream pulling address is the second coding standard, the current number of viewers in the live broadcast room is obtained.
[0069] Among them, the compression rate of the first coding standard is greater than the compression rate of the second coding standard. When the audience terminal supports playing the live data stream corresponding to the first coding standard, and the live data stream corresponding to the first streaming address is the second coding standard, it means that the audience terminal can decode the live video stream with a compression rate higher than the second coding standard. At this time, the live data stream corresponding to the first streaming address can be transcoded to obtain a live data stream with a higher compression rate, thereby reducing the occupancy of bandwidth resources. In an embodiment of the present application, in order to reduce the transcoding cost, when it is determined that the audience terminal can decode the live video stream with a compression rate higher than the second coding standard, the number of viewers in the current live broadcast room will be obtained first.
[0070] In step 103, in response to the number of viewers being greater than a preset number threshold, a first transcoding request is sent to a transcoding server to request the transcoding server to transcode the current live data stream based on the first encoding standard to obtain a transcoded live data stream.
[0071] In some embodiments, when the number of viewers is greater than a preset threshold, the live broadcast server sends a first transcoding request to the transcoding server, and the transcoding server responds to the first transcoding request, obtains the current live broadcast data stream corresponding to the first stream pull address, and transcodes the current live broadcast data stream based on the first encoding standard to obtain a transcoded live broadcast data stream. When the number of viewers is greater than the threshold, it means that the current live broadcast room is a popular live broadcast room with a large number of viewers. At this time, using the transcoding server to transcode the current live broadcast data stream can not only save bandwidth resources, but also reduce transcoding costs.
[0072] In step 104, a second stream pulling address corresponding to the transcoded live data stream is obtained, and the second stream pulling address is sent to the viewer terminal.
[0073] In some embodiments, after the transcoding server transcodes the current live data stream to obtain the transcoded live data stream, it will send the second stream pulling address corresponding to the transcoded live data stream to the live server. After the live server receives the second stream pulling address, it will send the second stream pulling address to the viewer terminal.
[0074] In some embodiments, the viewer terminal pulls the transcoded live data stream from the transcoding server based on the second stream pulling address, and decodes the pulled transcoded live data stream, thereby outputting the live video using its own display device.
[0075] In the live data processing method provided in the embodiment of the present application, after the live server receives a stream pulling request sent by an audience terminal during the live broadcast process, it determines based on the decoding capability information carried in the stream pulling request that the audience terminal supports the playback of the live data stream corresponding to the first coding standard, and when the live data stream corresponding to the first stream pulling address is the second coding standard, the current number of viewers in the live broadcast room is obtained, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard. If the number of viewers is greater than a preset number threshold, a first transcoding request is sent to the transcoding server to request the transcoding server to transcode the current live data stream based on the first coding standard to obtain the transcoded live data stream, and obtain the second stream pulling address corresponding to the transcoded live data stream, and finally send the second stream pulling address to the audience terminal. In this way, by counting the number of online viewers and controlling whether to transcode the live data stream, not only can the playback bandwidth be reduced and the utilization rate of bandwidth resources be improved, but also the transcoding cost can be reduced.
[0076] Based on the above embodiments, the present application further provides a live broadcast data processing method, which is applied to Figure 1 The network architecture shown, Figure 4A This is another implementation flow diagram of the live broadcast data processing method provided in the embodiment of the present application. Figure 4A The live broadcast data processing fee method provided in the embodiment of the present application is described.
[0077] In step 201, the anchor terminal obtains live broadcast parameters based on the received live broadcast setting operation.
[0078] Among them, the live broadcast setting operation may include the operation of setting the live broadcast type and live broadcast time, and the live broadcast parameters may include the live broadcast type, live broadcast time, live broadcast identification, etc. The live broadcast type and live broadcast time can be obtained through the live broadcast setting operation, and the live broadcast identification can be applied to the live broadcast server when scheduling a live broadcast or starting a live broadcast.
[0079] In step 202, the anchor terminal sends a live broadcast room creation request to the live broadcast server in response to the received live broadcast room creation operation.
[0080] The live broadcast room creation request includes live broadcast parameters.
[0081] In step 203, the live broadcast server responds to the live broadcast room creation request and creates a live broadcast room corresponding to the anchor terminal based on the live broadcast parameters.
[0082] In step 204, the live broadcast server determines the streaming address corresponding to the live broadcast room.
[0083] In some embodiments, if the live broadcast server has an address allocation function, then when step 204 is implemented, the live broadcast server allocates a push stream address and a pull stream address for the live broadcast identifier through the address allocation function. If the live broadcast server does not have an address allocation function but the audio and video server has an address allocation function, when step 204 is implemented, the live broadcast server sends an address acquisition request to the audio and video server, and the audio and video server allocates a push stream address and a pull stream address for the live broadcast identifier, and returns the push stream address and the pull stream address to the live broadcast server, and at this time the live broadcast server also obtains the push stream address and the pull stream address of the live broadcast identifier.
[0084] In step 205, the live streaming server sends the streaming address to the anchor terminal.
[0085] In some embodiments, the live broadcast server may also send the stream pulling address to the anchor terminal, so that after starting the live broadcast, the anchor terminal may use the stream pulling address to pull the live broadcast data stream from the audio and video server and play it.
[0086] In step 206, the anchor terminal collects audio and video data in response to the operation instruction to start live broadcast.
[0087] In some embodiments, the anchor terminal responds to an operation instruction to start live broadcasting by starting an image acquisition device and a voice acquisition device to collect audio and video data.
[0088] In step 207, the anchor terminal uploads the live data stream to the audio and video server based on the streaming address.
[0089] In some embodiments, after collecting the audio and video data, the anchor terminal encodes the collected audio and video data to obtain a live data stream, and pushes the live data stream to the audio and video server through the push stream address.
[0090] In step 208, the live broadcast server obtains the first network status information of the anchor terminal.
[0091] The first network status information includes the first delay information and the first packet loss rate. In some embodiments, the anchor terminal may report the first network status information to the live broadcast server in real time, or the anchor terminal may report the first network status information to the live broadcast server at a certain interval; in addition, the live broadcast server may send a notification message of obtaining the network status information to the anchor terminal, and the anchor terminal may report the first network status information after receiving the notification message.
[0092] In step 209, the live broadcast server predicts the first bandwidth information of the anchor terminal based on the first network status information.
[0093] In the process of video transmission, network bandwidth is an important consideration for the sender when sending data. Network bandwidth refers to the amount of data that can be transmitted per unit time (generally 1 second). In some embodiments, when predicting the first bandwidth information of the anchor terminal based on the first network status information, the first delay information and the first packet loss rate can be predicted and processed using a trained bandwidth prediction model to obtain the first bandwidth information of the anchor terminal. In some embodiments, the correspondence between the packet loss rate, delay and bandwidth can also be obtained; based on the correspondence, the first bandwidth information corresponding to the first packet loss rate and the first delay information can be determined; and the congestion control algorithm can also be used to determine the first bandwidth information based on the first packet loss rate and the first delay information.
[0094] In step 210, the live broadcast server determines the target encoding information of the anchor terminal in response to the first bandwidth information being smaller than the transmission bandwidth required for the live broadcast data stream.
[0095] In some embodiments, step 210 has at least the following two implementations, which are described below respectively.
[0096] The first implementation method is to determine the target encoding information based on the live broadcast type of the anchor terminal, see Figure 4B Step 210 can be implemented through the following steps 2101 to 2104, which are described in detail below.
[0097] In step 2101, the live broadcast type corresponding to the anchor terminal is obtained.
[0098] The live broadcast type may include shopping live broadcast, performance live broadcast, chat live broadcast, etc.
[0099] In step 2102, based on the live broadcast type, the adjustable encoding parameters corresponding to the anchor terminal are determined.
[0100] The adjustable encoding parameters include at least one of the video bit rate, video frame rate and video resolution. Video bit rate refers to the data flow used by a video file per unit time, also called bit stream or bit stream rate, which is the most important part of picture quality control in video encoding. Generally speaking, at the same resolution, the larger the bit stream of a video file, the smaller the compression ratio and the higher the picture quality. The larger the bit stream, the larger the sampling rate per unit time, the higher the data flow, the higher the accuracy, the closer the processed file is to the original file, the better the image quality, the clearer the picture quality, and the higher the decoding capability of the playback device. The frame rate is the number of frames of the picture transmitted in 1 second, or the number of pictures that can be displayed in 1 second, usually expressed in fps (Frames Per Second). Each frame is a static image, and the rapid and continuous display of frames creates the illusion of motion. A high frame rate can obtain smoother and more realistic animations. The more frames per second (fps), the smoother the displayed action will be. Generally, most video frame rates are around 25fps. Video resolution refers to the size or dimension of the image formed by a video imaging product.
[0101] Different live broadcast types have different requirements for live broadcast picture quality. For example, for shopping live broadcasts, in order to allow users to see the actual situation of the objects for sale more clearly, the requirements for live broadcast picture quality will be higher than the requirements for chat live broadcasts or performance live broadcasts. In some embodiments, adjustable encoding parameters corresponding to different live broadcast types can be pre-set according to the requirements of different live broadcast types for live broadcast picture quality. Exemplarily, for example, for shopping live broadcasts, the adjustable encoding parameters may include video bit rate and video frame rate. For chat live broadcasts or performance live broadcasts, the adjustable encoding parameters may include video resolution and video bit rate.
[0102] In step 2103, a target value of the adjustable coding parameter is determined based on the first bandwidth information.
[0103] In some embodiments, since both the video bit rate and the bandwidth represent the data transmission rate, the unit of the video bit rate is generally Kbps, and the unit of the bandwidth is generally Mbps. If the adjustable encoding parameters include the video bit rate, the first bandwidth information is first converted to Kbps to obtain the target value of the video bit rate. The general video frame rates include: 24fps, 25fps, 30fps, 48fps, 50fps, 60fps. When the adjustable encoding parameters include the video frame rate, one of the commonly used video frame rates can be selected based on the first bandwidth information as the target value of the video frame rate. For example, in order to reduce the size of the video file, the minimum value of 24fps can be taken. When the adjustable encoding parameters include the video resolution, after determining the video frame rate and the video bit rate, the target value of the video resolution can be determined based on the first bandwidth information.
[0104] In step 2104, the adjustable coding parameter, the target value of the adjustable parameter, other coding parameters except the adjustable coding parameter, and the current value of the other coding parameters are determined as the target coding information.
[0105] In a second implementation, the target coding information is determined based on a first mapping relationship table between bandwidth information and coding parameters. In the implementation, the first mapping relationship table between bandwidth information and coding information is first obtained, and then the target coding information corresponding to the first bandwidth information is determined based on the first mapping relationship table. The target coding information includes target values corresponding to the video bit rate, the video frame rate, and the video resolution.
[0106] In some embodiments, the first mapping relationship table includes recommended values of video bit rate, video frame rate and video resolution corresponding to different bandwidth information. Therefore, after obtaining the first bandwidth information, the target values of the video bit rate, video frame rate and video resolution corresponding to the first bandwidth information can be determined by querying the first mapping relationship table.
[0107] Continue to see Figure 4A , and the description continues with step 210 above.
[0108] In step 211, the live broadcast server sends the target coding information to the anchor terminal.
[0109] In step 212, the anchor terminal encodes the collected audio and video data based on the target encoding information to obtain a live data stream to be transmitted.
[0110] In some embodiments, the anchor terminal encodes the collected audio and video data based on the target encoding information, and the obtained live data stream can be guaranteed to be less than or equal to the first bandwidth information, thereby realizing adaptive adjustment of the bandwidth based on the network status reported by the anchor terminal.
[0111] In step 213, the anchor terminal uploads the live data stream to be transmitted to the audio and video server based on the streaming address.
[0112] In the live data processing method provided in the embodiment of the present application, after the anchor terminal sends a live room creation request to the live server, the live server responds to the live room creation request, creates a live room for the anchor terminal based on the live parameters sent by the anchor terminal, and sends a push stream address and a pull stream address to the live terminal. After starting the live broadcast, the anchor terminal collects audio and video data, and sends the live data stream corresponding to the audio and video data to the audio and video server based on the push stream address, so that the audience terminal pulls the live data stream from the audio and video server to watch the live broadcast. During the live broadcast process, the live server detects the first network status information of the anchor terminal, and when the first bandwidth information predicted based on the first network status information is less than the transmission bandwidth, the target encoding information is determined based on the first bandwidth information, and the target encoding information is sent to the anchor terminal, so that the anchor terminal can encode the collected audio and video data based on the target encoding information, so that the transmission bandwidth of the live data stream to be transmitted obtained by using the target encoding information can be less than or equal to the first bandwidth information, and the adaptive adjustment of the bandwidth based on the network status reported by the anchor terminal is realized, while saving bandwidth, the smoothness of the live broadcast and the quality of the live broadcast picture can be guaranteed.
[0113] Based on the above embodiments, the present application further provides a live broadcast data processing method, which is applied to Figure 1 The network architecture shown, Figure 5A A schematic diagram of another implementation flow of the live broadcast data processing method provided in the embodiment of the present application is shown below in combination with Figure 5A Provide explanation.
[0114] In step 301, the anchor terminal sends a live broadcast room creation request to the live broadcast server in response to the received live broadcast room creation operation.
[0115] The live broadcast room creation request includes live broadcast parameters. The live broadcast parameters may include live broadcast type, live broadcast time, live broadcast identifier, etc. The live broadcast type and live broadcast time can be obtained through the live broadcast setting operation, and the live broadcast identifier can be applied to the live broadcast server when reserving a live broadcast or starting a live broadcast.
[0116] In step 302, the live broadcast server responds to the live broadcast room creation request and creates a live broadcast room corresponding to the anchor terminal based on the live broadcast parameters.
[0117] In step 303, the live broadcast server determines the streaming address corresponding to the live broadcast room, and sends the streaming address to the anchor terminal.
[0118] In step 304, the anchor terminal uploads the collected live data stream to the audio and video server based on the streaming address.
[0119] It should be noted that the implementation process of the above steps 301 to 304 is similar to the implementation process of steps 201 to 207 in other embodiments, and the implementation process of steps 301 to 304 may refer to the implementation process of steps 201 to 207 when implementing steps 301 to 304.
[0120] In step 305, the viewer terminal sends a stream pull request to the live broadcast server.
[0121] In some embodiments, when the viewer terminal wants to enter the live broadcast room corresponding to the anchor terminal to watch the live broadcast, it will send a stream pull request to the live broadcast server to request to enter the live broadcast room and pull the live broadcast data stream to watch the live broadcast. The stream pull request carries the decoding capability information of the viewer terminal.
[0122] In step 306, the live broadcast server determines, based on the decoding capability information, whether the second encoding standard of the live broadcast data stream corresponding to the first stream pull address is lower than the first encoding standard supported by the viewer terminal for playback.
[0123] Among them, the compression rate of the first encoding standard is greater than the compression rate of the second encoding standard; when the second encoding standard of the live data stream corresponding to the first streaming address is lower than the first encoding standard supported by the audience terminal, it means that the audience terminal supports the playback of live data streams with higher compression rates and can perform transcoding processing, and the process goes to step 307; if the compression rate of the second encoding standard is not lower than the compression rate of the first encoding standard, it means that transcoding processing is not required at this time, and the process goes to step 322.
[0124] In step 307, the live broadcast server determines whether the current number of viewers in the live broadcast room is greater than the number threshold.
[0125] Among them, when the number of viewers is greater than the number threshold, it means that the live broadcast room is a popular live broadcast room, and step 308 is entered at this time; when the number of viewers is less than or equal to the number threshold, it means that the live broadcast room is not a popular live broadcast room, and step 314 is entered at this time.
[0126] In step 308, the live broadcast server sends a first transcoding request to the transcoding server.
[0127] In some embodiments, the first transcoding request may carry a first coding standard and a first streaming address, and is used to request the transcoding server to pull the current live data stream based on the first streaming address and transcode the current live data stream based on the first coding standard.
[0128] In step 309, the transcoding server obtains the current live data stream from the audio and video server.
[0129] In some embodiments, after receiving the first transcoding request, the transcoding server parses the first transcoding request, obtains the first encoding standard and the first streaming address, and then pulls the current live data stream from the audio and video server based on the first streaming address.
[0130] In step 310, the transcoding server transcodes the current live data stream based on the first coding standard to obtain a transcoded live data stream.
[0131] Video transcoding refers to converting a compressed and encoded video stream into another video stream to adapt to different network bandwidths, different terminal processing capabilities, and different user needs. The transcoding process is essentially a process of decoding first and then encoding, so the streams before and after the conversion may or may not follow the same video coding standard. In an embodiment of the present application, the coding standards of the live data streams before and after transcoding are different. In some embodiments, after acquiring the current live data stream, the transcoding server first decodes the current live data stream to obtain decoded audio and video data, and then encodes the decoded audio and video data according to the first coding standard to obtain a transcoded live data stream.
[0132] In step 311, the transcoding server sends the second stream pulling address corresponding to the transcoded live broadcast data stream to the live broadcast server.
[0133] In step 312, the live streaming server sends the second streaming address to the viewer terminal.
[0134] In step 313, the viewer terminal obtains the live data stream from the transcoding server based on the second stream pulling address and plays it.
[0135] In step 314, the live broadcast server obtains the second network status information of the viewer terminal.
[0136] The second network status information at least includes the second packet loss rate and the second delay information. In some embodiments, the viewer terminal may report the second network status information to the live broadcast server in real time, or the viewer terminal may report the second network status information to the live broadcast server at a certain interval; in addition, the live broadcast server may send a notification message of obtaining the network status information to the viewer terminal, and the viewer terminal may report the second network status information after receiving the notification message.
[0137] In step 315, the live broadcast server predicts the second bandwidth information of the viewer terminal based on the second network status information.
[0138] In some embodiments, a correspondence between packet loss rate, delay and bandwidth can be established in advance through multiple experiments; based on the correspondence, the corresponding second bandwidth information can be determined on the premise that the second packet loss rate and the second delay information are known; and a congestion control algorithm can be used to determine the second bandwidth information based on the second packet loss rate and the second delay information.
[0139] In some embodiments, the trained bandwidth prediction model may be used to predict the second delay information and the second packet loss rate to obtain the second bandwidth information of the viewer terminal.
[0140] In step 316, the live streaming server determines whether the second bandwidth information is smaller than the transmission bandwidth required by the live streaming data stream corresponding to the first streaming address.
[0141] Among them, when the second bandwidth information is less than the transmission bandwidth required for the live data stream corresponding to the first streaming address, enter step 317; when the second bandwidth information is greater than or equal to the transmission bandwidth required for the live data stream corresponding to the first streaming address, enter step 322.
[0142] In step 317, the live broadcast server determines the target encoding standard based on the decoding capability information of the viewer terminal and the second bandwidth information.
[0143] In some embodiments, see Figure 5B Step 317 can be implemented by steps 3171 to 3173 as follows: Figure 5B Provide explanation.
[0144] In step 3171, a candidate coding standard corresponding to the second bandwidth information is determined.
[0145] In some embodiments, the current encoding standard of the live data stream to be transmitted can be first obtained, and reference bandwidth information corresponding to other encoding standards with compression rates higher than the current encoding standard can be determined, and other standards with reference bandwidth information less than or equal to the second bandwidth information can be determined as candidate encoding standards corresponding to the second bandwidth information.
[0146] In step 3172, based on the decoding capability information of the viewer terminal, the highest encoding standard that the viewer terminal can support for playing the video is determined.
[0147] In some embodiments, the decoding capability information includes the highest encoding standard that the viewer terminal can support for playing videos. Exemplarily, the highest encoding standard that the viewer terminal can support for playing videos is h.265.
[0148] In step 3173, a target coding standard is determined based on the candidate coding standards and the highest coding standard.
[0149] In some embodiments, the highest candidate coding standard is first determined from at least one candidate coding standard. If the highest candidate coding standard in the candidate coding standard is higher than the highest coding standard that the viewer terminal can support, then the highest coding standard supported by the viewer terminal is determined as the target coding standard. If the highest candidate coding standard is the same as the highest coding standard that the viewer terminal can support, then the highest coding standard supported by the viewer terminal can be determined as the target coding standard, or the second highest candidate coding standard in the candidate coding standard can be determined as the target coding standard. Exemplarily, the candidate coding standards are h.264 and h.265, and the highest coding standard that the viewer terminal can support is h.264. Then, in order to ensure that the transcoded live data stream can be played normally on the viewer terminal, the highest coding standard that the viewer terminal can support, that is, h.264, is determined as the target coding standard. If the candidate coding standards are h.264 and h.265, and the highest coding standard that the viewer terminal can support is h.265, then the highest coding standard that the viewer terminal can support, that is, h.265, can be determined as the target coding standard, or the second highest candidate coding standard, that is, h.264, can be determined as the target coding standard. Determining the second highest candidate encoding standard as the target encoding standard can reduce the transcoding complexity while ensuring that the transmission bandwidth of the live data stream after transcoding is less than or equal to the second bandwidth information.
[0150] In step 318, the live broadcast server sends a second transcoding request to the transcoding server.
[0151] The second transcoding request carries the target coding standard. In some embodiments, the second transcoding request also carries the first streaming address.
[0152] In step 319, the transcoding server transcodes the live data stream to be transmitted based on the target coding standard to obtain a transcoded live data stream.
[0153] In some embodiments, after receiving the second transcoding request, the transcoding server parses the second transcoding request, obtains the target coding standard and the first streaming address, and thereby pulls the live data stream to be transmitted from the audio and video server based on the first streaming address, and transcodes the live data stream to be transmitted according to the target coding standard to obtain the transcoded live data stream.
[0154] In step 320, the transcoding server sends the third stream pulling address corresponding to the transcoded live broadcast data stream to the live broadcast server.
[0155] In step 321, the live streaming server sends the third streaming address to the viewer terminal.
[0156] In step 322, the viewer terminal obtains the transcoded live data stream from the transcoding server based on the third stream pulling address and plays it.
[0157] In step 322, the live streaming server sends the first streaming address to the viewer terminal.
[0158] In step 323, the viewer terminal obtains the live data stream from the audio and video server based on the first stream pulling address and plays it.
[0159] In the live data processing method provided in the embodiment of the present application, after the anchor terminal sends a live room creation request to the live server, the live server responds to the live room creation request, creates a live room for the anchor terminal based on the live parameters sent by the anchor terminal, and sends a push stream address and a pull stream address to the live terminal, so that the anchor terminal sends the live data stream to the audio and video server based on the push stream address; when the audience terminal wants to watch the live broadcast, it sends a pull stream request to the live server, and the live server determines that the audience terminal supports playing the live data stream corresponding to the first encoding standard based on the decoding capability information carried in the pull stream request, and the first pull stream address is used to generate a live data stream corresponding to the first encoding standard. When the live data stream corresponding to the stream address is of the second encoding standard, the current number of viewers in the live room is obtained. If the number of viewers is greater than the preset threshold, it means that the live room is a popular room. In order to save bandwidth, a first transcoding request is sent to the transcoding server to request the transcoding server to transcode the current live data stream based on the first encoding standard to obtain the transcoded live data stream. The audience terminal pulls the transcoded live data stream to watch the live broadcast. In this way, by counting the number of online viewers and controlling whether to transcode the live data stream, not only can the playback bandwidth be reduced and the utilization rate of bandwidth resources be improved, but also the transcoding cost can be reduced. In addition, if the number of viewers in the live broadcast room reaches the threshold, but the audience terminal supports playing live data streams with higher compression rates, the live broadcast server will request the transcoding server to transcode the live data stream based on the network status information of the audience terminal and send the third stream pulling address corresponding to the transcoded live data stream to the audience terminal, so that the audience terminal can pull the transcoded live data stream from the transcoding server based on the third stream pulling address. Since the transcoded live data stream has a higher compression rate, it can transmit higher quality live data streams under limited bandwidth, thereby ensuring the smoothness of the live broadcast for the audience terminal; in addition, if the number of viewers does not reach the threshold, or the audience terminal does not support playing live data streams with higher bit rates, the live data stream that supports playback will be provided to the audience terminal, thereby improving compatibility and product coverage.
[0160] The following is an explanation of an exemplary application of an embodiment of the present application in a practical application scenario.
[0161] The live broadcast data method provided in the embodiment of the present application can be applied to enterprise-level live broadcast apps, personal-level live broadcast apps, and instant messaging apps with live broadcast functions, which can be enterprise instant messaging apps or personal instant messaging apps. The anchor can initiate a live broadcast through a computer or mobile phone with a live broadcast app installed, and the audience can access and watch through a computer client or mobile phone client. The live broadcast data method provided in the embodiment of the present application can be applied to any type of live broadcast app and has strong versatility.
[0162] Figure 6 is another network architecture diagram of the live broadcast system provided in the embodiment of the present application, such as Figure 6 As shown, the network architecture includes: a host client 601, a viewer client 602-1, a viewer terminal 602-2 and a viewer terminal 602-3, a QoS server 603, an RTMP server 604, a room management server 605 and a transcoding server 606, wherein:
[0163] The host client 601 is used to initiate live streaming, and the audience client 602-1, audience terminal 602-2 and audience terminal 602-3 are used to pull live data streams to watch live broadcasts. The QoS server 603 is used to receive the network status reported by the host client and perform adaptive bandwidth adjustment, and determine whether transcoding is required based on the network status reported by the audience client; the RTMP server 604 is used to receive the live data stream pushed by the host client and generate audio and video playback formats. The audience client can pull the stream from the RTMP server 604 for playback, and the transcoding server pulls the stream from the RTMP server 604 for transcoding; the room management server 605 is used to manage the live room, and is used to control the distribution of signaling such as the host creating a room, the audience entering and exiting the room, connecting microphones, and personnel synchronization; the transcoding server 606 is used to pull the live data stream from the RTMP server 604 and transcode the live data stream. Exemplarily, the h.264 code stream can be transcoded into the h.265 code stream in real time.
[0164] The present invention provides a method for processing live broadcast data. Figure 6 The network architecture shown, Figure 7 This is another implementation flow diagram of the live broadcast data processing method provided in the embodiment of the present application. Figure 7 The live broadcast data processing method provided in the embodiment of the present application is described.
[0165] In step 701, the anchor client sends a request to create a room to the room management server.
[0166] In step 702, the room management server sends the streaming address to the anchor client.
[0167] In some embodiments, after receiving a room creation request sent by a host client, the room management server creates a live broadcast room for the host client and obtains a streaming address, and the room management server sends the streaming address to the host client.
[0168] In step 703, the anchor client pushes the live data stream to the RTMP server.
[0169] In some embodiments, after starting the live broadcast, the anchor client collects audio and video data through the image acquisition device and the audio acquisition device, and encodes the collected audio and video data to obtain a live data stream. For example, it is assumed that the live data stream is an h.264 code stream. After obtaining the live data stream, the anchor client sends the live data stream to the RTMP server based on the push stream address.
[0170] In step 704, the anchor client reports network status information to the QoS server.
[0171] In some embodiments, the anchor client may report network status information to the QoS server in real time, or the anchor client may send network status information to the QoS server once at a certain interval. The network status information may include network delay, packet loss rate, etc.
[0172] In step 705, the QoS server predicts the network bandwidth information of the anchor client according to the network status information.
[0173] In step 706, QoS determines that the network bandwidth of the anchor client is insufficient and sends a bandwidth adjustment strategy to the anchor client.
[0174] In some embodiments, the bandwidth adjustment strategy may include:
[0175] Dynamically adjust the video bit rate: Based on the network bandwidth of the anchor client, adjust the video bit rate to achieve the purpose of adaptive bandwidth;
[0176] Adaptive video resolution: dynamically adjust the video resolution according to the network bandwidth of the anchor client to reduce video bandwidth usage;
[0177] Intelligent frame rate adjustment: Dynamically adjust the video frame rate according to the network bandwidth of the anchor client to achieve the purpose of adaptive bandwidth.
[0178] In step 707, the viewer client sends a request to the room management server to enter the room.
[0179] The room entry request corresponds to the streaming request in other embodiments, and the room entry request carries the decoding capability information of the viewer terminal corresponding to the viewer client. The decoding capability information includes all encoding standards that the viewer terminal can decode, and can also include only the highest encoding standard that the viewer terminal can decode. In the embodiment of the present application, the decoding capability information includes the highest encoding standard that the viewer terminal can decode as an example for explanation.
[0180] In step 708, the room management server determines whether the live broadcast room is a hot room and whether the viewer terminal supports playing a bit stream with a higher compression rate.
[0181] In some embodiments, to determine whether the live broadcast room is a hot room, a decision can be made based on the threshold of the number of online viewers in the room pre-set by the room management server. When the number of viewers in the live broadcast room is greater than the threshold of the number of online viewers in the room, the live broadcast room is determined to be a hot room. When the number of viewers in the live broadcast room is less than or equal to the threshold of the number of online viewers in the room, the live broadcast room is determined not to be a hot room. To determine whether the viewer terminal supports playing a stream with a higher compression rate, it can be determined whether the compression rate of the highest encoding standard supported by the viewer terminal is higher than the compression rate of the encoding standard corresponding to the live data stream currently provided by the audio and video server. If the compression rate of the highest encoding standard supported by the viewer terminal is higher than the compression rate of the encoding standard corresponding to the current live data stream, it is determined that the viewer terminal supports playing a stream with a higher compression rate. Conversely, if the compression rate of the highest encoding standard supported by the viewer terminal is not higher than the compression rate of the encoding standard corresponding to the current live data stream, it is determined that the viewer terminal does not support playing a stream with a higher compression rate.
[0182] If the live broadcast room is not a hot room, or the viewer terminal does not support playing a stream with a higher compression rate, 709 If the live broadcast room is a hot room and the viewer terminal supports playing a stream with a higher compression rate, go to step 709; go to step 711.
[0183] In step 709, the room management server sends the first streaming address to the viewer terminal.
[0184] The first streaming address is an address for obtaining the live data stream from the RTMP server.
[0185] In step 710, the viewer terminal pulls the stream from the RTMP server based on the first stream pulling address to watch the live broadcast.
[0186] In step 711, the room management server sends a transcoding request to the transcoding server.
[0187] In some embodiments, the transcoding request may carry a target coding standard, for example, h.265.
[0188] In step 712, the transcoding server pulls the live data stream from the RTMP server in response to the transcoding request.
[0189] In step 713, the transcoding server transcodes the pulled live data stream to obtain a transcoded live data stream.
[0190] In some embodiments, the transcoding server transcodes the live data stream based on the target coding standard to obtain a transcoded live data stream.
[0191] In step 714, the transcoding server sends the second stream pulling address corresponding to the transcoded live data stream to the room management server.
[0192] In step 715, the room management server sends the second streaming address to the viewer terminal.
[0193] In step 716, the viewer terminal pulls the transcoded live data stream from the transcoding server based on the second stream pulling address and watches the live broadcast.
[0194] In the embodiment of the present application, during the live broadcast of the anchor client, the QoS server will adaptively adjust the bandwidth according to the network status information of the anchor client, so that the live broadcast can be guaranteed to be stable and reliable in various network environments; when the audience client sends a request to enter the room to the room management server, the room management server determines whether the current live broadcast room is a hot room. If it is a hot room and the audience terminal supports playing a bit stream with a higher compression rate (such as h.265), the room management server sends a transcoding request to the transcoding server. The transcoding server responds to the transcoding request to pull the live broadcast data stream from the audio and video server and transcode it, and then sends the transcoded live broadcast data stream to the audio and video server. The second stream pulling address corresponding to the data stream is sent to the room management server, and the room management server sends the second stream pulling address to the audience terminal. In this way, the live data stream will be transcoded only when the live broadcast room is a hot room and the audience terminal supports playing high-compression bitstreams. This can not only efficiently utilize bandwidth resources and save costs, but also improve the quality of live broadcast and ensure user experience. If the live broadcast room is not a hot room or the audience terminal does not support higher-compression bitstreams, the room management server sends the h.264 bitstream viewing address to the audience terminal, which is compatible with clients that support high compression rates and clients that do not support high compression rates. It has good compatibility, thereby effectively improving product coverage.
[0195] It is understandable that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0196] The following is a description of an exemplary structure of the live data processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the live data processing device 455 of the memory 440 may include:
[0197] The first receiving module 4551 is used to receive a stream pulling request sent by a viewer terminal during a live broadcast, wherein the stream pulling request carries decoding capability information of the viewer terminal;
[0198] The first acquisition module 4552 is used to determine, based on the decoding capability information, that the audience terminal supports playing the live data stream corresponding to the first coding standard, and when the live data stream corresponding to the current first stream pulling address is the second coding standard, obtain the current number of viewers in the live broadcast room, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard;
[0199] The first sending module 4553 is used for sending a first transcoding request to a transcoding server in response to the number of viewers being greater than a preset number threshold, so as to request the transcoding server to perform transcoding processing on the current live broadcast data stream based on the first encoding standard to obtain a transcoded live broadcast data stream;
[0200] The second sending module 4554 is used to obtain a second stream pulling address corresponding to the transcoded live data stream, and send the second stream pulling address to the viewer terminal.
[0201] In some embodiments, the apparatus further comprises:
[0202] A second acquisition module is used to acquire first network status information of the anchor terminal;
[0203] A first prediction module, configured to predict first bandwidth information of the anchor terminal based on the first network status information;
[0204] A first determining module, configured to determine target encoding information of the anchor terminal in response to the first bandwidth information being smaller than a transmission bandwidth required by the live data stream;
[0205] The third sending module is used to send the target coding information to the anchor terminal.
[0206] In some embodiments, the first determining module is further configured to:
[0207] Obtain the live broadcast type corresponding to the anchor terminal;
[0208] Based on the live broadcast type, determining an adjustable encoding parameter corresponding to the anchor terminal, wherein the adjustable parameter includes: at least one of a video bit rate, a video frame rate, and a video resolution;
[0209] Determining a target value of the adjustable encoding parameter based on the first bandwidth information;
[0210] The adjustable encoding parameter, the target value of the adjustable parameter, other encoding parameters except the adjustable encoding parameter, and the current value of the other encoding parameters are determined as the target encoding information.
[0211] In some embodiments, the first determining module is further configured to:
[0212] Acquire a first mapping relationship table between bandwidth information and coding information;
[0213] Based on the first mapping relationship table, target coding information corresponding to the first bandwidth information is determined, wherein the target coding information includes target values corresponding to a video bit rate, a video frame rate, and a video resolution.
[0214] In some embodiments, the apparatus further comprises:
[0215] A third acquisition module, configured to acquire second network status information of the viewer terminal in response to the number of viewers being less than or equal to the number threshold;
[0216] A second prediction module, configured to predict second bandwidth information of the viewer terminal based on the second network status information;
[0217] The fourth sending module is configured to send the first streaming address to the viewer terminal in response to the second bandwidth information being greater than or equal to the transmission bandwidth required for the live streaming data stream corresponding to the first streaming address.
[0218] In some embodiments, the second network state information includes a second packet loss rate and a second delay information. Correspondingly, the second prediction module is further used to:
[0219] Obtaining a correspondence between packet loss rate, delay and bandwidth; based on the correspondence, determining second bandwidth information corresponding to the second packet loss rate and second delay information; or,
[0220] The second bandwidth information is determined based on the second packet loss rate and the second delay information by using a congestion control algorithm.
[0221] In some embodiments, the apparatus further comprises:
[0222] A second determination module, configured to determine a target coding standard based on the decoding capability information of the viewer terminal and the second bandwidth information in response to the second bandwidth information being smaller than the transmission bandwidth required for the live data stream corresponding to the first stream pull address;
[0223] a fifth sending module, configured to send a second transcoding request to the transcoding server, wherein the second transcoding request carries the target coding standard, so as to request the transcoding server to perform transcoding processing on the live data stream to be transmitted based on the target coding standard to obtain a transcoded live data stream;
[0224] The sixth sending module is used to obtain a third stream pulling address corresponding to the transcoded live broadcast data stream, and send the third stream pulling address to the viewer terminal.
[0225] In some embodiments, the second determining module is further used to:
[0226] Determining a candidate coding standard corresponding to the second bandwidth information;
[0227] Determining the highest encoding standard that the viewer terminal can support for playing the video based on the decoding capability information of the viewer terminal;
[0228] A target encoding standard is determined based on the candidate encoding standards and the highest encoding standard.
[0229] In some embodiments, the apparatus further comprises:
[0230] A second receiving module is used to receive a live broadcast room creation request sent by an anchor terminal, wherein the live broadcast room creation request includes live broadcast parameters;
[0231] A live broadcast room creation module, used to create a live broadcast room corresponding to the anchor terminal based on the live broadcast parameters in response to the live broadcast room creation request;
[0232] A third determination module is used to determine the streaming address corresponding to the live broadcast room;
[0233] The seventh sending module is used to send the streaming address to the anchor terminal, so that the anchor terminal uploads the live data stream based on the streaming address.
[0234] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the live broadcast data processing method described in the embodiment of the present application.
[0235] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will be caused to execute the live broadcast data processing method provided by the embodiment of the present application, for example, Figure 3 , Figure 4A , Figure 5A and Figure 7 The live data processing method is shown.
[0236] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0237] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0238] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0239] As an example, the executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0240] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A live broadcast data processing method, It is characterized in that The method comprises: During the live broadcast process, receiving a stream pulling request sent by a viewer terminal, wherein the stream pulling request carries decoding capability information of the viewer terminal; When it is determined based on the decoding capability information that the viewer terminal supports playing the live data stream corresponding to the first coding standard, and the live data stream corresponding to the current first stream pulling address is the second coding standard, obtaining the current number of viewers in the live broadcast room, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard; In response to the number of viewers being greater than a preset number threshold, sending a first transcoding request to a transcoding server to request the transcoding server to perform transcoding processing on the current live broadcast data stream based on the first encoding standard to obtain a transcoded live broadcast data stream; Obtain a second stream pulling address corresponding to the transcoded live broadcast data stream, and send the second stream pulling address to the viewer terminal.
2. The method according to claim 1, It is characterized in that The method further comprises: Obtaining first network status information of the anchor terminal; Predicting first bandwidth information of the anchor terminal based on the first network status information; In response to the first bandwidth information being smaller than the transmission bandwidth required by the live data stream, determining target encoding information of the anchor terminal; The target coding information is sent to the anchor terminal.
3. The method according to claim 2, It is characterized in that In response to the first bandwidth information being smaller than the transmission bandwidth required by the live data stream, determining the target encoding information of the anchor terminal includes: Obtain the live broadcast type corresponding to the anchor terminal; Based on the live broadcast type, determining an adjustable encoding parameter corresponding to the anchor terminal, wherein the adjustable parameter includes: at least one of a video bit rate, a video frame rate, and a video resolution; Determining a target value of the adjustable encoding parameter based on the first bandwidth information; The adjustable encoding parameter, the target value of the adjustable parameter, other encoding parameters except the adjustable encoding parameter, and the current value of the other encoding parameters are determined as the target encoding information.
4. The method according to claim 2, It is characterized in that In response to the first bandwidth information being smaller than the transmission bandwidth required by the live data stream, determining the target encoding information of the anchor terminal includes: Acquire a first mapping relationship table between bandwidth information and coding information; Based on the first mapping relationship table, target coding information corresponding to the first bandwidth information is determined, wherein the target coding information includes target values corresponding to a video bit rate, a video frame rate, and a video resolution.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: In response to the number of viewers being less than or equal to the number threshold, acquiring second network status information of the viewer terminal; predicting second bandwidth information of the viewer terminal based on the second network status information; In response to the second bandwidth information being greater than or equal to the transmission bandwidth required for the live data stream corresponding to the first stream pulling address, the first stream pulling address is sent to the viewer terminal.
6. The method according to claim 5, It is characterized in that The second network status information includes a second packet loss rate and a second delay information, The predicting the second bandwidth information of the viewer terminal based on the second network status information includes: Obtaining a correspondence between packet loss rate, delay and bandwidth; based on the correspondence, determining second bandwidth information corresponding to the second packet loss rate and second delay information; or, The second bandwidth information is determined based on the second packet loss rate and the second delay information by using a congestion control algorithm.
7. The method according to claim 5, It is characterized in that The method further comprises: In response to the second bandwidth information being smaller than the transmission bandwidth required for the live data stream corresponding to the first stream pull address, determining a target coding standard based on the decoding capability information of the viewer terminal and the second bandwidth information; Sending a second transcoding request to a transcoding server, wherein the second transcoding request carries the target coding standard, so as to request the transcoding server to perform transcoding processing on the live data stream to be transmitted based on the target coding standard to obtain a transcoded live data stream; Obtain a third stream pulling address corresponding to the transcoded live broadcast data stream, and send the third stream pulling address to the viewer terminal.
8. The method according to claim 7, It is characterized in that The determining of the target coding standard based on the decoding capability information of the viewer terminal and the second bandwidth information includes: Determining a candidate coding standard corresponding to the second bandwidth information; Determining the highest encoding standard that the viewer terminal can support for playing the video based on the decoding capability information of the viewer terminal; A target encoding standard is determined based on the candidate encoding standards and the highest encoding standard.
9. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Receive a live broadcast room creation request sent by an anchor terminal, wherein the live broadcast room creation request includes live broadcast parameters; In response to the live broadcast room creation request, based on the live broadcast parameters, create a live broadcast room corresponding to the anchor terminal; Determine the streaming address corresponding to the live broadcast room; The streaming address is sent to the anchor terminal, so that the anchor terminal uploads the live data stream based on the streaming address.
10. A live broadcast data processing device, It is characterized in that The device comprises: A first receiving module is used to receive a stream pulling request sent by a viewer terminal during a live broadcast, wherein the stream pulling request carries decoding capability information of the viewer terminal; A first acquisition module is used to determine, based on the decoding capability information, that the audience terminal supports playing the live data stream corresponding to the first coding standard, and when the live data stream corresponding to the current first stream pulling address is the second coding standard, obtain the current number of viewers in the live broadcast room, and the compression rate of the first coding standard is greater than the compression rate of the second coding standard; A first sending module, configured to send a first transcoding request to a transcoding server in response to the number of viewers being greater than a preset number threshold, so as to request the transcoding server to perform transcoding processing on the current live data stream based on the first encoding standard to obtain a transcoded live data stream; The second sending module is used to obtain a second stream pulling address corresponding to the transcoded live broadcast data stream, and send the second stream pulling address to the viewer terminal.
11. An electronic device, It is characterized in that The electronic device comprises: A memory for storing computer executable instructions; The processor is used to implement the live broadcast data processing method described in any one of claims 1 to 9 when executing the computer executable instructions stored in the memory.
12. A computer-readable storage medium storing computer-executable instructions, It is characterized in that When the computer executable instructions are executed by a processor, the live broadcast data processing method described in any one of claims 1 to 9 is implemented.
13. A computer program product comprising computer executable instructions, It is characterized in that When the computer executable instructions are executed by the processor, the live broadcast data processing method described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and system for playing multi-media file and cloud transcoding service device
CN103561279A
Video transcoding method and device and computer storage medium
CN111107387A
Video data coding method and device, equipment and storage medium
CN113630604A
Live video transcoding method and device
CN113676754A
Video coding configuration method, device and equipment and computer readable storage medium
CN113747160A
Cited By
Video playing method, computer equipment and readable storage medium
CN120769125A
