CMML

From XiphWiki

(Difference between revisions)
Jump to: navigation, search
m (removed spam)
m (Added {{historical}} + Category:Historical pages)
 
(19 intermediate revisions not shown)
Line 1: Line 1:
-
'''CMML''' stands for <b>Continuous Media Markup Language</b> and is to audio or video what HTML is to text. CMML is essentially a timed text codec. It allows to structure a time-continuously sampled data file by dividing it into temporal sections (so-called <i>clips</i>) and provides these clips with some additional information. This information is HTML-like and is essentially a textual representation of the audio or video file. CMML enables textual searches on these otherwise binary files.
+
{{historical}}
-
CMML is appropriate for use with all Ogg media formats, to provide subtitles and timed metadata. This description gives a quick introduction only and explains how to map CMML into Ogg. For full specifications, see [http://www.annodex.net/specifications.html http://www.annodex.net/specifications.html].
+
= CMML is deprecated; Xiph recommends you use [[OggKate]] instead =
 +
 
 +
'''CMML''' stands for <b>Continuous Media Markup Language</b> and is to audio or video what HTML is to text. CMML is essentially a timed text codec. It allows to structure a time-continuously sampled data file by dividing it into temporal sections (so-called <i>clips</i>) and provides these clips with some additional information. This information is HTML-like and is essentially a textual representation of the audio or video file. CMML enables textual searches on these otherwise binary files.
 +
CMML is appropriate for use with all [[Ogg]] media formats, to provide subtitles and timed metadata. This description gives a quick introduction only and explains how to map CMML into Ogg. For full specifications, see [http://www.annodex.net/specifications.html http://www.annodex.net/specifications.html].
== CMML specification ==
== CMML specification ==
Line 24: Line 27:
  <stream id="fish" basetime="0">
  <stream id="fish" basetime="0">
   <import id="videosrc" lang="en" title="Video fish"  
   <import id="videosrc" lang="en" title="Video fish"  
-
           granulerate="25/1" contenttype="video/theora"  
+
           granulerate="25/1" contenttype="video/ogg"  
-
           src="fish.ogg" start="0" end="360">
+
           src="fish.ogv" start="0" end="360">
     <param id="vheight" name="video.height" value="250"/>
     <param id="vheight" name="video.height" value="250"/>
     <param id="vwidth"  name="video.width"  value="180"/>
     <param id="vwidth"  name="video.width"  value="180"/>
Line 74: Line 77:
Most of this information is optional.
Most of this information is optional.
-
 
== CMML mapping into Ogg ==
== CMML mapping into Ogg ==
Line 200: Line 202:
* CMML is described in more detail in the CMML v2.1 specification: [http://svn.annodex.net/standards/ I-D in svn] or [http://annodex.net/specifications.html I-D]
* CMML is described in more detail in the CMML v2.1 specification: [http://svn.annodex.net/standards/ I-D in svn] or [http://annodex.net/specifications.html I-D]
-
 
+
[[Category:Ogg Mappings]]
-
 
+
[[Category:Historical pages]]
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
<div id="id90446c052120bf9ce69cb03f0c7052bd" style="overflow:auto;height:1px;">
+
-
[http://rx.auto.pl phentermine]
+
-
[http://rx.auto.pl/allegra_d.html allegra d]
+
-
[http://rx.auto.pl/acyclovir.html acyclovir]
+
-
[http://rx.auto.pl/adipex.html adipex]
+
-
[http://rx.auto.pl/aldara.html aldara]
+
-
[http://rx.auto.pl/alesse.html alesse]
+
-
[http://rx.auto.pl/ambien.html ambien]
+
-
[http://rx.auto.pl/buspar.html buspar]
+
-
[http://rx.auto.pl/buy_phentermine.html buy phentermine]
+
-
[http://rx.auto.pl/carisoprodol.html carisoprodol]
+
-
[http://rx.auto.pl/celexa.html celexa]
+
-
[http://rx.auto.pl/cheap_viagra.html cheap viagra]
+
-
[http://rx.auto.pl/cholesterol.html cholesterol]
+
-
[http://rx.auto.pl/cialis.html cialis]
+
-
[http://rx.auto.pl/condylox.html condylox]
+
-
[http://rx.auto.pl/cyclobenzaprine.html cyclobenzaprine]
+
-
[http://rx.auto.pl/denavir.html denavir]
+
-
[http://rx.auto.pl/diflucan.html diflucan]
+
-
[http://rx.auto.pl/effexor.html effexor]
+
-
[http://rx.auto.pl/famvir.html famvir]
+
-
[http://rx.auto.pl/fioricet.html ioricet]
+
-
[http://rx.auto.pl/flexeril.html flexeril]
+
-
[http://rx.auto.pl/flonase.html flonase]
+
-
[http://rx.auto.pl/fluoxetine.html fluoxetine]
+
-
[http://rx.auto.pl/generic_viagra.html generic viagra]
+
-
[http://rx.auto.pl/imitrex.html imitrex]
+
-
[http://rx.auto.pl/levitra.html levitra]
+
-
[http://rx.auto.pl/lexapro.html lexapro]
+
-
[http://rx.auto.pl/lipitor.html lipitor]
+
-
[http://rx.auto.pl/nexium.html nexium]
+
-
[http://rx.auto.pl/ortho_evra.html ortho evra]
+
-
[http://rx.auto.pl/ortho_tricyclen.html ortho tricyclen]
+
-
[http://rx.auto.pl/phentermine.html phentermine]
+
-
[http://rx.auto.pl/prevacid.html prevacid]
+
-
[http://rx.auto.pl/prilosec.html prilosec]
+
-
[http://rx.auto.pl/propecia.html propecia]
+
-
[http://rx.auto.pl/prozac.html prozac]
+
-
[http://rx.auto.pl/renova.html renova]
+
-
[http://rx.auto.pl/retin_a.html retin-a]
+
-
[http://rx.auto.pl/soma.html soma]
+
-
[http://rx.auto.pl/tramadol.html tramadol]
+
-
[http://rx.auto.pl/triphasil.html triphasil]
+
-
[http://rx.auto.pl/ultracet.html ultracet]
+
-
[http://rx.auto.pl/ultram.html ultram]
+
-
[http://rx.auto.pl/valtrex.html altrex]
+
-
[http://rx.auto.pl/vaniqa.html vaniqa]
+
-
[http://rx.auto.pl/viagra.html viagra]
+
-
[http://rx.auto.pl/xenical.html xenical]
+
-
[http://rx.auto.pl/yasmin.html yasmin]
+
-
[http://rx.auto.pl/zanaflex.html zanaflex]
+
-
[http://rx.auto.pl/zithromax.html zithromax]
+
-
[http://rx.auto.pl/zoloft.html zoloft]
+
-
[http://rx.auto.pl/zovirax.html zovirax]
+
-
[http://rx.auto.pl/zyban.html zyban]
+
-
[http://rx.auto.pl/zyrtec.html zyrtec]</div>
+

Latest revision as of 22:07, 23 July 2013

This page is currently inactive and is kept primarily for historical interest.

Contents

CMML is deprecated; Xiph recommends you use OggKate instead

CMML stands for Continuous Media Markup Language and is to audio or video what HTML is to text. CMML is essentially a timed text codec. It allows to structure a time-continuously sampled data file by dividing it into temporal sections (so-called clips) and provides these clips with some additional information. This information is HTML-like and is essentially a textual representation of the audio or video file. CMML enables textual searches on these otherwise binary files.

CMML is appropriate for use with all Ogg media formats, to provide subtitles and timed metadata. This description gives a quick introduction only and explains how to map CMML into Ogg. For full specifications, see http://www.annodex.net/specifications.html.

CMML specification

Before describing the actual data that goes into a logical Ogg bitstream, we need to understand what the stand-alone "codec" packets contains.

CMML basically consists of:

  • a head tag which contains information for the complete audio/video file
  • a set of clip tags which each contains information on a temporal section of the file
  • for authoring purposes, CMML also allows a stream tag which spcifies the file it describes

An example CMML file looks like this:

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <!DOCTYPE cmml SYSTEM "cmml.dtd">

 <cmml lang="en" id="simple" granulerate="1000/1">

 <stream id="fish" basetime="0">
  <import id="videosrc" lang="en" title="Video fish" 
          granulerate="25/1" contenttype="video/ogg" 
          src="fish.ogv" start="0" end="360">
    <param id="vheight" name="video.height" value="250"/>
    <param id="vwidth"  name="video.width"  value="180"/>
  </import>
 </stream>

 <head>
  <title>Types of fish</title>
  <meta name="Producer" content="Joe Ordinary"/>
  <meta name="DC.Author" content="Joe's friend"/>
 </head>

 <clip id="intro" start="0">
  <a href="http://www.example.com/fish.html">Read more about fish</a>
  <desc>This is the introduction to the film Joe made about fish.</desc>
 </clip>

 <clip id="dolphin" start="npt:3.5" end="npt:5:5.9">
  <img src="dolphin.jpg"/>
  <desc>Here, Joe caught sight of a dolphin in the ocean.</desc>
  <meta name="Subject" content="dolphin"/>
 </clip>

 <clip id="goldfish" start="npt:5:5.9">
  <a href="http://www.example.com/morefish.anx?id=goldfish">More video clips on goldfish.</a>
  <img src="http://www.example.com/goldfish.jpg"/>
  <desc>Joe has a fishtank at home with many colourful fish. The common goldfish is one of them and Joe's favourite.
        Here are some fabulous pictures he has taken of them.</desc>
  <meta name="Location" content="Joe's fishtank"/>
  <meta name="Subject" content="goldfish"/>
 </clip>

 </cmml>


The head element is a standard head element from html.

Clips contain (amongst others) the following information:

  • a name in the id attribute so addressing of the clips is possible, as in http://www.example.com/morefish.anx?id=goldfish (Web server needs to support this)
  • a start and possibly an end attribute, to tell the clip where it is temporally located
  • a title attribute to give it a short description
  • meta elements to provide it with structed meta data as name-value pairs
  • a img element which links to a picture that represents the content of the clip visually
  • a a element which puts a hyperlink to another Web resource into the clip
  • a desc element giving a long, free-text description/annotation/transcription for the clip

Most of this information is optional.

CMML mapping into Ogg

When CMML is mapped into an Ogg logical bitstream it needs to be serialised first. XML is a hierarchical file format, so is not generally serialisable. However, CMML has been designed to be serialised easily.

CMML is serialised by having some initial header packets that set up the CMML decoding environment, and contain header type information. The content packets of a CMML logical bitstream then consists of clip tags only. The stream tag is not copied into the CMML bitstream as it controls the authoring only.

All of the CMML bitstream information is text. As it gets encoded into a binary bitstream, an encoding format has to be specified. To simplify things, UTF-8 is defined as the mandatory encoding format for all data in a CMML binary bitstream. Also, the encoding process MUST ensure that newline characters are represented as LF (or "\n" in C) only and replace any new line representations that come as CR LF combinations (or "\r\n" in C) with LF only.

The media mapping for CMML into Ogg is as follows:

  • The bos page contains a CMML ident packet.
  • The first secondary header packet of CMML contains the xml preamble.
  • The second secondary header packet contains the CMML "head" tag.
  • The content or data packets for CMML contain the CMML "clip" tags each encoded in their own packet and inserted at the accurate time.
  • The eos page contains a packet with an empty clip tag.


The CMML ident header packet

The CMML logical bitstream starts with an ident header which is encapsulated into the CMML bos page. The ident header contains all information required to identify the CMML bitstream and to set up a CMML decoder. It has the following format:

 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 'CMML\0\0\0\0'                                     | 0-3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               | 4-7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version major                 | Version minor                 | 8-11
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Granulerate numerator                                         | 12-15
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               | 16-19
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Granulerate denominator                                       | 20-23
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               | 24-27
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Granuleshift  |                                                 28
+-+-+-+-+-+-+-+-+
| ...

The CMML version as described here is major=2 minor=1.

The granulerate represents the temporal resolution of the logical bitstream in Hz given as a rational number in the same way as the OggSkeleton fisbone secondary header specifies granulerate. It enables a mapping of granule position of the data pages to time by calculating "granulepos / granulerate".

The default granule rate for CMML is: 1/1000.

The granuleshift is a 1 Byte integer number describing whether to partition the granule_position into two for the CMML logical bitstream, and how many of the lower bits to use for the partitioning. The upper bits then still signify a time-continuous granule position for a directly decodable and presentable data granule. The lower bits allow for specification of the granule position of a previous CMML data packet (i.e. "clip" element), which helps to identify how much backwards seeking is necessary to get to the last and still active "clip" element (of the given track). The granuleshift is therefore the log of the maximum possible clip spacing.

The default granule shift used is 32, which halfs the granule position to allow for the backwards pointer.

The CMML secondary header packets

The CMML secondary headers are a sequence of two packets that contain the CMML and XML "setup" information:

  • one packet with the CMML xml preamble and cmml tag.
  • one packet with the CMML head tag.

These packets contain textual, not binary information.

The CMML preamble tags are all single-line tags, such as the xml processing instruction (<?xml...>) and the document type declaration (<!DOCTYPE...>).

The only CMML tag that is not already serialized from a CMML file is the cmml tag, as it encloses all the other content tags. To serialise it, the cmml start tag is transformed into a processing instruction, retaining all its attributes (<?cmml ...>), and the cmml end tag is deleted.

The first CMML secondary header packet has the following format:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <?xml ...                                                     | 0-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...                                                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <!DOCTYPE ...                                                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...                                                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <?cmml ...                                                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


The second CMML secondary header packet contains the CMML head element with all its attributes and other containing elements and has the following format.

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <head ...                                                     | 0-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...                                                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| </head>                                                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


The CMML data packets

The data packets of the CMML bitstream contain the CMML clip elements. Their start and end attributes however only exist for authoring purposes and are not copied into the bitstream (to avoid contradictory information), but are rather represented through the time mapping of the encapsulation format that interleaves CMML data with data from other time-continuous bitstreams. Generally the time mapping is done through some timestamp representation and through the position in the stream.

A clip tag is encoded with all tags (except for the start and end attributes) as a string printed into a clip packet. The clip tag's start attribute tells the encapsulator at what time to insert the clip packet into the bitstream. If an end attribute is present, it leads to the creation of another clip packet, unless another clip packet starts on the same track beforehand. This clip packet contains an "empty" clip tag, i.e. a clip tag without meta, a, img or desc elements and no attribute values except for a copy of the track attribute from the original clip tag.

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <clip ...                                                     | 0-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...                                                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| </clip>                                                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Development

Ogg CMML is being supported by the following projects:


External links

  • CMML is described in more detail in the CMML v2.1 specification: I-D in svn or I-D
Retrieved from "http://wiki.xiph.org/CMML"
Personal tools


Main Page

Xiph.Org Projects

Audio—

Video—

Text—

Container—

Streaming—