The present invention generally relates to encoding and playback of video content and more specifically to the use of metadata to enable playback of media at different frame rates.
Media distributed by content providers to content consumers can be encoded using a variety of video compression standards that facilitate the distribution of the content across a distribution channel. Well know compression standards include H.264/MPEG-4, published by the ITU-T Video Coding Experts Group (VCEG) together with the ISO/IEC JTC1 Moving Picture Experts Group (MPEG), and the newer High Efficiency Video Coding (HEVC) standard, MPEG-H Part 2, developed by MPEG and VCEG, both of which are herein incorporated by reference. Video compression or video encoding involves compressing the amount of information used to describe the frames of video in a video sequence in order to reduce the consumption of network resources that are utilized when distributing content via a network. The reduced size also facilitates the distribution of content on non-volatile storage mediums such as CD-ROMs and flash-drives.
Media playback devices can utilize video decoders to decode encoded video for playback. Video can be encoded using predetermined encoding profiles. Typically, playback devices utilize decoders that are capable of playing back video encoded using one or more profiles. A particular profile may specify parameters and limits for various video settings, including picture resolution (e.g., 720p, 1080p, 4 k etc.), frame rate (i.e., 24, 30, 48, 60 frames per second, etc.), and bitrate (e.g., 12 Mbps, 40 Mbps, etc.).
Encoded media is typically stored in one or more container files. The most commonly used media container formats are the MP4 container format specified in MPEG-4 Part 14 (i.e., ISO/IEC Standard 14496-14) and the MPEG transport stream (TS) container specified in MPEG-2 Part 1 (i.e., ISO/IEC Standard 13818-1). The Matroska container is a media container developed as an open standard project by the Matroska non-profit organization of Aussonne, France. The Matroska container is based upon Extensible Binary Markup Language (EBML), which is a binary derivative of the Extensible Markup Language (XML). Decoding of the Matroska container is supported by many consumer electronics (CE) devices. The DivX Plus file format developed by DivX, LLC of San Diego, Calif. utilizes an extension of the Matroska container format (i.e., is based upon the Matroska container format, but includes elements that are not specified within the Matroska format).
Furthermore, encoded video can be distributed to devices through different mechanisms, including downloading from a server for storage and future playback on the device, streaming the encoded video during playback on the device, and retrieving the encoded video from one or more files stored on a CD-ROM, flash drive, or other non-volatile storage medium, and various other storage and distribution mechanisms. Streaming solutions typically utilize either Hypertext Transfer Protocol (HTTP), published by the Internet Engineering Task Force and the World Wide Web Consortium as RFC 2615, or Real Time Streaming Protocol (RTSP), published by the Internet Engineering Task Force as RFC 2326, to stream media between a server and a playback device. HTTP is a stateless protocol that enables a playback device to request a byte range within a file. HTTP is described as stateless, because the server is not required to record information concerning the state of the playback device requesting information or the byte ranges requested by the playback device in order to respond to requests received from the playback device. RTSP is a network control protocol used to control streaming media servers. Playback devices issue control commands, such as “play” and “pause”, to the server streaming the media to control the playback of media files. When RTSP is utilized, the media server records the state of each client device and determines the media to stream based upon the instructions received from the client devices and the client's state. Thus, content providers utilize different distribution protocols for each of the different mechanisms (i.e., download vs. streaming) for distributing video files to different devices.
Systems and methods in accordance with embodiments of this invention encode and play back video at different frame rates using enhancement layers. In an embodiment of the invention, a non-transitory machine readable medium containing processor instructions, where execution of the instructions by a processor causes the processor to perform a process that includes receiving video having several access units and encoding the video into a set of layers that includes a base layer and at least one enhancement layer, where the encoding includes: (i) using a temporal identifier of each access unit to determine the particular layer associated with the access unit and (ii) retaining an order of the temporal identifiers of the several access units of the video.
In another embodiment, the temporal identifier of an access unit is stored in an initial set of bits of the access unit.
In yet another embodiment, a process inserts a temporal identifier for a set of access units of the several access units of the video.
In still another embodiment, a process inserts a metadata tag providing information regarding the layers available and the frame rate of each layer.
In still yet another embodiment, a process receives a request for streaming of the video, determines playback capabilities of a device requesting the video, and streams different sets of layers of the video based on the playback capabilities of the device, where (i) the base layer is streamed to a playback device capable of playing back the base layer and (ii) the base layer and at least one enhancement layer is streamed to a playback device capable of streaming the plurality of layers.
In a further embodiment, streaming the different sets of layers includes merging the different layers using the retained order of the temporal identifiers of the plurality of access units of the video.
In another embodiment, a process receives a request for downloading of the video from a playback device and provides the encoded video to the playback device.
In another embodiment again, a frame rate of at least one enhancement layer is an integer multiple of the base layer.
In yet another embodiment again, a process stores each layer as a separate stream.
In still yet another embodiment again, a process stores each layer in a separate container file.
In an embodiment of the invention provides a source encoder that includes a processor configured by a source encoder application to receive video having several access units and encode the video into a set of layers that includes a base layer and at least one enhancement layer, where the encoding includes: (i) using a temporal identifier of each access unit to determine the particular layer associated with the access unit and (ii) retaining an order of the temporal identifiers of the plurality of access units of the video;
In another embodiment, a temporal identifier of an access unit is stored in a header of the access unit.
In yet another embodiment, a source encoder inserts a temporal identifier for a set of access units of the several access units of the video.
In still a further embodiment, a source encoder inserts a metadata tag providing information regarding the layers available and the frame rate of each layer.
An embodiment of the invention includes a playback device configured to playback video that includes a processor configured to communicate with a memory, where the memory contains a client application, where the client application configures the processor to receive video that includes several access units, playback the video, where the playback device plays back the video (i) using a base layer when the playback device has a first set of playback capabilities and (ii) using the base layer and at least one enhancement layer when the playback device has a second set of playback capabilities.
In another embodiment, a client application further configures the processor to identify an order of temporal identifiers of the several access units of the video and merge the access units of the base layer and the access units of at least one enhancement layer using the order of temporal identifies of the several access units of the video.
In yet another embodiment, a client application further configures the processor to request streaming of the video to a playback server and provide information regarding playback capabilities of the playback device to the playback server and receive a first stream that includes the base layer of the video and a second stream that includes the at least one enhancement layer of the video.
In still yet another embodiment, a client application further configures the processor to request downloading of the video to a content distribution server and provide playback capabilities of the playback device to the content distribution server, receive the video from the content distribution server, where a first device receives video that includes the base layer when the first device is capable of playing back the video at a first frame rate and a second device receives video that includes the base layer and at least one enhancement layer when the second device is capable of playing back the video at a second frame rate.
In yet another embodiment again, a client application further configures the processor to retrieve a metadata tag from the video identifying the layers available and the frame rate of each layer; and determine a set of layers to playback based on the information in the metadata tag.
In a further embodiment again, a client application further configures the processor to identify the temporal identifier of an access unit by parsing an initial set of bytes of the access unit.
Turning now to the drawings, systems and methods for encoding and playing back video at different frame rates using enhancement layers in accordance with embodiments of the invention are illustrated. In a number of embodiments, video is encoded using temporal scalability involving the creation of a base layer at a first frame rate and an enhancement layer including additional frames enabling playback at a second higher frame rate. The second higher frame rate can also be referred to as an enhanced frame rate. In a number of embodiments, the base and enhancement layers are stored in one or more container files that contain metadata describing the enhancement layer. Based on the capabilities of a playback device, it can select the particular frame rate at which to playback encoded video. For example, for a single media file containing video encoded with temporal scalability that provides both a base frame rate (e.g., 30 fps) and an enhanced frame rate (e.g., 60 fps), a first device may only be able to play back the encoded video at the base frame rate while a different device may be able to playback encoded video at the enhanced frame rate. Thus, video content can be played back at different frame rates on different devices.
In several embodiments, encoded video can be distributed to playback devices using a variety of distribution mechanisms, including downloading of one or more files containing the encoded video or streaming the encoded video to the playback device for progressive playback and/or as part of an adaptive bitrate streaming system. However, in order to avoid wasting network resources when streaming encoded video that includes temporal scalability to a device that is not capable of handling the decoding of the enhancement layer(s), in some embodiments the different video layers are separated and streamed on an “as needed” basis to the playback device. For example, for a file containing encoded video that has both a base video layer that provides a base frame rate of 30 fps and an enhancement layer that provides a frame rate of 60 fps, a first device with only the capacity to playback video at a frame rate of 30 fps can request a stream of only the base layer of the encoded video while a second device that has the capacity to playback the video at a frame rate of 60 fps can request streams containing both the base video layer and the enhancement layer.
When streaming multiple separate video layers to a user's device, the streams can be combined at the playback device into a single stream in order to allow for the playback of the encoded video on the device at the enhanced frame rate. Due to dependencies that can exist between encoded frames of video (specifically bi-directionally encoded frames of video), the frames of video in the base layer and/or the enhancement layer may not be received by the playback device in the order in which they are to be played back. In several embodiments, the frames of video in the base and/or enhancement layers are received in “decode order”, which is an order that causes the decoder to have fully decoded all frames on which a given frame depends prior to decoding the given frame. In order to determine the particular decode order, in some embodiments, one or more of the enhancement layers include metadata that specifies a sequential order for selecting frames of video from the different layers to merge the frames into a single stream for decoding and playback at the enhanced frame rate.
Some embodiments utilize an adaptive streaming mechanism that detects the present streaming conditions (e.g., the user's network bandwidth and CPU capacity) in real time and adjusts the frame rate of the streamed video accordingly. When a playback device has the capability to play back the video file at an enhanced frame rate, the playback device can stream both the base and enhancement layers when the network bandwidth is sufficient to satisfy that bitrate necessary for transmission and/or the CPU has capacity to process the encoded video at the enhanced rate. The playback device may likewise stream the encoded video at the base rate when a change in the streaming conditions is detected indicative of insufficient bandwidth for the enhanced frame rate and/or the CPU no longer has capacity to process the encoded video at the enhanced frame rate.
In several embodiments, the base layer includes a sequence of frames encoded at a first frame rate in such a way that the frames in the base layer are only dependent upon other frames in the base layer. In a number of embodiments, the enhancement layer includes additional frames that, when merged with the sequence of frames in the base layer, form a sequence of frames encoded at a second frame rate. In certain embodiments, the frames in the enhancement layer are encoded so that they are only dependent upon frames in the base layer. In a number of embodiments, the frames in the enhancement layer are further constrained so that the enhancement layer does not include any I-frames (i.e., frames that can be decoded without reference to other frames). In other embodiments, the enhancement layer can include frames that incorporate dependencies upon other frames in the enhancement layer and/or I-frames.
In some embodiments, the source video is encoded and decoded using codecs implemented in accordance with the HEVC standard. In order to signal the availability of temporal scalability (i.e., the existence of at least one enhancement layer), the files containing the encoded video can include a metadata tag that provides information regarding the available layers within the media file and the frame rate of each layer. In several embodiments, at least one enhancement layer includes metadata in the form of an ordered set of Access Unit Delimiters (AUDs) that specify a sequential order for selecting access units from different layers. In particular, each AUD identifies the specific layer containing the video data of the Access Unit and this information can be used to determine the manner in which the Access Units from the different layers are combined into a single video stream. In some embodiments, the multiple streams are combined on the user's playback device prior to being provided to the decoder on the device. In other embodiments, the separate streams are combined into a single stream by the content provider prior to their streaming to the user's device.
System and methods for encoding and playing back video at different frame rates using enhancement layers in accordance with embodiments of the invention are discussed further below.
A system for encoding and playing back video at different frame rates using enhancement layers in accordance with an embodiment of the invention is illustrated in
As is discussed further below, in many embodiments, the source encoder is able to encode a video with temporal scalability by creating a base layer of video frames that allow playback at a base frame rate and one or more enhancement layers of video frames that allow playback at a higher enhanced frame rate. In many embodiments, the source encoder stores the encoded video in one or more container files. In some embodiments, the encoded video is then uploaded to distribution server 104. In many embodiments, source encoder uploads the encoded video as a single file containing multiple temporal layers. In several embodiments, the encoded video is uploaded as one or more separate streams, with each stream corresponding to a particular temporal layer of the encoded video. In many embodiments, each stream can be stored in a separate container file (e.g., Matroska container file) while in other embodiments the streams are stored in the same container file. A device 105-107 may then request either to (i) download the entire file, or (ii) receive a streamed video for progressive playback. In some embodiments, the streamed video provides either the base layer of video data when the requested stream is at the base frame rate or the base layer and one or more enhancement layers when the requested stream is at a higher enhanced frame rate.
In many embodiments, the encoded video is stored in Matroska container files. As is discussed further below, the encoded video can be stored within the Matroska container file in a way that facilitates the embedding of metadata within a file containing encoded video that describes any enhancement layers that may be available to achieve playback of the content at an enhanced frame rate. In many embodiments, the Matroska container files are specialized Matroska container files that include enhancements (i.e., elements that do not form part of the Matroska file format specification) that facilitate the retrieval of the video at different frame rates via HTTP or RTSP during the streaming of the video. The enhancements to the Matroska container file can also include storing metadata that provides information regarding the temporal layers that are available for the encoded video and the frame rate of each layer.
In many embodiments, the distribution server receives and processes download requests from a variety of playback devices 105-107 that seek to download the encoded video. When the distribution server receives a download request from a playback device, it can provide the playback device with the encoded video for storage. A downloaded video file may include a header that contains metadata describing temporal layers within the video file and the video data stored within the various temporal layers. In some embodiments, the temporal layers provided to a playback device may include only the base layer when the device requests the encoded video at the base frame rate or both the base layer and one or more enhancement layers when the device requests the encoded video at the enhanced frame rate.
In some embodiments, the distribution server receives stream requests from a variety of playback devices and subsequently streams the encoded video to the playback devices for progressive playback and/or as part of an adaptive bitrate streaming system. In several embodiments, the variety of playback devices can use HTTP or another appropriate stateless protocol to request streams via a network 108 such as the Internet. In several embodiments, a variety of playback devices can use RTSP whereby the distribution server records the state of each playback device and determines the video to stream based upon instructions received from the playback devices and stored data describing the state of the playback device.
Playback devices with different playback capacities may request different streams from the distribution server. For example, for a particular video that has been encoded with temporal scalability, a device with only the capacity to playback the encoded video at a base frame rate can request a stream from the distribution server that contains only the base layer. The distribution server would then stream only the base layer of the encoded video to the playback device. Likewise, a device with the capacity to playback video at the enhanced frame rate can request the distribution server to provide streams that contain both the base layer and the one or more enhancement layers whereby the distribution server would stream both layers to the playback device. By allowing a device to request only the particular layers that the device is capable of decoding, the system is able to avoid wasting network resources that would otherwise be needed to provide all layers to every device, including those without the capacity to handle the enhancement layers.
As described above, in order to enable playback of the video, the separate streams can be merged according to the decode order of the video frames. Thus, in many embodiments, when a device requests a stream at the enhanced frame rate, the distribution server first merges the separate temporal streams and sends a single ordered stream of video to the device. In other embodiments, the playback device is responsible for merging the separate streams into the single ordered stream prior to providing the stream to a decoder on the playback device for play back of the video stream.
In the illustrated embodiment, playback devices include personal computers 105-106 and mobile phones 107. In other embodiments, playback devices can include consumer electronics devices such as DVD players, Blu-ray players, televisions, set top boxes, video game consoles, tablets, and other devices that are capable of connecting to a server via HTTP and playing back encoded video. Although a specific architecture is shown in
The basic architecture of a playback device in accordance with an embodiment of the invention is illustrated in
Stream Selection of Video Encoded with Temporal Scalability
As described above, different classes of devices may request different streams from the distribution server in order to play back a video at different frame rates. Streams generated by a source encoder and/or stored on a distribution server for streaming to playback devices in accordance with embodiments of the invention are illustrated in
In many embodiments, each Matroska container file contains a single stream that corresponds to a particular temporal layer of the encoded video. For example, a first stream could contain video frames for a base layer of the encoded video and a second stream could contain the video frames for one or more enhancement layers. In some embodiments, each stream includes only the video data for the particular layer. Thus, in many embodiments, in order to play back the video at an enhanced rate, the video data from the different layers can be combined into a single stream prior to being sent to the decoder. As can readily be appreciated, the combination of streams can occur at the server and/or at the playback device. In several embodiments, at least one enhancement layer includes metadata in the form of an ordered set of Access Unit Delimiters (AUDs) that provide the order for selecting access units from different layers (or streams). In particular, each AUD identifies the particular layer containing the video data of the Access Unit and this information can be used to determine the manner in which the Access Units from the different layers are combined into a single video stream.
As is discussed further below, in many embodiments the Matroska container files are specialized files. The encoding of the video and the manner in which the video is stored within elements within the Matroska container file can be subject to constraints designed to enhance the performance of a streaming system for playing video encoded with temporal sub-layers. In addition, the Matroska container file can include index elements that facilitate the location and downloading of frames of video (i.e., Access Units) from the various Matroska container files during the streaming of the media. Specialized Matroska container files that can be used in adaptive bitrate streaming systems are proposed by DivX, LLC in U.S. patent application Ser. No. 13/221,682, entitled “Systems and Methods for Adaptive Bitrate Streaming of Media Stored in Matroska Container Files Using Hypertext Transfer Protocol”, filed Aug. 30, 2011, the disclosure of which is hereby incorporated by reference in its entirety. Matroska container files that can be used in streaming systems that distribute video encoded with temporal layers in accordance with embodiments of the invention are discussed below.
Storing Encoded Video with Temporal Layers in Matroska Files
A Matroska container file used to store encoded video in accordance with an embodiment of the invention is illustrated in
In addition to the above standard elements, the Segment element 412 also includes a modified version of the standard Tracks element 415. As is discussed further below, the Tracks element includes a standard Codec Private element 420. The Codec Private element includes a specialized Profile Message element 421 (e.g., the DivX™ HEVC Profile Tag specified by DivX, LLC of San Diego, Calif.) that is used to (i) signal the availability of temporal scalability for the encoded video and (ii) provide information regarding the temporal layers that are available and corresponding frame rates of each available layer. In some embodiments, the temporal scalability of encoded video can be quickly detected based on the presence of this tag within the container file and/or the presence of similar information within a top level index file.
The Payload element 425 includes an Asset element 426, Layers L[0] through L[ . . . ] 427, and Frame Rate Per Seconds “FPS” elements FPS[0] through FPS[ . . . ] 428. The Asset element 426 includes the UUID identifying the video file encoded with temporal scalability. As described above, the encoded video can be separated into several temporal layers, with each layer having frames of video that can be merged with a base layer to achieve a particular enhanced frame rate. Each separated layer has the same UUID, which is used to verify and track the different layers. Layers L[0] through L[ . . . ] provide a numerical value (i.e., 0 or 1) that can be used to determine whether the particular layer is available. The FPS[0] through FPS[ . . . ] provide the frame rate (i.e., frames per second) of each corresponding layer. In some embodiments, the frame rate of each layer is fixed and can be an integer multiple of the base layer. Although
As described, the encoded video can be inserted within individual Cluster elements of the MKV container. A standard (i.e., none enhanced) Clusters element of a Matroska container file containing encoded video in accordance with an embodiment of the invention is illustrated in
In the example illustrated in
An example of separate container files storing different temporal layers is illustrated in
In order to separate the temporal layers into separate streams, many embodiments can store within a particular container file only those video frames that have a Temporal ID identifying the particular temporal layer. As illustrated in this example, Cluster 601 includes Blocks and Reference Blocks which all have a Temporal ID of 0, which indicates that the encoded video frame within these Blocks correspond to the base temporal layer. In the illustrated embodiment, these Blocks do not include AUDs. In other embodiments, the Blocks in the container file containing the base layer can include AUDs. Likewise, Cluster 602 includes Blocks (and ReferenceBlocks) which all have a Temporal ID of 1, which indicates that the encoded video frames within these Blocks belong to an enhancement layer with and ID of 1. As noted above, the container file containing the clusters that include the enhancement layer(s) can also include Blocks containing AUDs indicating the decode order of the merged layers (see discussion below). In many embodiments, storing the temporal layers in separate containers allows for the individual streaming of particular temporal layers, as requested by different devices with different playback capabilities. Although the above describes inserting information concerning the various temporal layers, and metadata identifying the frames belonging to the enhancement layers, similar techniques can be utilized to stored encoded video incorporating enhancement layers in any of a variety of different container files in accordance with embodiments of the invention.
Generating a Container File for Video Encoded with Temporal Layers
In order to facilitate the playback of encoded video with temporal scalability, metadata describing the temporal layers of the encoded video may be embedded that facilitates the playback of the encoded video at different frame rates. The metadata may be embedded in either the container file or within the encoded video data. In many embodiments, the video is encoded in accordance with the HEVC standard and an encoder can embed certain additional information during the encoding process that facilitates the video playback. A process for embedding information describing video encoded with temporal scalability in a container file in accordance with an embodiment of the invention is illustrated in
The process 700 commences by initializing (705) source video for encoding with temporal scalability. The resulting encoded video may contain multiple video layers, including a base layer containing frames of video for playback at a base frame rate and one or more enhancement layers containing frames of video for playback at a higher enhanced frame rate. In some embodiments, the same process will be utilized for encoding a video without temporal scalability (i.e., no multiple temporal layers). In this situation, the process may provide an indication that the enhancement layers are unavailable.
The process inserts (710) metadata into the container file indicating the presence of one or more enhancement layers within the file and the frame rate of the enhancement layer. In the case of a Matroska container file, a Profile Message can be inserted into the file header that includes information regarding the temporal layers and the corresponding frame rate of each layer. In many embodiments, the Profile Message is the DivX HEVC Profile Message specified by DivX, LLC of San Diego, Calif. In other embodiments, any of a variety of metadata describing an enhancement layer can be stored in a container file as appropriate to the requirements of a specific application.
The process 700 encodes (715) the video with temporal scalability. As described above, in many embodiments the process utilizes the HEVC compression standard for encoding the video. During the encoding process, the process may store portions of the encoded video within Matroska container files. As described above, in some embodiments, the process may also embed an Access Unit Delimiter (AUD) within each frame of video that provides the corresponding temporal layer associated with the video frame. In some embodiments, the AUD is contained within the Block (or Reference Block) element of the MKV container, with each Block containing the encoded video frame data for a particular video frame. In other embodiments, the process may not embed the AUD into the Block, but can use a different mechanism in order to provide an indication of the temporal layer associated with a particular frame of video. For example, in many embodiments that store the temporal layers in different containers, the process may provide null values to indicate that Blocks in different containers corresponding to different temporal layers will contain the video data for certain frames.
The process 700 determines (720) whether to store the encoded video as one or more files, such as a single MKV file. The file may then be stored on a non-volatile storage medium such as a CD-ROM, flash-drive, or other storage medium. The file may also be stored and distributed to a user by allowing the user to download the file from a distribution server. If the process determines that the encoded video is to be stored as a file, the process can store (725) the file containing the encoded video on a storage medium (i.e., Distribution Server or CD-ROM, flash-drive, or other non-volatile storage etc.). In many embodiments, the encoded video is stored as a single file with multiple temporal layers of video that can be decoded by a decoder implemented on the playback device. In several other embodiments, each temporal layer of the encoded video is stored as a separate file in order to allow a playback device to obtain only the encoded video that the device is capable of playing back.
The process 700 determines (730) whether to store the encoded video in a manner suitable for streaming to playback devices. When the process determines (730) not to store streams of the encoded video, the process is complete.
When the process 700 determines (730) that the encoded video should be stored for streaming, the process generates and stores (735) separate streams of frames of video, with each stream corresponding to a temporal layer of the encoded video. In many embodiments, in order to generate the separate streams, the process analyzes a Temporal I.D. associated with each frame of video in the single video stream. In several embodiments, the video stream will include many different video frames with the frames ordered based on the decoding order.
In a number of embodiments, the Temporal I.D. may be stored within the AUD of a Block element within a Matroska container. Based on the Temporal I.D. of the frames of video, the process may separate out different frames of video to different streams. Thus each separate stream may contain only the video data for frames of video within the particular stream. For example, the base layer may contain only the video data for frames that are to be played back at the base frame rate. Thus, if a video has a base frame rate of 30 f.p.s, the base layer will contain 30 frames for one second of encoded video. Continuing with the example, the one or more enhancement layers can contain the video data for the frames that are to be played back at the higher enhanced frame rate. Thus, if a video is to be played back at an enhanced frame rate of 60 f.p.s. and has a base frame rate of 30 f.p.s., the enhancement layer of this encoded video will contain 30 additional video frames that can be combined with the 30 frames in the base layer to generate an output of 60 f.p.s. As described below, the combined frames may be provided to the decoder in a particular decode order, which is an order that causes the decoder to have fully decoded all frames on which a given frame depends prior to decoding the given frame. In order to know how the frames are to be merged, the process also retains (735) the AUD order of frames within at least one of the layers. In many embodiments, metadata describing the ordering of frames is stored in at least one of the enhancement layers. For example, prior to separating the frames to the different streams, the process can retain the order of the layers of the frames within the single stream. During the merging of the frames, the process can then identify the corresponding layer that contains the frame that should be retrieved for the encoded video. After generating and storing the separate streams, the process is complete. Although specific processes for embedding information describing video encoded with temporal scalability are described above, any of a variety of processes may be utilized for embedding information describing video encoded with temporal scalability as appropriate to the requirements of specific applications in accordance with embodiments of the invention.
Playback of encoded video with temporal scalability can allow the encoded video to be played back at different frame rates. A process for playing back an encoded video including temporal layers in accordance with an embodiment of the invention is illustrated in
Metadata is obtained (810) from the header, which describes the various tracks within the encoded video. The metadata can be parsed (815) to retrieve information regarding the particular codec (i.e., compression/decompression standard) that was used to encode the video. In embodiments where the encoded video data is contained within a Matroska container file, the metadata is contained within a Codec Private element contained within a Tracks element. In many embodiments, the codec may be a codec provided by DivX, LLC of San Diego, Calif.
The metadata within the header of the container file may contain metadata that describes the temporal layers of the encoded video. If the process does not detect (820) metadata that describes temporal layers of the encoded video, the process plays back (835) the encoded video using a standard normal playback process. This would occur for a video that has been encoded without temporal scalability (i.e., there is only a single base layer of video frames). In many embodiments, the standard playback process decodes the video frames within a single track of video data contained in the container file.
If the process detects (820) metadata that describes the temporal layers of the encoded video, the metadata can be parsed (825) in order to obtain information that can be used to facilitate the playback of the encoded video at an enhanced frame rate. The obtained information can indicate whether or not the video is encoded with temporal scalability (i.e., there are multiple layers of video data). In particular, the metadata can describe the layers that are available in the encoded video and the particular frame rate of each layer. In a streaming environment, the metadata may also describe other temporal scalability streams contained within different container files. In embodiments where the encoded video data is contained within a Matroska container file, the metadata that describes the temporal layers of the encoded video can be contained within a Profile Message element within a Codec Private element. In other embodiments, metadata describing the temporal layers of the encoded video can be inserted in any of a variety of locations and/or data formats within a container file and/or other file type including (but not limited to) top level index files and/or metadata files as appropriate to the requirements of specific applications.
When the process (830) does not detect temporal scalability (i.e., the process does not detect the existence of multiple layers in the encoded video), the process plays (835) the encoded video using standard playback. When the process detects (830) temporal scalability (i.e., multiple available temporal layers), the process can play back (840) the encoded video with temporal scalability. In particular, the process plays back the encoded video either the full frame rate (e.g., 60 fps) or only at the base frame rate (e.g., 30 fps). Furthermore, for a file-based playback, the device on which the process will play back the encoded video can quickly determine which frames can be decoded by the device based on the temporal I.D. of each frame. Likewise, as described in detail below, during a streaming playback session involving separate streams for different temporal layers, the process can merge the separate streams corresponding to the different temporal layers into a single stream of encoded video prior to providing the stream to a decoding process. Various mechanisms for separating and merging streams of video data to achieve temporal scalability in accordance with embodiments of the invention are described in detail further below.
Playback of Encoded Video with Separate Streams
As described above, in many embodiments the video is encoded with one or more temporal layers, with each layer stored in a separate stream. In a distribution channel that streams the encoded video to playback devices, the separate streams allow different playback devices the ability to request only those streams that the particular playback device is capable of decoding and playing back. An example of a process for streaming encoded video utilizing separate streams in accordance with an embodiment of the invention is illustrated in
The process 900 initially detects (905) the presence of metadata within a header of the container file containing information about the temporal scalability of the encoded video. In embodiments that utilize a Matroska container file, the metadata can take the form of a Profile Message element similar to the various Profile Messages described above with respect to
Based on the playback capabilities of the device (i.e., the device's video profile), the process requests (915) streams for one or more of the temporal layers from a distribution server. In some embodiments, when the process requests only the base layer of the encoded video for playback at the base frame rate, the distribution server streams only the base layer. When the process requests the base layer and or more enhancement layers, the distribution server also streams each different temporal layer of the encoded video.
Based on whether the process has requested (i) only the base layer or (ii) the base layer and one or more enhancement layers, the process may need to merge 920 (optional) the streams of temporal layers into a single stream of frames in decode order (as opposed to playback order). In several embodiments, at least one of the layers includes metadata indicating the decode order of the frames in the base layer and the one or more enhancement layers. In embodiments in which the video is encoded in accordance with the HEVC standard, the metadata indicating decode order is a sequence of AUDs that indicate the temporal layer from which to retrieve encoded video data. The separate streams can then be merged 720 based on the AUD order contained within the one (or more) layers described above. In certain embodiments, the sequence of AUDs is contained in at least one of the enhancement layers. In other embodiments, decode order can be indicated in any of a variety of ways appropriate to the requirements of specific applications including (but not limited) by specifying the decode order of access units within metadata accompanying the access units in the container file and/or inserting null or empty access units in the container file of one of the layers.
When the process only requests a single temporal layer, the process can skip the optional merge (920) and playback (925) the encoded video. Furthermore, in many embodiments, the distribution server can merge the separate streams into a single stream prior to distributing the encoded video to a playback device. In this situation, the process may also playback (925) the encoded video without executing the optional merge (920) in the process. After playback, the process is complete. The process of merging the separate streams containing the different temporal layers may be performed by either (i) the playback device after it receives the separate streams from the distribution server or (ii) the distribution server prior to sending a single stream containing the multiple temporal layers to the playback device. Although specific processes for playback of an encoded video containing separate streams are described above, any of a variety of processes may be utilized for playback of an encoded video containing separate streams as appropriate to the requirements of specific application in accordance with embodiments of the invention. An example of a process of many embodiments for merging separate streams is described below.
As described above, in a streaming context, each temporal layer of the encoded video may be stored as a separate stream and different streams may be provided to different playback devices to reduce wasteful network consumption. An example of a process for merging separate streams of an encoded video in accordance with an embodiment of the invention is illustrated in
The process 1000 requests (1005) streaming of a particular set of temporal layers from a distribution server. In some embodiments, the process requests the set of streams based on the playback capabilities of the playback device. In particular, when a playback device does not have the playback capability to handle the enhancement layer(s), the process requests (1005) only the encoded video within the base layer, receives (1015) a stream containing video data from only the base layer of the encoded video, and plays back (1035) the encoded video.
When (1010) the playback device has the ability to decode and playback one or more of the enhancement layers, the process requests both the base layer and enhancement layer(s). The process then receives (1020) separate streams containing the base layer and the one or more enhancement layers. The process then may need to combine the separate streams into a single stream prior to providing the stream to the decoder on the playback device. In order to combine the streams, the process identifies (1025) an AUD order for the video frames (i.e., Access Units), and determines the temporal layer associated with each frame of video. In many embodiments, the AUD order may be obtained from at least one of the layers. The AUD order identifies the order of video frames and the particular temporal layer that contains the video frame. In particular, each frame (e.g., Matroska Block described above) can be embedded with an AUD containing a Temporal I.D. that identifies a particular layer for the frame. The order that these frames are separated into separate streams may be retained within one of the temporal layers. For example, an AUD order may simply be a series of 1's and 0's, such as “001101 . . . ”, which would indicate that the order of frames (prior to being separated into separate streams) is: “base layer, base layer, enhancement layer, enhancement layer, base layer, enhancement layer, . . . ” etc.
Thus each separate layer can be recombined by selecting frames from the different temporal layers based on the AUD. In particular, an AUD with Temporal I.D. of 0 means that the process needs to merge the next frame of the base layer stream and an AUD with Temporal ID of 1 means that the process needs to merge the next frame of the particular enhancement layer stream with Temporal ID of 1. By retaining the original Temporal ID order of the video frames, the process is able to easily re-combine (1030) the base layer video data with the enhancement layer video data into a single stream of encoded video.
Having combined the separate streams, the process plays back (1035) the encoded video. After playback, the process is complete. Although specific processes for merging separate streams of an encoded video are described above, any of a variety of processes may be utilized for merging separate streams of an encoded video as appropriate to the requirements of specific application in accordance with embodiments of the invention. Several additional examples are provided below that illustrate the merging of separate streams of an encoded video.
As described above, in order for a decoder to decode a given video frame, in some embodiments, the decoder of a playback device needs to have fully decoded all frames on which the given frame depends prior to decoding the given frame.
As illustrated, the arrows between the various frames 1110 indicate the other frames on which the particular frame is dependent. As illustrated, POC 0 does not have any outward arrows, since this is an I-frame and thus is not dependent on any other frames for its decoding. The next POC 1 is dependent on frames POC 0 and POC 2. Thus, in order for a decoder of a playback device of some embodiments to be able to decode POC 1 video frame, the decoder should have already decoded POC 0 and POC 2. Likewise, POC 2 is dependent on POC 0 and POC 4; POC 3 is dependent on POC 2 and POC 0; POC 4 is dependent on POC0 and POC 8; and these dependencies continue for each B or P frame in the particular portion of encoded video. Thus in order to decode these video frames within the particular portion of the encoded video, the frames are provided to the decoder in an order that guarantees that for a given frame, the decoder has already decoded all frames on which the given frame depends prior to decoding the given frame. Thus the decode order for these frames is not the same as the POC order (i.e., 0, 1, 2, 3, etc.) of the frames.
Furthermore, the Temporal ID associated with each frame of an encoded video can be used to quickly separate the temporal layers into different streams. An example of separating an encoded video into separate streams in accordance with an embodiment of the invention is illustrated in
An example of merging of different temporal streams in accordance with an embodiment of the invention is illustrated in
In particular, the AUD Temporal ID order in this example is: 0, 0, 0, 0, 1, 1, 0, 1, 1. As such, this AUD Temporal ID order indicates that the first AUD has a Temporal ID of 0, and thus the combined video stream needs to retrieve and merge the video data of the 1st frame (i.e., POC 0) from the base layer stream 1305. The next AUD Temporal ID is again 0, and thus again, the combined stream is able to retrieve and merge the video data of the next frame from the base layer (i.e., POC 8). This continues through the entire AUD Temporal ID series, and thus the stream is combined as a combined stream using the following order of POCs: 0, 8, 4, 2, 6, 1, 3, 6, 5 and 7. Note that the POC order is now back to the same order that it was prior to the separation of the layers into the separate streams illustrated in
The combined stream can now be provided to a decoder of the playback device for decoding of the video frames. Although the example in
Furthermore, providing separate streams for the different temporal layers allows the system to stream the individual layers that are needed for a particular device. As described above, the different streams may be requested by a playback device using HTTP, which is a stateless protocol that enables a playback device to request a byte range within a file, or RTSP which is a network control protocol used to control streaming media servers whereby playback devices issue control commands, such as “play” and “pause”, to the server streaming the media to control the playback of media files. When RTSP is utilized, the media server records the state of each client device and determines the media to stream based upon the instructions received from the client devices and the client's state. Examples of such streaming media servers are described below.
Playback devices may request different temporal layers of an encoded video with temporal scalability based on the particular playback capacities of the device. A process for streaming different temporal layers of an encoded video for playback on a playback device in accordance with an embodiment of the invention is illustrated in
The process 1400 receives a request (1405) for streaming of an encoded video. In some embodiments, the request may be received from a playback device and include a particular video profile of the device. For example, the video profile may provide the frame rate at which the device is able to playback an encoded video.
The process determines (1410) whether to stream the video at a base frame rate. For example, if the playback device is only capable of decoding the base layer of the encoded video, the process streams only the base layer. In an adaptive bitrate context, the process may decide to stream at the base rate based on the given streaming conditions of the network such as the bandwidth available or the CPU capacity of the device for processing the video frames.
When the process determines (1410) to stream the encoded video at the base frame rate, the process streams (1420) only the stream containing the base layer of video frames. In some embodiments, the process maintains the state of the streaming being provided to the playback device. For example, the process may use RTSP to establish and control the video streams to the playback device. Likewise, the playback device can issue commands, such as play, pause, and stop, to enable the real-time control of playback of the streaming video. In other embodiments, the process is a stateless process such as HTTP.
When the process determines (1410) not to stream the video at the base frame rate, the process determines (1415) whether to stream the video at a higher enhanced frame rate. For example, if the profile of the playback device indicates that the device is able to playback video at the enhanced frame rate, the process streams (1425) both the stream for the base layer and the one or more streams for the enhancement layer. As described above, in several embodiments, the process may merge the separate streams and stream a single stream to the playback device while in other embodiments, the process may stream the streams as separate streams. In some embodiments, the playback device can merge the separate streams into the proper decode order for decoding by a decoder implemented on the playback device. After merging, the process is complete. If the process determines (1415) not to stream the video at the enhanced frame rate, the process is complete.
A specific process for streaming different temporal layers of an encoded video for playback on a playback device is described above, however, any variety of processes may be utilized for streaming different temporal layers of an encoded video for playback on a playback device in accordance with embodiments of the invention.
Although the present invention has been described in certain specific aspects, many additional modifications and variations would be apparent to those skilled in the art. It is therefore to be understood that the present invention may be practiced otherwise than specifically described. Thus, embodiments of the present invention should be considered in all respects as illustrative and not restrictive. Accordingly, the scope of the invention should be determined not by the embodiments illustrated, but by the appended claims and their equivalents.
This application is a continuation of U.S. application Ser. No. 15/863,456 entitled “Systems and Methods for Encoding and Playing Back Video at Different Frame Rates Using Enhancement Layers” to van der Schaar et al., filed Jan. 5, 2018, which is a continuation of U.S. application Ser. No. 14/679,469 entitled “Systems and Methods for Encoding and Playing Back Video at Different Frame Rates Using Enhancement Layers” to van der Schaar et al., filed Apr. 6, 2015, which claims priority to U.S. patent application Ser. No. 61/975,789 entitled “Systems and Methods for Encoding and Playing Back Video at Different Frame Rates Using Enhancement Layers” to van der Schaar et al., filed Apr. 5, 2014, the disclosures of which are incorporated herein by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
61975789 | Apr 2014 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 15863456 | Jan 2018 | US |
Child | 16436429 | US | |
Parent | 14679469 | Apr 2015 | US |
Child | 15863456 | US |