The Ogg Skeleton Metadata Bitstream原文html
Ogg Skeleton provides structuring information for multitrack Ogg files. It is compatible with Ogg Theora and provides extra clues for synchronization and content negotiation such as language selection. Ogg Skeleton提供多軌Ogg文件的結構信息。它與Ogg Theora兼容,併爲同步和內容協商(例如語言選擇)提供了額外的線索。 Ogg is a generic container format for time-continuous data streams, enabling interleaving of several tracks of frame-wise encoded content in a time-multiplexed manner. As an example, an Ogg physical bitstream could encapsulate several tracks of video encoded in Theora and multiple tracks of audio encoded in Speex or Vorbis or FLAC at the same time. A player that decodes such a bitstream could then, for example, play one video channel as the main video playback, alpha-blend another one on top of it (e.g. a caption track), play a main Vorbis audio together with several FLAC audio tracks simultaneously (e.g. as sound effects), and provide a choice of Speex channels (e.g. providing commentary in different languages). Such a file is generally possible to create with Ogg, it is however not possible to generically parse such a file, seek on it, understand what codecs are contained in such a file, and dynamically handle and play back such content. Ogg是用於時間連續數據流的通用容器格式,可以以時分多路複用方式對逐幀編碼內容的多個磁道進行交織。做爲示例,Ogg物理比特流能夠同時封裝以Theora編碼的多個視頻軌道和同時以Speex或Vorbis或FLAC編碼的多個音頻軌道。解碼此類比特流的播放器隨後能夠例如播放一個視頻頻道做爲主要視頻播放,將其上的另外一個Alpha混合(例如字幕軌道),將主要Vorbis音頻與幾個FLAC音頻軌道一塊兒播放同時(例如,做爲聲音效果),並提供Speex頻道的選擇(例如,提供不一樣語言的評論)。一般可使用Ogg建立這樣的文件,可是不可能通常性地解析,搜索,瞭解該文件中包含哪些編解碼器以及動態地處理和播放此類內容。 Ogg does not know anything about the content it carries and leaves it to the media mapping of each codec to declare and describe itself. There is no meta information available at the Ogg level about the content tracks encapsulated within an Ogg physical bitstream. This is particularly a problem if you don't have all the decoder libraries available and just want to parse an Ogg file to find out what type of data it encapsulates (such as the "file" command under nix to determine what file it is through magic numbers), or want to seek to a temporal offset without having to decode the data (such as on a Web server that just serves out Ogg files and parts thereof). Ogg對它所攜帶的內容一無所知,而是將其留給每一個編解碼器的媒體映射來聲明和描述本身。在Ogg級別上沒有關於封裝在Ogg物理比特流中的內容軌道的元信息。若是您沒有全部可用的解碼器庫,而只是想解析一個Ogg文件以找出封裝的數據類型(例如 nix下的「 file」命令來肯定它是什麼文件),則這尤爲成問題。 (例如,經過魔術數字),或者想要尋求時間偏移而沒必要解碼數據(例如在僅提供Ogg文件及其部份內容的Web服務器上)。node
Ogg Skeleton is being designed to overcome these problems. Ogg Skeleton is a logical bitstream within an Ogg stream that contains information about the other encapsulated logical bitstreams. For each logical bitstream it provides information such as its media type, and explains the way the granulepos field in Ogg pages is mapped to time. Ogg Skeleton旨在克服這些問題。 Ogg Skeleton是Ogg流中的邏輯位流,其中包含有關其餘封裝的邏輯位流的信息。對於每一個邏輯位流,它提供諸如其媒體類型之類的信息,並說明Ogg頁面中的granulepos字段映射到時間的方式。 Ogg Skeleton is also designed to allow the creation of substreams from Ogg physical bitstreams that retain the original timing information. For example, when cutting out the segment between the 7th and the 59th second of an Ogg file, it would be nice to continue to start this cut out file with a playback time of 7 seconds and not of 0. This is of particular interest if you're streaming this file from a Web server after a query for a temporal subpart such as in example.com/video.ogv?t… Ogg Skeleton還設計爲容許從Ogg物理位流建立保留原始時序信息的子流。例如,當切出Ogg文件的第7秒到第59秒之間的片斷時,最好以7秒而不是0的播放時間繼續啓動此切出的文件。您查詢了時間子部分(例如http://example.com/video.ogv?t=7-59)以後,正在從Web服務器流式傳輸此文件git
The following information about a logical bitstream is of interest to contain as meta information in the Skeleton: 如下是有關邏輯位流的信息,但願將其包含在骨架中做爲元信息:服務器
When cutting out a subpart of an Ogg physical bitstream, the aim is to keep all the content pages intact (including the framing and granule positions) and just change some information in the Skeleton that allows reconstruction of the accurate time mapping. When remultiplexing such a bitstream, it is necessary to take into account all the different contained logical bitstreams. A given cut-in time maps to several different byte positions in the Ogg physical bitstream because each logical bitstream has its relevant information for that time at a different location. In addition, the resolution of each logical bitstream may not be high enough to accommodate for the given cut-in time and thus there may be some surplus information necessary to be remuxed into the new bitstream. 切出Ogg物理位流的子部分時,其目的是保持全部內容頁(包括成幀和顆粒位置)完好無損,而且只需更改「骨架」中的某些信息便可重建準確的時間映射。當從新複用這樣的比特流時,必須考慮全部不一樣的包含的邏輯比特流。給定的插入時間映射到Ogg物理比特流中的幾個不一樣字節位置,由於每一個邏輯比特流在不一樣的位置具備該時間的相關信息。另外,每一個邏輯比特流的分辨率可能不夠高以適應給定的切入時間,所以可能有一些多餘的信息須要從新混合到新的比特流中。 The following information is necessary to be added to the Skeleton to allow a correct presentation of a subpart of an Ogg bitstream: 必須將如下信息添加到骨骼中,以正確呈現Ogg比特流的子部分: the presentation time: this is the actual cut-in time and all logical bitstreams are meant to start presenting from this time onwards, not from the time their data starts, which may be some time before that (because this time may have mapped right into the middle of a packet, or because the logical bitstream has a preroll or a keyframe shift) 表示時間:這是實際的插入時間,全部邏輯比特流均應今後時間開始顯示,而不是從其數據開始的時間開始,這多是在此以前的某個時間(由於此時間可能已經映射到數據包的中間,或者由於邏輯位流具備預滾動或關鍵幀移位) the basegranule: this represents the granule number with which this logical bitstream starts in the remuxed stream and provides for each logical bitstream the accurate start time of its data stream; this information is necessary to allow correct decoding and timing of the first data packets contained in a logcial bitstream of a remuxed Ogg stream 基本粒度:表明該邏輯比特流在重混合流中以此開始的粒度,併爲每一個邏輯比特流提供其數據流的準確開始時間;此信息對於容許正確解碼和定時從新混合的Ogg流的邏輯比特流中包含的第一個數據包是必需的markdown
Adding the above information into an Ogg bitstream without breaking existing Ogg functionality and code requires the use of a logical bitstream for Ogg Skeleton. This logical bitstream may be ignored on decoding such that existing players can still continue to play back Ogg files that have a Skeleton bitstream. Skeleton enriches the Ogg bitstream to provide meta information about structure and content of the Ogg bitstream. 在不破壞現有Ogg功能和代碼的狀況下將上述信息添加到Ogg比特流中,須要爲Ogg Skeleton使用邏輯比特流。解碼時能夠忽略此邏輯比特流,以便現有播放器仍能夠繼續播放具備骨架比特流的Ogg文件。骨架豐富了Ogg比特流,以提供有關Ogg比特流的結構和內容的元信息。 The Skeleton logical bitstream starts with an ident header that contains information about all of the logical bitstreams and is mapped into the Skeleton bos page. The first 8 bytes provide the magic identifier "fishead\0". After the fishead follows a set of secondary header packets, each of which contains information about one logical bitstream. These secondary header packets are identified by an 8 byte code of "fisbone\0". The Skeleton logical bitstream has no actual content packets. Its eos page is included into the stream before any data pages of the other logical bitstreams appear and contains a packet of length 0. 骨架邏輯比特流以ident頭開頭,該頭包含有關全部邏輯比特流的信息,並映射到Skeleton Bos頁面。前8個字節提供魔術標識符「 fishead \ 0」。在fishead以後,出現一組輔助標頭數據包,每一個輔助標頭數據包都包含有關一個邏輯比特流的信息。這些輔助報頭數據包由8字節代碼「 fisbone \ 0」標識。骨架邏輯比特流沒有實際的內容包。在其餘邏輯比特流的任何數據頁出現以前,其eos頁已包含在流中,而且包含長度爲0的數據包。 The fishead ident header looks as follows:app
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identifier 'fishead\0' | 0-3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 4-7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version major | Version minor | 8-11 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Presentationtime numerator | 12-15 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 16-19 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Presentationtime denominator | 20-23 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 24-27 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Basetime numerator | 28-31 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 32-35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Basetime denominator | 36-39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 40-43 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | UTC | 44-47 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 48-51 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 52-55 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 56-59 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 60-63 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ide
The version fields provide version information for the Skeleton track, currently being 3.0 (the number having evolved within the Annodex project). 版本字段提供了有關Skeleton軌跡的版本信息,當前爲3.0(在Annodex項目中不斷髮展的數量)。 Presentation time and basetime are specified as a rational number, the denominator providing the temporal resolution at which the time is given (e.g. to specify time in milliseconds, provide a denominator of 1000). 表示時間和基準時間被指定爲有理數,分母提供給出時間的時間分辨率(例如,以毫秒爲單位指定時間,分母爲1000)。 The fisbone secondary header packet looks as follows: fisbone輔助標頭數據包以下所示:oop
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identifier 'fisbone\0' | 0-3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 4-7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Offset to message header fields | 8-11 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Serial number | 12-15 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of header packets | 16-19 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Granulerate numerator | 20-23 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 24-27 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Granulerate denominator | 28-31 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 32-35 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Basegranule | 36-39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 40-43 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Preroll | 44-47 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Granuleshift | Padding/future use | 48-51 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Message header fields ... | 52- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ui
The mime type is provided as a message header field specified in the same way that HTTP header fields are given (e.g. "Content-Type: audio/vorbis"). Further meta information (such as language and screen size) are also included as message header fields. The offset to the message header fields at the beginning of a fisbone packet is included for forward compatibility - to allow further fields to be included into the packet without disrupting the message header field parsing. MIME類型是做爲消息頭字段提供的,該消息頭字段的指定方式與HTTP頭字段的指定方式相同(例如,「 Content-Type:audio / vorbis」)。其餘元信息(例如語言和屏幕大小)也做爲消息頭字段包含在內。包含在fisbone數據包開頭的消息頭字段的偏移量是爲了向前兼容-容許在不破壞消息頭字段解析的狀況下將其餘字段包含在數據包中。 The granule rate is again given as a rational number in the same way that presentation time and basetime were provided above. 顆粒率再次以與上面提供展現時間和基準時間相同的方式做爲有理數給出。 A further restriction on how to encapsulate Skeleton into Ogg is proposed to allow for easier parsing: 建議進一步限制如何將Skeleton封裝到Ogg中,以簡化解析過程: there can only be one Skeleton logical bitstream in a Ogg bitstream Ogg比特流中只能有一個Skeleton邏輯比特流 the Skeleton bos page is the very first bos page in the Ogg stream such that it can be identified straight away and decoders don't get confused about it being e.g. Ogg Vorbis without this meta information Skeleton bos頁面是Ogg流中的第一個bos頁面,所以能夠當即對其進行識別,而且解碼器不會對此感到困惑,例如沒有此中繼信息的Ogg Vorbis the bos pages of all the other logical bistreams come next (a requirement of Ogg) Skeleton bos頁面是Ogg流中的第一個bos頁面,所以能夠當即對其進行識別,而且解碼器不會對此感到困惑,例如沒有此中繼信息的Ogg Vorbis the secondary header pages of all logical bitstreams come next, including Skeleton's secondary header packets 接下來是全部邏輯位流的輔助標頭頁面,包括骨架的輔助標頭數據包 the Skeleton eos page end the control section of the Ogg stream before any content pages of any of the other logical bitstreams appear 在任何其餘邏輯比特流的任何內容頁面出現以前,Skeleton eos頁面結束Ogg流的控制部分this