Video live broadcast method and device, computer equipment and storage medium
By obtaining and analyzing the play status information of live videos and dynamically adjusting the download path of video shards, the problems of poor user experience and high server resource costs caused by a single download method in the existing technology are solved, and the smoothness of live videos and High-quality viewing experience.
Patent Information
- Application Number
- CN202411159785.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing live video broadcast technology, the single download method of viewer clients downloading video data from the server will affect the user experience and increase the cost of server resources when the network performance is poor or multiple clients are viewed simultaneously.
By obtaining playback status information, including network performance, system resource usage and whether other devices exist in the same LAN, dynamically adjust the download path of video shards and select the best download method, such as mirror server, CDN server or P2P connection.
Adjust the download strategy in real time under different playback statuses to ensure the smoothness of live video and high-quality viewing experience, and reduce bandwidth costs and server resource costs.
Smart Images

Figure CN119135938A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of video live broadcast processing, and in particular to a video live broadcast method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of the Internet and terminal technology, live video has been widely used in all walks of life. Live video uses the Internet and streaming media technology to transmit the video data of the host client to the viewer client in real time. During the transmission process, the host client will push or transmit the video data to the server, and then the viewer client will download the video data from the server to achieve live video. However, the single download method of downloading video data from the server is not suitable for all playback situations. For example, when the network performance of the viewer client is poor, it will seriously affect the user's live viewing experience. At the same time, watching live broadcasts also requires a lot of bandwidth fees, and when many viewer clients download video data from the server at the same time, the server resource cost will also increase. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a video live broadcast method, apparatus, computer equipment and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a video live broadcast method is provided, the method comprising:
[0005] Obtaining playback status information of a target live video, the playback status information including first information, second information, and third information, wherein the first information represents network performance, the second information represents system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network;
[0006] Determine, according to the playback state information, a target download path of a video segment in the target live video, wherein the video segment is a video segment to be played in the target live video;
[0007] The video segments are downloaded according to the target download path.
[0008] In an exemplary embodiment, the first information includes at least one of network bandwidth, network delay, and network jitter;
[0009] Obtain the first information, including:
[0010] Sending a network performance measurement request to a network device based on a preset time interval;
[0011] receiving measurement response information sent by the network device, where the measurement response information is generated by the network device based on the network performance measurement request;
[0012] The first information is obtained according to the measurement response information.
[0013] In an exemplary embodiment, determining, according to the playback status information, a target download path of the video segment in the target video live broadcast includes:
[0014] When the third information indicates that there is no other device playing the target live video in the same local area network, the target download path is determined according to the first information and the second information.
[0015] In an exemplary embodiment, the first information includes a first parameter, the first parameter is a network performance evaluation value, and the second information includes a second parameter, the second parameter is an amount of available system resources;
[0016] The step of determining the target download path according to the first information and the second information includes:
[0017] When the first parameter is greater than a first threshold and the second parameter is greater than a second threshold, determining the mirror server as the target download path;
[0018] When the first parameter is less than or equal to a first threshold and the second parameter is less than or equal to a second threshold, the CDN server is determined as the target download path.
[0019] In an exemplary embodiment, when it is determined that the mirror server is the target download path, and there are multiple mirror servers, the method further includes:
[0020] Sending download request information of the video segments to the plurality of mirror servers;
[0021] Determine the receiving time of the video segment sent by each of the mirror servers;
[0022] According to the receiving time, download parameters of each mirror server are determined.
[0023] In an exemplary embodiment, downloading the video segments according to the target download path includes:
[0024] Determining a target mirror server according to the download parameters of each mirror server;
[0025] The video segments are downloaded from the target mirror server.
[0026] In an exemplary embodiment, determining, according to the playback status information, a target download path of the video segment in the target video live broadcast includes:
[0027] When the third information indicates that there are other devices playing the target live video in the same local area network, determining at least one target device, where the target device indicates other devices playing the target live video in the same local area network;
[0028] The at least one target device is determined to be the target download path.
[0029] In an exemplary embodiment, downloading the video segments according to the target download path includes:
[0030] Establishing a P2P connection with the at least one target device;
[0031] Sending video request information of the video segment to the at least one target device;
[0032] The video segment sent by any of the target devices is received within a preset time period.
[0033] In an exemplary embodiment, the method further comprises:
[0034] If the P2P communication environment meets the preset conditions, the target download path is determined according to the first information and the second information; wherein the preset conditions include at least one of the following: poor P2P communication quality, and the number of the target devices is less than a set value.
[0035] In an exemplary embodiment, the method further comprises:
[0036] Obtaining identification information of video segments in the target video live broadcast;
[0037] Obtaining a video segment index table from a local cache, wherein the video segment index table includes identification information of the downloaded video segments;
[0038] If the video segment index table includes identification information of the video segment, the video segment is read from the local cache.
[0039] According to a second aspect of an embodiment of the present disclosure, a video live broadcast device is provided, the device comprising:
[0040] An acquisition module, used to acquire playback status information of a target live video, wherein the playback status information includes first information, second information, and third information, wherein the first information represents network performance, the second information represents system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network;
[0041] A determination module, configured to determine a target download path of a video segment in the target live video according to the playback state information, wherein the video segment is a video segment to be played in the target live video;
[0042] The download module is used to download the video segments according to the target download path.
[0043] According to a third aspect of an embodiment of the present disclosure, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0044] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0045] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: under different playback states, the download strategy of the video segments is adjusted in real time to ensure the selection of the best download method suitable for the current playback state, thereby ensuring the smoothness of live video playback and high-quality viewing experience.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0048] Figure 1 is a flow chart of a video live broadcast method according to an exemplary embodiment;
[0049] Figure 2 is a flow chart of a video live broadcast method according to an exemplary embodiment;
[0050] Figure 3 is a flow chart of a video live broadcast method according to an exemplary embodiment;
[0051] Figure 4 is a block diagram of a video live broadcast device according to an exemplary embodiment;
[0052] Figure 5 It is a block diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION
[0053] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0054] In some embodiments, live broadcast is implemented through an anchor client, at least one viewer client, and a server, wherein the anchor client refers to a user client that provides video data, the viewer client refers to a user client that plays and watches video data, and the server refers to a service device that transmits video data. The server can be an independent service device or a cluster device composed of multiple service devices.
[0055] In some embodiments, during live streaming video broadcast, the host client sends video data to the server in real time; the server encodes the received video data in real time to generate video fragments, which are transport stream (TS) fragments. The number of TS fragments generated is determined according to the duration of the received video data and the preset duration of each TS fragment. For example, when the duration of the received video data is 4 seconds and the preset duration of the TS fragment is 2 seconds, the video data is encoded to generate 2 TS fragments; the server stores the generated TS fragments and records the identification information such as the address, length, and sequence number of the TS fragment, and generates an index for each TS fragment according to the identification information; the viewer client sends a video request to the server when watching the live broadcast, and the server returns the index of the TS fragment to the viewer client; the viewer client obtains the address of the TS fragment according to the index of the TS fragment, and downloads the TS fragment from the address for playback.
[0056] However, the single download method of downloading video segments from the server is not suitable for all playback situations. For example, when the network performance of the viewer's client is poor, it will seriously affect the user's live viewing experience. At the same time, watching the live broadcast requires a lot of bandwidth fees. Moreover, when many viewer clients download video data from the server at the same time, the server resource cost will also increase.
[0057] In an exemplary embodiment of the present disclosure, in order to overcome the problem in the related art that the download method is not suitable for the current playback state when the user watches the live broadcast, resulting in a poor viewing experience, a video live broadcast method is provided, including: obtaining the playback state information of the target video live broadcast, the playback state information includes first information, second information and third information, the first information represents the network performance, the second information represents the system resource usage, and the third information represents whether there are other devices playing the target video live broadcast in the same local area network; according to the playback state information, determining the target download path of the video segment in the target video live broadcast, the video segment is the video clip to be played in the target video live broadcast; according to the target download path, download the video segment. The method adjusts the download strategy of the video segment in real time under different playback states, ensures that the best download method suitable for the current playback state is selected, and can ensure the smoothness of the video live broadcast and the high-quality viewing experience.
[0058] In an exemplary embodiment of the present disclosure, a video live broadcast method is provided. Figure 1 is a flow chart of a video live broadcast method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:
[0059] Step S101, obtaining the playback status information of the target live video, the playback status information includes first information, second information and third information, the first information represents the network performance, the second information represents the system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network;
[0060] Step S102, determining a target download path of a video segment in the target live video according to the playback state information, where the video segment is a video segment to be played in the target live video;
[0061] Step S103, downloading video segments according to the target download path.
[0062] The method in this embodiment is applied to electronic devices, including smart phones, tablets, personal computers, smart wearable devices, smart car machines, and other electronic devices with a live broadcast viewing function.
[0063] In step S101, the target video live broadcast represents the video data collected by the live broadcast client, and the electronic device in this embodiment is one of the audience clients. When the electronic device plays the target video live broadcast, that is, when watching the live broadcast, the playback status information of the target video live broadcast is monitored in real time through the monitoring module in the electronic device. The playback status information includes first information, second information and third information, wherein the first information represents the network performance, represents the network environment performance of the target video live broadcast, and the network performance can be evaluated by network environment parameters such as network bandwidth, network delay, and network jitter; the second information represents the system resource usage, represents the storage resource usage in the electronic device operating system; the third information represents whether there are other devices playing the target video live broadcast in the same local area network, and the third information is a binary variable, for example, the third information is 1 or 0, 1 indicates that there are other devices playing the target video live broadcast in the same local area network, and 0 indicates that there are no other devices playing the target video live broadcast in the same local area network, and for another example, the third information is True or False, True indicates that there are other devices playing the target video live broadcast in the same local area network, and False indicates that there are no other devices playing the target video live broadcast in the same local area network.
[0064] In an example, the first information includes at least one of network bandwidth, network delay, and network jitter.
[0065] In some implementations, obtaining the first information includes the following steps:
[0066] S11-1, sending a network performance measurement request to a network device based on a preset time interval;
[0067] S11-2, receiving measurement response information sent by the network device, where the measurement response information is generated by the network device based on the network performance measurement request;
[0068] S11-3, obtaining first information according to the measurement response information.
[0069] The preset time interval is set according to actual needs. The shorter the time interval, the more real-time information the network status can be obtained. The network performance measurement request represents a request to measure network bandwidth, network delay and network jitter. The network device generates measurement response information based on the network performance measurement request, and sends the measurement response information to the electronic device. The first information can be obtained through information interaction between the network device and the electronic device. For example, a measurement request is represented by a specific type of data packet. Measuring network bandwidth means measuring the amount of data transmitted from the network device to the electronic device in a unit time. The network bandwidth can be determined according to the amount of data received in the measurement response information per unit time; measuring network delay means measuring the time required for the network device to send data to the electronic device to receive the data. The measurement response information includes the time when the network device sends the response information. The network delay can be calculated according to the time when the electronic device receives the measurement impact information; measuring network jitter means the instability of the change in the delay of data transmission between the network device and the electronic device. The network jitter can be calculated according to the maximum network delay and the minimum network delay in the preset time period. Among them, the network device is a server.
[0070] In some implementations, the third information is obtained through a Tracker server. The front-end browser used to watch the target live video uses WebSocket to connect to the Tracker server, and the Tracker server can count the viewer information of the target live video and push the other users who are currently playing the target live video to the front-end server, so that the current player can automatically detect other devices playing the target live video.
[0071] In step S102, the video segment is a video clip to be played in the target video live broadcast, which is any TS segment of the target video live broadcast. In this embodiment, multiple download paths are provided, including local cache, other electronic devices, mirror servers, CDN servers, etc. Network performance and system resource usage are both important factors affecting the user's live viewing experience. Poor network performance will lead to slow download speed, and fewer system available resources will lead to system resources being unable to meet video playback requirements. At the same time, other devices playing the target video live broadcast in the same local area network can also provide other download paths. Therefore, the target download path of the video segment is determined by the playback status information, and the download strategy can be adjusted in real time under different playback conditions to select the best download method in real time to ensure the smoothness of video playback and high-quality viewing experience. In some embodiments, the mapping relationship between the playback status information and the target download path is pre-stored in the electronic device, and the target download path is matched from the mapping relationship according to the real-time monitored playback status information.
[0072] In step S103, the electronic device downloads the video segment from the target download path and plays the video segment to watch the live broadcast.
[0073] In an exemplary embodiment of the present disclosure, when watching a live broadcast, the playback status information of the target video live broadcast is obtained, and the target download path of the video fragments in the target video live broadcast is determined based on the playback status information. The video fragments are video segments to be played in the target video live broadcast. According to the target download path, the video fragments are downloaded. This method adjusts the download strategy of the video fragments in real time under different playback states, ensuring that the best download method suitable for the current playback state is selected, which can ensure the smoothness of the video live broadcast and a high-quality viewing experience.
[0074] In an exemplary embodiment of the present disclosure, a video live broadcast method is provided. Figure 2 is a flow chart of a video live broadcast method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:
[0075] Step S201, obtaining the playback status information of the target live video, the playback status information includes first information, second information and third information, the first information represents the network performance, the second information represents the system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network;
[0076] Step S202, when the third information indicates that there is no other device playing the target live video in the same local area network, determine the target download path according to the first information and the second information;
[0077] Step S203, downloading video segments according to the target download path;
[0078] Step S204, when the third information indicates that there are other devices playing the target live video in the same local area network, determining at least one target device, where the target device indicates other devices playing the target live video in the same local area network;
[0079] Step S205, determining at least one target device as a target download path;
[0080] Step S206, establishing a P2P connection with at least one target device;
[0081] Step S207, sending video request information of the video segment to at least one target device;
[0082] Step S208: receiving a video segment sent by any target device within a preset time period.
[0083] The specific implementation of step S201 refers to step S101 and will not be described in detail here.
[0084] In step S202-step S203, when it is determined according to the third information that there are no other devices playing the target live video in the same local area network, the target download path is determined according to the first information and the second information, and the video segments are downloaded from the target download path.
[0085] In some implementations, the first information includes a first parameter, which is a network performance evaluation value, and the second information includes a second parameter, which is an amount of available system resources.
[0086] The first information includes network performance indicators such as network bandwidth, network jitter, and network delay. The network performance indicator values at each moment are recorded. After determining the network performance indicators at the current moment, the network health status and network stability at the current moment are evaluated using statistical methods or machine learning techniques based on the network performance indicator values at the current moment and historical moments, and the network health status and network stability at the current moment are scored or evaluated to obtain the first parameter. For example, the parameter value of the first parameter corresponding to a network state with high network bandwidth, low network delay, and small network jitter is greater than the parameter value of the first parameter corresponding to a network state with low network bandwidth, high network delay, and large network jitter. The second parameter is the amount of available system resources, which is determined by the difference between the total amount of system resources and the amount of system resources used read in real time.
[0087] In some implementations, when the first parameter is greater than a first threshold and the second parameter is greater than a second threshold, the mirror server is determined as the target download path; when the first parameter is less than or equal to the first threshold and the second parameter is less than or equal to the second threshold, the CDN server is determined as the target download path.
[0088] The first threshold and the second threshold are both preset values, which are set according to actual needs. If the first parameter is greater than the first threshold and the second parameter is greater than the second threshold, it means that the system resources can meet the current video playback requirements and the network performance is good. At this time, the mirror server is determined as the target download path, and a download request for the video segment is sent to the mirror server. Since the mirror server resource cost is low and it can save bandwidth costs, when the system resources are sufficient and the network performance is good, the mirror server is used as the target download path, which can effectively utilize the resources of the mirror server, reduce the load of the CDN server, reduce bandwidth costs and server resource costs, and improve cost-effectiveness. The first parameter is less than or equal to the first threshold and the second parameter is less than or equal to the second threshold, which means that the system resources cannot meet the current video playback requirements and the network performance is poor. At this time, the CDN server is determined as the target download path, and a download request for the video segment is sent to the CDN server. Since the CDN server is widely distributed and has a high degree of reliability, when the system resources are insufficient and the network performance is poor, the CDN server is used as the target download path, which can ensure the smoothness and stability of the live video playback.
[0089] In some implementations, when the mirror server is determined as the target download path and there are multiple mirror servers, the following steps are also included:
[0090] Sending download request information of video segments to multiple mirror servers;
[0091] Determine the reception time of the video segments sent by each mirror server;
[0092] According to the receiving time, the download parameters of each mirror server are determined.
[0093] When the target download path is determined to be a mirror server, if there are multiple mirror servers, and if the local cache is sufficient, send download requests for video segments to multiple mirror servers, record the receiving time of the video segments, and count the receiving time of the video segments received from each mirror server when multiple consecutive mirror servers are used as the target download path. Perform a comprehensive score on multiple mirror servers according to the order of receiving time, and use the score as the download parameter of each mirror server. The mirror server with the earlier receiving time has a higher score, and there is no restriction on the specific scoring method. If there are many mirror servers, give priority to scoring edge mirror servers.
[0094] In some implementations, a target mirror server is determined according to the download parameters of each mirror server; and the video segments are downloaded from the target mirror server.
[0095] When it is necessary to download video segments from a mirror server, a mirror server with a high score is selected as a target mirror server according to the download parameters of each mirror server, and the video segments are downloaded from the target mirror server to improve the download speed of the video segments. In some embodiments, when the local cache is insufficient, according to the download parameters of each mirror server, while selecting a mirror server with a high score, the video segments are preferentially downloaded from the domestic mirror server.
[0096] In step S204-step S205, when it is determined according to the third information that there are other devices playing the target live video in the same local area network, the other devices playing the target live video in the same local area network are used as target devices, and the number of target devices is determined according to the actual situation, which may be multiple or one. At least one target device is determined as the target download path, and the video fragment is obtained from the at least one target device.
[0097] In step S206-step S208, the Tracker server is used as the signaling server of Webrtc to instruct the electronic device that plays the target live video to initiate a P2P connection, so that it establishes a P2P connection with all other target devices, and all other target devices serve as the DataChannel of the electronic device. The electronic device sends video request information of the video segment to each target device with which it establishes a P2P connection. If a video segment sent by any target device is received within the preset time length, the video segment is played; if a video segment sent by any target device is not received within the preset time length or the player cache is insufficient, the target download path is determined according to the first information and the second information, and the video segment is downloaded from the target download path. Among them, the preset time length is a shorter time length, for example, 5 seconds.
[0098] In some implementations, when the electronic device receives video request information of a video segment sent by any other target device, if the video segment exists in the local cache, it sends it to the target device.
[0099] In some implementations, if the P2P communication environment meets preset conditions, the target download path is determined based on the first information and the second information; wherein the preset conditions include at least one of the following: poor P2P communication quality, and the number of target devices is less than a set value.
[0100] If there are other devices playing the target live video in the same local area network, but the communication quality of the P2P communication method is poor or the target devices to establish a P2P connection with the current device are less than the set value (for example, less than 3), it is considered that the possibility of obtaining video fragments from other devices at this time is low. In this case, it is determined that there are no other devices playing the target live video in the same local area network, and the target download path is determined based on the first information and the second information.
[0101] When multiple users watch the target video live at the same time and have the same video segments, by establishing a P2P communication method within the local area network, only some of the users need to download the video segments from the server and exchange the required video segments between users, without the need for all users to download from the server. This P2P download method realizes resource sharing among users, can reduce dependence on the server, reduce the amount of data requested from the server, and save video data transmission costs. At the same time, video data interaction within the local area network can speed up the acquisition of video segments.
[0102] In an exemplary embodiment of the present disclosure, a video live broadcast method is provided. Figure 3 is a flow chart of a video live broadcast method according to an exemplary embodiment. Figure 3 As shown, the following steps are included:
[0103] Step S301, obtaining identification information of video segments in the target video live broadcast;
[0104] Step S302, obtaining a video segment index table from a local cache, wherein the video segment index table includes identification information of the downloaded video segments;
[0105] Step S303, determining whether the video segment index table includes identification information of the video segment;
[0106] If the video segment index table includes identification information of the video segment, the video segment is read from the local cache; if the video segment index table does not include identification information of the video segment, step S304 to step S306 are executed;
[0107] Step S304, obtaining the playback status information of the target live video, the playback status information including first information, second information and third information, the first information representing the network performance, the second information representing the system resource usage, and the third information representing whether there are other devices playing the target live video in the same local area network;
[0108] Step S305, determining a target download path of a video segment in the target live video according to the playback state information, where the video segment is a video segment to be played in the target live video;
[0109] Step S306, downloading video segments according to the target download path.
[0110] The specific implementation of steps S304 to S306 refers to steps S101 to S103 or steps S201 to S208, which will not be described in detail here.
[0111] In step S301, the identification information of the video segment represents information that can uniquely identify the video segment, such as the segment sequence number of the video segment and the target video live broadcast identifier corresponding to the video segment, and the identification information is obtained from the request information of the video segment.
[0112] In step S302, a video segment index table is pre-set in the local cache, and the identification information of the downloaded video segments and the corresponding video segments are stored in the video segment index table, which is used to record the video segments that have been cached locally in real time, so as to facilitate the subsequent direct reading of the video segments from the cache.
[0113] In step S303, the identification information of the requested video segment is read from the request information of the video segment, and the identification information is searched in the video segment index table. If the identification information of the requested video segment can be found in the video segment index table, it is determined to be a "cache hit". At this time, no other download paths are obtained, and the requested video segment is directly read from the local cache to reduce network bandwidth consumption and server load; if the identification information of the requested video segment cannot be found in the video segment index table, it is determined to be a "cache miss". At this time, the playback status information of the target video live broadcast is obtained, and the target download path is determined according to the playback status information, and the requested video segment is downloaded from the target download path. After the download is completed, it is saved in the video segment index table of the local cache so that it can be directly read from the cache later.
[0114] It should be noted that when the available storage space in the local cache is insufficient, that is, when the available storage space is less than the storage threshold, the downloaded video segments are no longer stored in the video segment index table.
[0115] The solution in this embodiment flexibly controls and determines when to trigger the server download request to maximize the use of local cache, which can reduce dependence on CDN servers, reduce bandwidth costs and server resource costs, and at the same time increase the acquisition speed of video segments and reduce live broadcast delays.
[0116] In an exemplary embodiment of the present disclosure, a video live broadcast device is provided. Figure 4 is a block diagram of a video live broadcast device according to an exemplary embodiment. Figure 4 As shown, the video live broadcast device includes:
[0117] The acquisition module 401 is used to acquire the playback status information of the target live video, wherein the playback status information includes first information, second information and third information, wherein the first information represents the network performance, the second information represents the system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network;
[0118] A determination module 402 is used to determine a target download path of a video segment in the target live video according to the playback state information, wherein the video segment is a video segment to be played in the target live video;
[0119] The download module 403 is used to download the video segments according to the target download path.
[0120] In an exemplary embodiment, the first information includes at least one of network bandwidth, network delay, and network jitter;
[0121] The acquisition module 401 is also used for:
[0122] Sending a network performance measurement request to a network device based on a preset time interval;
[0123] receiving measurement response information sent by the network device, where the measurement response information is generated by the network device based on the network performance measurement request;
[0124] The first information is obtained according to the measurement response information.
[0125] In an exemplary embodiment, the determining module 402 is further configured to:
[0126] When the third information indicates that there is no other device playing the target live video in the same local area network, the target download path is determined according to the first information and the second information.
[0127] In an exemplary embodiment, the first information includes a first parameter, the first parameter is a network performance evaluation value, and the second information includes a second parameter, the second parameter is an amount of available system resources;
[0128] The determining module 402 is further configured to:
[0129] When the first parameter is greater than a first threshold and the second parameter is greater than a second threshold, determining the mirror server as the target download path;
[0130] When the first parameter is less than or equal to a first threshold and the second parameter is less than or equal to a second threshold, the CDN server is determined as the target download path.
[0131] In an exemplary embodiment, when it is determined that the mirror server is the target download path, and there are multiple mirror servers, the determination module 402 is further configured to:
[0132] Sending download request information of the video segments to the plurality of mirror servers;
[0133] Determine the receiving time of the video segment sent by each of the mirror servers;
[0134] According to the receiving time, download parameters of each mirror server are determined.
[0135] In an exemplary embodiment, the download module 403 is further configured to:
[0136] Determining a target mirror server according to the download parameters of each mirror server;
[0137] The video segments are downloaded from the target mirror server.
[0138] In an exemplary embodiment, the determining module 402 is further configured to:
[0139] When the third information indicates that there are other devices playing the target live video in the same local area network, determining at least one target device, where the target device indicates other devices playing the target live video in the same local area network;
[0140] The at least one target device is determined to be the target download path.
[0141] In an exemplary embodiment, the download module 403 is further used for:
[0142] Establishing a P2P connection with the at least one target device;
[0143] Sending video request information of the video segment to the at least one target device;
[0144] The video segment sent by any of the target devices is received within a preset time period.
[0145] In an exemplary embodiment, the determination module 402 is further configured to:
[0146] If the P2P communication environment meets the preset conditions, the target download path is determined according to the first information and the second information; wherein the preset conditions include at least one of the following: poor P2P communication quality, and the number of the target devices is less than a set value.
[0147] In an exemplary embodiment, the download module 403 is further used for:
[0148] Obtaining identification information of video segments in the target video live broadcast;
[0149] Obtaining a video segment index table from a local cache, wherein the video segment index table includes identification information of the downloaded video segments;
[0150] If the video segment index table includes identification information of the video segment, the video segment is read from the local cache.
[0151] Each module in the above-mentioned video live broadcast device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0152] In an exemplary embodiment of the present disclosure, a computer device is provided, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any of the above-mentioned video live broadcast methods are implemented.
[0153] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned video live broadcast methods are implemented. The computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0154] In an exemplary embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of implementing any of the above-mentioned video live broadcast directions are implemented.
[0155] Figure 5 is a block diagram of a computer device 500 according to an exemplary embodiment.
[0156] refer to Figure 5 , a block diagram of a computer device that can be used as the camera 2 or terminal 1 of the present disclosure will now be described, and the computer device includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer device 500 can also be stored. The computing unit 505, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0157] A plurality of components in the computer device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 may be any type of device capable of inputting information to the computer device 500, the input unit 506 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the computer device 500, and may include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 may be any type of device capable of presenting information, and may include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 may include but is not limited to a disk, an optical disk. The communication unit 509 allows the computer device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0158] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a live video method. For example, in some embodiments, the live video method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the computer device 500 via ROM 502 and / or a communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the live video method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the live video method in any other appropriate manner (e.g., by means of firmware).
[0159] The computer device 500 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned video live broadcast method.
[0160] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0161] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A video live broadcast method, characterized in that: The method comprises: Obtaining playback status information of a target live video, the playback status information including first information, second information, and third information, wherein the first information represents network performance, the second information represents system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network; Determine, according to the playback state information, a target download path of a video segment in the target live video, wherein the video segment is a video segment to be played in the target live video; The video segments are downloaded according to the target download path.
2. The video live broadcast method according to claim 1, characterized in that: The first information includes at least one of network bandwidth, network delay and network jitter; Obtain the first information, including: Sending a network performance measurement request to a network device based on a preset time interval; receiving measurement response information sent by the network device, where the measurement response information is generated by the network device based on the network performance measurement request; The first information is obtained according to the measurement response information.
3. The video live broadcast method according to claim 1, characterized in that: The step of determining a target download path of the video segments in the target video live broadcast according to the playback status information includes: When the third information indicates that there is no other device playing the target live video in the same local area network, the target download path is determined according to the first information and the second information.
4. The video live broadcast method according to claim 3, characterized in that: The first information includes a first parameter, which is a network performance evaluation value; the second information includes a second parameter, which is an amount of available system resources; The step of determining the target download path according to the first information and the second information includes: When the first parameter is greater than a first threshold and the second parameter is greater than a second threshold, determining the mirror server as the target download path; When the first parameter is less than or equal to a first threshold and the second parameter is less than or equal to a second threshold, the CDN server is determined as the target download path.
5. The video live broadcast method according to claim 4, characterized in that: When it is determined that the mirror server is the target download path, and there are multiple mirror servers, the method further includes: Sending download request information of the video segments to the plurality of mirror servers; Determine the receiving time of the video segment sent by each of the mirror servers; According to the receiving time, download parameters of each mirror server are determined.
6. The video live broadcast method according to claim 5, characterized in that: The downloading of the video segments according to the target download path includes: Determining a target mirror server according to the download parameters of each mirror server; The video segments are downloaded from the target mirror server.
7. The video live broadcast method according to claim 1, characterized in that: The step of determining a target download path of the video segments in the target video live broadcast according to the playback status information includes: When the third information indicates that there are other devices playing the target live video in the same local area network, determining at least one target device, where the target device indicates other devices playing the target live video in the same local area network; The at least one target device is determined to be the target download path.
8. The video live broadcast method according to claim 7, characterized in that: The downloading of the video segments according to the target download path includes: Establishing a P2P connection with the at least one target device; Sending video request information of the video segment to the at least one target device; The video segment sent by any of the target devices is received within a preset time period.
9. The video live broadcast method according to claim 7, characterized in that: The method further comprises: If the P2P communication environment meets the preset conditions, the target download path is determined according to the first information and the second information; wherein the preset conditions include at least one of the following: poor P2P communication quality, and the number of the target devices is less than a set value.
10. The video live broadcast method according to claim 1, characterized in that: The method further comprises: Obtaining identification information of video segments in the target video live broadcast; Obtaining a video segment index table from a local cache, wherein the video segment index table includes identification information of the downloaded video segments; If the video segment index table includes identification information of the video segment, the video segment is read from the local cache.
11. A video live broadcast device, characterized in that: The device comprises: An acquisition module, used to acquire playback status information of a target live video, wherein the playback status information includes first information, second information, and third information, wherein the first information represents network performance, the second information represents system resource usage, and the third information represents whether there are other devices playing the target live video in the same local area network; A determination module, configured to determine a target download path of a video segment in the target live video according to the playback state information, wherein the video segment is a video segment to be played in the target live video; The download module is used to download the video segments according to the target download path.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
