A Proposed Adaptive Bitrate Scheme Based on Bandwidth Prediction Algorithm for Smoothly Video Streaming

A robust video-bitrate adaptive scheme at client-aspect plays a significant role in keeping a good quality of video streaming technology experience. Video quality affects the amount of time the video has turned off playing due to the unfilled buffer state. Therefore to maintain a video streaming continuously with smooth bandwidth fluctuation, a video buffer structure based on adapting the video bitrate is considered in this work. Initially, the video buffer structure is formulated as an optimal control-theoretic problem that combines both video bitrate and video buffer feedback signals . While protecting the video buffer occupancy from exceeding the limited operating level can provide continuous video streaming, it may also cause a video bitrate oscillation. So the video buffer structure is adjusted by adding two thresholds as operating points for overflow and underflow states to filter the impact of throughput fluctuation on video buffer occupancy level. Then a bandwidth prediction algorithm is proposed for enhancing the performance of video bitrate adaptation. This algorithm's work depends on the current video buffer level, video bitrate of the previous segment, and iterative throughput measurements to predict the best video bitrate for the next segment. Simulation results show that reserving a bandwidth margin is better in adapting the video bitrate under bandwidth variation and then reducing the risk of video playback freezing. Simulation results proved that the playback freezing happens two times: firstly, when there is no bandwidth margin used and secondly, when the bandwidth margin is high while smooth video bitrate is obtained with moderate value. The proposed scheme is compared with other two schemes such as smoothed throughput rate (STR) and Buffer Based Rate (BBR) in terms of prediction error, QoE preferences, buffer size, and startup delay time, then the proposed scheme outperforms these schemes in attaining smooth video bitrates and continuous video playback.


INTRODUCTION
Video content constitutes a dominant fraction of Internet traffic today. Further, to ride the Internet bandwidth requirements, existing video streaming systems pick out adaptive and scalable video coding techniques to simplify transmission (Ni P, 2011). Dynamic adaptive streaming over HTTP (DASH) (Stoekhammer T, 2011) is an HTTP-based technique in which each video is divided into segments encoded at multiple rates. This policy supplies TCP fairness in the network and efficient delivery of MPEG media over HTTP. The video client requests a segment encoded at a particular video rate with an HTTP GET message, depending on the network conditions. Adaptive bitrate (ABR) algorithms are responsible for selecting the video bitrates of the segments (ur Rahman W, 2015). ABR algorithms strive to maximize video quality to upgrade the user's viewing experience. At this point, algorithms seek to increase viewing quality by meeting conflicting video quality goals in different environments. Maximizing the video rate would risk rebuffering, whereas minimizing rebuffering can lead to low video quality. In an environment with variable throughput, selecting a higher feasible video rate may lead to a high frequency of video-rate switches (Liu C, 2011).
With this system, the bitrate of the video segment can be altered (i.e., quality) in an adaptive manner to maintain continuous operation and avoid large latency to start and stop due to network congestion (Kadhim DJ, 2017). On the other hand, choosing the correct adaptive decision to suit the user's conviction in viewing is an open path to study present scaling techniques for video permit adaptation in either the spatial or temporal domain. Downloaded segments are stored for a period of time before playback starts so that a short-term mismatch between bitrate and available bandwidth can be accommodated and can mitigate video interruptions. (Jabbar SQ, 2017). In any case, the mismatch's persistence will cause the buffer to be empty from the video segments, which affects the user's viewing quality due to constantly stopping playback. On the other hand, adaptive tuning is prepared to video source quickly. The user can watch videos at the maximum bit rate allowing time, available bandwidth, and device resources to vary. (Liu C, 2011). This basic issue will also affect the customer's ability to avoid buffer operation when bandwidth is suddenly low (Jabbar SQ, 2018). In short, the problem stems from the discrete nature of video bitrates. This makes it impossible to always match the video bit rate with network bandwidth, resulting in no network bandwidth subscription. Not subscribing is usually paired with a customer's download patterns upon checkout. Time distances are a source of uncertainty for the customer to understand their fair share of network bandwidth properly, thus preventing the customer from making precise decisions for adapting the bitrates (Sun Y, 2016). To solve this basic limitation, a method based on the "predict-and-adapt" principle" is picked up. In this context, the authors (Li Z, 2014) suggested that TCP data rate be input only when it becomes a good indicator of fair share bandwidth. This usually happens when the number of subscribers and absence periods are exceeded. In the outages, the agreed algorithm continually checks the network bandwidth by increasing the transmission rate, and if it is congested, it will prepare to return (Kadhim DJ, 2015). This algorithm dynamically determines the level of the version that matches the user's available bandwidth. No further processing is needed to adapt the video rate to variable bandwidth since this algorithm diminishes processing costs when the video is encoded. In contrast, this way's drawback is the increased storage requirements. A more approximate splitting characterizes the adaptation because video bit rates can only belong to a discrete set of levels.
In (Miller K., 2012), an adaptive algorithm for HTTP video streaming has been proposed. This algorithm consists of two stages: a fast phase to raise the occupancy of segments in the buffer to a known threshold value and a steady phase to prevent the privilege from returning to a low-flow state; hence the number of quality switches can be dominated. In the work of (Jabbar SQ, 2018), the suggested algorithm is used to choose the dynamic version bitrate based on the network conditions. Then it was implemented as a platform-independent software library, after which they evaluated the prototype applied in real-world scenarios and found that it worked remarkably even under challenging network conditions. Moreover, it displays a stable and fair process if it is shared by many clients (Abdulredah SH, 2020). In this work, video streaming will be maintained continuously with smooth bandwidth fluctuation, so a video buffer structure based on adapting the video bitrate is considered in this research. Initially, the video buffer structure is formulated as an optimal control-theoretic problem that combines both video bitrate and video buffer feedback signals. While protecting the video buffer occupancy from exceeding the limited operating level can provide continuous video streaming, it may also cause a video bitrate oscillation. So the video buffer structure is adjusted by adding two thresholds as operating points for overflow and underflow states to filter the impact of throughput fluctuation on video buffer occupancy level. Then a bandwidth prediction algorithm is proposed for enhancing the performance of video bitrate adaptation. This algorithm's work depends on the current video buffer level, video bitrate of the previous segment, and iterative throughput measurements to predict the best video bitrate for the next segment.

VIDEO STREAMING MODEL
In the DASH system, the original video is divided into miniature clips and are encoded at different levels in order to suit the network conditions of the user side and stored on server with {VR1< VR2<.....<VRm}∈ V where V is the set of these rates and m different versions. The m encoded versions are further segmented into Nt individual segments, which can be decoded separately. These segments are common of equal and steady τ second duration. So the total length of the video is Nt τ. The customer plays an essential role in altering the rate by choosing and ordering the appropriate video version for each video clip. The rates for different video rendering levels are accessed to a customer by the server in the Media Presentation Data (MPD) stage. The size of i th segment is VRiτ frames. The bitrate level of the already downloaded segment is notated as L(i) ∈ [1,m]. The client starts to download i th segment at i s t and gets the last bits of the segment at i r t . If Ti is the network throughput during the period of downloading segment i th . Assuming the video player waits for wi (i.e., w is a short time not lead to interrupt the video) and starts to download the i th segment at a time i s t . Then The average throughput for download i th segment is given by: The needed time for i th segment to be downloaded is given by: Where 1 i T − is the average throughput during the downloaded of (i-1) th segment. Since video segments have different video bitrate levels in the DASH system, there is no relation between video buffer size and video buffer time. And then, to directly measure the buffer's length, the video buffer time is used, and the buffer process is mentioned in terms of time as B(t). The video buffer behavior after the downloaded i th segment is written as: (3) if the picked video level is more than i T , the video buffer level decreases, and playback freezing status occurs; if the selected video level is lower, than i T the video buffer level faces an overflow status. Hence the adaptation process for video bitrate should take into account these two statuses. To avoid buffer underflow, the video bitrate should satisfy the following condition to downloading i th : Journal of Engineering Volume 27 January 2021 Number 1 On the other side, to avoid buffer overflow, the video bitrate should satisfy the following condition: where Bmax is the maximum buffer size. U Ri V and L Ri V represent the upper bound and lower bound of video bitrate (VR), respectively. However, if the lower bound is higher than the highest Vh video version or the upper bound is lower than the lowest VL video version. There is no video bit rate in V that meets the inequality limitations (6) and (7).

QOE IMPROVEMENT PROBLEM
The main goal of video bitrate adaptation is to enhance the video quality on the user side. This paper tries to provide a flexible QoE formula, an active area of research (Dobrian F, 2011 Aug 15 ). The key metrics that impact QoE are: 1. Average Video bitrate (VRavg): The average video bitrate over all segments is equal to: Average video bitrate variations (Dvar): This metric follows the magnitude of the changes in the video bitrate from one segment to another and is given as: And w(i-1) as: where (x)+ = max{x,0} for ensuring the term is never being negative value. Accordingly, the QoE can be formulated as a weighted sum of the metrics mentioned above and is given by: where αr, αint, and αs are positive weighted parameters for average video birate variation, interruption duration, and startup time, respectively. For more clarity, a small αr means the user does not deal with bitrate variation, while a large value means more work must do to reach a smooth video buffer level. The same thing for other parameters (i.e., αint, αs ). To improve the video quality and ensure smooth bitrate adaptation, the main problem is defined as: ( To maximally use the bandwidth and ensure improving video quality, constraints in (14) must be satisfied. In any case, the problem of predicting the bandwidth remains complex because sometimes there is a mistake in the prediction, and the conditions in (6) and (7) related to the overflow/underflow in the buffer can be inaccurate. This leads to fluctuations in the content level of the buffer due to changes in the bandwidth. In the following annotation, the proposed method is explained as a solution to this problem.

PROPOSED ADAPTIVE BITRATE SCHEME
Generally, preventing underflow/overflow in buffer level is simple for any adaptive algorithm to do it. But avoiding bitrate oscillation is not easy. In this section, two thresholds are added as the maximum and minimum level for the segments in the buffer and filter the effect of changing the buffer occupancy on the bit rate selection, and then analyzing the adaptive bitrate system. Also, a bandwidth prediction algorithm is proposed to enhance the performance of bitrate adaptation. Moreover, a small positive/negative bandwidth margin is conserved to repay the bandwidth prediction fault as explained below.

Video Buffer Modification Scheme
Firstly, the video buffer is modified by adding two thresholds bmin and bmax as the main operating points for controlling the video bitrate oscillation and stabilizing the buffer occupancy level. In detail, if the current video buffer of the last downloaded segment between the two thresholds (i.e. In this case, the video bitrate should be selected from a high version that satisfies expression (15) to make full use of the bandwidth while guaranteeing no buffer underflow happens. On the other side, if the current video buffer occupancy is more than bmax i.e., the operating threshold bmax is used to choose the bitrate version that pulls the current video buffer level until bmax ensures no video buffer overflow occurs. The video bitrate must satisfy the following condition: The video bitrate should be select from the lowest version to satisfy Eq. (16) since any video version that fulfills the above condition will degrade the video buffer and ensure no buffer overflow. According to the modification in video buffer, the adaptive system for controlling the video bitrate can be represented as: Eq. (17) is a non-linear style and unsuitable for analysis and implementation. For a linear system, the following procedure is done.
Let ( ) 0 Bt  = around the operating point bx the corresponding video bitrate be VRx, then: The following are the output equations obtained for the entire system with feedback signals in term of bitrate and video buffer: Applying the Laplace transform to the differential equations, With some manipulation, the transfer function is gotten as: The system's equilibrium state is stable since the system's pole is

Bandwidth Prediction Algorithm
In this subsection, a bandwidth prediction algorithm is proposed to stable and improve the performance of bitrate adaptation. The algorithm's workflow is described below, which can optimally combine both bandwidth prediction and buffer occupancy.

The basic Work of Algorithm
The algorithm consists of two phases the startup phase and the stable phase. Essentially the algorithm selects the video bitrate VRi through looking N steps ahead (i.e., N is a small duration of about ten seconds). Network conditions are stable for a short duration of time so, it is possible to have accurate bandwidth prediction for a short duration to the future (Zhang Y, 2001 Nov 1). Then the problem of improving the video quality of experience is solved with bandwidth prediction . Initially, feedback information is dependent for the first bitrate and the improvement process is repeated at each step i. At each iteration, the video player keeps a duration from i th segment to (i+N-1) th and performs the three main steps in the prediction algorithm: a. Expectation: This part responsible for predicting the bandwidth for the next N segments ( , ) i i N tt T + using information about bandwidth predictors. b. Improvement: It is the main part of this algorithm. Video bitrate VRi is obtained based on the current video buffer occupancy, video bitrate of last downloaded segment VRi-1, and bandwidth prediction. Here it depends on which phase the video player is to find the optimal VRi for the next segment. In stable phase

Improve Bandwidth Prediction Algorithm
The above algorithm basically assumes the existence of an accurate bandwidth predictor. However, this accuracy may not be found in reality, especially with the network's poor status, for example, in cellular networks or at peak times when the Internet is crowded. Furthermore, the risk of freezing during video playing or buffer overflow and with no bandwidth margin comes with this issue since prediction error is inescapable. The improved bandwidth prediction algorithm enhances QoE's worst case assuming the actual bandwidth can take any value in a range To obtain the video bitrate of i th segment as: By taking the lowest value of the bandwidth as the input to the improved algorithm, to repay the error of bandwidth prediction and video buffer overflow / empty, a small positive / negative bandwidth margin is used, so: The worst case of QoE takes place when the bandwidth is at its lower bound L T . According to expressions (13) and (14), the QoE can be written as the sum of 3 main elements (f1: average video bitrate level, f2: average bitrate variation, and f3: total interruption duration), only the interruption duration element depends on bandwidth T, thus: So, any decrease in throughput T will lead to high interruption duration; the minimum QoE is achieved at T = T L . In simulation results, the improvement in the prediction algorithm is verified through changing the value of bandwidth margin. It explains the effect of prediction error on video bitrate and video buffer occupancy.

SIMULATION RESULTS
Here, the Adaptive Video Bitrate Scheme is appreciated based on bandwidth prediction at changeable network status. H.264/ AVC codec is used for encoding video, and five versions are prepared at the server V = {400kbps, 800kbps, 1200kbps, 1600kbps, 2500kbps}. The initial video buffer time is set to 40 seconds. The default values of bmin, bmax, τ, Bmax, and ρ are 10, 70, 10, 80, and 3, respectively. The performance of our scheme is compared with other schemes, the smoothed throughput rate (STR) (Liu C, 2011 Feb 23 ) and Buffer Based Rate adaptation (BBR) schemes as in (Huang TY, 2015 Feb 25). For bandwidth trace and prediction, a combination of existing datasets for bandwidth measurements is used (ZTI Telecom). Fig.1 shows the bandwidth margin's role in controlling the video buffer occupancy since underflow or overflow due to inaccuracy in bandwidth prediction. From the figure, the video freezing occurs twice, once in case there is no margin with bandwidth, while in case rising the margin value the stopping within playback video clips vanishes as from Fig.1(e) to Fig.1(g). Video bitrate becomes more smooth when ρ=3 than when ρ =1. The freezing in video playback appears again when the bandwidth margin is high, and the video bitrate oscillates as Fig.1(d), Fig.1(h). The huge space between the adjusted bandwidth and practical bandwidth is why this issue cannot be used for suitable video bitrate adaptation. While reserving appropriate bandwidth margins produces a relatively smooth video bitrate, some bitrate ripples as when t = 2350s short term oscillations. The video buffer thresholds bmin and bmax are fixed.  From Fig 2, when the timing space between bmin , bmax increases (i.e., bmin low and bmax high ), the hazard of underflow/ overflow for buffer content increases, this is obvious in Fig.2(e). On the other side, when the timing space decreases (i.e., bmin increases and bmax decreases), the video bitrate oscillates drastically as in Fig.2(c). But when bmin = 10 and bmax = 70, the achievement turns better in terms of bitrate of video and buffer contents. Then the adjustment of bmin and bmax is dynamically by adding a change in video buffer expression (4) to satisfy the constraints in expressions (15) and (16) for video bitrates since there is some ripples in video bitrate when bmin, bmax are fixed. The condition for bmin, bmax be: Where β1 , β2 are weighted conservative parameters. From this figure, with dynamic thresholds, the achievement of bitrate is much better than static values. The diagrams in Fig.2 (d) and Fig.2 (h) show that freezing in playback and video buffer underflow/overflow never occurs. A comparison between the proposed scheme with other schemes is made, the smoothed throughput rate (STR) and Buffer Based Rate adaptation (BBR) schemes. At time when the bitrate of i th segment is required, the simulation requests the proposed scheme based on bandwidth prediction algorithm to get VRi. The comparison is made in terms of prediction error, QoE favorites, and video buffer size, and startup delay time. Here a normalized QoE metric ( QoE-N) is defined as the ratio between the online QoE achieved by proposed scheme with the selected video bitrate VR based on current bandwidth predictions and the maximum QoE that can be achieved with perfect knowledge of future bandwidths over the entire duration .   Fig 3, examines the effect of prediction error on video bit rate conditioning. The mean level of error is used to describe the bandwidth predictor's performance and model the prediction output as a combination of real bandwidth with added random noise according to the average error level. As expected, BBR is unaffected as it does not use any transmission information. When the bandwidth predictions are accurate, the proposed system has a greater advantage over the BBR algorithm. However, with the prediction error exceeding 25%, which is the worst case, the improvement we proposed in improving the forecasted bandwidth may make our scheme less affected by the prediction error because it considers the potential error and increases the worst-case for the quality of the experience. In contrast, STR performance decreases as prediction error rises .
In Fig. 4, as customers place more weights to change bitrate, the proposed scheme shows more advantage over STR and BBR. This is because the proposed scheme model is a video bit rate tradeoff against the QoE function bit rate changes, while the STR and BBR decrease as the contrast increases. However, when outage time is a more important factor, the BBR scheme works similarly to this STR scheme because the BBR scheme maintains a minimal buffer level. The video player has a better chance of moving away from the lower bandwidth with less or no outage. Although our chart does a good job with a perfect prediction of bandwidth, it may suffer from a long outage due to the lack of a perfect average bandwidth predictor. Still, the performance of our scheme has been improved, such as keeping the level to a minimum and using an indicator for accuracy in bandwidth. Fig. 5 explains the effect of video buffer size. At the beginning, the buffer size is small (playtime is less than 25 seconds); increasing the buffer size can improve all schemes' performance. The larger buffer size protects the player from interruption events and provides more freedom to optimize performance. When the buffer size reaches a certain level (playing time 25 seconds), even if the buffer size is further increased, the performance of all schemes will remain unchanged. Finally, STR is least affected by the buffer size because it does not consider the level of occupancy in the decision logic.  From Fig. 6, the scheme automatically optimizes the startup delay; it analyzes how overall QoE would be affected if the startup delay were fixed. As shown in Fig.6, when the startup time increases, all schemes' performance enhances since the player of user collects more clips in the video buffer in the startup phase, which makes it easier to administrate interruption situations.

CONCLUSIONS
In this paper, an adaptive bitrate scheme is suggested based on bandwidth prediction algorithms to ensure video playback continually. It was found that the conventional adaptive bitrate algorithms can provide continuous video playback but result in a serious rate fluctuation. At this point, to avoid buffer underflow/overflow and filter the impact of fluctuation in bandwidth, two thresholds are used as main points. When the timing space between these two thresholds becomes small, video bitrate fluctuates drastically. While it increases the timing space by about 60 sec, the video bitrate be stable. But when setting these thresholds dynamically, the performance becomes better for video buffer level. Then a bandwidth prediction algorithm is proposed to improve and stabilize the adaptation of video bitrate. The main elements that affect QoE Improvement are discussed. The work deduces that even the algorithm can provide a suitable video bitrate, but there is still the same fluctuation in video buffer occupancy, resulting in deteriorating the QoE. So the algorithm is improved using a small positive/negative bandwidth margin. The playback freezing happens twice, once in the case, there is no bandwidth margin used and second when the bandwidth margin is huge while smooth video bitrate is obtained with moderate value. The implementations of our scheme are compared with other schemes, the smooth throughput rate (STR) and adaptive schemes based on the buffering rate (BBR). The proposed scheme is outperformed these in achieving smooth rates and continuous playback.