« PreviousContinue »
STREAMING A SINGLE MEDIA TRACK TO
 This invention relates to the field of computer systems. More particularly, in a media streaming system in which a track of media has associated metadata that provides timing, offset and other information, an apparatus and methods are provided for streaming a media track to multiple clients with just one copy of the track metadata.
 Media streaming systems are designed to stream media programs and events, which may be pre-recorded or live, to client devices (e.g., computers, media players). A client can play a media stream as it is received (i.e., before the stream is complete), thereby allowing fast, or even real-time, enjoyment of the media program or event.
 Streamed media is often composed of multiple tracks. For example, an audiovisual program generally includes at least one audio track and at least one video track. Each track includes media of the appropriate type (e.g., audio, video), and may also include metadata that is used to stream the media correctly. A track's metadata may include information for identifying a media segment or sample (or other unit of media) that should be played for a given time index within the program, for determining where that segment or sample is located in the file, etc. A media track's metadata may thus be used by a media streaming server to stream the media track in the correct sequence, with appropriate timing, and so on.
 When streaming a media track or program to multiple clients, existing systems usually store separate copies of each track's metadata for each client. More specifically, from a media file containing the media to be streamed, these systems repeatedly extract and store the metadata each time a new client requests the media. When serving a large number of clients, this could require a significant amount of the server's resources (e.g., memory, processor, disk usage), and may limit the number of clients the server can support.
 Also, some existing systems typically allocate just one file descriptor, to be shared among all clients receiving a particular media stream, for accessing the media file containing the media being streamed. This can lead to a great deal of contention among the client streams as each one attempts to seek to (i.e., find) and extract a different media segment or sample.
 Yet further, when streaming a multi-track media program to a client, existing media streaming systems attempt to maintain synchronization between the tracks so that the appropriate corresponding track media is streamed or played for each time unit of the program, but may be incapable of regaining synchronization if it is lost. For example, if the media for one track is received (e.g., from a storage device) at a slower rate than the media for another track, an existing media streaming system may simply continue streaming the media, even if the tracks get further and further out of synchronization. Other systems may simply halt a media stream if synchronization is lost, without attempting to correct the situation.
 Therefore, in one embodiment of the invention, an apparatus and methods are provided for sharing one copy of a media track's metadata for streaming the media track to multiple clients.
 In this embodiment, one file track is generated to store the metadata of a single media track. For a media program comprising multiple tracks, a separate file track is generated for each track. For each client stream of the media, separate file track handles are established. Each file track handle acts as an interface between its client stream— different client streams may be at different time indices within the media—and the single instance of media metadata.
 In another embodiment of the invention, a single file descriptor is shared among all file track handles associated with a single media track, for accessing the file storing the track's media.
DESCRIPTION OF THE FIGURES
 FIG. 1 is a block diagram depicting a server configured to stream media in accordance with an embodiment of the present invention.
 FIG. 2 is a block diagram depicting the use of a single copy of media track metadata to stream the media to multiple clients, in accordance with an embodiment of the invention.
 FIG. 3 depicts one configuration of program objects cooperating to stream a media track to multiple clients with a single copy of the track's metadata, in accordance with an embodiment of the present invention.
 FIGS. 4A-4B comprise a flowchart demonstrating one method of streaming a media track to multiple clients with a single copy of the track's metadata in accordance with an embodiment of the present invention.
 FIG. 5 depicts one configuration of program objects for resynchronizing media within a media stream, in accordance with an embodiment of the present invention.
 FIG. 6 is a flowchart demonstrating one method of resynchronizing media within a media stream in accordance with an embodiment of the present invention.
 The following description is presented to enable any person skilled in the art to make and use the invention, and is provided in the context of particular applications of the invention and their requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
 The program environment in which a present embodiment of the invention is executed illustratively incorporates a general-purpose computer or a special purpose device such as a computer server configured to provide data
