CN111083536A - Method and device for adjusting video code rate - Google Patents

Method and device for adjusting video code rate Download PDF

Info

Publication number
CN111083536A
CN111083536A CN201911403641.0A CN201911403641A CN111083536A CN 111083536 A CN111083536 A CN 111083536A CN 201911403641 A CN201911403641 A CN 201911403641A CN 111083536 A CN111083536 A CN 111083536A
Authority
CN
China
Prior art keywords
target client
code rate
video
video stream
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911403641.0A
Other languages
Chinese (zh)
Other versions
CN111083536B (en
Inventor
周林军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911403641.0A priority Critical patent/CN111083536B/en
Publication of CN111083536A publication Critical patent/CN111083536A/en
Application granted granted Critical
Publication of CN111083536B publication Critical patent/CN111083536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management 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/266Channel 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/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a method and a device for adjusting video code rate, and belongs to the technical field of communication. The method comprises the following steps: sending the video stream with the first code rate to a target client through a bidirectional communication link; after receiving a request for reducing the code rate sent by the target client, determining the network bandwidth condition of a network accessed by the target client; if the network bandwidth of the network accessed by the target client is determined to be insufficient, acquiring a video stream with a second code rate to be sent, wherein the second code rate is lower than the first code rate; and sending the video stream with the second code rate to the target client through the bidirectional communication link. By adopting the method provided by the application, the technical problem that frame skipping or picture rebound easily occurs when the video code rate is adjusted in the related technology can be effectively solved, and the watching experience of a user is improved.

Description

Method and device for adjusting video code rate
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for adjusting a video bitrate.
Background
In order to ensure the fluency of videos watched by users, many clients have the function of dynamically adjusting the video code rate. When the user network quality is good, the video with higher code rate is played to ensure the high image quality of the video; when the user network is poor, the video with lower code rate is played to ensure the fluency of the video.
In the related technology, in the process of playing video, a live stream is obtained by using an HTTP (hyper text transport protocol), a client requests to play, a server continuously sends audio and video streams after receiving the client request, and the HTTP carries out one-way communication. When the client detects that the pause of the card possibly occurs, the client directly switches the playing address into the low-bit-rate video address, and establishes a new link to request to play the low-bit-rate audio/video stream.
In the course of implementing the present application, the inventors found that the related art has at least the following problems:
in the method for adjusting video bitrate in the related art, since a new link needs to be established to send a video stream with a lower bitrate, the problem of picture jump or frame skipping may occur, so that the picture is discontinuous, and the viewing experience of a user is affected.
Disclosure of Invention
The embodiment of the application provides a method and a device for adjusting video code rate, which can solve the technical problems in the related technology. The technical scheme of the method and the device for adjusting the video code rate is as follows:
in a first aspect, a method for adjusting a video bitrate is provided, where the method includes:
sending the video stream with the first code rate to a target client through a bidirectional communication link;
after receiving a request for reducing the code rate sent by the target client, determining the network bandwidth condition of a network accessed by the target client;
if the network bandwidth of the network accessed by the target client is determined to be insufficient, acquiring a video stream with a second code rate to be sent, wherein the second code rate is lower than the first code rate;
and sending the video stream with the second code rate to the target client through the bidirectional communication link.
In a possible implementation manner, the determining a network bandwidth condition of a network accessed by the target client includes:
determining the data volume of a sending buffer corresponding to the target client;
and determining the network bandwidth condition of the network accessed by the target client based on the data volume of the sending buffer corresponding to the target client.
In a possible implementation manner, the determining, based on the data amount of the transmission buffer corresponding to the target client, a network bandwidth condition of a network to which the target client accesses includes:
determining the average value of the data amount of the sending buffer corresponding to all the clients, wherein the played video is the same as the video played by the target client;
and if the difference value between the data volume of the sending buffer area corresponding to the target client and the average value is larger than a target threshold value, determining that the network bandwidth of the network accessed by the target client is insufficient.
In a possible implementation manner, the request for reducing the bit rate carries an identifier of a playing video and a playing progress;
the acquiring the video stream with the second code rate to be sent includes:
and determining the video stream after the playing progress as the video stream with the second code rate to be sent in the video stream corresponding to the identifier of the playing video based on the identifier of the playing video and the playing progress.
In a possible implementation manner, after determining a network bandwidth condition of a network accessed by the target client, the method further includes:
and sending a message carrying the network condition to the target client.
In a possible implementation manner, the request for reducing the bitrate is sent when the target client detects that the duration of the remaining playable videos in the video playing buffer is less than a target duration.
In a possible implementation manner, after the sending the video with the first bitrate to the target client through the bidirectional communication link, the method further includes:
after receiving a request for increasing the code rate sent by the target client, acquiring a video stream with a third code rate to be sent, wherein the third code rate is higher than the first code rate;
and sending the video stream with the third code rate to the target client through the bidirectional communication link.
In a second aspect, an apparatus for adjusting a video bitrate is provided, the apparatus comprising:
the sending module is used for sending the video stream with the first code rate to the target client through the bidirectional communication link;
the determining module is used for determining the network bandwidth condition of a network accessed by the target client after receiving the request for reducing the code rate sent by the target client;
an obtaining module, configured to obtain a video stream with a second code rate to be sent if it is determined that a network bandwidth of a network to which the target client is accessed is insufficient, where the second code rate is lower than the first code rate;
the sending module is further configured to send the video stream with the second bitrate to the target client through the bidirectional communication link.
In one possible implementation manner, the determining module is configured to:
determining the data volume of a sending buffer corresponding to the target client;
and determining the network bandwidth condition of the network accessed by the target client based on the data volume of the sending buffer corresponding to the target client.
In one possible implementation manner, the determining module is configured to:
determining the average value of the data amount of the sending buffer corresponding to all the clients, wherein the played video is the same as the video played by the target client;
and if the difference value between the data volume of the sending buffer area corresponding to the target client and the average value is larger than a target threshold value, determining that the network bandwidth of the network accessed by the target client is insufficient.
In a possible implementation manner, the request for reducing the bit rate carries an identifier of a playing video and a playing progress;
the obtaining module is configured to:
and determining the video stream after the playing progress as the video stream with the second code rate to be sent in the video stream corresponding to the identifier of the playing video based on the identifier of the playing video and the playing progress.
In a possible implementation manner, the sending module is further configured to:
and sending a message carrying the network condition to the target client.
In a possible implementation manner, the request for reducing the bitrate is sent when the target client detects that the duration of the remaining playable videos in the video playing buffer is less than a target duration.
In a possible implementation manner, the obtaining module is further configured to:
after receiving a request for increasing the code rate sent by the target client, acquiring a video stream with a third code rate to be sent, wherein the third code rate is higher than the first code rate;
the sending module is further configured to:
and sending the video stream with the third code rate to the target client through the bidirectional communication link.
In a third aspect, a terminal is provided, where the terminal includes a memory and a processor, and the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for adjusting a video bitrate according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the method for adjusting video bitrate according to the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the embodiment of the application provides a method for adjusting video code rate, which can be used for adjusting the video code rate. In the process of sending the video stream with the first code rate to the target client through the bidirectional communication link, after receiving a request for reducing the code rate sent by the target client, determining the network bandwidth condition of a network accessed by the target client. And if the network bandwidth of the network accessed by the target client is determined to be insufficient, acquiring the video stream with the second code rate to be sent, and sending the video stream with the second code rate to the target client through the original bidirectional communication link. Therefore, the method for adjusting the video code rate provided by the embodiment of the application sends the video stream through the bidirectional communication link, so that when the client detects that the pause in the video is likely to occur, the client can send the request for reducing the code rate to the server through the bidirectional communication link, the server can directly send the video stream to the client through the original bidirectional communication link without establishing a new link, the possibility of picture jump back and frame jump is reduced, and the watching experience of a user is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for adjusting a video bitrate according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus for adjusting a video bitrate according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a server provided in an embodiment of the present application;
fig. 4 is an implementation environment diagram of a method for adjusting a video bitrate according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Please refer to fig. 4, which illustrates an implementation environment of the method for adjusting a video bitrate according to an embodiment of the present application. The implementation environment may include a server 01 and one or more terminals 02 (e.g., 2 terminals 02 are shown in fig. 4). Each terminal 02 may establish a bidirectional communication link with the server 02 in a wired or wireless manner, for example, a Real Time Messaging Protocol (RTMP) link may be established.
The terminal 02 may be a smart phone, a tablet computer, an MP4(moving picture experts group audio layer IV), a laptop portable computer, or a desktop computer. Each terminal 02 is installed with a client (this client may also be referred to as an application) capable of playing video, such as a live client. The server 01 may be a server, a server cluster composed of a plurality of servers, or a cloud computing service center. The server 01 may be a background server of a client installed in the terminal 02.
In the embodiment of the present application, the server 01 sends a video stream to the terminal 02, so that the target client plays a video. In the process of playing the video, when the target client detects that video playing is about to be paused, or when the target client artificially selects to reduce the code rate, the target client may send a request for reducing the code rate to the server 01. The server 01 detects the network bandwidth condition of the network accessed by the target client to determine whether the bitrate needs to be reduced, and sends the bitrate-reduced video stream to the server when the network bandwidth is determined to be insufficient, so as to ensure the smoothness of the video played by the target client.
As shown in fig. 1, a processing flow of the method for adjusting a video bitrate provided by the embodiment of the present application may include the following steps:
in step 101, a video stream at a first bitrate is transmitted to a target client over a bidirectional communication link.
Wherein the bi-directional communication link may be an RTMP link. The server and the client which establish the bidirectional communication link can both actively initiate communication and send notification signaling data or send video stream data.
The video stream may or may not be a live video stream, such as a movie or a tv show. The video stream may include both audio data and image data.
In implementation, the server sends the video stream with the first code rate to the target client in real time through the bidirectional communication link, so that the target client can play the video corresponding to the video stream. It can be appreciated that the first code rate should be larger than the lowest code rate that can be achieved, since the code rate needs to be lowered.
In step 102, after receiving the request for reducing the bit rate sent by the target client, the network bandwidth condition of the network accessed by the target client is determined.
Network bandwidth conditions may include, among others, insufficient network bandwidth and sufficient network bandwidth.
In implementation, the target client can start a function of dynamically adjusting the code rate to ensure the smoothness of playing the video. In the process of playing the video, the target client monitors the time length of the remaining playable video in the video playing cache region in real time, if the time length is less than the target time length, it is judged that the video is likely to be jammed, and at this time, a request for reducing the code rate can be sent to the server. That is, the request for reducing the bit rate is sent when the target client detects that the duration of the remaining playable video in the video playing buffer is less than the target duration.
Or, the user can also manually select to reduce the bitrate of the video during the process of watching the video. At this time, the user may operate on the terminal, trigger the instruction to decrease the code rate, and send the request to decrease the code rate to the server when the target client detects the instruction to decrease the code rate.
After receiving a request for reducing the code rate sent by the target client, the server needs to determine the network bandwidth condition of the network accessed by the target client, and then determines whether to reduce the code rate. Because, in some cases, the target client may issue a request to reduce the bitrate in case of error, even reducing the bitrate may not solve the problem. For example, the target client sends a request for reducing the code rate to the server when detecting that the data that can be played in the buffer area is empty, but the buffer area may be slow in receiving/downloading rate, or may be slow in sending data due to a problem of a video source, or the server has a busy task, a high load and is slow in sending data, and the data is unrelated to the code rate, so that the code rate does not need to be reduced in some cases, and even if the code rate is reduced, the problem cannot be solved. Therefore, the server needs to determine the network bandwidth condition, video source condition, and server resource condition of the network to which the target client is connected.
In a possible implementation manner, the method for the server to determine the network bandwidth condition of the network to which the target client accesses may be as follows, and determine the data amount of the sending buffer corresponding to the target client. And determining the network bandwidth condition of the network accessed by the target client based on the data volume of the sending buffer corresponding to the target client.
The server side is provided with a plurality of sending buffer areas for a plurality of clients connected with the server side, the sending buffer areas are used for writing data to be sent to the clients by the server side, and after response messages (used for indicating that the clients receive certain data) returned by the clients are received, the server side deletes the data corresponding to the response messages in the sending buffer areas. Therefore, when the speeds of writing in the transmission buffers by the server are the same, the larger the data amount of a certain transmission buffer is, the lower the transmission speed corresponding to the transmission buffer is, and the network bandwidth of the target client corresponding to the transmission buffer is insufficient.
In implementation, first, the data amount of the transmission buffer corresponding to the target client is determined.
Then, in a possible implementation manner, the data amount may be compared with a set target data amount threshold, and when the data amount is greater than the target data amount threshold, it may be determined that the network bandwidth of the network to which the target client accesses is insufficient; when the data amount is less than the target data amount threshold, it may be determined that the network bandwidth of the network to which the target client accesses is sufficient.
Or, in another possible implementation manner, an average value of data amounts of sending buffers corresponding to all clients where the played video is the same as the video played by the target client is determined. And if the difference value between the data volume of the sending buffer area corresponding to the target client and the average value is larger than the target threshold value, determining that the network bandwidth of the network accessed by the target client is insufficient.
The difference between the data volume of the sending buffer corresponding to the target client and the average value is greater than the target threshold, which means that the difference between the data volume and the average value is greater than the target threshold.
In implementation, by using the average value of the data volumes of the sending buffers corresponding to all the clients that play the same video as the video played by the target client as a comparison reference, the influence of the video source itself can be reduced (for example, if the video source is poor, the sending rate is generally poor, and the data volume of the sending buffer is generally large). If the data volume of the sending buffer corresponding to the target client is larger than the average value, it can be said that the receiving speed of the target client is relatively slow, and when the data volume of the data volume exceeding the average value reaches the target threshold value, it is said that the network bandwidth of the network accessed by the target client is insufficient. If the data volume of the sending buffer zone corresponding to the target client is smaller than the average value, the receiving speed of the target client is higher, and the network bandwidth of the accessed network is sufficient.
In a possible implementation manner, in order to facilitate the user to know the network bandwidth situation, after determining the network bandwidth situation of the network to which the target client accesses, a message carrying the network situation may be sent to the target client.
In implementation, if the server determines that the network bandwidth of the network received by the target client is sufficient, the video playing will not become smooth even if the bitrate of the video is reduced, so in this case, the adjustment processing of the bitrate of the video may not be performed. In order to let the user know the reason for not reducing the video bitrate (for example, for the case that the user selects to reduce the bitrate, the user may be prompted accordingly), a message carrying the network condition may be sent to the target client, for example, the message may be "network bandwidth is sufficient at this time, and bitrate does not need to be reduced". In addition, in order to enhance the autonomy of the user, an option of "whether to continue to reduce the bit rate" may also be displayed in the interface where the target client displays the message.
If the server determines that the network bandwidth received by the target client is insufficient, the server may also send information carrying the network condition to the target client, for example, in this case, the information may be "the network bandwidth is insufficient at this time, and the code rate is to be reduced".
In step 103, if it is determined that the network bandwidth of the network to which the target client is accessed is insufficient, a video stream with a second bitrate to be sent is obtained.
Wherein the second code rate is lower than the first code rate.
The request for reducing the code rate carries the identifier of the played video and the playing progress.
The server may store the video streams with multiple bit rates in advance.
In implementation, when it is determined that the network bandwidth of the network to which the target client accesses is insufficient, the video stream with the second bitrate needs to be sent to the target client. And, the first frame of the transmitted video stream of the second bitrate should be accurate to avoid picture back-off or frame skipping.
In a possible implementation manner, the method for obtaining the video stream with the second bitrate to be sent may be as follows, based on the identifier of the played video and the playing progress, and in the video stream corresponding to the identifier of the played video, determining that the video stream after the playing progress is the video stream with the second bitrate to be sent.
The playing progress can be a timestamp of a video frame being played when the client sends a request for reducing the code rate.
In implementation, the server may determine the video stream of the second bitrate according to the identifier of the video carried in the request for reducing bitrate. And then, according to the time stamp of the carried video frame, determining the video frame with the time stamp same as the carried time stamp in the video stream of the total second code rate. And finally, determining all video streams after the determined video frame as video streams to be sent. Thus, the possibility of picture skipping or frame skipping is reduced.
In step 104, the video stream at the second bitrate is sent to the target client over the bidirectional communication link.
In implementation, after the video stream with the second bitrate to be sent is obtained, the video stream with the second bitrate to be sent can be sent to the target client.
In a possible implementation manner, in order to make the user know that the current bitrate has been reduced, a message carrying information that the bitrate has been reduced may be sent to the target client.
It should be added that, besides the above case of reducing the code rate, the case of increasing the code rate is also included, and the specific process may be as follows:
the first step is that after a request for increasing the code rate sent by a target client is received, a video stream with a third code rate to be sent is obtained.
Wherein the third bitrate is higher than the first bitrate if the request to increase bitrate is sent after the target client sends the video stream of the first bitrate over the bidirectional communication link. The third bitrate is higher than the second bitrate if the request to increase bitrate is sent after the target client sends the video stream at the second bitrate over the bidirectional communication link.
The request for increasing the code rate also carries the identifier and the playing progress of the playing video. The playing progress may be a timestamp of a video frame being played when the client sends a request to increase the bitrate.
In implementation, in the process of playing the video, the target client monitors the remaining time length of the video that can be played in the video playing buffer area in real time, and if the time length is greater than the target time length within a period of time, the target client may try to increase the video code rate. Then at this point, a request to increase the video bitrate may be sent to the server.
Or, the user can manually select to increase the bitrate of the video during the process of watching the video. At this time, the user may operate on the terminal, trigger the instruction for increasing the code rate, and send the request for increasing the code rate to the server when the target client detects the instruction for increasing the code rate.
When a request for increasing the code rate is received, a video stream with a third code rate to be sent needs to be determined.
First, the total video stream with the third bitrate can be determined according to the identifier of the video carried in the request for increasing bitrate. And then, according to the timestamp of the carried video frame, determining the video frame with the timestamp same as the carried timestamp in the video stream of the total third code rate. And finally, determining all video streams after the determined video frame as video streams to be sent. Thus, the possibility of picture skipping or frame skipping is reduced.
Secondly, sending the video stream with the third code rate to the target client through the bidirectional communication link
In implementation, after the video stream with the third bitrate to be sent is obtained, the video stream with the third bitrate to be sent can be sent to the target client.
In order to facilitate the user to know that the current code rate is increased, a message carrying information that the code rate is increased can be sent to the target client.
Compared with the method for reducing the code rate in the related technology, the method for regulating the video code rate has the advantages that the client side in the related technology obtains the live broadcast stream through the HTTP, and the HTTP protocol is in one-way communication, so that the client side is difficult to send the notification message to the server side, when the client side detects that the code rate needs to be regulated, the client side can only reinitiate the playing request, the playing address is switched to the low-code-rate video address, and a new link request is established to play the low-code-rate audio/video stream. This inevitably leads to picture-skipping or frame-skipping problems.
In the method for adjusting video bitrate provided by the embodiment of the application, in the process of sending the video stream with the first bitrate to the target client through the bidirectional communication link, after receiving a bitrate reduction request sent by the target client, the network bandwidth condition of a network accessed by the target client is determined. And if the network bandwidth of the network accessed by the target client is determined to be insufficient, acquiring the video stream with the second code rate to be sent, and sending the video stream with the second code rate to the target client through the original bidirectional communication link. Therefore, according to the method for adjusting the video bitrate provided by the embodiment of the application, the video stream and the signaling are transmitted through the bidirectional communication link, so that when the client detects that the pause in the video stream is likely to occur, the request for reducing the bitrate can be transmitted to the server through the bidirectional communication link, the server can directly transmit the video stream to the client through the original bidirectional communication link without establishing a new link, the possibility of picture jump back and frame jump is reduced, and the watching experience of a user is effectively improved.
In addition, when the request for reducing the code rate is received, the server side judges the network bandwidth condition of the network accessed by the client side, so that the occurrence of the condition of reducing the code rate when the network bandwidth is sufficient can be reduced.
The following describes a method for adjusting video bitrate according to an embodiment of the present application with a specific example.
(1) And the target client initially plays the video with the first code rate.
(2) And the target client detects the duration of the remaining playable video in the video playing buffer area in real time, judges that the jamming is likely to occur when the duration is less than the target duration, and informs the server of the need of reducing the code rate through an RTMP notification message.
(3) After receiving the request for reducing the code rate sent by the target client, the server detects and confirms the network bandwidth condition of the network accessed by the target client, and the detection scheme is as follows:
a: the server side counts the average value of the data volume of the sending buffer areas corresponding to all the clients in real time;
b: and detecting the data volume of a sending buffer corresponding to the target client, and when the difference value between the data volume and the average value is larger than a target threshold value, determining that the network bandwidth is insufficient and the code rate playing needs to be reduced.
(4) And after the server side checks and confirms, the server side informs the client side of the detection result.
(5) After confirming that the code rate needs to be reduced, the server starts a video frame replacement function, acquires a video stream with a second code rate coded in advance, searches for a sending position, sends the video stream with the second code rate to be sent based on the original bidirectional communication link, and simultaneously informs the client that the current actual code rate is changed.
(6) After the code rate is reduced, the target client side tries to improve the playing image quality after detecting that the remaining playable videos in the video playing cache area are continuously stable for a period of time, and informs the server side of needing to improve the code rate.
(7) And after receiving the request for increasing the code rate, the server closes the dynamic replacement function of the video frame, and sends the video stream with the first code rate according to the original bidirectional communication link.
Based on the same technical concept, an embodiment of the present application further provides a device for adjusting a video bitrate, where the device may be a server in the foregoing embodiment, as shown in fig. 2, and the device includes:
a sending module 201, configured to send a video stream with a first code rate to a target client through a bidirectional communication link;
a determining module 202, configured to determine, after receiving a request for reducing a code rate sent by a target client, a network bandwidth condition of a network to which the target client accesses;
an obtaining module 203, configured to obtain a video stream with a second code rate to be sent if it is determined that a network bandwidth of a network to which a target client is accessed is insufficient, where the second code rate is lower than the first code rate;
the sending module 201 is further configured to send the video stream with the second bitrate to the target client through the bidirectional communication link.
In one possible implementation, the determining module 202 is configured to:
determining the data volume of a sending buffer corresponding to a target client;
and determining the network bandwidth condition of the network accessed by the target client based on the data volume of the sending buffer corresponding to the target client.
In one possible implementation, the determining module 202 is configured to:
determining the average value of the data amount of the sending buffer corresponding to all the clients, wherein the played video is the same as the video played by the target client;
and if the difference value between the data volume of the sending buffer area corresponding to the target client and the average value is larger than the target threshold value, determining that the network bandwidth of the network accessed by the target client is insufficient.
In a possible implementation manner, the request for reducing the code rate carries an identifier of a played video and a playing progress;
an obtaining module 203, configured to:
and determining the video stream after the playing progress to be the video stream with the second code rate to be sent in the video stream corresponding to the identifier of the playing video based on the identifier of the playing video and the playing progress.
In a possible implementation manner, the sending module 201 is further configured to:
and sending a message carrying the network condition to the target client.
In one possible implementation, the request for reducing the bitrate is sent when the target client detects that the duration of the remaining playable video in the video play cache region is less than the target duration.
In a possible implementation manner, the obtaining module 203 is further configured to:
after receiving a request for increasing the code rate sent by a target client, acquiring a video stream with a third code rate to be sent, wherein the third code rate is higher than the first code rate;
the sending module 201 is further configured to:
and sending the video stream with the third code rate to the target client through the bidirectional communication link.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that: in the apparatus for adjusting a video bitrate provided in the foregoing embodiment, when the video bitrate is adjusted, only the division of the functional modules is illustrated, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for adjusting video bitrate provided by the foregoing embodiment and the method embodiment for adjusting video bitrate belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
Fig. 3 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 300 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 301 and one or more memories 302, where the memory 302 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 301 to implement the method for adjusting the video bitrate.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method for adjusting a video bitrate in the above-mentioned embodiment. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for adjusting video bitrate, the method comprising:
sending the video stream with the first code rate to a target client through a bidirectional communication link;
after receiving a request for reducing the code rate sent by the target client, determining the network bandwidth condition of a network accessed by the target client;
if the network bandwidth of the network accessed by the target client is determined to be insufficient, acquiring a video stream with a second code rate to be sent, wherein the second code rate is lower than the first code rate;
and sending the video stream with the second code rate to the target client through the bidirectional communication link.
2. The method of claim 1, wherein the determining a network bandwidth condition of a network accessed by the target client comprises:
determining the data volume of a sending buffer corresponding to the target client;
and determining the network bandwidth condition of the network accessed by the target client based on the data volume of the sending buffer corresponding to the target client.
3. The method of claim 2, wherein the determining the network bandwidth condition of the network accessed by the target client based on the data amount of the transmission buffer corresponding to the target client comprises:
determining the average value of the data amount of the sending buffer corresponding to all the clients, wherein the played video is the same as the video played by the target client;
and if the difference value between the data volume of the sending buffer area corresponding to the target client and the average value is larger than a target threshold value, determining that the network bandwidth of the network accessed by the target client is insufficient.
4. The method according to claim 1, wherein the request for reducing the bitrate carries an identifier of playing the video and a playing progress;
the acquiring the video stream with the second code rate to be sent includes:
and determining the video stream after the playing progress as the video stream with the second code rate to be sent in the video stream corresponding to the identifier of the playing video based on the identifier of the playing video and the playing progress.
5. The method of claim 1, wherein after determining the network bandwidth condition of the network accessed by the target client, further comprising:
and sending a message carrying the network condition to the target client.
6. The method of claim 1, wherein the request to reduce the bitrate is sent when the target client detects that a duration of the remaining playable video in the video play buffer is less than a target duration.
7. The method of any of claims 1-6, wherein after sending the video stream at the first bitrate over the bi-directional communication link to the target client, further comprising:
after receiving a request for increasing the code rate sent by the target client, acquiring a video stream with a third code rate to be sent, wherein the third code rate is higher than the first code rate;
and sending the video stream with the third code rate to the target client through the bidirectional communication link.
8. An apparatus for adjusting video bitrate, the apparatus comprising:
the sending module is used for sending the video stream with the first code rate to the target client through the bidirectional communication link;
the determining module is used for determining the network bandwidth condition of a network accessed by the target client after receiving the request for reducing the code rate sent by the target client;
an obtaining module, configured to obtain a video stream with a second code rate to be sent if it is determined that a network bandwidth of a network to which the target client is accessed is insufficient, where the second code rate is lower than the first code rate;
the sending module is further configured to send the video stream with the second bitrate to the target client through the bidirectional communication link.
9. A server, comprising a processor and a memory, wherein the memory has stored therein at least one instruction, which is loaded and executed by the processor to implement the method for adjusting video bitrate of any one of claims 1-7.
10. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor, to implement the method for adjusting a video bitrate of any one of claims 1-7.
CN201911403641.0A 2019-12-31 2019-12-31 Method and device for adjusting video code rate Active CN111083536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911403641.0A CN111083536B (en) 2019-12-31 2019-12-31 Method and device for adjusting video code rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911403641.0A CN111083536B (en) 2019-12-31 2019-12-31 Method and device for adjusting video code rate

Publications (2)

Publication Number Publication Date
CN111083536A true CN111083536A (en) 2020-04-28
CN111083536B CN111083536B (en) 2022-02-22

Family

ID=70320212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911403641.0A Active CN111083536B (en) 2019-12-31 2019-12-31 Method and device for adjusting video code rate

Country Status (1)

Country Link
CN (1) CN111083536B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055698A (en) * 2021-03-09 2021-06-29 百果园技术(新加坡)有限公司 Video parameter adjusting method, device, equipment and medium
CN114760528A (en) * 2022-04-19 2022-07-15 广州方硅信息技术有限公司 Method, system, device, computer equipment and medium for video data transmission
WO2023193126A1 (en) * 2022-04-05 2023-10-12 Citrix Systems, Inc. Enhanced video conferencing based on speech detection
CN116916071A (en) * 2023-06-12 2023-10-20 广州开得联软件技术有限公司 Video picture display method, system, device, electronic equipment and storage medium
CN117596234A (en) * 2023-09-28 2024-02-23 书行科技(北京)有限公司 Multi-person conversation method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833219A (en) * 2011-06-16 2012-12-19 华为技术有限公司 Method and device for transmitting data files to client side
CN103002272A (en) * 2011-09-15 2013-03-27 上海聚力传媒技术有限公司 Method, device and equipment for switching code rate of audio and video information
CN106488265A (en) * 2016-10-12 2017-03-08 广州酷狗计算机科技有限公司 A kind of method and apparatus sending Media Stream
CN106791956A (en) * 2016-11-25 2017-05-31 百度在线网络技术(北京)有限公司 The processing method and processing device of network direct broadcasting interim card
CN108024126A (en) * 2017-11-28 2018-05-11 北京潘达互娱科技有限公司 Network direct broadcasting video regulation method, device, electronic equipment and storage medium
CN108769805A (en) * 2018-06-11 2018-11-06 广州酷狗计算机科技有限公司 Data transmission method, device, computer equipment and storage medium
CN109120933A (en) * 2018-10-11 2019-01-01 广州酷狗计算机科技有限公司 Dynamic adjusts method, apparatus, equipment and the storage medium of code rate
CN110022498A (en) * 2018-01-08 2019-07-16 深圳市中兴微电子技术有限公司 A kind of method and device for realizing code rate switching
WO2019184643A1 (en) * 2018-03-28 2019-10-03 腾讯科技(深圳)有限公司 Video coding code rate control method, apparatus and device, and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833219A (en) * 2011-06-16 2012-12-19 华为技术有限公司 Method and device for transmitting data files to client side
CN103002272A (en) * 2011-09-15 2013-03-27 上海聚力传媒技术有限公司 Method, device and equipment for switching code rate of audio and video information
CN106488265A (en) * 2016-10-12 2017-03-08 广州酷狗计算机科技有限公司 A kind of method and apparatus sending Media Stream
CN106791956A (en) * 2016-11-25 2017-05-31 百度在线网络技术(北京)有限公司 The processing method and processing device of network direct broadcasting interim card
CN108024126A (en) * 2017-11-28 2018-05-11 北京潘达互娱科技有限公司 Network direct broadcasting video regulation method, device, electronic equipment and storage medium
CN110022498A (en) * 2018-01-08 2019-07-16 深圳市中兴微电子技术有限公司 A kind of method and device for realizing code rate switching
WO2019184643A1 (en) * 2018-03-28 2019-10-03 腾讯科技(深圳)有限公司 Video coding code rate control method, apparatus and device, and storage medium
CN108769805A (en) * 2018-06-11 2018-11-06 广州酷狗计算机科技有限公司 Data transmission method, device, computer equipment and storage medium
CN109120933A (en) * 2018-10-11 2019-01-01 广州酷狗计算机科技有限公司 Dynamic adjusts method, apparatus, equipment and the storage medium of code rate

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈永建; 周艳; 崔海宁: "基于双向强化学习与动态码率调节的无线mesh网络协议", 《计算机应用研究》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055698A (en) * 2021-03-09 2021-06-29 百果园技术(新加坡)有限公司 Video parameter adjusting method, device, equipment and medium
WO2023193126A1 (en) * 2022-04-05 2023-10-12 Citrix Systems, Inc. Enhanced video conferencing based on speech detection
CN114760528A (en) * 2022-04-19 2022-07-15 广州方硅信息技术有限公司 Method, system, device, computer equipment and medium for video data transmission
CN116916071A (en) * 2023-06-12 2023-10-20 广州开得联软件技术有限公司 Video picture display method, system, device, electronic equipment and storage medium
CN117596234A (en) * 2023-09-28 2024-02-23 书行科技(北京)有限公司 Multi-person conversation method and device
CN117596234B (en) * 2023-09-28 2024-05-28 书行科技(北京)有限公司 Multi-person conversation method and device

Also Published As

Publication number Publication date
CN111083536B (en) 2022-02-22

Similar Documents

Publication Publication Date Title
CN111083536B (en) Method and device for adjusting video code rate
CN112437122B (en) Communication method, communication device, computer readable medium and electronic equipment
EP2095205B1 (en) Hybrid buffer management
US10194210B2 (en) Dynamic content delivery network allocation system
CN108063769B (en) Method and device for realizing content service and content distribution network node
CN108462899B (en) Streaming media code stream self-adaptive transmission method based on equipment capability, playing equipment and playing system
CN107147921B (en) Video playing acceleration method and device based on slice and intelligent CDN scheduling
CN109996094B (en) Video playing method, device and system
US11863841B2 (en) Video playing control method and system
CN108881931B (en) Data buffering method and network equipment
US11025987B2 (en) Prediction-based representation selection in video playback
WO2015120766A1 (en) Video optimisation system and method
US20120221681A1 (en) Method, apparatus and system for hierarchically requesting contents in a http streaming system
CN114449353B (en) Session-based adaptive playback profile decision-making for video streaming
US20240137585A1 (en) Multiple protocol prediction and in-session adaptation in video streaming
CN113905257A (en) Video code rate switching method and device, electronic equipment and storage medium
US9247315B2 (en) Disabling of multiple bitrate algorithm for media programs while playing advertisements
US11265356B2 (en) Network assistance functions for virtual reality dyanmic streaming
US11622135B2 (en) Bandwidth allocation for low latency content and buffered content
CN116527992A (en) Video playing resolution switching method and device
US11140060B2 (en) Dynamic variation of media segment durations for optimization of network round trip times
US10771522B2 (en) Crowdsourced prediction of CDN performance for zero buffer delivery of content
CN118590474A (en) Cloud media player
KR20230008323A (en) Edge caching system
CN116962764A (en) Streaming media transmission method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant