local storage. After several visits of a location, it may predict its speed and the available bandwidth at the locations
PREDICTIVE PREFETCHING FOR MPEG DASH OVER LTE NETWORKS Tianyi Xu, Liangping Ma InterDigital Communications, Inc San Diego, CA 92121, USA ABSTRACT Recently HTTP based adaptive video streaming has gained significant attention. A video client predicts the future available bandwidth and then selects the appropriate bit rate for the video content in order to maximize the video quality while avoiding rebuffering. The often severe fluctuation in the available bandwidth in mobile wireless networks poses a challenge to the bit rate selection algorithm. In this paper, we propose to utilize the regularity in a user’s movement to improve the bit rate selection algorithm. We use Kalman filters to predict a user’s speed and available bandwidth, which are then fed into a bit rate adaptation algorithm. The proposed method is implemented in JavaScript, and tested in real LTE networks. Experimental results show that our method significantly improves the quality of DASH-based video streaming. Index Terms— DASH, bandwidth prediction, Kalman filter, bit rate adaptation 1. INTRODUCTION The rapid increase in the capacity of mobile networks gives rise to a high demand for high-quality video streaming over mobile wireless networks. Dynamic Adaptive Streaming over HTTP (DASH) [1] is the first international standard on adaptive HTTP streaming. In DASH, a video file is partitioned into multiple segments with durations of a few seconds, and each segment is encoded at different bit rates (or different video quality levels). The video client determines the bit rate of the next video segment to be requested. If the requested bit rate is too high, it may increase the risk of buffer underflow (or rebuffering). On the other hand, if the requested bit rate is too low, the video quality will be poor. Based on the playback buffer level and the network condition (which determines the available bandwidth), an ideal client chooses the bit rate for the subsequent video segments to achieve the highest video quality, while avoiding buffer underflow and limiting the frequency of video quality switching. To achieve high quality of experience (QoE), it is crucial that the client is able to predict the available bandwidth so as to select the appropriate video bit rate. There are usually two approaches to predicting the available bandwidth. One approach uses the moving average to estimate the available
bandwidth, where the average is based on recent bandwidth measurements [2, 3]. The other approach predicts the available bandwidth using past measurements made at the same location [4]-[7]. The study in [4] collects bandwidth measurements from repeated trips, and suggests that using the bandwidth measurements from the past trips can improve the bandwidth prediction accuracy. In [5], historical bandwidth measurements within 100 meters of the current location are averaged to predict the bandwidth. In [6, 7], K-means or K-nearest neighbor (K-NN) algorithms are used to group the bandwidth measurements of nearby locations and the average is taken as the bandwidth prediction. In this paper, we propose a scheme that allows the client to predict the available bandwidth and the vehicular speed with the help of not only measurements made in previous trips but also in the current trip, which is different from the previous studies [2]-[7]. Our proposed method first performs offline computation to determine the parameters in a state transition model, and then operates recursively on the measurements of the current trip by applying a Kalman filter [8] to obtain the predictions for future locations. We further propose a video bit rate adaptation algorithm to maximize the video quality while avoiding buffer underflow. We prototyped our method in JavaScript DASH.js [9], developed by the DASH Industry Forum [10], on a Samsung Galaxy tablet and we carried out experiments on a real LTE network. The remainder of this paper is organized as follows. Section 2 gives the system architecture of our proposed method. Section 3 describes our proposed prediction algorithms for both the available bandwidth and the vehicular speed. Section 4 presents the video bit rate adaptation algorithm based on the speed and the bandwidth prediction. Section 5 gives the experimental results. Section 6 concludes the paper. 2. SYSTEM ARCHITECTURE The system architecture for our proposed method is shown in Fig.1, where every user device makes the prediction based on its own previous measurements, including measurements from previous trips and the current trip. The DASH [1] media presentation server stores video segments, each encoded at different bit rates. The DASH media presentation description (MPD) server contains MPD files describing basic segment
to Bi+1 , and Ni is the process noise which is assumed to be drawn from a zero mean Gaussian distribution with variance Qi . Assume that Ni is independent of Bj and bj for all j. At the i-th segment, the bandwidth measurement is obtained from the following model: bi = B i + n i
Fig. 1: The system architecture information, such as URL, video resolution, bit rate, codec, time and duration. The DASH client measures its own available bandwidth every time it visits a location, and saves the bandwidth measurement and the corresponding location at its local storage. After several visits of a location, it may predict its speed and the available bandwidth at the locations that are about to be visited. As shown in [7], the bandwidths measured at the same time of different days have strong similarity. In the prediction, we may use the measurements of the past trips at the same time of a day and the same day of a week (weekday or weekend). Then, based on these predictions, the client determines the bit rate and requests the media data from the DASH media presentation server. Our proposed method is easy to implement, without the need for a new entity residing in the network to provide the available bandwidth information of the LTE network. 3. PREDICTION ALGORITHM In this section, we propose algorithms to predict the available bandwidth and the vehicular speed at future locations, respectively, based on the measurements of the current and previous trips. The algorithms are similar, so in this section we only give details for the bandwidth prediction algorithm. Assume that the travel route is given, and is partitioned into segments of equal length L, for example, 300 meters. Denote by Vi and Bi the random variables of the (average) vehicular speed and the available bandwidth in the i-th segment in the current trip, respectively. Let the random variable bi be the measured bandwidth in the i-th segment in the current trip. Generally, the measurement is not accurate and contains random noise. Suppose that we conduct N repeated trials collecting the historical data. Based on the measurements at prior locations in the current trip, we predict the available bandwidths in the upcoming locations by Kalman filter [8], where state transition parameters and variances of the noise are determined by the measurements that were taken in the previous trips. We assume that the available bandwidth can be modeled in the following form: Bi+1 = φi Bi + Ni
(2)
where ni is the measurement error which is assumed to be drawn from a zero mean Gaussian distribution with variance qi . Assume that ni is independent of Bj , bj and Nj for all j. Before using the Kalman filter, we first determine the parameters φi , Qi and qi in (1) and (2) from historical measurements. From (1) and (2), the measured bandwidth bi+1 can be expressed as bi+1
= Bi+1 + ni+1 = φi Bi + Ni + ni+1 = φi φi−1 Bi−1 + φi Ni−1 + Ni + ni+1 .
(3)
Similarly, we have bi = φi−1 Bi−1 + Ni−1 + ni and bi−1 = Bi−1 + ni−1 . The mean of the measured bandwidth bi+1 can be written as E[bi+1 ] = E[Bi+1 ] = φi E[Bi ] = φi E[bi ]
(4)
Because of the independence of the random variables Bi−1 , Ni−1 and ni , the variances of the measured speed bi and bi−1 are obtained by Var[bi ]
=
φ2i−1 Var[Bi−1 ] + Qi−1 + qi
(5)
Var[bi−1 ]
=
Var[Bi−1 ] + qi−1
(6)
Moreover, because of the independence of Bi , Ni and ni for all i, we also have the following covariances Cov[bi+1 , bi ] Cov[bi+1 , bi−1 ] Cov[bi , bi−1 ]
= φi φ2i−1 Var[Bi−1 ] + φi Qi−1 (7) = φi φi−1 Var[Bi−1 ]
(8)
= φi−1 Var[Bi−1 ]
(9)
In (4)-(9), the mean E[bi ], variance Var[bi ] and covariance Cov[bi , bj ] of the measured bandwidth can be estimated by the sample mean mi , sample variance σi2 and sample covariance σi,j of the historical measurements at the same locations. Let βi−1 = Var[Bi−1 ]. Then (4)-(9) become mi+1 − φi mi 2 − φi−1 βi−1 − Qi−1 − qi 2 σi−1 − βi−1 − qi−1 2 σi+1,i − φi φi−1 βi−1 − φi Qi−1
=
σi2
0
(10)
=
0
(11)
=
0
(12)
=
0
(13)
σi+1,i−1 − φi φi−1 βi−1
=
0
(14)
σi,i−1 − φi−1 βi−1
=
0
(15)
(1)
for all i, where φi is the state transition parameter from Bi
For now we assume that qi−1 and φi−1 are known, which are actually obtained in the previous steps of the algorithm as we
show later. Denote the left hand side of (10)-(15) by functions f1 (φi ), f2 (Qi−1 , qi , βi−1 ), f3 (βi−1 ), f4 (φi , Qi−1 , βi−1 ), f5 (φi , βi−1 ) and f6 (βi−1 ). These equations form an overdetermined system of unknowns qi , Qi−1 , φi , βi−1 . An approximate solution can be found by solving the following optimization problem, minimize
qi ,Qi−1 ,φi ,βi−1
subject to
f (φi , Qi−1 , qi , βi−1 ) = f14 +
6 X
2 fm
m=2
φi , Qi−1 , qi , βi−1 > 0.
(Ai ) The algorithm is summarized as follows: we first initialize φ1 and q1 , and for i = 2, · · · , N , determine φi , Qi−1 and qi by solving Problem (Ai ). This algorithm can be performed offline, and does not increase the complexity or latency of the DASH player. Only the parameters φi , Qi and qi are provided to the DASH player. With the parameters determined we use a Kalman filter to predict the available bandwidth in the following segments as follows. Let Ki be the Kalman gain at the i-th segment, and Pi− be the predicted estimate error variance. When a ˆi = measurement bi is available, we update the estimate by B ˆ − + Ki (vi − B ˆ − ), where B ˆ − is a prior estimate without bi , B i i i ˆi is the updated estimate. We compute the error variance and B for the updated estimate by Pi = (1 − Ki )Pi− . Then we obtain the prior estimate for the next segment, and compute the predicted estimate error variance and the Kalman gain for ˆ − = φi B ˆi , P − = φ2 Pi + Qi and the next segment as B i i+1 i+1 Ki+1 =
− Pi+1 − Pi+1 +qi+1
. The details of Kalman filter can be found
in [8]. Now with the measurement bi of the i-th segment, we ˆ− . may predict the bandwidth of the next segment by B i+1 Although the available bandwidth changes quickly as the client moves in a wireless network, the bandwidths of the same location measured at the same time of a day and the same day of a week (weekday or weekend) show strong similarity. Based on this observation, we use the measurements at the same time of a day and the same day of a week as historical data to estimate mi , σi2 and σi,j , and then optimize φi , Qi−1 and qi by solving Problem (Ai ). Similar to the above bandwidth prediction, we predict the − speed Vˆi+1 of the next segment from the measurement vi of the current segment by another Kalman filter. 4. PREDICTIVE-PREFETCHING BASED RATE ADAPTATION FOR DASH With the predictions in Section 3, we now present a video bit rate adaptation algorithm for DASH. Assume that the measurements of the current segment, vi and bi , are avail− able, and so are the predictions of the next segment, Vˆi+1 ˆ − . The aim of the bit rate adaptation algorithm is and B i+1 to choose the bit rate to maximize the video quality, while
avoiding the buffer underflow. Assume that the length of every segment is L meters, and we want to optimize the video quality for the subsequent M segments. Denote by BS the current buffer size, which is the video playback ˆi,j be the pretime of the buffered data. Let Vˆi,j and B dicted speed and the predicted bandwidth for the (i + j)-th segment, respectively. Note that only the measurements be− fore the i-th segment are available, and that Vˆi,1 = Vˆi+1 , − − ˆi,1 = B ˆ ,B ˆi,k = φi+k φi+k−1 · · · φi+1 B ˆ ˆi,k = B and V i+1 i+1 − ψi+k ψi+k−1 · · · ψi+1 Vˆi+1 for 2 ≤ k ≤ M , where ψi is the state transition parameter from Vi to Vi+1 . The time needed to travel through the (i + m)-th segment, 1 ≤ m ≤ M , is Ti,m = VˆL . The total data downloaded during the (i + m)i,m
ˆ B
L
ˆi,m Ti,m = i,m . If the buffer size th segment is Di,m = B Vˆi,m BS is no more than a lower bound BSlow , then rebuffering may occur with a significant probability, and the client will be forced to switch to the lowest bit rate. Otherwise, to avoid rebuffering, we only need Σm k=1 Ti,k ≤ BS +
Σm k=1 Di,k , BR
(16)
for 1 ≤ m ≤ M , where BR is the bit rate that we choose. When Σm k=1 Ti,k > BS, the selected bit rate is upper bounded as follows, BR ≤
Σm k=1 Di,k m Σk=1 Ti,k − BS
(17)
When Σm k=1 Ti,k ≤ BS, no upper bound is imposed on BR. The details of the bit rate adaptation algorithm are shown below. Algorithm 1 Given the predicted speeds Vˆi,m and the preˆi,m for 1 ≤ m ≤ M , and the current dicted bandwidth B buffer size BS, determine the upper bound for the video bit rate to avoid rebuffering, and choose the bit rate to maximize the video quality. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
IF BS > BSlow Initialize BRmax = ∞ ; FOR m = 1 to M ˆi,m Ti,m Ti,m = VˆL , Di,m = B i,m m IF Σk=1 Ti,k > BS Σm Di,k temp = Σm k=1 ;(See (16)) k=1 Ti,k −BS IF temp < BRmax BRmax = temp; END IF END IF END FOR Select the maximum bit rate from the available bit rates in the MPD that is not greater than BRmax ; ELSE Select the minimum bit rate from the MPD; END IF
5. EXPERIMENTS We first describe our implementation, test bench, and the experimental setup. Refer to the architecture in Figure 1. The DASH MPD server is an Apache web server running on Ubuntu 14.04, which also hosts the JavaScript program DASH.js, and the client is a Samsung Galaxy Tab 4 accessing the Verizon LTE network. The video sequence “Big Buck Bunny” is used in the experiment, which is also provided by DASH.js. The video lasts approximately 600 seconds, and every video segment contains 3 seconds of video content. There are 10 video bit rates (from level 1 to 10): 0.23, 0.33, 0.45, 0.67, 0.99, 1.43, 2.06, 2.96, 5.03 and 6 Mbps. We tested the proposed algorithm on a major highway near San Diego from September 2014 to March, 2015. The experiments were preformed during both peak and off-peak hours, and as a result, lasted 15 to 45 minutes. The route is partitioned into segments of approximately 300 meters. First, we collect historical data, imitating the accumulation of measurements, for example, of a person commuting regularly to work. These data contain the location and speed, which are provided by the GPS device on the client with a location accuracy of 4 meters, as well as the time and the available bandwidth obtained by dividing the size of downloaded data by the elapsed time from the request to the reception. In a segment, we may obtain more than one measurement and we take the average of all measurements in the segment as the measurement for that segment. With the historical data, we are able to run the offline algorithm to determine the parameters in the state transition models, and feed them to the DASH player. We also implement prediction using the Kalman filter and the bit rate adaptation algorithm in DASH.js. We compare the performance of our algorithm and that of Thang’s algorithm [2], which selects the maximal available bit rate that is not greater than a moving average of the measured bandwidths. The performance of Thang’s algorithm is obtained by simulations using the historical data (available bandwidth as a function of time) obtained from the experiments. We use the average bit rate and the bit rate switching frequency as the performance metrics, which are shown in [11] to correlate well with the QoE. In Fig. 2, we present the video bit rates selected by our algorithm and Thang’s algorithm under the same channel realization. When the bandwidth fluctuates from 350 to 450 sec, the bit rates selected by our proposed algorithm are greater than those by Thang’s algorithm. We also observe that being aware of the low bandwidths between 620 and 680 sec, our algorithm does not increase the bit rate during the bandwidth bursts. Instead, it keeps downloading video segments with lower bit rates to maintain a high buffer level. As a result, from 660 to 680 sec, the selected bit rates do not decrease with the bandwidths. Our algorithm also provide a smoother bit rate selection than Thang’s algorithm: the switching ratio for our algorithm is only 2.3% compared to 18.5% for Thang’s algorithm. Fig. 3
(a) Video bit rates for the whole trip
(b) Video bit rates from 350 sec to 700 sec Fig. 2: Video bit rates for our proposed algorithm and Thang’s algorithm.
Fig. 3: The CDFs of the video bit rates shows the CDFs of the bit rates for these two algorithms collected in multiple trips. The lower curve (blue solid line) indicates that our proposed algorithm provides more video frames with higher bit rates. For example, with our proposed algorithm 95.7% of the frames are at bit rate level 10 (6 Mbps), while with Thang’s algorithm the percentage is only 80.6%. 6. CONCLUSION In this paper, we propose a system architecture to predict the available bandwidth based on the measurements of the current and previous trips. We also present a bit rate adaptation algorithm for DASH, considering the predicted bandwidth and the current buffer size. We implement our method and test it in a real LTE network, and the experimental results show that it is effective in improving the QoE of the video client. 7. ACKNOWLEDGMENT The authors would like to thank Dr. Ariela Zeira, Gregory Sternberg, Dr. Ralph A. Neff of InterDigital Labs and Dr. Hong Zhang of Broadcom for insightful discussions.
8. REFERENCES [1] “ISO/IEC 23009-1:2014, Information technology – Dynamic adaptive streaming over HTTP (DASH) – Part 1: Media presentation description and segment formats,” 2014. [2] T. Thang, Q. Ho, J. Kang, and A. Pham, “Adaptive streaming of audiovisual content using MPEG DASH,” Consumer Electronics, IEEE Transactions on, vol. 58, no.1, pp. 78-85, Feb., 2012. [3] S. Hesse, “Design of scheduling and rate-adaptation algorithms for adaptive HTTP streaming,” Proc. SPIE 8856, Applications of Digital Image Processing XXXVI, 88560M, Sep., 2013. [4] J. Yao, S. Kanhere, and M Hassan, “An empirical study of bandwidth predictability in mobile computing,” in ACM WinTech, San Francisco, CA, Sep. 2008. [5] H. Riiser, T. Endestad, P. Vigmostad, C Griwodz, and P. Halvorsen, “Video streaming using a location-based bandwidth-lookup service for bitrate planning,” ACM Trans. Multimedia Comput. Commun. Appl., vol. 8, no. 3, pp. 24:1-24:19, Aug., 2012. [6] V. Singh, J. Ott, and I Curcio, “Predictive buffering for streaming video in 3G networks,” World of Wireless, Mobile and Multimedia Networks (WoWMoM), 2012 IEEE International Symposium on a, Jun., 2012. [7] J. Hao, R. Zimmermann, and H. Ma, “GTube: geopredictive video streaming over HTTP in mobile environment,” 5th ACM Multimedia Systems Conference, Mar., 2014. [8] R. Brown and P. Hwang, “Introduction to random signals and applied Kalman filtering: with MATLAB exercises,” 4th ed., 2011. [9] DASH.js, URL Forum/dash.js/wiki
https://github.com/Dash-Industry-
[10] DASH Industry Forum, URL http://dashif.org [11] P. Ni, R. Eg, A. Eichhorn, C. Griwodz, and P. Halvorsen, “Flicker effects in adaptive video streaming to handheld devices,” 19th ACM International Conference on Multimedia, pp. 463-472, 2011.