This invention relates generally to systems and methods for streaming data in a network, and more particularly to systems and methods for managing cache storage in an adaptive video streaming system.
The use of video streaming is commonly used to deliver video data via the Internet and other networks. Typically, a video server divides a video program into segments, encodes each segment, and transmits the encoded segments via a network to a client device. The client device receives the encoded segments, decodes the segments, and presents the decoded segments in an appropriate sequence to produce a video presentation.
To facilitate the delivery of encoded video segments to a client device, selected encoded segments may be stored in a cache memory at a selected location in the network. When the client device requests an encoded segment associated with a video program, the cache may provide the requested encoded segment if it is stored in the cache (a condition known as a cache hit). If the encoded segment is not stored in the cache (a condition known as a cache miss), it may be necessary for the cache to obtain the encoded segment from the video server or from another source. A high number or a high frequency of cache misses may adversely affect the ability of the client device to produce a quality video presentation.
In accordance with an embodiment of the invention, a method for removing video data stored in a cache is provided. A plurality of encoded video segments that are stored in a cache memory and associated with every nth video segment in a sequence of video segments of a video program is selected, where n is an integer. The selected encoded video segments are removed from the cache memory. Each video segment in the sequence may be associated with a respective plurality of encoded video segments encoded at different respective encoding rates.
In one embodiment, encoded video segments associated with every second video segment in a sequence of video segments of a video program are selected.
The cache memory may comprise a random access memory in a cache device. The selected segments may be removed from the cache memory and stored in a storage in the cache device that is different from the cache memory. One or more second encoded video segments may be stored in the cache memory after removing the selected encoded video segments.
In another embodiment of the invention, a method for removing video data stored in a cache is provided. A plurality of encoded video segments that are stored in a cache memory and associated with n consecutive video segments in a sequence of video segments of a video program is selected, in accordance with a predetermined repeating pattern, where n is an integer not exceeding a predetermined limit. The selected encoded video segments are removed from the cache memory.
In another embodiment of the invention, a method for storing video data in a cache is provided. A plurality of encoded video segments associated with every nth video segment in a sequence of video segments of a video program is selected, where n is an integer. The selected encoded video segments are transmitted to a cache memory, and stored in the cache memory.
These and other advantages of the present disclosure will be apparent to those of ordinary skill in the art by reference to the following Detailed Description and the accompanying drawings.
In the exemplary embodiment of
In the exemplary embodiment of
Video server 120 streams video data via network 105 to client device 130. Techniques for video streaming are known. Video server 120 may encode video data before transmitting the data to client device 130. Video server 120 may store video data in a storage device, for example. Alternatively, video server 120 may receive video data from other sources.
Client device 130 receives video data via network 105, decodes the data (if necessary), and presents the resulting video program. The video program may be shown on a display device, for example.
In one embodiment, buffer 220 has a specified size defined as a time period T; when full, buffer 220 stores an amount of encoded video data corresponding to T seconds of a video program. For example, a buffer may be described as having a capacity to hold fifteen seconds of video data. Therefore, the size of buffer 220, measured in bytes, may vary.
Video server 120 divides a video program into a sequence of video segments, and encodes each segment in accordance with a selected delivery format. In one embodiment, each segment may contain from two to ten seconds of video data.
In accordance with a technique known as HyperText Transfer Protocol (HTTP) adaptive streaming, some or all of the video segments in sequence 310 are encoded multiple times at different encoding rates, resulting in a plurality of encoded video segments (referred to as “chunks”) for each original video segment in sequence 310. Referring to
In
Video server 120 may generate a manifest file (not shown) identifying video segments associated with a respective video program, the corresponding chunks, and the encoding rates of the various chunks. The chunks, and the associated manifest file, may be stored on video server 120.
Prior to downloading a desired video program, client device 130 may download from video server 120, or otherwise access, the manifest file containing information concerning the desired video program, and identify the sequence of video segments associated with the video program. Supposing, for example, that client device 130 needs to play video program 305, client device 130 may access the relevant manifest file and determine that video program 305 comprises sequence 310 and is associated with segments 315, 318, 321, 324, etc. Client device 130 may select a particular video segment and transmits to video server 120 a request for a corresponding chunk. Video server 120 transmits the requested chunks to client 120. As chunks are received by client device 130, client device 130 decodes the chunks and plays back the decoded video segments in an appropriate sequence to produce a video presentation.
For a particular video segment, client device 130 determines which chunk to request from among the corresponding chunks of different quality levels, based on a rate determination algorithm that considers various factors. In one embodiment, client device 130 selects a chunk that offers the highest sustainable quality level for current network conditions. For example, while receiving chunks corresponding to a sequence of video segments, client device 130 may periodically determine current available bandwidth based on the delay between transmission of a request for a respective chunk and receipt of the requested chunk, and determine a quality level of a subsequent chunk to be requested based on the current bandwidth. The rate determination algorithm may also consider the need to keep buffer 220 sufficiently full to avoid pauses, stops, and stutters in the presentation of the video stream.
To facilitate the delivery of chunks associated with a video program, one or more chunks may be stored in cache 150 and accessed by client device 130 as needed. Cache 150 can ordinarily provide data to client device 130 more quickly than can video server 120. For example, cache 150 may be closer to client device 130 than video server 120.
In accordance with an embodiment of the invention, when client device 130 requests from video server 120 a chunk associated with a particular video program, a request for the chunk may first be made to cache 150. For example, video server 120 may transmit a request to cache 150 identifying the requested chunk and client device 130. In response to the request, controller 455 may determine the presence or absence in cache 150 of the requested chunk, for example, by consulting chunk list 472. If the requested chunk is stored in cache 150 (a condition referred to as a cache hit), cache 150 may transmit the requested chunk to client device 130.
If the requested chunk is not stored in cache 150 (a condition referred to as a cache miss), cache 150 may obtain the requested chunk from video server 120, and then provide the requested chunk to client device 130. After obtaining the requested chunk from video server 120, cache 150 may also store the chunk. In order to store a new chunk, it may be necessary for controller 455 to remove, or evict, one or more chunks currently stored in RAM 430 or in storage 440. Controller 455 may select chunks for eviction based on a predetermined replacement algorithm. Existing replacement algorithms select chunks for replacement based on parameters including frequency of chunk utilization, recency of chunk utilization, size of chunks, etc.
When a cache miss renders it necessary for a client device to obtain a desired chunk from the video server or from another source, the client device's ability to produce a high quality video presentation may be adversely affected. Specifically, when the time required to download a desired chunk exceeds the associated playback time of the chunk, the delay may “drain” the client device's buffer. When a client device's buffer becomes low or empty, the client device's rate determination algorithm may determine that it is necessary to select chunks of lower quality, compromising the device's ability to produce a high quality video presentation.
In particular, a high number or high frequency of cache misses can adversely affect the performance of a client device's rate determination algorithm and reduce the quality of a video presentation produced by the client device. For example, repeated, or frequent, cache misses can drain the client device's buffer, causing a reduction in the quality level of the video presentation, or undesirable oscillations between quality levels in the video presentation.
Existing replacement algorithms used to manage video data stored in caches fail to consider the effect of cache hits and misses on the rate determination algorithms used by client devices in an HTTP adaptive video streaming system. Some traditional cache replacement algorithms may even increase the likelihood of repeated cache misses, causing undesirable effects in the clients' playback of a video program.
In accordance with an embodiment of the invention, a replacement algorithm is used which considers the effects of data eviction on a client device's rate determination algorithm. In particular, a replacement algorithm is provided which reduces the likelihood of repeated cache misses in an HTTP adaptive streaming video system, in order to avoid excessive draining of the client device's buffer, thereby enabling the client to provide a video stream of consistent quality.
At step 510, chunks associated with every nth video segment from a sequence of video segments of a video program are selected, where n is an integer. To facilitate the selection of specific chunks to be evicted, controller 455 may access chunk list 472 and/or the manifest file maintained by video server 120, and identify video segment sequence 310 associated with video program 305, which includes segments 315, 318, 321, 324. In the present example, n=2 and controller 455 therefore selects chunks associated with every second video segment in sequence 310. Thus, controller 455 selects chunks 318-1, 318-2, and 318-3, associated with segment 318, and chunks 324-1, 324-2, and 324-3, associated with segment 324.
At step 520, the selected chunks are removed from the cache memory. In the present example, the cache memory is RAM 430. Thus, controller 455 removes chunks 318-1, 318-2, and 318-3, associated with segment 318, and chunks 324-1, 324-2, and 324-3, associated with segment 324, from RAM 430.
In an alternative embodiment, chunks may be selected based on a predetermined irregular pattern. For example, controller 455 may identify groups of ten consecutive video segments in a sequence of video segments, select the 1st, 7th and 9th video segments from every group, and evict chunks associated with the selected segments.
In another embodiment, controller 455 selects, based on a predetermined pattern, groups of consecutive video segments in a sequence, such that no more than a predetermined number of consecutive segments are selected. In one example, no more than three consecutive video segments are selected from a defined group of segments. For example, controller 455 may identify groups of ten consecutive video segments in a sequence, select the 1st, 2nd, and 3rd video segments from every group, and evict chunks associated with the selected segments. In one embodiment, chunks are selected in this manner from chunks that are older (e.g., chunks that have been stored in cache 150 longer than other chunks) or less popular (e.g. chunks that are not accessed as frequently as other chunks).
In other embodiments, video segments may be selected in accordance with any predetermined pattern selected to minimize the occurrence of cache misses that will cause excessive draining of a client device's buffer.
In one embodiment, evicted chunks are permanently removed from cache 150. In another embodiment, evicted chunks are removed from RAM 430 and stored in storage 440, which comprises a memory device that is slower than RAM 430.
In another embodiment, chunks are selectively stored in cache 150 after a video program has been encoded and before any chunk is requested by a client device. In an exemplary embodiment, selected chunks associated with video program 305 are pre-stored in cache 150 after video program 305 is encoded and before any chunk is requested by client device 130.
In an alternative embodiment, chunks may be selected based on a predetermined irregular pattern, and pre-stored in cache 150. For example, video server 120 may identify groups of ten consecutive video segments in a sequence of video segments, select the 1st, 7th and 9th video segments from every group, and transit to cache 150 chunks associated with the selected segments. The chunks are then stored in cache 150.
In another embodiment, video server 120 selects, based on a predetermined pattern, groups of consecutive video segments in a sequence, such that no more than a predetermined number of consecutive segments are selected. In one example, no more than three consecutive video segments are selected from a defined group of segments. For example, video server 120 may identify groups of ten consecutive video segments in a sequence, select the 1st, 2nd, and 3rd video segments from every group, and transmit to cache 150 chunks associated with the selected segments. The chunks are then stored in cache 150.
While the systems and methods described herein are discussed in the context of HTTP adaptive video streaming, this exemplary embodiment is not intended to be limiting. The systems and methods described herein may be used to stream other types of data.
The above-described systems and methods can be implemented on one or more computers using well-known computer processors, memory units, storage devices, computer software, and other components. A high-level block diagram of such a computer is illustrated in
Any or all of the systems and apparatus discussed herein, including video server 120, client device 130, and cache 150, and components thereof, including controller 455, storage 440, RAM 430, and chunk list 472, may be implemented using a computer such as computer 800.
The foregoing Detailed Description is to be understood as being in every respect illustrative and exemplary, but not restrictive, and the scope of the invention disclosed herein is not to be determined from the Detailed Description, but rather from the claims as interpreted according to the full breadth permitted by the patent laws. It is to be understood that the embodiments shown and described herein are only illustrative of the principles of the present invention and that various modifications may be implemented by those skilled in the art without departing from the scope and spirit of the invention. Those skilled in the art could implement various other feature combinations without departing from the scope and spirit of the invention.