WO2021179304A1 - 自动调整视频直播码率的方法、视频传输装置和服务器 - Google Patents
自动调整视频直播码率的方法、视频传输装置和服务器 Download PDFInfo
- Publication number
- WO2021179304A1 WO2021179304A1 PCT/CN2020/079284 CN2020079284W WO2021179304A1 WO 2021179304 A1 WO2021179304 A1 WO 2021179304A1 CN 2020079284 W CN2020079284 W CN 2020079284W WO 2021179304 A1 WO2021179304 A1 WO 2021179304A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bit rate
- network bandwidth
- current network
- set bit
- video
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/266—Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
- H04N21/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
Definitions
- the present invention generally relates to the technical field of live video broadcasting, and more particularly relates to a method for automatically adjusting the bit rate of live video broadcasting, a video transmission device and a server.
- the server pushes the stream generally using a fixed bit rate set in the previous stage.
- the quality of the live broadcast network changes dynamically and is unpredictable.
- Using a fixed bitrate to push the stream may cause problems such as freezing and increased delay in the live broadcast during the live broadcast, which affects the user's live broadcast experience.
- the present invention proposes a method, system and computer storage medium for automatically adjusting the bit rate of live video.
- one aspect of the present invention provides a method for automatically adjusting the bitrate of live video, the method includes: obtaining the current network bandwidth when the video transmission device currently pushes the video stream to the server; discretizing the current network bandwidth To obtain the discretized current network bandwidth; according to the discretized current network bandwidth and the current set bit rate of the video transmission device, automatically adjust the current set bit rate; based on the adjusted current set code Rate, push the video stream to the server.
- Another aspect of the present invention provides a method for automatically adjusting the bitrate of live video, the method includes: obtaining the current network bandwidth when the video transmission device currently pushes the video stream to the server; discretizing the current network bandwidth to Obtain the discretized current network bandwidth; according to the discretized current network bandwidth and the current set bit rate of the video transmission device, automatically adjust the current set bit rate; push the adjusted current set bit rate to The video transmission device is configured to enable the video transmission device to push the video stream to the server based on the adjusted current set bit rate.
- the video transmission device includes: a memory for storing executable instructions; a processor for executing the instructions stored in the memory so that the processor executes
- the following actions, the actions include: obtaining the current network bandwidth when the video transmission device currently pushes the video stream to the server; discretizing the current network bandwidth to obtain the discretized current network bandwidth; The current network bandwidth and the current set bit rate of the video transmission device automatically adjust the current set bit rate; based on the adjusted current set bit rate, the video stream is pushed to the server.
- the server includes: a memory, configured to store executable instructions; a processor, configured to execute the instructions stored in the memory, so that the processor performs the following actions, so The actions include: obtaining the current network bandwidth when the video transmission device currently pushes the video stream to the server; discretizing the current network bandwidth to obtain the discretized current network bandwidth; according to the discretized current network bandwidth and The current set bit rate of the video transmission device automatically adjusts the current set bit rate; the adjusted current set bit rate is pushed to the video transmission device so that the video transmission device is based on the adjusted current bit rate. Set the bit rate to push the video stream to the server.
- Another aspect of the present invention provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the foregoing method is implemented.
- the method and device of the embodiment of the present invention can dynamically monitor the current network environment (that is, the current network bandwidth) during the current live broadcast, and adaptively adjust the live broadcast bit rate of the video transmission device, thereby effectively alleviating live broadcast jams and live broadcast delays, and improving user experience .
- the discretization process is first performed, which reduces frequent adjustments of the code rate, reduces the oscillation of the code rate adjustment, and improves the stability.
- FIG. 1 shows a schematic structural diagram of a video live broadcast system in an embodiment of the present invention
- Figure 2 shows a schematic diagram of the dynamic changes of live network links in an embodiment of the present invention
- FIG. 3 shows a schematic flowchart of a method for automatically adjusting the bit rate of live video in an embodiment of the present invention
- Figure 4 shows a schematic diagram of discretized current network bandwidth in an embodiment of the present invention
- FIG. 5 shows a schematic diagram of the process of adjusting the currently set bit rate in an embodiment of the present invention
- Figure 6 shows a schematic diagram of an adjusted current set bit rate in an embodiment of the present invention
- FIG. 7 shows a schematic flowchart of a method for automatically adjusting the bit rate of live video in another embodiment of the present invention.
- FIG. 8 shows a schematic block diagram of a video transmission device in an embodiment of the present invention.
- Fig. 9 shows a schematic block diagram of a server in an embodiment of the present invention.
- FIG. 1 is a schematic structural diagram of a video live broadcast system in an embodiment of the present invention.
- the video live broadcast system 100 may include: a video transmission device 101, a server 102 and a playback terminal 103.
- the video transmission device 101 and the server 102 can be connected wirelessly (such as traditional 4G, 5G, WiFi or the Internet, etc.), and the player 103 and the server 102 can be connected wirelessly (such as traditional 4G, 5G, WiFi or the Internet, etc.).
- the video transmission device 101 may be a video capture device (not shown), the video capture device is used to capture a video stream of a live video, and push it to the server 102.
- the video capture device can also be more specifically used for audio and video capture, video processing (such as beauty, watermarking, etc.), audio and video encoding compression, audio and video packaging, and other processing.
- the video capture device may be any electronic device with a video capture function.
- the video capture device may be a camera (for example, a handheld pan/tilt camera), a mobile phone, a tablet computer, a smart wearable device, a computer, and the like.
- the video transmission device 101 may also be used to receive a live video stream from a video capture device, and the video capture device is used to capture the video stream and send the video stream to the video stream.
- the video transmission device 101 pushes the video stream to the server 102.
- the video transmission device may include, for example, a terminal device.
- the terminal device may be, for example, a mobile computing or communication device, a smart phone, a wearable device, a computer, or a desktop computer. , Notebooks, tablets, etc.
- the terminal device can communicate with a video capture device (such as a camera) (such as WiFi, Bluetooth connection, etc.), so that it can receive a live video stream from the video capture device and push the video stream to the server.
- the server 102 may include a streaming media server or a server of a live broadcast platform, and the video transmission device 101 may perform audio and video streaming transmission through the Real Time Messaging Protocol (RTMP, Real Time Messaging Protocol), and the server 102 is mainly used to receive the video transmission device 101 The transmitted audio and video stream, and then the received audio and video stream is distributed to each playback terminal 103.
- upstreaming means that the video transmission device pushes the voice stream or video stream to the server.
- the playback terminal 103 which is the live audience, transmits audio and video data with the server 102 through RTMP or HyperText Transfer Protocol (HTTP, HyperText Transfer Protocol), and is mainly used to receive the audio and video streams transmitted by the server 102 and decode the audio and video streams. , Play.
- HTTP HyperText Transfer Protocol
- the server pushes the code stream generally at a fixed bit rate set in the previous stage.
- the quality of the live broadcast network changes dynamically and is unpredictable.
- the maximum streaming rate is set to the live broadcast setting bit rate when streaming is performed at a fixed bit rate.
- Min dotted line indicates the minimum push rate of live streaming.
- the network bandwidth from 0 to t2 decreases, and the network bandwidth from t2 to t3 runs smoothly in a poor state, and from t3 to t5
- the network bandwidth increases
- the network bandwidth from t5 to t6 runs smoothly in a good state
- the network bandwidth from t6 to t7 decreases.
- the network runs smoothly in a normal state. It can be seen from the figure that the network status changes in real time and not predictable. If the video transmission device uses a fixed bit rate to push the stream during the live broadcast process, it may cause problems such as freezing of the live broadcast picture and increased delay during the live broadcast process, which affects the user's live broadcast experience.
- an embodiment of the present invention provides a method 300 for dynamically adjusting the bitrate of live video.
- the method includes the following steps: in step S301 , Obtain the current network bandwidth when the video transmission device currently pushes the video stream to the server; in step S302, discretize the current network bandwidth to obtain the discretized current network bandwidth; in step S303, according to the discretized current network bandwidth And the current set bit rate of the video transmission device, automatically adjust the current set bit rate; in step S304, based on the adjusted current set bit rate, push the video stream to the server.
- the current network environment that is, the current network bandwidth
- the live broadcast bit rate of the video transmission device can be adaptively adjusted, thereby effectively alleviating live broadcast jams and live broadcast delays, and improving user experience.
- the above method first performs discretization processing after acquiring the current network bandwidth, which reduces frequent adjustment of the code rate, reduces the oscillation of the code rate adjustment, and improves the stability.
- a method 300 for dynamically adjusting the bitrate of a live video provided in an embodiment of the present invention will be described below with reference to FIG. 3 to FIG. 6. The description is based on the perspective of the video transmission device.
- step S301 the current network bandwidth when the video transmission device is currently pushing the video stream to the server is acquired.
- the current network bandwidth can be obtained by any suitable method well known to those skilled in the art, for example, the current network bandwidth can be obtained by testing the current network bandwidth, for example, uploading in a time window through a video transmission device Or the amount of downloaded data can be used to calculate the current network bandwidth, or a third-party tool can also be used to test the current network bandwidth.
- the current network bandwidth can also be calculated by detecting the amount of data in the sending buffer queue of the video transmission device.
- step S302 the current network bandwidth is discretized to obtain the discretized current network bandwidth.
- discretizing the current network bandwidth to obtain the discretized current network bandwidth may be specifically discretizing (that is, performing rounding) on the current network bandwidth through a discretization interval. Obtain the discretized current network bandwidth. Through discretization, the fluctuation of the current network bandwidth can be reduced, and the frequent adjustment of the code rate when the code rate is adjusted based on the discretized current network bandwidth can be avoided and the fluctuation of the code rate adjustment can be reduced. Compared with the situation without discretization, the calculation workload is reduced, the load of the processor is reduced, the network bandwidth is prevented from repeatedly oscillating, and the stability is improved.
- the discretization interval in this article can be set reasonably based on a priori, which is not specifically limited here.
- the discretized current network bandwidth is obtained by rounding the current network bandwidth at discretization intervals, and the current network bandwidth in a specific range can be decentralized into the same network bandwidth by rounding. Thereby reducing the fluctuation of the network bandwidth to avoid frequent adjustments to the code rate.
- rounding may include rounding down or rounding up.
- the discretized current network bandwidth is a value obtained by rounding down the current network bandwidth at the discretization interval, and by rounding down, the current network bandwidth can be scaled down while rounding.
- the current network bandwidth thereby further reducing the fluctuation of the network bandwidth, to avoid subsequent frequent adjustments to the code rate. For example, it can be expressed by the following formula (1):
- y is the current network bandwidth
- m is the discretization interval
- yf is the current network bandwidth of the discretization
- the linear broken line in the figure is the discretized current network bandwidth, and the curve is the actual current network bandwidth. From the figure, it can be seen that the discretized current network bandwidth fluctuates compared with the actual current network bandwidth. smaller.
- step S303 the current set bit rate is automatically adjusted according to the discretized current network bandwidth and the current set bit rate of the video transmission device.
- the current set bit rate of the video transmission device is also the streaming bit rate of the video transmission device during the current live broadcast.
- automatically adjusting the current set bit rate according to the discretized current network bandwidth and the current set bit rate of the video transmission device includes: if the current set bit rate is greater than the Discretized current network bandwidth, then reduce the current set bit rate, for example, reduce the current set bit rate to be equal to or lower than the discretized current network bandwidth, so as to avoid live broadcast delay caused by excessive bit rate Occurs, if the current set bit rate is less than the discretized current network bandwidth, the current set bit rate is increased, for example, the current set bit rate is adjusted to be equal to the discretized current network bandwidth or less than The discretized current network bandwidth is greater than the current set bit rate, so as to avoid problems such as screen freezes caused by too low bit rate, and improve the quality of the live broadcast.
- the currently set code rate is between a first threshold code rate and a second threshold code rate, wherein the second threshold code rate is greater than the first threshold code rate, wherein the first threshold code rate
- the bit rate can be the minimum streaming code rate Min for live streaming. If it is lower than the minimum streaming code rate, the live screen is likely to experience obvious freezes, which will seriously affect the live broadcast effect.
- the second threshold bit rate can be the maximum streaming code for live streaming.
- the maximum streaming code rate can be the maximum streaming code rate Max that the server allows the video transmission device to push to the server. Therefore, no matter how the current set bit rate is adjusted, its value is always at the first threshold bit rate and the first bit rate. Between the two threshold bitrates, so as to ensure the quality of the live video and the smoothness of streaming.
- the adjusted current set bit rate is the discretized current network bandwidth and the first threshold code
- the current network bandwidth after discretization at time t2 is significantly reduced compared to the current set bit rate at time t1, so it needs to be adjusted
- the current set bit rate at time t2 is adjusted to the larger of the discretized current network bandwidth and the first threshold bit rate, that is, adjusted to the discretized current network bandwidth and live broadcast
- the adjusted current set bit rate is the larger of the discretized current network bandwidth and the first threshold bit rate, that is, when the current set bit rate is reduced, the reduced current set bit rate is guaranteed (That is, the adjusted current set bit rate) is greater than or equal to the first threshold bit rate.
- the purpose of this setting is to prevent the following from happening: If the current network bandwidth is less than the first threshold bit rate (for example, the minimum push code rate) Rate Min), then if the current set bit rate is directly reduced to the discretized current network bandwidth, it may cause the current set bit rate to be less than the minimum streaming bit rate Min, which will affect the live screen seriously and seriously affect the live broadcast. Effect. Therefore, through the above adjustments, the adjusted current set bit rate can be matched with the current network bandwidth, while ensuring the quality of the live broadcast while avoiding the delay of streaming, and improving the live broadcast effect and user experience.
- the adjusted current set bit rate is increased by at least one bit rate from the current set bit rate.
- the current set bit rate of is less than or equal to the second threshold bit rate (for example, the maximum streaming bit rate of live broadcast Max), to avoid the adjusted current set bit rate exceeding the maximum streaming bit rate allowed by the server and affect the live broadcast effect There was a problem.
- the bit rate increase can be increased on the basis of the current set bit rate, and the adjusted current set bit rate is at the current set bit rate
- the smaller one of the bit rate value obtained after at least one bit rate increase amount and the second threshold bit rate (for example, the maximum streaming bit rate Max of live broadcast) is increased, that is, the current set bit rate is increased by at least A bit rate value obtained after a bit rate increase.
- the current set bit rate is After adding a bit rate increase, a bit rate value is obtained.
- the bit rate value is still smaller than the maximum streaming bit rate Max of the live broadcast. Therefore, adjust the current set bit rate to this bit rate value to use the principle to control the live broadcast process. After adjusting the bit rate in Figure 6, you can finally obtain the adjusted current set bit rate curve as shown in Figure 6.
- the current set bit rate is used to push the stream, thereby effectively alleviating the live broadcast jam and live broadcast. Delay, improve user experience.
- the code rate increase is less than the discretization interval, and the discretization interval is used to discretize the current network bandwidth. Further, the increase of the code rate of 2 times is less than the discretization interval.
- the current set bit rate can be adjusted at a predetermined time interval according to the aforementioned method.
- the time interval can be set reasonably according to actual needs, for example, every interval of 3 seconds, 5 seconds, and 10 seconds. , 20 seconds, 30 seconds, 40 seconds, 50 seconds, 60 seconds, 80 seconds, etc.
- step S304 based on the adjusted current set bit rate, the video stream is pushed to the server.
- streaming to the server can be implemented by any suitable method well known to those skilled in the art.
- the video stream can be encapsulated in advance through, for example, the RTMP protocol or other protocols, and then through the encapsulation, for example, QoS( Quality of Service) algorithm pushes the video stream to the server.
- QoS( Quality of Service) algorithm pushes the video stream to the server.
- the live broadcast bit rate is dynamically adjusted according to the current network state, so as to solve the problems of slowing down and delay during the live broadcast process.
- the method according to the embodiment of the present invention can dynamically monitor the current network environment (that is, the current network bandwidth) during the current live broadcast, and adaptively adjust the live broadcast bit rate of the video transmission device, thereby effectively alleviating live broadcast jams and live broadcast delays, and improving user experience.
- the above method first performs discretization processing after acquiring the current network bandwidth, which reduces frequent adjustment of the code rate, reduces the oscillation of the code rate adjustment, and improves the stability.
- a method 700 for automatically adjusting the bitrate of live video is also provided.
- the method 700 will be described below with reference to FIG. 7 based on the perspective of the server.
- step S701 the current network bandwidth when the video transmission device currently pushes the video stream to the server is acquired.
- the current network bandwidth can be obtained by any suitable method well known to those skilled in the art, for example, the current network bandwidth can be obtained by testing the current network bandwidth, for example, uploading in a time window through a video transmission device Or the amount of downloaded data can be used to calculate the current network bandwidth, or a third-party tool can also be used to test the current network bandwidth.
- the server receives the current network bandwidth sent by the video transmission device when the video transmission device currently pushes the video stream to the server.
- step S702 the current network bandwidth is discretized to obtain the discretized current network bandwidth.
- discretizing the current network bandwidth to obtain the discretized current network bandwidth may be specifically discretizing (that is, performing rounding) on the current network bandwidth through a discretization interval. Obtain the discretized current network bandwidth. Through discretization, the fluctuation of the current network bandwidth can be reduced, and the frequent adjustment of the code rate when the code rate is adjusted based on the discretized current network bandwidth can be avoided and the fluctuation of the code rate adjustment can be reduced. Compared with the situation without discretization, the calculation workload is reduced, the load of the processor is reduced, and the stability is improved.
- the discretization interval in this article can be set reasonably based on a priori, which is not specifically limited here.
- the discretized current network bandwidth is obtained by rounding the current network bandwidth at discretization intervals, and the current network bandwidth in a specific range can be decentralized into the same network bandwidth by rounding. Therefore, the fluctuation of the network bandwidth is reduced to avoid subsequent frequent adjustments to the code rate. Furthermore, the discretized current network bandwidth is a value obtained by rounding down the current network bandwidth at the discretization interval , And by rounding down, the current network bandwidth can be reduced proportionally while rounding, so as to further reduce the fluctuation of network bandwidth to avoid subsequent frequent adjustments to the code rate. Specifically, the following formula (1) Express
- y is the current network bandwidth
- m is the discretization interval
- yf is the current network bandwidth of the discretization
- the linear broken line in the figure is the discretized current network bandwidth, and the curve is the actual current network bandwidth. From the figure, it can be seen that the discretized current network bandwidth fluctuates compared with the actual current network bandwidth. smaller.
- step S703 the current set bit rate is automatically adjusted according to the discretized current network bandwidth and the current set bit rate of the video transmission device.
- the current set bit rate of the video transmission device is also the streaming bit rate of the video transmission device during the current live broadcast.
- automatically adjusting the current set bit rate of the video transmission device according to the discretized current network bandwidth and the current set bit rate of the video transmission device includes: if the current set code rate is If the rate is greater than the discretized current network bandwidth, the current set bit rate is reduced, for example, the current set bit rate is reduced to be equal to or lower than the discretized current network bandwidth, so as to avoid excessive bit rate.
- the current set bit rate is less than the discretized current network bandwidth
- the current set bit rate is increased, for example, the current set bit rate is adjusted to be equal to the discretized current
- the network bandwidth may be less than the discretized current network bandwidth but greater than the currently set bit rate, so as to avoid problems such as screen freezes caused by the bit rate being too low, and improve the quality of the live broadcast.
- the currently set code rate is between a first threshold code rate and a second threshold code rate, wherein the second threshold code rate is greater than the first threshold code rate, wherein the first threshold code rate
- the bit rate can be the minimum streaming code rate Min for live streaming. If it is lower than the minimum streaming code rate, the live screen is likely to experience obvious freezes, which will seriously affect the live broadcast effect.
- the second threshold bit rate can be the maximum streaming code for live streaming.
- the maximum streaming code rate can be the maximum streaming code rate Max that the server allows the video transmission device to push to the server. Therefore, no matter how the current set bit rate is adjusted, its value is always at the first threshold bit rate and the first bit rate. Between the two threshold bitrates, so as to ensure the quality of the live video and the smoothness of streaming.
- the adjusted current set bit rate is the discretized current network bandwidth and the first threshold code
- t2 needs to be adjusted
- the current set bit rate at the moment is adjusted to the larger of the discretized current network bandwidth and the first threshold bit rate, that is, adjusted to the discretized current network bandwidth and the minimum of the live broadcast
- the adjusted current set bit rate is the larger of the discretized current network bandwidth and the first threshold bit rate, that is, when the current set bit rate is reduced, the reduced current set bit rate is guaranteed (That is, the adjusted current set bit rate) is greater than or equal to the first threshold bit rate.
- the purpose of this setting is to prevent the following from happening: If the current network bandwidth is less than the first threshold bit rate (for example, the minimum push code rate) Rate Min), then if the current set bit rate is directly reduced to the discretized current network bandwidth, it may cause the current set bit rate to be less than the minimum streaming bit rate Min, which will affect the live screen seriously and seriously affect the live broadcast. Effect. Therefore, through the above adjustments, the adjusted current set bit rate can be matched with the current network bandwidth, while ensuring the quality of the live broadcast while avoiding the delay of streaming, and improving the live broadcast effect and user experience.
- the adjusted current set bit rate is increased by at least one bit rate from the current set bit rate.
- the current set bit rate of is less than or equal to the second threshold bit rate (for example, the maximum streaming bit rate of live broadcast Max), to avoid the adjusted current set bit rate exceeding the maximum streaming bit rate allowed by the server and affect the live broadcast effect There was a problem.
- the bit rate increase can be increased on the basis of the current set bit rate, and the adjusted current set bit rate is at the current set bit rate
- the smaller one of the bit rate value obtained after at least one bit rate increase amount and the second threshold bit rate (for example, the maximum streaming bit rate Max of live broadcast) is increased, that is, the current set bit rate is increased by at least A bit rate value obtained after a bit rate increase.
- the current set bit rate is After adding a bit rate increase, a bit rate value is obtained.
- the bit rate value is still smaller than the maximum streaming bit rate Max of the live broadcast. Therefore, adjust the current set bit rate to this bit rate value to use the principle to control the live broadcast process. After adjusting the bit rate in Figure 6, you can finally obtain the adjusted current set bit rate curve as shown in Figure 6.
- the current set bit rate is used to push the stream, thereby effectively alleviating the live broadcast jam and live broadcast. Delay, improve user experience.
- the code rate increase is less than the discretization interval, and the discretization interval is used to discretize the current network bandwidth. Further, the increase of the code rate of 2 times is less than the discretization interval.
- the current set bit rate can be adjusted at a predetermined time interval according to the aforementioned method.
- the time interval can be set reasonably according to actual needs, for example, every interval of 3 seconds, 5 seconds, and 10 seconds. , 20 seconds, 30 seconds, 40 seconds, 50 seconds, 60 seconds, 80 seconds, etc.
- step S704 the adjusted current set bit rate is pushed to the video transmission device, so that the video transmission device pushes the video stream to the server based on the adjusted current set bit rate.
- the server pushes the adjusted current set bit rate to the video transmission device through the communication interface, so that the video transmission device pushes based on the adjusted current set bit rate
- the video is streamed to the server.
- the video transmission device can push the stream to the server by any suitable method well known to those skilled in the art.
- the video stream can be encapsulated in advance through, for example, the RTMP protocol or other protocols, and then through the QoS ( Quality of Service) algorithm pushes the video stream to the server.
- the server may receive that the video transmission device pushes the video stream based on the adjusted current set bit rate, and distribute the video stream to each playback terminal.
- the live broadcast bit rate is dynamically adjusted according to the current network state, so as to solve the problems of slowing down and delay during the live broadcast process.
- the method according to the embodiment of the present invention can dynamically monitor the current network environment (that is, the current network bandwidth) during the current live broadcast, and adaptively adjust the live broadcast bit rate of the video transmission device, thereby effectively alleviating live broadcast jams and live broadcast delays, and improving user experience.
- the above method first performs discretization processing after acquiring the current network bandwidth, which reduces frequent adjustment of the code rate, reduces the oscillation of the code rate adjustment, and improves the stability.
- the video transmission device 800 includes a memory 801, a processor 802, and a communication interface 803.
- the video transmission device 800 further includes one or more processors 802, one or more memories 801, and one or more processors 802 work together or individually.
- the video transmission device 800 may also include at least one of an input device (not shown), an output device (not shown), and an image sensor (not shown). These components are connected through a bus system and/or other forms of The connecting mechanism (not shown) is interconnected.
- the memory 801 is used to store executable instructions, for example, to store corresponding steps and program instructions in the method for automatically adjusting the bitrate of a live video according to an embodiment of the present invention. It may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- the volatile memory may include random access memory (RAM) and/or cache memory (cache), for example.
- the non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, and the like.
- the input device may be a device used by the user to input instructions, for example, it may be a device for the user to input instructions to control the start and end of the live broadcast, and may include one or more of a keyboard, a mouse, a microphone, and a touch screen.
- the output device may output various information (such as images or sounds) to the outside (such as a user), and may include one or more of a display, a speaker, etc., in this embodiment, the output device may include a display for displaying live images, etc. .
- the communication interface 803 is used for communication between the video transmission device 800 and other devices (for example, a live broadcast server), including wired or wireless communication.
- the video transmission device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof.
- the communication interface receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
- the communication interface 803 further includes a near field communication (NFC) module to facilitate short-range communication.
- the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- the processor 802 may be a central processing unit (CPU), an image processing unit (GPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other forms of processing with data processing capabilities and/or instruction execution capabilities Unit, and can control other components in the video transmission device to perform desired functions.
- the processor 802 can execute the instructions stored in the memory 801 to execute the corresponding steps in the method 300 for automatically adjusting the bitrate of a live video broadcast described herein.
- the processor 802 can include one or more embedded processors, processor cores, microprocessors, logic circuits, hardware finite state machines (FSM), digital signal processors (DSP), or combinations thereof.
- the processor 802 is configured to execute the instructions stored in the memory, so that the processor performs the following actions, the actions include: obtaining the current network bandwidth of the video transmission device when the video transmission device currently pushes the video stream to the server ; Discretize the current network bandwidth to obtain a discretized current network bandwidth; automatically adjust the current setting according to the discretized current network bandwidth and the current set bit rate of the video transmission device Bit rate; based on the adjusted current set bit rate, push the video stream to the server.
- the discretized current network bandwidth is obtained by rounding the current network bandwidth at a discretization interval. Further, the discretized current network bandwidth is a value obtained by rounding down the current network bandwidth at the discretization interval.
- automatically adjusting the current set bit rate according to the discretized current network bandwidth and the current set bit rate of the video transmission device includes: if the current set bit rate is greater than the discretized bit rate If the current network bandwidth is lower than the current set bit rate; if the current set bit rate is less than the discretized current network bandwidth, then the current set bit rate is increased.
- the currently set code rate is between a first threshold code rate and a second threshold code rate, wherein the second threshold code rate is greater than the first threshold code rate.
- the adjusted current set bit rate is the discretized current network bandwidth and the first threshold code The greater of the rate.
- the adjusted current set bit rate is increased by at least one bit rate from the current set bit rate The smaller of the code rate value obtained after the increase amount and the second threshold code rate.
- the code rate increase is less than the discretization interval, and the discretization interval is used to discretize the current network bandwidth.
- the code rate increase of 2 times is less than the discretization interval .
- the video transmission device 800 is a video collection device, and the video collection device is used to collect a video stream of a live video broadcast and push it to the server.
- the video capture device may be a camera (for example, a handheld pan-tilt camera), a mobile phone, a tablet computer, a smart wearable device, a computer or the like.
- the video transmission device 800 may also be used to receive a live video stream from a video capture device, and the video capture device is used to capture the video stream and send the video stream to the video stream.
- the video transmission device 800 pushes the video stream to the server 103.
- the video transmission device 800 may include, for example, a terminal device.
- the terminal device may be, for example, a mobile computing or communication device, a smart phone, a wearable device, a computer, or a desktop Computers, notebooks, tablets, etc.
- the terminal device can also be installed with an application program APP for controlling the video capture device.
- the terminal device (such as a smart phone) can communicate with the video capture device (such as a camera), so that the video stream of the live video can be received from the video capture device. , And push the video stream to the server.
- the video transmission device 800 can dynamically monitor the current network environment (that is, the current network bandwidth) during the current live broadcast, and adaptively adjust the live broadcast bit rate of the video transmission device, thereby effectively alleviating live broadcast jams and live broadcast delays, and improve user experience.
- the video transmission device 800 first performs discretization processing after acquiring the current network bandwidth, which reduces frequent adjustment of the code rate, reduces the oscillation of the code rate adjustment, and improves stability.
- the server 900 includes a memory 901, a processor 902, and a communication interface 903.
- the server 900 further includes one or more processors 902, one or more memories 901, and one or more processors 902 work together or individually.
- the server 900 may further include at least one of an input device (not shown) and an output device (not shown), and these components are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
- the memory 901 is used to store executable instructions, for example, to store corresponding steps and program instructions in the method 700 for automatically adjusting the bitrate of a live video according to an embodiment of the present invention. It may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- the volatile memory may include random access memory (RAM) and/or cache memory (cache), for example.
- the non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, and the like.
- the input device may be a device used by the user to input instructions, for example, it may be a device for the user to input instructions to control the start and end of the live broadcast, and may include one or more of a keyboard, a mouse, a microphone, and a touch screen.
- the output device may output various information (such as images or sounds) to the outside (such as a user), and may include one or more of a display, a speaker, etc., in this embodiment, the output device may include a display for displaying live images, etc. .
- the communication interface 903 is used for communication between the server 900 and other devices (for example, a live broadcast server), including wired or wireless communication.
- the server 900 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof.
- the communication interface receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
- the communication interface 903 further includes a near field communication (NFC) module to facilitate short-range communication.
- the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- the processor 902 may be a central processing unit (CPU), an image processing unit (GPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other forms of processing with data processing capabilities and/or instruction execution capabilities Unit, and can control other components in the video transmission device to perform desired functions.
- the processor 902 can execute the instructions stored in the memory 901 to execute the corresponding steps in the method 700 for automatically adjusting the bitrate of a live video described herein. To avoid repetition, it will not be repeated here.
- the processor 902 can include a Or multiple embedded processors, processor cores, microprocessors, logic circuits, hardware finite state machines (FSM), digital signal processors (DSP), or combinations thereof.
- the server 900 may be an electronic device capable of receiving input, processing the input, and generating output data.
- the electronic device can be a general-purpose computer, such as a desktop computer, a tablet computer, and a notebook computer.
- the electronic device can also be a virtual computing device, such as a virtual machine hosted in the cloud.
- the server 900 can dynamically monitor the current network environment (that is, the current network bandwidth) during the current live broadcast, adaptively adjust the live broadcast bit rate of the video transmission device, and enable the video transmission device to push the stream at a better bit rate. , Thereby effectively alleviating live broadcast jams and live broadcast delays, and improve user experience.
- the server 900 first performs discretization processing after acquiring the current network bandwidth, which reduces frequent adjustment of the code rate, reduces the oscillation of the code rate adjustment, and improves stability.
- FIG. 1 a system as shown in FIG. 1 is also provided. Since the system includes the aforementioned video transmission device and server, it also has the related functions of the video transmission device and server in the aforementioned embodiment, thereby achieving the same The advantages.
- the embodiment of the present invention also provides a computer storage medium on which a computer program is stored.
- One or more computer program instructions can be stored on the computer-readable storage medium, and the processor can run the program instructions stored in the storage device to implement the steps (implemented by the processor) in the embodiments of the present invention described herein.
- Functions and/or other desired functions for example, to perform the corresponding steps of the methods 300 and 700 for automatically adjusting the bit rate of a live video according to an embodiment of the present invention, and various application programs and programs may be stored in the computer-readable storage medium.
- Various data such as various data used and/or generated by the application program.
- the computer storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), and a portable compact disk.
- ROM read-only memory
- EPROM erasable programmable read-only memory
- CD-ROM Compact Only memory
- USB memory or any combination of the above storage media.
- the computer-readable storage medium may be any combination of one or more computer-readable storage media.
- the disclosed device and method can be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another device, or some features can be ignored or not implemented.
- the various component embodiments of the present invention may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them.
- a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules according to the embodiments of the present invention.
- DSP digital signal processor
- the present invention can also be implemented as a device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein.
- Such a program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals.
- Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
提供一种自动调整视频直播码率的方法、视频传输装置和服务器,该方法(300)包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽(S301);对当前网络带宽进行离散化处理,以获得离散化的当前网络带宽(S302);根据离散化的当前网络带宽和视频传输装置的当前设定码率,自动调整当前设定码率(S303);基于调整后的当前设定码率,推送视频流至服务器(S304)。该方法能够有效缓解直播卡顿及直播延迟,提高用户体验。并且,在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
Description
说明书
本发明总地涉及视频直播技术领域,更具体地涉及一种自动调整视频直播码率的方法、视频传输装置和服务器。
现有手持云台相机直播过程中,服务器推送码流一般采用前期设置好的固定码率进行推流,而实际使用场景下,直播网络质量是动态变化的,且不可预测。采用固定码率进行推流可能导致直播过程中存在直播画面卡顿以及延迟增大等问题,影响用户直播体验。
因此,鉴于上述问题的存在,本发明提出一种自动调整视频直播码率的方法、***和计算机存储介质。
发明内容
为了解决上述问题中的至少一个而提出了本发明。具体地,本发明一方面提供一种自动调整视频直播码率的方法,所述方法包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;基于调整后的当前设定码率,推送视频流至所述服务器。
本发明另一方面提供一种自动调整视频直播码率的方法,所述方法包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
本发明再一方面提供一种视频传输装置,所述视频传输装置包括:存储器,用于存储可执行指令;处理器,用于执行所述存储器中存储的所述指令,使得所述处理器执行以下动作,所述动作包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;基于调整后的当前设定码率,推送视频流至所述服务器。
本发明再一方面提供一种服务器,所述服务器包括:存储器,用于存储可执行指令;处理器,用于执行所述存储器中存储的所述指令,使得所述处理器执行以下动作,所述动作包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络 带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
本发明又一方面提供一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现前述的方法。
本发明实施例的方法和装置,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1示出了本发明一实施例中的视频直播***的架构示意图;
图2示出了本发明一实施例中的直播网络链路动态变化的示意图;
图3示出了本发明一个实施例中的自动调整视频直播码率的方法的示意性流程图;
图4示出了本发明一个实施例中的离散化的当前网络带宽的示意图;
图5示出了本发明一个实施例中的调整当前设定码率的过程示意图;
图6示出了本发明一个实施例中的调整后的当前设定码率的示意图;
图7示出了本发明另一个实施例中的自动调整视频直播码率的方法的示意性流程图;
图8示出了本发明一个实施例中的视频传输装置的示意性框图;
图9示出了本发明一个实施例中的服务器的示意性框图。
为了使得本发明的目的、技术方案和优点更为明显,下面将参照附图详细描述根据本发明的示例实施例。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是本发明的全部实施例,应理解,本发明不受这里描述的示例实施例的限制。基于本发明中描述的本发明实施例,本领域技术人员在没有付出创造性劳动的情况下所得到的所有其它实施例都应落入本发明的保护范围之内。
在下文的描述中,给出了大量具体的细节以便提供对本发明更为彻底的理解。然而,对于本领域技术人员而言显而易见的是,本发明可以无需一个或多个这些细节而得以实施。在其他的例子中,为了避免与本发明发生混淆,对于本领域公知的一些技术特征未进行描述。
应当理解的是,本发明能够以不同形式实施,而不应当解释为局限于这里提出的实施例。相反地,提供这些实施例将使公开彻底和完全,并且将本发明的范围完全地传递给本领域技术人员。
在此使用的术语的目的仅在于描述具体实施例并且不作为本发明的限制。在此使用时,单数形式的“一”、“一个”和“所述/该”也意图包括复数形式,除非上下文清楚指出另外的方式。还应明白术语“组成”和/或“包括”,当在该说明书中使用时,确定所述特征、整数、步骤、操作、元件和/或部件的存在,但不排除一个或更多其它的特征、整数、步骤、操作、元件、部件和/或组的存在或添加。在此使用时,术语“和/或”包括相关所列项目的任何及所有组合。
为了彻底理解本发明,将在下列的描述中提出详细的结构,以便阐释本发明提出的技术方案。本发明的可选实施例详细描述如下,然而除了这些详细描述外,本发明还可以具有其他实施方式。
下面结合附图,对本发明的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
图1为本发明一实施例中的视频直播***的架构示意图,参考图1,该视频直播***100可以包括:视频传输装置101、服务器102和播放端103。视频传输装置101与服务器102可以通过无线(例如传统4G、5G、WiFi或者互联网等)连接,播放端103与服务器102可以通过无线(例如传统4G、5G、WiFi或者互联网等)连接。
在一个示例中,视频传输装置101可以为视频采集装置(未示出),所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器102。其中,视频采集装置还可以更具体的用于进行音视频采集、视频处理(如美颜、加水印等)、音视频编码压缩、音视频封装等处理。可选地,视频采集装置可以是任意具有视频采集功能的电子设备,例如视频采集装置可以为相机(例如,手持云台相机)、手机、平板电脑、智能穿戴设备、计算机之类的设备。
在另一示例中,所述视频传输装置101还可以用于从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置,而视频传输装置101向服务器102推送该视频流,所述视频传输装置例如可以包括终端设备,该终端设备可以是例如移动计算或通信设备、智能手机、可穿戴设备、计算机、台式计算 机、笔记本、平板电脑等。该终端设备可以和视频采集装置(例如相机)通信连接(例如WiFi、蓝牙连接等),从而可以从视频采集装置接收视频直播的视频流,并向服务器推送该视频流。
服务器102可以包括流媒体服务器或直播平台的服务器,与所述视频传输装置101可以通过实时消息传输协议(RTMP,Real Time Messaging Protocol)进行音视频流传输,服务器102主要用于接收视频传输装置101传输的音视频流,然后将接收的音视频流分发给各个播放端103。在本文中,推流(up streaming)是指视频传输装置将语音流或视频流推送到服务器。
播放端103也即直播的观众,与服务器102通过RTMP或者超文本传输协议(HTTP,HyperText Transfer Protocol)进行音视频数据传输,主要用于接收服务器102传输的音视频流,对音视频流进行解码、播放。
在实际应用中,现有手持云台相机直播过程中,服务器推送码流一般采用前期设置好的固定码率进行推流,而实际使用场景下,直播网络质量是动态变化的,且不可预测,如图2所示的直播网络链路,其中,图中Max虚线表示直播的最大推流码率,通常以固定码率进行推流时将该最大推流码率设定为直播设定码率,Min虚线表示直播最小推流码率,在实际直播时,例如如图2所示,0至t2时间段网络带宽下降,t2至t3时间段网络带宽以较差状态平稳运行,t3至t5时间段网络带宽上升,t5至t6时间段网络带宽以较好状态平稳运行,t6至t7时间段网络带宽下降,时间t7之后网络以一般状态平稳运行,从图中可以看到,网络状态实时变化且不可预测。如果直播过程中视频传输装置采用固定码率进行推流可能导致直播过程中存在直播画面卡顿以及延迟增大等问题,影响用户直播体验。
基于上述应用场景的上述问题的存在,如图3所示,本发明实施例中提供一种动调整视频直播码率的方法300,基于视频传输装置的角度,该方法包括以下步骤:在步骤S301,获取视频传输装置当前向服务器推送视频流时的当前网络带宽;在步骤S302,对当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;在步骤S303,根据离散化的当前网络带宽和视频传输装置的当前设定码率,自动调整当前设定码率;在步骤S304,基于调整后的当前设定码率,推送视频流至服务器。通过上述方法,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,上述方法在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
具体地,下面参考图3至图6对本发明实施例中提供的一种动调整视频直播码率的方 法300进行描述,该描述基于视频传输装置的角度。
首选,如图3所示,在步骤S301中,获取视频传输装置当前向服务器推送视频流时的当前网络带宽。
在本文中,可以通过本领域技术人员熟知的任意适合的方法获取该当前网络带宽,例如,可以通过对当前网络带宽进行测试从而获取该当前网络带宽,例如,通过视频传输装置在时间窗口内上传或下载的数据量来计算当前网络带宽,或者,还可以通过第三方工具来测试该当前网络带宽。还可以通过检测视频传输装置的发送缓冲队列中的数据量来计算当前网络带宽。
接着,继续参考图3,在步骤S302中,对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽。
示例性地,对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽,可以具体为通过离散化间隔对所述当前网络带宽进行离散化处理(也即进行取整),以获得离散化的当前网络带宽,通过离散化处理可以降低当前网络带宽的波动,避免后续基于该离散化的当前网络带宽对码率进行调节时的码率的频繁调节以及降低了码率调节的震荡,相比不做离散化处理的情况,减小了计算工作量,降低了处理器的负荷,避免网络带宽反复震荡,提升了稳定性。
值得一提的是,在本文中离散化间隔可以根据先验进行合理设置,在此不对其进行具体限定。
在一个示例中,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得,通过取整可以使得特定范围内的当前网络带宽散化为相同的网络带宽,从而减小网络带宽的波动,以避免后续对码率的频繁调节。其中,取整可以包括向下取整或向上取整。例如,所述离散化的当前网络带宽为以所述离散化间隔对所述当前网络带宽向下取整而获得的数值,而通过向下取整的方式可以在取整的同时等比例的缩小当前网络带宽,从而进一步减小网络带宽的波动,以避免后续对码率的频繁调节。例如可以用以下公式(1)表示:
如图4所示,图中直线型折线为离散化的当前网络带宽,而曲线则为实际的当前网络带宽,从图可以看出离散化的当前网络带宽相比实际的当前网络带宽其变化波动更小。
接着,继续参考图3,在步骤S303,根据离散化的当前网络带宽和视频传输装置的当前设定码率,自动调整当前设定码率。
视频传输装置的当前设定码率也即为当前直播时的视频传输装置的推流码率。在一个示例中,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率,例如将当前设定码率降低到等于或低于离散化的当前网络带宽,从而避免由于码率过大而导致的直播延迟的发生,若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率,例如调整当前设定码率增大到等于离散化的当前网络带宽或者小于离散化的当前网络带宽而大于当前设定码率,从而避免由于码率过低而导致的画面卡顿等问题的出现,提高直播画面质量。
在一个示例中,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率,其中,第一阈值码率可以为直播的最小推流码率Min,低于该最小推流码率,直播画面很可能会发生明显卡顿,严重影响直播效果,第二阈值码率可以为直播的最大推流码率Max,该最大推流码率可以为服务器允许视频传输装置向服务器推流的最大推流码率Max,因此,无论当前设定码率如何调整,其数值始终处于第一阈值码率和第二阈值码率之间,从而保证直播画面的质量和推流的流畅性。
在一个示例中,若所述当前设定码率大于所述离散化的当前网络带宽,则所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者,可以通过以下公式表示:若yf<x,则调整后的x=max(yf,Min),其中,yf为离散化的当前网络带宽,x表示当前设定码率,Min为直播的最小推流码率,例如,参考图5中t1到t2时刻,在t2时刻离散化后的当前网络带宽相比t1时刻时的当前设定码率明显减小,因此,需要调整t2时刻的当前设定码率,将其调整为所述离散化的当前网络带宽和所述第一阈值码率中的较大者,也即调整为所述离散化的当前网络带宽和直播的最小推流码率中的较大者,由于t2时刻离散化的当前网络带宽和最小推流码率大体相等,因此,调整后的当前网络带宽为两者中的任意一个都可以。
调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者也即在降低当前设定码率时,保证降低后的当前设定码率(也即调整后的当前设定码率)大于或等于第一阈值码率,这样设定的目的是为了防止以下情况的发生:如果当前网络带宽小于第一阈值码率(例如最小推流码率Min),那么如果直接将当前设定码率降低为离散化的当前网络带宽则可能导致当前设定码率小于最小推流码率Min,从而影响使直播画面严重卡顿,严重影响直播的效果。因此,通过上述调整,可以使调整后的当前设定码率与当前网络带宽相匹配,在保证直播质量的同时避免推流的延迟,提高直播效果和用户体验。
在另一个示例中,若所述当前设定码率小于所述离散化的当前网络带宽,则所述调整 后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者,也即在增加当前设定码率避免直播卡顿并提高直播效果和稳定性的同时,也要保证调整后的当前设定码率小于或等于第二阈值码率(例如直播的最大推流码率Max),避免调整后的当前设定码率超过服务器允许的最大推流码率而对影响直播效果的问题出现。例如,参考图5中t4时刻之后t5时刻之前离散化的当前网络带宽发生变化的时刻,由于该时刻的离散化后的当前网络带宽大于t4时刻的当前设定码率,如果在该时刻仍然沿用t4时刻的设定码率将无法达到最佳直播效果,因此可以在当前设定码率的基础上增加码率增加量,则调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率(例如直播的最大推流码率Max)中的较小者,也即为当前设定码率上增加至少一个码率增加量后获得的码率数值,当直播进行到t5时刻时,再次检测到离散化的当前网络带宽仍然大于当前设定码率,那么继续上述操作,在所述当前设定码率上增加一个码率增加量后获得一个码率数值,该码率数值仍然比直播的最大推流码率Max小,因此,调整当前设定码率为该码率数值,以此原理对直播过程中的码率进行调整,最终可获得如图6所示的调整后的当前设定码率曲线图,在直播过程中基于该当前设定码率进行推流,从而有效缓解直播卡顿及直播延迟,提高用户体验。
可选地,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理,更进一步地,2倍的所述码率增加量小于所述离散化间隔,通过上述限定,保证在增大当前设定码率的过程中,以小幅度的码率增加量逐步增加当前设定码率,避免在大幅度增加码率时,在当前直播的下一刻网络带宽忽然发生变化而和当前设定码率不匹配时又要再次对码率进行调整的问题出现,也即防止频繁的对码率进行调节,从而减小计算量,提高直播质量和用户体验。
可以通过以下公式表示上述关系:若yf>x,则在当前设定值x上添加增加至少一个码率增加量Δ(delta)(例如,保证m/Δ>2),即增大后的x=x+Δ,则调整后的x=min(x+Δ,Max),其中,yf为离散化的当前网络带宽,x表示当前设定码率,Max为直播的最大推流码率。
在其他示例中,可以每间隔预定的时间间隔对当前设定码率依据前述的方法进行调整,该时间间隔可以根据实际需要进行合理的设定,例如可以每间隔3秒、5秒、10秒、20秒、30秒、40秒、50秒、60秒、80秒等。
继续参考图3,在步骤S304,基于调整后的当前设定码率,推送视频流至服务器。
具体地,可以通过本领域技术人员熟知的任何适合的方法实现向服务器推流,例如, 为了实现推流功能可以预先通过例如RTMP协议或其他协议对视频流进行封装,封装后再通过例如QoS(Quality of Service,服务质量)算法将视频流推送到服务器。由于本实施例中,基于直播过程中动态分析当前网络带宽,根据当前网络状态,动态调整直播码率,解决直播过程中减缓卡顿,延迟等问题。
根据本发明实施例的方法,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,上述方法在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
在本发明的另一个实施例中还提供一种自动调整视频直播码率的方法700,下面参考图7基于服务器的角度对该方法700进行描述。
首先,如图7所示,在步骤S701中,获取视频传输装置当前向服务器推送视频流时的当前网络带宽。
在本文中,可以通过本领域技术人员熟知的任意适合的方法获取该当前网络带宽,例如,可以通过对当前网络带宽进行测试从而获取该当前网络带宽,例如,通过视频传输装置在时间窗口内上传或下载的数据量来计算当前网络带宽,或者,还可以通过第三方工具来测试该当前网络带宽。
在另一个示例中,服务器接收所述视频传输装置发送的视频传输装置当前向服务器推送视频流时的当前网络带宽。
接着,继续参考图7,在步骤S702中,对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽。
示例性地,对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽,可以具体为通过离散化间隔对所述当前网络带宽进行离散化处理(也即进行取整),以获得离散化的当前网络带宽,通过离散化处理可以降低当前网络带宽的波动,避免后续基于该离散化的当前网络带宽对码率进行调节时的码率的频繁调节以及降低了码率调节的震荡,相比不做离散化处理的情况,减小了计算工作量,降低了处理器的负荷,提升了稳定性。
值得一提的是,在本文中离散化间隔可以根据先验进行合理设置,在此不对其进行具体限定。
在一个示例中,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得,通过取整可以使得特定范围内的当前网络带宽散化为相同的网络带宽,从而减小网络带宽的波动,以避免后续对码率的频繁调节,更进一步,所述离散化的当前网络 带宽为以所述离散化间隔对所述当前网络带宽向下取整而获得的数值,而通过向下取整的方式可以在取整的同时等比例的缩小当前网络带宽,从而进一步减小网络带宽的波动,以避免后续对码率的频繁调节,具体可以用以下公式(1)表示
:
如图4所示,图中直线型折线为离散化的当前网络带宽,而曲线则为实际的当前网络带宽,从图可以看出离散化的当前网络带宽相比实际的当前网络带宽其变化波动更小。
接着,继续参考图7,在步骤S703,根据离散化的当前网络带宽和视频传输装置的当前设定码率,自动调整当前设定码率。
视频传输装置的当前设定码率也即为当前直播时的视频传输装置的推流码率。在一个示例中,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整视频传输装置的所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率,例如将当前设定码率降低到等于或低于离散化的当前网络带宽,从而避免由于码率过大而导致的直播延迟的发生,若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率,例如调整当前设定码率增大到等于离散化的当前网络带宽或者小于离散化的当前网络带宽而大于当前设定码率,从而避免由于码率过低而导致的画面卡顿等问题的出现,提高直播画面质量。
在一个示例中,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率,其中,第一阈值码率可以为直播的最小推流码率Min,低于该最小推流码率,直播画面很可能会发生明显卡顿,严重影响直播效果,第二阈值码率可以为直播的最大推流码率Max,该最大推流码率可以为服务器允许视频传输装置向服务器推流的最大推流码率Max,因此,无论当前设定码率如何调整,其数值始终处于第一阈值码率和第二阈值码率之间,从而保证直播画面的质量和推流的流畅性。
在一个示例中,若所述当前设定码率大于所述离散化的当前网络带宽,则所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者,可以通过以下公式表示:若yf<x,则调整后的x=max(yf,Min),其中,yf为离散化的当前网络带宽x表示当前设定码率,Min为直播的最小推流码率,例如,参考图5中t1到t2时刻,在t2时刻离散化后的当前网络带宽相比t1时刻时的当前设定码率明显减小,因此,需要调整t2时刻的当前设定码率,将其调整为所述离散化的当前网络带宽和所述第一阈值码率 中的较大者,也即调整为所述离散化的当前网络带宽和直播的最小推流码率中的较大者,由于t2时刻离散化的当前网络带宽和最小推流码率大体相等,因此,调整后的当前网络带宽为两者中的任意一个都可以。
调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者也即在降低当前设定码率时,保证降低后的当前设定码率(也即调整后的当前设定码率)大于或等于第一阈值码率,这样设定的目的是为了防止以下情况的发生:如果当前网络带宽小于第一阈值码率(例如最小推流码率Min),那么如果直接将当前设定码率降低为离散化的当前网络带宽则可能导致当前设定码率小于最小推流码率Min,从而影响使直播画面严重卡顿,严重影响直播的效果。因此,通过上述调整,可以使调整后的当前设定码率与当前网络带宽相匹配,在保证直播质量的同时避免推流的延迟,提高直播效果和用户体验。
在另一个示例中,若所述当前设定码率小于所述离散化的当前网络带宽,则所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者,也即在增加当前设定码率避免直播卡顿并提高直播效果和稳定性的同时,也要保证调整后的当前设定码率小于或等于第二阈值码率(例如直播的最大推流码率Max),避免调整后的当前设定码率超过服务器允许的最大推流码率而对影响直播效果的问题出现。例如,参考图5中t4时刻之后t5时刻之前离散化的当前网络带宽发生变化的时刻,由于该时刻的离散化后的当前网络带宽大于t4时刻的当前设定码率,如果在该时刻仍然沿用t4时刻的设定码率将无法达到最佳直播效果,因此可以在当前设定码率的基础上增加码率增加量,则调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率(例如直播的最大推流码率Max)中的较小者,也即为当前设定码率上增加至少一个码率增加量后获得的码率数值,当直播进行到t5时刻时,再次检测到离散化的当前网络带宽仍然大于当前设定码率,那么继续上述操作,在所述当前设定码率上增加一个码率增加量后获得一个码率数值,该码率数值仍然比直播的最大推流码率Max小,因此,调整当前设定码率为该码率数值,以此原理对直播过程中的码率进行调整,最终可获得如图6所示的调整后的当前设定码率曲线图,在直播过程中基于该当前设定码率进行推流,从而有效缓解直播卡顿及直播延迟,提高用户体验。
可选地,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理,更进一步地,2倍的所述码率增加量小于所述离散化间隔,通过上述限定,保证在增大当前设定码率的过程中,以小幅度的码率增加量逐步增加当前设定码率,避免在大幅度增加码率时,在当前直播的下一刻网络带宽忽然发生变化而和当前设定码率 不匹配时又要再次对码率进行调整的问题出现,也即防止频繁的对码率进行调节,从而减小计算量,提高直播质量和用户体验。
可以通过以下公式表示上述关系:若yf>x,则在当前设定值x上添加增加至少一个码率增加量Δ(delta)(例如,保证m/Δ>2),即增大后的x=x+Δ,则调整后的x=min(x+Δ,Max),其中,yf为离散化的当前网络带宽,x表示当前设定码率,Max为直播的最大推流码率。
在其他示例中,可以每间隔预定的时间间隔对当前设定码率依据前述的方法进行调整,该时间间隔可以根据实际需要进行合理的设定,例如可以每间隔3秒、5秒、10秒、20秒、30秒、40秒、50秒、60秒、80秒等。
继续参考图7,在步骤S704,推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
具体地,服务器和视频传输装置之间通信连接,服务器通过通信接口推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
视频传输装置可以通过本领域技术人员熟知的任何适合的方法实现向服务器推流,例如,为了实现推流功能可以预先通过例如RTMP协议或其他协议对视频流进行封装,封装后再通过例如QoS(Quality of Service,服务质量)算法将视频流推送到服务器。服务器可以接收所述视频传输装置基于调整后的当前设定码率推送视频流,并将该视频流分发至各个播放端。由于本实施例中,基于直播过程中动态分析当前网络带宽,根据当前网络状态,动态调整直播码率,解决直播过程中减缓卡顿,延迟等问题。
根据本发明实施例的方法,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,上述方法在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
本发明再一个实施例还提供一种视频传输装置800,如图8所示,该视频传输装置800包括:存储器801、处理器802和通信接口803。
在一些实施例中,视频传输装置800还包括一个或多个处理器802,一个或多个存储器801,一个或多个处理器802共同地或单独地工作。可选地,视频传输装置800还可以包括输入装置(未示出)、输出装置(未示出)以及图像传感器(未示出)中的至少一个,这些组件通过总线***和/或其它形式的连接机构(未示出)互连。
存储器801用于存储可执行指令,例如用于存储用于实现根据本发明实施例的自动 调整视频直播码率的方法中的相应步骤和程序指令。可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。
输入装置可以是用户用来输入指令的装置,例如可以是用户输入控制直播开始、直播结束等指令的装置,并且可以包括键盘、鼠标、麦克风和触摸屏等中的一个或多个。
输出装置可以向外部(例如用户)输出各种信息(例如图像或声音),并且可以包括显示器、扬声器等中的一个或多个,本实施例中,输出装置可以包括显示器用于显示直播画面等。
通信接口803用于视频传输装置800和其他设备(例如直播服务器)之间进行通信,包括有线或者无线方式的通信。视频传输装置800可以接入基于通信标准的无线网络,如WiFi、2G、3G、4G、5G或它们的组合。在一个示例性实施例中,通信接口经由广播信道接收来自外部广播管理***的广播信号或广播相关信息。在一个示例性实施例中,所述通信接口803还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
处理器802可以是中央处理单元(CPU)、图像处理单元(GPU)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者具有数据处理能力和/或指令执行能力的其它形式的处理单元,并且可以控制视频传输装置中的其它组件以执行期望的功能。处理器802能够执行存储器801中存储的所述指令,以执行本文描述的自动调整视频直播码率的方法300中的相应步骤。例如,处理器802能够包括一个或多个嵌入式处理器、处理器核心、微型处理器、逻辑电路、硬件有限状态机(FSM)、数字信号处理器(DSP)或它们的组合。
在一个示例中,处理器802用于执行所述存储器中存储的所述指令,使得所述处理器执行以下动作,所述动作包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;基于调整后的当前设定码率,推送视频流至所述服务器。
可选地,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而 获得。进一步,所述离散化的当前网络带宽为以所述离散化间隔对所述当前网络带宽向下取整而获得的数值。
进一步,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率;若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率。
可选地,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率。
在一个示例中,若所述当前设定码率大于所述离散化的当前网络带宽,则所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者。在另一个示例中,若所述当前设定码率小于所述离散化的当前网络带宽,则所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者。进一步,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理,可选地,2倍的所述码率增加量小于所述离散化间隔。
在一个示例中,视频传输装置800为视频采集装置,所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器。例如视频采集装置可以为相机(例如,手持云台相机)、手机、平板电脑、智能穿戴设备、计算机之类的设备。
在另一示例中,所述视频传输装置800还可以用于从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置,而视频传输装置800向服务器103推送该视频流,所述视频传输装置800例如可以包括终端设备,该终端设备可以是例如移动计算或通信设备、智能手机、可穿戴设备、计算机、台式计算机、笔记本、平板电脑等。该终端设备上还可以安装有应用程序APP用于控制视频采集装置,该终端设备(例如智能手机)可以和视频采集装置(例如相机)通信连接,从而可以从视频采集装置接收视频直播的视频流,并向服务器推送该视频流。
根据本发明实施例的视频传输装置800,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,视频传输装置800在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
本发明另一个实施例还提供一种服务器900,如图9所示,该服务器900包括:存储器901、处理器902和通信接口903。
在一些实施例中,服务器900还包括一个或多个处理器902,一个或多个存储器901,一个或多个处理器902共同地或单独地工作。可选地,服务器900还可以包括输入装置(未示出)、输出装置(未示出)中的至少一个,这些组件通过总线***和/或其它形式的连接机构(未示出)互连。
存储器901用于存储可执行指令,例如用于存储用于实现根据本发明实施例的自动调整视频直播码率的方法700中的相应步骤和程序指令。可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。
输入装置可以是用户用来输入指令的装置,例如可以是用户输入控制直播开始、直播结束等指令的装置,并且可以包括键盘、鼠标、麦克风和触摸屏等中的一个或多个。
输出装置可以向外部(例如用户)输出各种信息(例如图像或声音),并且可以包括显示器、扬声器等中的一个或多个,本实施例中,输出装置可以包括显示器用于显示直播画面等。
通信接口903用于服务器900和其他设备(例如直播服务器)之间进行通信,包括有线或者无线方式的通信。服务器900可以接入基于通信标准的无线网络,如WiFi、2G、3G、4G、5G或它们的组合。在一个示例性实施例中,通信接口经由广播信道接收来自外部广播管理***的广播信号或广播相关信息。在一个示例性实施例中,所述通信接口903还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
处理器902可以是中央处理单元(CPU)、图像处理单元(GPU)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者具有数据处理能力和/或指令执行能力的其它形式的处理单元,并且可以控制视频传输装置中的其它组件以执行期望的功能。处理器902能够执行存储器901中存储的所述指令,以执行本文描述的自动调整视频直播码率的方法700中的相应步骤,为避免重复在此不再赘述,例如,处理器902能够包括一个或多个嵌入式处理器、处理器核心、微型处理器、逻辑电路、硬件有限状态机(FSM)、数字信号处理器(DSP)或它们的组合。
服务器900或是能够接收输入、处理输入并生成输出数据的电子设备。电子设备可以是通用计算机,例如台式计算机、平板计算机、笔记本电脑,电子设备还可以是虚拟计算 设备,例如托管在云中的虚拟机等。
根据本发明实施例的服务器900,能够动态监测当前直播时的网络环境(也即当前网络带宽),自适应调节视频传输装置的直播码率,使视频传输装置以更佳的码率进行推流,从而有效缓解直播卡顿及直播延迟,提高用户体验。并且,服务器900在获取到当前网络带宽后首先进行离散化处理,降低了码率的频繁调节以及降低了码率调节的震荡,提升了稳定性。
在其他实施例中还提供一种如图1所示的***,该***由于包括前述的视频传输装置和服务器,因此也就具有前述实施例中的视频传输装置和服务器的相关功能,从而实现同样的优点。
另外,本发明实施例还提供了一种计算机存储介质,其上存储有计算机程序。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器可以运行存储装置存储的所述程序指令,以实现本文所述的本发明实施例中(由处理器实现)的功能以及/或者其它期望的功能,例如以执行根据本发明实施例的自动调整视频直播码率的方法300、700的相应步骤,在所述计算机可读存储介质中还可以存储各种应用程序和各种数据,例如所述应用程序使用和/或产生的各种数据等。
例如,所述计算机存储介质例如可以包括智能电话的存储卡、平板电脑的存储部件、个人计算机的硬盘、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、或者上述存储介质的任意组合。所述计算机可读存储介质可以是一个或多个计算机可读存储介质的任意组合。
尽管这里已经参考附图描述了示例实施例,应理解上述示例实施例仅仅是示例性的,并且不意图将本发明的范围限制于此。本领域普通技术人员可以在其中进行各种改变和修改,而不偏离本发明的范围和精神。所有这些改变和修改意在被包括在所附权利要求所要求的本发明的范围之内。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它 的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个设备,或一些特征可以忽略,或不执行。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该本发明的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如相应的权利要求书所反映的那样,其发明点在于可以用少于某个公开的单个实施例的所有特征的特征来解决相应的技术问题。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域的技术人员可以理解,除了特征之间相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一些模块的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求 中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
Claims (45)
- 一种自动调整视频直播码率的方法,其特征在于,所述方法包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;基于调整后的当前设定码率,推送视频流至所述服务器。
- 如权利要求1所述的方法,其特征在于,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率;若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率。
- 如权利要求1所述的方法,其特征在于,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率。
- 如权利要求3所述的方法,其特征在于,若所述当前设定码率大于所述离散化的当前网络带宽,则所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者。
- 如权利要求3或4所述的方法,其特征在于,若所述当前设定码率小于所述离散化的当前网络带宽,则所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者。
- 如权利要求5所述的方法,其特征在于,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理。
- 如权利要求6所述的方法,其特征在于,2倍的所述码率增加量小于所述离散化间隔。
- 如权利要求1至7任一项所述的方法,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得。
- 如权利要求8所述的方法,其特征在于,所述离散化的当前网络带宽为以所述离散化间隔对所述当前网络带宽向下取整而获得的数值。
- 如权利要求1至9任一项所述的方法,其特征在于,所述视频传输装置为视频采集装置,所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器。
- 如权利要求1至9任一项所述的方法,其特征在于,所述视频传输装置从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置。
- 一种自动调整视频直播码率的方法,其特征在于,所述方法包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
- 如权利要求12所述的方法,其特征在于,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率;若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率。
- 如权利要求12所述的方法,其特征在于,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率。
- 如权利要求13或14所述的方法,其特征在于,若所述当前设定码率大于所述离散化的当前网络带宽,所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者。
- 如权利要求15所述的方法,其特征在于,若所述当前设定码率小于所述离散化的当前网络带宽,所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者。
- 如权利要求16所述的方法,其特征在于,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理。
- 如权利要求17所述的方法,其特征在于,2倍的所述码率增加量小于所述离散化间隔。
- 如权利要求12至18任一项所述的方法,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得。
- 如权利要求19所述的方法,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽向下取整而获得的数值。
- 如权利要求12至20任一项所述的方法,其特征在于,所述视频传输装置为视频采集装置,所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器。
- 如权利要求12至20任一项所述的方法,其特征在于,所述视频传输装置从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置。
- 一种视频传输装置,其特征在于,所述视频传输装置包括:存储器,用于存储可执行指令;处理器,用于执行所述存储器中存储的所述指令,使得所述处理器执行以下动作,所述动作包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;基于调整后的当前设定码率,推送视频流至所述服务器。
- 如权利要求23所述的视频传输装置,其特征在于,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率;若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率。
- 如权利要求23所述的视频传输装置,其特征在于,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率。
- 如权利要求25所述的视频传输装置,其特征在于,若所述当前设定码率大于所述离散化的当前网络带宽,则所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者。
- 如权利要求25或26所述的视频传输装置,其特征在于,若所述当前设定码率小于所述离散化的当前网络带宽,则所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者。
- 如权利要求27所述的视频传输装置,其特征在于,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理。
- 如权利要求28所述的视频传输装置,其特征在于,2倍的所述码率增加量小于所述离散化间隔。
- 如权利要求23至29任一项所述的视频传输装置,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得。
- 如权利要求30所述的视频传输装置,其特征在于,所述离散化的当前网络带宽为以所述离散化间隔对所述当前网络带宽向下取整而获得的数值。
- 如权利要求23至31任一项所述的视频传输装置,其特征在于,所述视频传输装置为视频采集装置,所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器。
- 如权利要求23至31任一项所述的视频传输装置,其特征在于,所述视频传输装 置从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置。
- 一种服务器,其特征在于,所述服务器包括:存储器,用于存储可执行指令;处理器,用于执行所述存储器中存储的所述指令,使得所述处理器执行以下动作,所述动作包括:获取视频传输装置当前向服务器推送视频流时的当前网络带宽;对所述当前网络带宽进行离散化处理,以获得离散化的当前网络带宽;根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率;推送调整后的当前设定码率至所述视频传输装置,以使所述视频传输装置基于调整后的当前设定码率推送视频流至所述服务器。
- 如权利要求34所述的服务器,其特征在于,根据所述离散化的当前网络带宽和所述视频传输装置的当前设定码率,自动调整所述当前设定码率,包括:若所述当前设定码率大于所述离散化的当前网络带宽,则降低所述当前设定码率;若所述当前设定码率小于所述离散化的当前网络带宽,则增大所述当前设定码率。
- 如权利要求34所述的服务器,其特征在于,所述当前设定码率处于第一阈值码率和第二阈值码率之间,其中,所述第二阈值码率大于所述第一阈值码率。
- 如权利要求35或36所述的服务器,其特征在于,若所述当前设定码率大于所述离散化的当前网络带宽,所述调整后的当前设定码率为所述离散化的当前网络带宽和所述第一阈值码率中的较大者。
- 如权利要求37所述的服务器,其特征在于,若所述当前设定码率小于所述离散化的当前网络带宽,所述调整后的当前设定码率为在所述当前设定码率上增加至少一个码率增加量后获得的码率数值和所述第二阈值码率中的较小者。
- 如权利要求38所述的服务器,其特征在于,所述码率增加量小于离散化间隔,所述离散化间隔用于对所述当前网络带宽进行离散化处理。
- 如权利要求39所述的服务器,其特征在于,2倍的所述码率增加量小于所述离散化间隔。
- 如权利要求34至40任一项所述的服务器,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽进行取整而获得。
- 如权利要求41所述的服务器,其特征在于,所述离散化的当前网络带宽为以离散化间隔对所述当前网络带宽向下取整而获得的数值。
- 如权利要求34至42任一项所述的服务器,其特征在于,所述视频传输装置为视频采集装置,所述视频采集装置用于采集视频直播的视频流,并推送至所述服务器。
- 如权利要求34至42任一项所述的服务器,其特征在于,所述视频传输装置从视频采集装置接收视频直播的视频流,所述视频采集装置用于采集所述视频流并将所述视频流发送至所述视频传输装置。
- 一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至22中任一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/079284 WO2021179304A1 (zh) | 2020-03-13 | 2020-03-13 | 自动调整视频直播码率的方法、视频传输装置和服务器 |
CN202080006510.3A CN113170214A (zh) | 2020-03-13 | 2020-03-13 | 自动调整视频直播码率的方法、视频传输装置和服务器 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/079284 WO2021179304A1 (zh) | 2020-03-13 | 2020-03-13 | 自动调整视频直播码率的方法、视频传输装置和服务器 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021179304A1 true WO2021179304A1 (zh) | 2021-09-16 |
Family
ID=76879282
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/079284 WO2021179304A1 (zh) | 2020-03-13 | 2020-03-13 | 自动调整视频直播码率的方法、视频传输装置和服务器 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113170214A (zh) |
WO (1) | WO2021179304A1 (zh) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143579A (zh) * | 2021-12-14 | 2022-03-04 | 江西电信信息产业有限公司 | 一种基于多线程队列及数组的视频推流方法及*** |
CN114422855A (zh) * | 2021-12-31 | 2022-04-29 | 北京五八信息技术有限公司 | 一种数据处理方法、装置、电子设备及存储介质 |
CN115834918A (zh) * | 2022-11-17 | 2023-03-21 | 深圳创维-Rgb电子有限公司 | 视频直播方法、装置、电子设备及可读存储介质 |
CN116614393A (zh) * | 2023-07-21 | 2023-08-18 | 中融云数(北京)技术有限公司 | 一种基于rtc通信的弱网场景带宽估计方法及*** |
WO2024051426A1 (zh) * | 2022-09-07 | 2024-03-14 | 腾讯科技(深圳)有限公司 | 视频流码率调整方法、装置、计算机设备和存储介质 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114630150A (zh) * | 2022-02-17 | 2022-06-14 | 儒安物联科技集团有限公司 | 一种适应用户多样性的视频流abr算法 |
CN115914682A (zh) * | 2022-11-24 | 2023-04-04 | 合肥移瑞通信技术有限公司 | 视频码率调整方法、***、服务器及存储介质 |
CN117528084B (zh) * | 2024-01-04 | 2024-03-26 | 书行科技(北京)有限公司 | 一种视频编码方法、装置、设备及存储介质 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103281568A (zh) * | 2013-04-25 | 2013-09-04 | 网宿科技股份有限公司 | 实现流媒体直播动态码率的方法及*** |
CN107277568A (zh) * | 2017-08-16 | 2017-10-20 | 广州市千钧网络科技有限公司 | 一种推流配置参数动态调整方法及装置 |
US20180054470A1 (en) * | 2015-03-20 | 2018-02-22 | Huawei Technologies Co., Ltd. | Streaming media resource downloading method and apparatus, and terminal device |
CN108012159A (zh) * | 2017-12-05 | 2018-05-08 | 广州华多网络科技有限公司 | 直播视频推送控制方法、装置及相应的终端 |
CN108024126A (zh) * | 2017-11-28 | 2018-05-11 | 北京潘达互娱科技有限公司 | 网络直播视频调整方法、装置、电子设备和存储介质 |
CN108540837A (zh) * | 2017-03-06 | 2018-09-14 | 华为技术有限公司 | 一种确定流媒体码率的方法和装置 |
WO2018176303A1 (zh) * | 2017-03-30 | 2018-10-04 | 深圳市大疆创新科技有限公司 | 视频传输、接收方法、***、设备及无人飞行器 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140286438A1 (en) * | 2013-03-19 | 2014-09-25 | Nvidia Corporation | Quality of service management server and method of managing streaming bit rate |
CN109874031A (zh) * | 2017-12-04 | 2019-06-11 | 华平信息技术股份有限公司 | 基于网络带宽预测的多优先级动态码率调整方法及*** |
-
2020
- 2020-03-13 WO PCT/CN2020/079284 patent/WO2021179304A1/zh active Application Filing
- 2020-03-13 CN CN202080006510.3A patent/CN113170214A/zh active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103281568A (zh) * | 2013-04-25 | 2013-09-04 | 网宿科技股份有限公司 | 实现流媒体直播动态码率的方法及*** |
US20180054470A1 (en) * | 2015-03-20 | 2018-02-22 | Huawei Technologies Co., Ltd. | Streaming media resource downloading method and apparatus, and terminal device |
CN108540837A (zh) * | 2017-03-06 | 2018-09-14 | 华为技术有限公司 | 一种确定流媒体码率的方法和装置 |
WO2018176303A1 (zh) * | 2017-03-30 | 2018-10-04 | 深圳市大疆创新科技有限公司 | 视频传输、接收方法、***、设备及无人飞行器 |
CN107277568A (zh) * | 2017-08-16 | 2017-10-20 | 广州市千钧网络科技有限公司 | 一种推流配置参数动态调整方法及装置 |
CN108024126A (zh) * | 2017-11-28 | 2018-05-11 | 北京潘达互娱科技有限公司 | 网络直播视频调整方法、装置、电子设备和存储介质 |
CN108012159A (zh) * | 2017-12-05 | 2018-05-08 | 广州华多网络科技有限公司 | 直播视频推送控制方法、装置及相应的终端 |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143579A (zh) * | 2021-12-14 | 2022-03-04 | 江西电信信息产业有限公司 | 一种基于多线程队列及数组的视频推流方法及*** |
CN114143579B (zh) * | 2021-12-14 | 2024-05-10 | 江西电信信息产业有限公司 | 一种基于多线程队列及数组的视频推流方法及*** |
CN114422855A (zh) * | 2021-12-31 | 2022-04-29 | 北京五八信息技术有限公司 | 一种数据处理方法、装置、电子设备及存储介质 |
WO2024051426A1 (zh) * | 2022-09-07 | 2024-03-14 | 腾讯科技(深圳)有限公司 | 视频流码率调整方法、装置、计算机设备和存储介质 |
CN115834918A (zh) * | 2022-11-17 | 2023-03-21 | 深圳创维-Rgb电子有限公司 | 视频直播方法、装置、电子设备及可读存储介质 |
CN116614393A (zh) * | 2023-07-21 | 2023-08-18 | 中融云数(北京)技术有限公司 | 一种基于rtc通信的弱网场景带宽估计方法及*** |
CN116614393B (zh) * | 2023-07-21 | 2023-11-28 | 中融云数(北京)技术有限公司 | 一种基于rtc通信的弱网场景带宽估计方法及*** |
Also Published As
Publication number | Publication date |
---|---|
CN113170214A (zh) | 2021-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021179304A1 (zh) | 自动调整视频直播码率的方法、视频传输装置和服务器 | |
CN108353239B (zh) | 无线音频同步 | |
US9106521B2 (en) | Method and system for visualizing an adaptive screen according to a terminal | |
US9288435B2 (en) | Speaker switching delay for video conferencing | |
WO2019154221A1 (zh) | 发送流数据的方法及数据发送设备 | |
US9213521B2 (en) | Control method of information processing apparatus and information processing apparatus | |
US10742955B2 (en) | Correlation of video stream frame timestamps based on a system clock | |
CN106415520B (zh) | 用于回放的高码率内容的预测性递送的***和方法 | |
US20200019535A1 (en) | Method and system for preparing data files for transmission over a data network | |
CN109660467B (zh) | 用于控制流量的方法和装置 | |
US8745170B2 (en) | Dynamic file streaming | |
CN103975569A (zh) | 用于仲裁时间敏感数据传输的方法和装置 | |
WO2023029846A1 (zh) | 多媒体资源上传方法、装置、电子设备以及可读存储介质 | |
WO2020211312A1 (en) | Data writing method, system, device and computer-readable storage medium | |
US20190074029A1 (en) | Voice data processing apparatus and voice data processing method for avoiding voice delay | |
WO2024099035A1 (zh) | 一种参数调节方法和相关装置 | |
JP6232604B2 (ja) | デバイスサーバとその制御方法 | |
US20150249698A1 (en) | Method and apparatus for playing multimedia contents in a communication | |
JP2010093346A (ja) | 情報送信装置、情報送信装置の制御方法及びコンピュータプログラム | |
US20170332149A1 (en) | Technologies for input compute offloading over a wireless connection | |
US10735508B2 (en) | Streaming synchronized media content to separate devices | |
US20150278149A1 (en) | Method for Real-Time HD Video Streaming Using Legacy Commodity Hardware Over an Unreliable Network | |
CN104506631A (zh) | 一种音频文件缓存方法和设备 | |
US11190317B2 (en) | Transmitting terminal, transmitting method, information processing terminal, and information processing method | |
US9560105B2 (en) | Server device and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20923919 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20923919 Country of ref document: EP Kind code of ref document: A1 |