Method and device for detecting available bandwidth based on burstiness of key frame of video stream
11641497 · 2023-05-02
Assignee
Inventors
Cpc classification
H04N21/44245
ELECTRICITY
H04N21/8455
ELECTRICITY
International classification
Abstract
A method for detecting an available bandwidth based on a burstiness of a key frame of a video stream, includes: establishing a video connection between a sender and a receiver, and sending the video stream by the sender to the receiver; recording a sending timestamp of each packet at the sender; recording a receiving timestamp of each packet received by the receiver; calculating a difference between the receiving timestamp and the sending timestamp of each packet, and obtaining the packet with the smallest difference and the packet with the greatest difference by traversing the packets in the key frame; and estimating a currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference.
Claims
1. A method for detecting an available bandwidth based on a burstiness of a key frame of a video stream, comprising: establishing a video connection between a sender and a receiver, and sending the video stream by the sender to the receiver; recording a sending timestamp of each packet at the sender; recording a receiving timestamp of each packet received by the receiver; calculating a difference between the receiving timestamp and the sending timestamp of each packet, and obtaining a packet with a smallest difference and a packet with a greatest difference by traversing the packets in the key frame; and estimating a currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference, wherein estimating the currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference comprises:
2. The method according to claim 1, further comprising: sending a feedback packet by the receiver to the sender after receiving the packet, wherein the receiving timestamp of the receiver is added to the feedback packet.
3. The method according to claim 1, wherein the video connection is established between the sender and the receiver through a transport layer protocol.
4. A device for detecting an available bandwidth based on a burstiness of a key frame of a video stream, comprising: a processor; and a memory, configured to store instructions executable by the processor, wherein the processor is configured to: establish a video connection between a sender and a receiver, wherein the video stream is sent by the sender to the receiver; record a sending timestamp of each packet at the sender; record a receiving timestamp of each packet received by the receiver; calculate a difference between the receiving timestamp and the sending timestamp of each packet, and obtain a packet with a smallest difference and a packet with a greatest difference by traversing the packets in the key frame; and estimate a currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference, wherein estimating the currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference comprises:
5. The device according to claim 4, wherein the receiver is configured to send a feedback packet to the sender after receiving the packet, wherein the receiving timestamp of the receiver is added to the feedback packet.
6. The device according to claim 4, wherein the video connection is established between the sender and the receiver through a transport layer protocol.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) These and other aspects and advantages of embodiments of the present disclosure will become apparent and more readily appreciated from the following descriptions made with reference to the accompanying drawings, in which:
(2)
(3)
(4)
DETAILED DESCRIPTION
(5) Reference will be made in detail to embodiments of the present disclosure. Embodiments of the present disclosure will be shown in drawings, in which the same or similar elements and the elements having same or similar functions are denoted by like reference numerals throughout the descriptions. Embodiments described herein with reference to drawings are explanatory, serve to explain the present disclosure, and are not construed to limit embodiments of the present disclosure.
(6) A method and device for detecting an available bandwidth based on a burstiness of a key frame of a video stream according to embodiments of the present disclosure will be described below with reference to the accompanying drawings.
(7) First, the method for detecting an available bandwidth based on a burstiness of a key frame of a video stream proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
(8) The upper limit of the available bandwidth is passively detected by using the burstiness of the key frame in the video stream without incurring any transmission overhead. Specifically, in video streaming, each encoded video stream contains some key frames and many non-key frames. A key frame, also known as an intra-coded frame, is a frame in a data stream that stores a complete image. The key frame is the least compressible and does not depend on other video frames when decoding. Compared to key frames, non-key frames rely on data from previous frames for decoding and are more compressible. Usually, the key frame has a large amount of data and has a burstiness (tens of packets at a time). Therefore, the present disclosure chooses to passively probe the available bandwidth using the burstiness of the key frame.
(9)
(10) As illustrated in
(11) In step S1, a video connection is established between a sender and a receiver, and a video stream is sent to the receiver by the sender.
(12) In detail, a sender application establishes a video connection with a receiver application through a transport layer protocol.
(13) In step S2, a sending timestamp of each packet of the sender is recorded.
(14) The sender records the sending timestamp send.sub.i of each packet in the video stream.
(15) In step S3, a receiving timestamp of each packet received by the receiver is recorded.
(16) It could be understood that the receiver sends a feedback ACK packet to the sender after receiving the packet, and adds the receiving timestamp send.sub.i of the receiver to the feedback ACK packet.
(17) In step S4, a difference between the receiving timestamp and the sending timestamp of each packet is calculated, and the packet with the smallest difference and the packet with the greatest difference are obtained by traversing all the packets in the current key frame.
(18) In step S5, a currently available bandwidth is estimated according to the packet with the smallest difference and the packet with the greatest difference.
(19) Specifically, the sender obtains the feedback ACK packet of each packet, and calculates the difference between the receiving timestamp and the sending timestamp.
(20) Further, all the packets in the current key frame are traversed, and the packet i with the smallest difference between the receiving timestamp and the sending timestamp and the packet j with the greatest difference are obtained, and the corresponding differences are recv.sub.i-send.sub.i and recv.sub.j-send.sub.j.
(21) It should be noted that, in embodiments of the present disclosure, statistics and calculations are not performed for non-key frames.
(22) Specifically, the key frame has burstiness and contains dozens of packets. All packets in the same keyframe are assumed to have the same length (maximum transmission unit). First, one-way delays (OWDs) of all packets belonging to the same key frame are acquired. The OWD consists of four main components: processing delay (the time to check the packet), queuing delay (the time to wait at the output port to be sent), transmission delay (the time to bring the packet into the link), and propagation delay (the time of propagation on the physical link). In general, all packets of the same key frame experience the same processing delay, transmission delay, and propagation delay. The only difference is the queuing delay. In embodiments of the present disclosure, the packet i with the smallest one-way delay (packet at the head of the burst packet group) and the packet j with the greatest one-way delay (packet at the end of the burst packet group) are found. The difference between OWD.sub.max and OWD.sub.min is the difference between the queuing delays of packet i and packet j, which is also the cumulative transmission delay of the entire key frame from the network port to the network link, as shown in
(23) ΔOWD=OWD.sub.max−OWD.sub.min
(24) =(recv′.sub.j−send.sub.j)−(recv′.sub.i−send.sub.i)
(25) =[(recv.sub.i−send.sub.j)+(recv′.sub.j−recv.sub.j)]−[(recv.sub.i−send.sub.i)+(recv′.sub.i−recv.sub.i)]
(26) =(recv.sub.j−send.sub.j)−(recv.sub.i−send.sub.i)
(27) Since both OWD.sub.max and OWD.sub.min include the clock difference between the sender and receiver, using subtraction can remove the clock difference on both ends, thus avoiding clock synchronization problems. Additionally, this converts the input for the ΔOWD calculation into readily available data, to estimate the available bandwidth:
(28)
where, Avai_bwd is the currently available bandwidth, Data.sub.Keyframe is a total size of the key frame, i is the packet with the smallest difference, j is the packet with the greatest difference, recv.sub.i and recv.sub.j are the receiving timestamps when the receiver receives the packets i and j, and send.sub.i and send.sub.j are the sending timestamps when the sender sends the packets i and j.
(29) According to the method for detecting an available bandwidth based on a burstiness of a key frame of a video stream proposed by the embodiment of the present disclosure, the video connection is established between the sender and the receiver, and the video stream is sent to the receiver through the sender; the sending timestamp of each packet of the sender is recorded; the receiving timestamp of each packet received by the receiver is recorded; the difference between the receiving timestamp and the sending timestamp of each packet is calculated, and the packet with the smallest difference and the packet with the greatest difference are obtained by traversing all the packets in the current key frame; the currently available bandwidth is estimated based on the packet with the smallest difference and the packet with the greatest difference. Therefore, the upper limit of the available bandwidth can be passively detected by using the burstiness of the key frame in the video stream without additional transmission overhead, which can utilize the network bandwidth more effectively than the algorithm that uses the average throughput to estimate.
(30) Next, the device for detecting an available bandwidth based on a burstiness of a key frame of a video stream proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
(31)
(32) As illustrated in
(33) The establishing module 401 is configured to establish a video connection between a sender and a receiver, wherein the video stream is sent by the sender to the receiver.
(34) The first recording module 402 is configured to record a sending timestamp of each packet at the sender.
(35) The second recording module 403 is configured to record a receiving timestamp of each packet received by the receiver.
(36) The calculating module 404 is configured to calculate a difference between the receiving timestamp and the sending timestamp of each packet, and obtain the packet with the smallest difference and the packet with the greatest difference by traversing the packets in the key frame.
(37) The estimating module 405 is configured to estimate a currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference.
(38) Further, estimating the currently available bandwidth according to the packet with the smallest difference and the packet with the greatest difference includes:
(39)
where, Avai_ bwd is the currently available bandwidth, Data.sub.Keyframe is a total size of the key frame, i is the packet with the smallest difference, j is the packet with the greatest difference, recv.sub.i and recv.sub.j are the receiving timestamps when the receiver receives the packets i and j, and send.sub.i and send.sub.j are the sending timestamps when the sender sends the packets i and j.
(40) Further, the receiver is configured to send a feedback packet to the sender after receiving the packet, wherein the receiving timestamp of the receiver is added to the feedback packet.
(41) Further, the video connection is established between the sender and the receiver through a transport layer protocol.
(42) According to the device for detecting an available bandwidth based on a burstiness of a key frame of a video stream proposed by the embodiment of the present disclosure, the video connection is established between the sender and the receiver, and the video stream is sent to the receiver through the sender; the sending timestamp of each packet of the sender is recorded; the receiving timestamp of each packet received by the receiver is recorded; the difference between the receiving timestamp and the sending timestamp of each packet is calculated, and the packet with the smallest difference and the packet with the greatest difference are obtained by traversing all the packets in the current key frame; the currently available bandwidth is estimated based on the packet with the smallest difference and the packet with the greatest difference. Therefore, the upper limit of the available bandwidth can be passively detected by using the burstiness of the key frame in the video stream without additional transmission overhead, which can utilize the network bandwidth more effectively than the algorithm that uses the average throughput to estimate.
(43) Embodiments of the present disclosure further provide a device for detecting an available bandwidth based on a burstiness of a key frame of a video stream. The device includes a processor and a memory. The memory is configured to store instructions executable by the processor. The processor is configured to implement the method for detecting an available bandwidth based on a burstiness of a key frame of a video stream described above by executing the instructions stored in the memory.
(44) It should be noted that the foregoing explanations of the method embodiment are also applicable to the device of this embodiment, and details are not repeated here.
(45) The terms “first” and “second” are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature delimited with “first”, “second” may expressly or implicitly include at least one of that feature. In the description of the present disclosure, “plurality” means at least two, such as two, three, etc., unless otherwise expressly and specifically defined.
(46) Reference throughout this specification to “an embodiment,” “some embodiments,” “an example,” “a specific example,” or “some examples,” means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. The appearances of the above phrases in various places throughout this specification are not necessarily referring to the same embodiment or example of the present disclosure. Furthermore, the particular features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples. In addition, different embodiments or examples and features of different embodiments or examples described in the specification may be combined by those skilled in the art without mutual contradiction.
(47) Although embodiments of present disclosure have been shown and described above, it should be understood that above embodiments are just explanatory, and cannot be construed to limit the present disclosure, for those skilled in the art, changes, modifications, alternations, and variations can be made to the embodiments within the scope of the present disclosure.