The detailed description is described with reference to the accompanying figures. In the figures, the left-most digit of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items.
This disclosure is directed to techniques for streaming media over a network, such as the Internet. More particularly, the techniques involve a hybrid approach of retrieving media from more than one source—peer-to-peer, streaming media servers, web servers, etc.—depending upon various factors.
The source(s) from which media is retrieved during a streaming session are selected based on factors such as a status of a playback buffer from which the media is played back, compliance with an optimization policy, and so forth. The optimization policy may further be defined in various ways, such as maintaining a given Quality of Service (QoS) at minimum cost of service, minimizing an amount of streaming media content retrieved from a SM server at a given QoS, or the like. In an exemplary implementation, hybrid streaming may be realized by contacting and retrieving the media from one or more sources in order to comply with a given optimization policy or a desired status of the playback buffer.
Multiple and varied implementations and embodiments are described below. In the following section, an exemplary environment that is suitable for practicing various implementations is discussed. After this discussion, representative implementations of systems, devices, and processes for implementing the hybrid streaming techniques are described.
Exemplary Environment
The computing device 102 may be implemented as any of a variety of conventional computing devices, including, for example, a server, a desktop PC, a notebook or portable computer, a workstation, a mainframe computer, a mobile computing device, an entertainment device, a game console, a set-top box, a DVD player, an Internet appliance, etc. that are configurable to receive streaming media content.
The network 108 may be a wireless or a wired network, or a combination thereof. The network 108 can be a collection of individual networks, interconnected with each other and functioning as a single large network (e.g., the Internet or an intranet). Examples of such individual networks include, but are not limited to, Local Area Networks (LANs), Wide Area Networks (WANs), and Metropolitan Area Networks (MANs). Further, the individual networks may be wireless or wired networks, or a combination thereof.
In one configuration, the computing device 102 includes a streaming control module 112 to implement hybrid streaming. The term “streaming” is used to indicate that data (streaming media content) is provided over the network 108 to the computing device 102 and that playback of the content can begin prior to the data being delivered in its entirety. The term “hybrid streaming” is used to indicate that the computing device 102 may receive various parts of a streaming file from one or more media sources, such as a SM server 104, a P2P network 106, and a web server 110. The streaming control module 112 coordinates the hybrid streaming by selecting the one or more media sources from which streaming media content is to be retrieved.
In one implementation, during a streaming session, the computing device 102 receives streaming media content over the network 108 from one or more media sources such as a SM server 104, a P2P network 106 and a web server 110. The streaming session is divided into time units and the media source(s) from which the streaming media content (data) is retrieved at a time unit is selected by the streaming control module 112. The streaming control module 112 may select one or more media source(s) for data retrieval at every time unit, at pre-decided time units, or at random time units. The time units may be measured in different ways, including in temporal fashion (i.e. every second of media) or as a specified number of frames (e.g., every frame or every N frames). The streaming control module 112 determines whether the streaming media content received at respective time units is less than a threshold or target amount. The determination may be made, for example, by monitoring an amount of data available for playback at a time unit. Based on this determination, the streaming control module 112 selects an appropriate source (e.g., SM server 104, P2P network 106, web server 110) to retrieve the streaming media content for a respective time unit.
As a more specific example, the streaming control module 112 may make source decisions in an effort to ensure QoS while exploiting the resources of the P2P network. Thus, the streaming control module 112 may initially retrieve streaming data from the P2P network 106. In the event that the throughput from the P2P network 106 is not sufficient for continuous playback, the streaming control module 112 retrieves data from the SM server 104. The SM server 104 is capable of streaming at a fixed bit rate or a variable bit rate.
Further, the streaming control module 112 may select the media source(s) based on an optimization policy, such as maintaining a given Quality of Service (QoS) at minimum cost of service, minimizing an amount of streaming media content retrieved from a SM server at a given QoS, or other like policies. Exemplary working of the streaming control module 112 is described in detail with reference to
System bus 208 represents any of the several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures can include an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, a Peripheral Component Interconnects (PCI) bus also known as a Mezzanine bus, a PCI Express bus, a Universal Serial Bus (USB), a Secure Digital (SD) bus, or an IEEE 1394 (i.e., FireWire) bus.
Memory 204 includes computer-readable media in the form of volatile memory, such as Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash RAM. Memory 204 typically includes data and/or program modules for implementing hybrid streaming that are immediately accessible to and/or presently operated on by processor 202. In one embodiment, the memory 204 includes a streaming control module 112, a network interface 210, a first buffer 212, a second buffer 214, a third or playback buffer 216, and other applications 218. The first and second buffers 212 and 214 store media (streaming media content) streamed from different sources 1 and 2, respectively. In other implementations, the memory 204 may have additional buffers corresponding to additional media sources in the event that streaming media is received from more than two sources during a streaming session. Thus, the memory 204 may further have buffer 3, buffer 4, buffer 5, and so on for corresponding media source 3, media source 4, media source 5, and so forth. The third or playback buffer 216 stores the media in a form suitable for playback. For example, the media received from two or more media source(s) or buffers may be combined or merged and stored in the playback buffer 216 as a continuous block of data available for playback.
Though
The network interface 210 may enable the computing device 102 to send and receive commands and media content from the media sources linked to the network 108. For example, the network interface 210 may be used by the computing device 102 to receive streaming media content from one or more of the SM server 104, the P2P network 106 and the web server 110 over the network 108.
In one implementation, during a streaming session divided into time units, the streaming control module 112 makes a decision at a time unit as to which media source(s) to contact and receive data from for the duration of at least that time unit. The decision may be based on an optimization policy, such as maintaining a given Quality of Service (QoS) at minimum cost of service or minimizing an amount of streaming media content retrieved from a SM server at a given QoS.
For example, to minimize the amount of streaming media content retrieved from the SM server 104 at a given QoS, the streaming control module 112 monitors an amount of streaming media content in the playback buffer 216. If the amount of streaming media content in the playback buffer at a time unit is less than a target amount, the streaming control module retrieves data for the time unit from a SM server 104. On the other hand, if the amount of streaming media content in the playback buffer at a time unit is more than the target amount, the streaming control module retrieves data for the time unit from a P2P network 106. The target amount may be determined based on one or more of a playback rate from the playback buffer, or on the optimization policy, etc.
In one implementation, the playback buffer 216 may receive streaming media content directly from selected media source(s) such as a SM server 104, a P2P network 106, or a web server 110. In another implementation, the playback buffer 216 may receive streaming media content from one or more of the first buffer 212 and the second buffer 214, which in turn receive streaming media content from respective media sources, i.e., media source 1 and media source 2. Media source 1 and media source 2 may be one or more of the SM server 104, P2P network 106, or web server 110. The playback buffer 216 may further receive data from additional buffers corresponding to additional media sources such as media source 3, media source 4, and so forth.
Generally, program modules executed on the components of computing device 102 include routines, programs, objects, components, data structures, etc., for performing particular tasks or implementing particular abstract data types. These program modules and the like may be executed as a native code or may be downloaded and executed such as in a virtual machine or other just-in-time compilation execution environments. Typically, the functionality of the program modules may be combined or distributed as desired in various implementations.
An implementation of these modules and techniques may be stored on or transmitted across some form of computer-readable media. Computer-readable media can be any available media that can be accessed by a computer. By way of example, and not limitation, computer-readable media may comprise computer storage media that includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium, which can be used to store the desired information and which can be accessed by a computer.
Exemplary Data Flow in Hybrid Streaming
In one exemplary implementation of hybrid streaming, the streaming control module 112 selects one or more media source(s) from which to retrieve data during a streaming session. The data retrieved from the selected media source(s) may be directly received by the playback buffer 216 or by one or more of the first buffer 212, the second buffer 214, and so forth. Where intermediate buffers are used, the first buffer 212, the second buffer 214, and so forth in turn send the data to the playback buffer 216.
In one implementation, the streaming control module 112 coordinates flow of data from the first buffer 212 and the second buffer 214 to the playback buffer 216 in accordance with an optimization policy. As an example optimization policy, the streaming control module 112 may employ a tiered approach in which two threshold values, i.e. a lower bound and an upper bound, are employed in determining from which source to retrieve the media. The streaming control module 112 assigns a high priority to one of the first buffer 212 or the second buffer 214 at a time unit based on the amount of data in the playback buffer 216 at that time unit. In one scenario, when the amount of data in the playback buffer 216 is below the lower bound, both the first buffer 212 and the second buffer 214 send data to the playback buffer 216. When the amount of data in the playback buffer 216 is between the lower bound and the upper bound, the high priority buffer sends data to the playback buffer 216. Then, when the amount of data in the playback buffer 216 is above the upper bound, neither buffer sends data to the playback buffer 216.
Further, the streaming control module 112 may also regulate throughputs of the first buffer 212 and the second buffer 214, thereby regulating an amount of data retrieved from the selected media source(s). For example, when rate of consumption of data (playback) from the playback buffer 216 slows down, there is less empty space in the playback buffer 216. Therefore, the rate of incoming data to the playback buffer 216 may be reduced by throttling back the throughputs of the first buffer 212 and the second buffer 214. Additionally, when the throughputs of the first buffer 212 and the second buffer 214 are throttled, the rate of incoming data from the P2P network 106 and the SM server 104 may also be throttled. Thus, the streaming control module 112 may also regulate the throughputs of the P2P network 106 and the SM server 104 when streaming data to the computing device 102.
In
As noted above, the streaming control module 112 may make the decision as to which media source(s) to select and receive data from based on an optimization policy. As one example, suppose the optimization policy is denoted by A, which is the complete set of all decisions (actions) over the entire streaming session, such that A={a(k)|0≦k<N}, where k is a time unit at which a decision a(k) is taken and N is a total number of time units in the entire streaming session (where each unit corresponds to a second, frame, etc.). For example, a scenario where the streaming control module 112 requests data from the SM server 104 may be represented as a(k)=1, while a(k)=0 may represent a scenario where the streaming control module 112 requests data from the P2P network 106. In such a case, the total data requested from the SM server 104 may be computed as:
where rw(k) is throughput from the SM server 104.
In an exemplary implementation of hybrid streaming, the streaming media content (data) may be received from either the P2P network 106 or the SM server 104 or both based on minimizing an amount of streaming media content retrieved from the SM server 104 at a given quality of service (QoS). In this exemplary implementation, an optimization policy A* corresponds to minimizing load on the SM server 104 during a streaming session while maintaining the given QoS. At the beginning of a time unit k(0≦k<N), the streaming control module 112 takes a decision whether to contact and request data from the P2P network 106 or the SM server 104 or both. The streaming control module 112 may take this decision at every time unit or at pre-decided time units or at random time units during the streaming session.
In one case, the streaming control module 112 may retrieve data from the P2P network 106 alone and thus, there is no load on the SM server 104. In such a case, throughput rp(k) of the P2P network 106 might be less than a media bit rate rm and result in the playback buffer 216 shrinking, or the throughput rp(k) might be enough to sustain the given QoS.
Alternatively, the streaming control module 112 may retrieve data from either or both of the P2P network 106 and the SM server 104. In this case, let throughput from the SM server 104 be denoted by rw(k) and throughput from the P2P network 106 be denoted by r′p(k). Total incoming throughput rw(k)+r′p(k) is capped by download link capacity rc of the computing device and is enough to sustain the given QoS. Let a(k) denote the decision (action) that the streaming control module 112 takes at a time unit k. A scenario where the streaming control module 112 requests data from the SM server 104 may be represented as a(k)=1, while a scenario where the streaming control module 112 requests data from the P2P network 106 may be represented as a(k)=0. A status of the playback buffer at time k may be denoted as tb(k). Then, the state transition or status of the playback buffer at time (k+1) can be summarized as:
To comply with optimization policy A*, the total amount of data retrieved from the SM server 104, computed as
is to be minimized. Further, to maintain the given QoS, the playback buffer 216 may not be allowed to underflow, i.e. tb(k)≧0 for all k's. Also, the playback buffer 216 may have an upper bound Tb, which confines tb(k)≦Tb for all k's. Therefore, the optimization policy A*={a*(k) 0≦k<N} may be defined by:
To comply with optimization policy A*, data is retrieved from either or both of the SM server 104 and the P2P network 106. There are multiple ways to fill the playback buffer according to the optimization policy. Two possible scenarios are described below with reference to
At the beginning of a period, the playback buffer 216 may already have td worth of content (in terms of media time). As shown in
In the first stage (0≦t<td), the computing device 102 consumes data from the playback buffer 216 and requests data from the P2P network in the meanwhile. An amount of data tI obtained from the P2P network 106 in this stage may therefore be computed to be:
where rp denotes throughput from the P2P network and rm denotes media bit rate.
During the second stage (td≦t≦td+tw) the streaming control module 112 streams and plays back data directly from the SM server 104. In case residual bandwidth is available, the streaming control module 112 also acquires data from the P2P network 106. The throughput of the P2P network 106 would then be capped by the link capacity (rc) and would change to r′p, where r′p=min(rc−rm,rp). The data retrieved from the P2P network 106 in this stage, tII, may therefore be computed as shown below:
The third stage begins at t=td+tw, when the streaming control module 112 stops streaming from the SM server 104 and starts playing out buffered data. The playback buffer 216 would have data sufficient for playback for duration equal to tI+tII at the beginning of this stage. The streaming control module 112 continues to acquire data from the P2P network 106 while consuming data from the playback buffer 216. An additional time in the third stage for which the streaming control module 112 would continue to acquire data from the P2P network 106 is denoted by tIII. The throughput from the P2P network 106 would resume to rp, as streaming from the SM server 104 would have stopped. The third period tIII of the third stage may therefore be computed by:
Further, as shown in
t
d
+t
w
+t
I
+t
II
=t
III
=T
p (7)
Solving Eq. (4)-(7), minimum amount of content to be streamed from the SM server 104, or tw, can be computed to be:
t
w(rm−rp+rp)≧Tp(rm−rp)+(td−td)rm (8)
Therefore, the minimum amount of streaming media content to be streamed from the SM server 104 (denoted by tw) and a point in the streaming media content (td+tw) at which the streaming control module 112 stops acquiring data from the SM server 104 and starts acquiring data from the P2P network 106 may be computed.
At the beginning of a period, the playback buffer 216 may already have td worth of content. So an amount of data that can be retrieved while playing through this buffer may be computed as:
T
d
=t
d(rp+rw)/rm (9)
where rp, rw and rm are throughput of the P2P network 106, throughput of the SM server 104, and media bit rate. Let T′p be the smaller value between Td and the period length Tp, so that T′p can be represented as T′p=min(Td,Tp). The streaming control module 112 starts downloading simultaneously from the SM server 104 and the P2P network 106 in opposite directions from time position td and td+T′p, respectively, as shown in
Though
There can be situations during streaming when there is no data in the playback buffer 216. In such a scenario, the playback buffer 216 may be grown to a stage so that there is at least a threshold amount of data in the playback buffer 216. Then, the data in the playback buffer 216 can sustain for a period of playback during which, the streaming control module 112 can retrieve further data. Such situations can occur at start-up, or when a user seeks to play from a new position, or if a new media file is pre-loaded before the end of an old one, or when a user starts a video file without following a playlist, etc.
In one implementation, to grow the data in the playback buffer 216 from no data to a threshold amount, an initial delay of reasonable time may be given during which the streaming control module 112 retrieves data from at least one of the media sources. The media source(s) may be selected by the streaming control module 112 based on throughputs of the media sources and on the optimization policy. In an exemplary implementation of hybrid streaming, the media source(s) may be selected from either the P2P network 110 or the SM server 104 or both based on minimizing an amount of streaming media content retrieved from the SM server 104 at a given quality of service (QoS). In such a case, as an initial delay is acceptable, data retrieval from the P2P network 106 may be given a greater priority. Thus, if the throughput of the P2P network 106 is sufficient to grow the playback buffer 216, the streaming control module 112 may retrieve data only from the P2P network 106. On the other hand, if the throughput of the P2P network 106 is not sufficient to grow the playback buffer 216, the streaming control module 112 may retrieve data from at least the SM server 104, with or without simultaneous data retrieval from the P2P network 106. Further, if the streaming control module 112 retrieves data from both the SM server 104 and the P2P network 106, the retrieval may be in a same time direction as explained earlier with reference to
In another implementation, to grow the data in the playback buffer 216 from no data to a threshold amount, it may not be desirable to have an initial delay. In such a case, data retrieval from the SM server 104 may be given a greater priority. The streaming control module 112 may retrieve data simultaneously from the P2P network 106 also based on residual bandwidth available. Further, if the streaming control module 112 retrieves data from both the SM server 104 and the P2P network 106, the retrieval may be in a same time direction as explained earlier with reference to
Exemplary Processes
The process 600 monitors a status of the playback buffer 216 and selects one or more media source(s) from which to retrieve data during a streaming session. The streaming session is preferably divided into many time units. At block 602, the streaming control module 112 determines whether an amount of data in the playback buffer 216 is less than a threshold amount. The threshold amount may be determined based, for example, on a playback rate from the playback buffer, an optimization policy, or other factors. The optimization policy may be defined in various ways, such as maintaining a given Quality of Service (QoS) at minimum cost of service, or minimizing an amount of streaming media content retrieved from a SM server at a given QoS, or so forth.
If the amount of data in the playback buffer 216 is determined to be less than the threshold amount (i.e. the “yes” branch from block 602), data is retrieved from the SM server 104 for at least one time unit (block 604). Additionally, data may also be retrieved simultaneously from the P2P network 106 if residual bandwidth is available. Alternatively, if the amount of data in the playback buffer 216 is determined to be more than the threshold amount (i.e. the “no” branch from block 602), data for at least the time unit is retrieved from at least one P2P network 106 (block 606).
In cases where the streaming control module 112 retrieves data simultaneously from both the SM server 104 and the P2P network 106, the streaming control module 112 may retrieve the data and fill the playback buffer 216 with data arranged in the same time direction or in opposite time directions. A scenario in which data is retrieved in a same time direction is described below with reference to
At block 608, the retrieved data is received in the playback buffer 216. At block 610, data in the playback buffer 216 is played back. While the data is played back from the playback buffer 216, data is also simultaneously received in the playback buffer from at least one of the SM server 104 and the P2P network 106. To select which media source(s) to retrieve data from, actions illustrated as blocks 602 to 608 are repeated. The operation may be repeated at every time unit, at pre-decided time units, or at random time units.
If the amount of data in the playback buffer 216 is more than the threshold amount (i.e. the “no” branch from block 702), data is retrieved from at least one P2P network 106 for at least one time unit (block 704). Alternatively, if the amount of data is less than the threshold amount (i.e. the “yes” branch from block 702), a computation is made to determine an amount of data, in terms of media time and denoted tw, to be retrieved from the SM server 104 (block 704). One exemplary computation to find the amount of data tw can be made using equation (8) above, as explained earlier with reference to
At block 708, retrieval of data tw from the SM server 104 is started. At block 710, the streaming control module 112 determines whether residual bandwidth is available. At block 712, if residual bandwidth is not available (i.e. the “no” branch from block 710), retrieval of data tw from the SM server 104 continues until finished. Alternatively, at block 714, assuming residual bandwidth is available (i.e. the “yes” branch from block 710), data is retrieved simultaneously from the P2P network 106 while retrieval of data tw from the SM server 104 is finished. The data retrieval from the P2P network 106 at block 714 is started from a point (td+tw) in the streaming media content. At block 716, data reverts to being retrieved from the P2P network 106.
At block 718, the retrieved data is received in the playback buffer 216. At block 720, data in the playback buffer 216 is played back. While the data is played back from the playback buffer 216, data is also simultaneously received in the playback buffer from at least one of the SM server 104 and the P2P network 106. To select which media source(s) to retrieve data from, actions illustrated as blocks 702 to 718 are repeated. The operation may be repeated at every time unit, at pre-decided time units, or at random time units.
At block 810, the retrieved data is received in the playback buffer 216. At block 812, data in the playback buffer 216 is played back. While the data is played back from the playback buffer 216, data is also simultaneously received in the playback buffer from at least one of the SM server 104 and the P2P network 106. To select which media source(s) to retrieve data from, the actions illustrated as blocks 802 to 810 are repeated. The operation may be repeated at every time unit, at pre-decided time units, or at random time units.
Exemplary Simulation Results
Although the invention has been described in language specific to structural features and/or methodological acts, it is to be understood that the invention defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the claimed invention.