or media streaming services to computers or communications devices of virtually any configuration (e.g., wired, wireless, portable, desktop). Details of such computers and other devices (e.g., processor, memory, data storage, display) are well known and may be omitted for the sake of clarity. Further, embodiments of the invention are described as they may be implemented in an object-oriented programming environment. Suitable variations of embodiments may be implemented using other programming models or frameworks, as will be appreciated by one skilled in the art.
 It should also be understood that the techniques of the present invention might be implemented using a variety of technologies. For example, the methods described herein may be implemented in software executing on a computer system, or implemented in hardware utilizing either a combination of microprocessors or other specially designed application specific integrated circuits, programmable logic devices, or various combinations thereof. In particular, the methods described herein may be implemented by a series of computer-executable instructions residing on a storage medium such as a carrier wave, disk drive, or computerreadable medium. Exemplary forms of carrier waves may take the form of electrical, electromagnetic or optical signals conveying digital data streams along a local network or a publicly accessible network such as the Internet.
 In one embodiment of the invention a media or data streaming server is configured to stream media or data to multiple clients. A media program or event that is to be streamed to multiple clients includes one or more tracks (e.g., audio, video), each of which may be stored in one or more media files. When a first request for the media program is received, the track's metadata is retrieved and stored in a file track. The metadata may include information regarding: timing (e.g., to synchronize the track's media with other program tracks), locations of media segments or samples (or other units of media) within a media file, hierarchies of media units (e.g., chunks, samples that comprise a chunk), edit tables, etc.
 For each client to which the media track is to be streamed, separate file track handles are established to reference metadata within the file track. Thus, instead of storing separate copies of the track metadata for each client stream, each client's file track handle references (e.g., with pointers) the single file track to retrieve timing location, locate media segments in a media file, etc. Further, each file track handle is allocated a file descriptor into the track's media files, for seeking and retrieving media.
 Specific embodiments of the invention are described below as they may be implemented for streaming QuickTime media from a UNIX-based computer system, such as a system executing the SolarisTM operating system by Sun Microsystems, Inc. Such embodiments may be modified for use with other types of media and other computer systems, as may be understood from the following descriptions.
 An Illustrative Media Streaming Server
 Media streaming allows a user to receive and enjoy media content without having to wait until the full program or presentation is downloaded to his or her client device. For example, the user can enjoy a pre-recorded program, or experience a live event in real-time, without waiting until the full program is received.
 Media may be streamed in unicast or multicast mode. In unicast mode the streaming server maintains a dedicated connection to each receiving client device, which grants a user great control over his or her stream. He or she may, for example, be able to pause a stream, rewind or fast-forward through the streamed media, or perform other control functions. However, this can lead to inefficient use of bandwidth for a large number of users. In multicast mode, the media streaming server streams a program to multiple users simultaneously, thereby using less bandwidth. This type of streaming is thus comparable to a traditional broadcast, and users have little control over their individual streams. Live events may normally be streamed in multicast mode, because it is more efficient for serving large numbers of users. And, because it is a live event being enjoyed in real-time, there is little need to manipulate the streamed media.
 A media streaming server according to a present embodiment of the invention may operate in a "reflection" mode of operation, in which the server receives a media stream from another streaming system or server (usually in multicast mode), and forwards the media to one or more users (in unicast or multicast mode).
 Streaming real-time media places constraints upon the issuing server, because delivery of each frame or other unit of the media must be performed in a specified order and within a certain period of time. Thus, despite the number of clients it serves, a media streaming server must strive to meet the demands of streaming real-time media so that the quality of service to the users does not drop to an unacceptable level. For example, regardless of the type of program (i.e., live or pre-recorded) and mode of streaming (i.e., unicast or multicast), streamed media is generally compressed to decrease the bandwidth that it consumes in transit, thus helping to ensure timely delivery of media to a client.
 A media streaming server according to one embodiment of the invention is configured to stream QuickTime media and/or other forms of media, in a unicast or multicast mode, over a proprietary or publicly accessible network such as the Internet. Media streams are formatted according to a set of protocols compatible with the transmission medium. In particular, when streaming QuickTime media the server may be configured for RTSP (Real-Time Streaming Protocol) to facilitate a client's control of a media stream, RTP (Real-Time Transport Protocol) to deliver the stream to the client and/or receive media from another source, RTCP (Real-Time Transport Control Protocol) to receive or exchange information regarding the quality of a stream, SDP (Session Description Protocol) to describe media to the client, etc. Other embodiments may be configured for other media protocols.
 FIG. 1 depicts media streaming server 102, configured to stream QuickTime media according to an embodiment of the invention. In FIG. 1, media streaming server 102 serves clients 110,112. The media that is streamed to the clients may comprise a pre-recorded program retrieved from storage device 104 or a real-time program received from server 130 (e.g., as part of multicast broadcast 130a). Media streaming server 102 may thus stream live events (e.g., concerts, news broadcasts, sporting events), movies, documentaries, training videos, educational programs or classes, etc.