<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.43 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-wilaw-moq-cmafpackaging-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.0 -->
  <front>
    <title>CMAF Packaging for moq-transport</title>
    <seriesInfo name="Internet-Draft" value="draft-wilaw-moq-cmafpackaging-00"/>
    <author fullname="Will Law">
      <organization>Akamai</organization>
      <address>
        <email>wilaw@akamai.com</email>
      </address>
    </author>
    <author fullname="Luke Curley">
      <organization/>
      <address>
        <email>kixelated@gmail.com</email>
      </address>
    </author>
    <date year="2023" month="October" day="02"/>
    <area>Applications and Real-Time</area>
    <workgroup>Media Over QUIC</workgroup>
    <keyword>moq</keyword>
    <keyword>cmaf</keyword>
    <abstract>
      <?line 48?>

<t>Packaging CMAF content for use with moq-transport.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://wilaw.github.io/moq-cmaf-packaging/draft-wilaw-moq-cmafpackaging.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-wilaw-moq-cmafpackaging/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Media Over QUIC Working Group mailing list (<eref target="mailto:moq@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/moq/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/moq/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/wilaw/moq-cmaf-packaging"/>.</t>
    </note>
  </front>
  <middle>
    <?line 52?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>This specification defines an interoperable method of transmitting CMAF <xref target="CMAF"/> compliant media content over Media Over QUIC Transport (MOQT) <xref target="MoQTransport"/>. Multiple mappings are supported, including mapping complete Groups of Pictures (GOPS) <xref target="ISOBMFF"/> or individual frames to MoQTransport Objects. This specification is intended to be referenced by MOQT-compliant Streaming Formats.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.</t>
    </section>
    <section anchor="objectpayload">
      <name>Media Object Payload</name>
      <t>This specification defines a direct mapping between CMAF Tracks ( <xref target="CMAF"/> Sect 3.2.1)  and MOQT tracks (<xref target="MoQTransport"/> Sect 2.3). As a consequence, the MOQT Object payload:</t>
      <ul spacing="normal">
        <li>
          <bcp14>MUST</bcp14> consist of a Segment Type Box (styp) followed by any number of media fragments. Each media fragment consists of a Movie Fragment Box (moof) followed by a Media Data Box (mdat). The Media Fragment Box (moof) <bcp14>MUST</bcp14> contain a Movie Fragment Header Box (mfhd) and Track Box (trak) with a Track ID (<tt>track_ID</tt>) matching a Track Box in the initialization fragment.</li>
        <li>
          <bcp14>MUST</bcp14> contain a single <xref target="ISOBMFF"/> track.</li>
        <li>
          <bcp14>MUST</bcp14> contain media content encoded in decode order. This implies an increasing decoding time stamp (DTS).</li>
        <li>
          <bcp14>MAY</bcp14> contain any number of frames/samples.</li>
        <li>
          <bcp14>MAY</bcp14> have gaps between frames/samples.</li>
        <li>
          <bcp14>MAY</bcp14> overlap with other objects. This means timestamps may be interleaved between objects.</li>
      </ul>
    </section>
    <section anchor="mapping-cmaf-objects-to-moqt-streams">
      <name>Mapping CMAF objects to MOQT Streams</name>
      <t>This specification defines two methods for mapping CMAF objects to MOQT objects:</t>
      <section anchor="cmaf-fragment-to-moqt-group">
        <name>CMAF Fragment to MOQT Group</name>
        <t>A complete CMAF Fragment (see <xref target="CMAF"/> sect 6.6.1) into a single object within each group. This results in there being a single GOP (Group of Pictures) in the media object and a single media object per group.</t>
      </section>
      <section anchor="cmaf-chunk-to-moqt-object">
        <name>CMAF Chunk to MOQT Object</name>
        <ul spacing="normal">
          <li>Each CMAF chunk (see <xref target="CMAF"/> sect 6.6.5) in a separate MOQT Object. All MOQT Objects holding chunks from the same parent fragment <bcp14>MUST</bcp14> belong to the same MOQT Group. A new MOQT Group <bcp14>MUST</bcp14> be generated for each new CMAF Fragment.</li>
        </ul>
      </section>
    </section>
    <section anchor="switching-sets">
      <name>Switching sets</name>
      <t>CMAF switching sets are a set of one or more CMAF tracks (3.2.1), where each track is an alternative encoding of the same source content, and are constrained to enable seamless track switching (3.3.9). If such switching sets are to be transported over MOQT, irrespective of the mapping of CMAF Objects to MOQT Streams, then MOQT Group numbers <bcp14>MUST</bcp14> be media time-aligned between the MOQT tracks. Media time-aligned requires that the presentation time of the first media sample contained within the first MOQT Object of each MOQT Group is identical.</t>
    </section>
    <section anchor="initialization-headers">
      <name>Initialization headers</name>
      <t>A CMAF header is sequence of CMAF constrained ISO BMFF boxes that do not reference any media samples (3.3.15), but are associated with a CMAF track (3.2.1) and necessary for the decoding of its CMAF fragments (3.1.1). The header for a given MOQT Track may be packaged in one of two ways:</t>
      <section anchor="binary-objects">
        <name>Binary objects</name>
        <t>As a binary blob which is communicated to the client via a mechanism  defined by the streaming format.</t>
      </section>
      <section anchor="moqt-tracks">
        <name>MOQT Tracks</name>
        <t>As a MOQT Track. In this case the track <bcp14>MUST</bcp14> have only a single GROUP and a single OBJECT. The payload of the object <bcp14>MUST</bcp14> be the complete initialization header. The mapping of this initialization MOQT TRACK to the MOQT track which it initializes is defined by the streaming format.</t>
      </section>
    </section>
    <section anchor="content-protection-and-encryption">
      <name>Content protection and encryption</name>
      <t>The media object payloads <bcp14>MAY</bcp14> be encrypted. If the content is encryptedm then Common Encryption <xref target="CENC"/> <bcp14>MUST</bcp14> be used. CMAF Track encruption <bcp14>MUST</bcp14> be applied following <xref target="CENC"/> Sectino 8.2. CENC with 'cbcs' mode (AES CBC with pattern encryption) is the <bcp14>RECOMMENDED</bcp14> encryption method.</t>
      <t>Any license acquisition information used to acquire CMAF decryption key(s) <bcp14>MUST</bcp14> be signalled by the Streaming Format, and not in the CMAF header.</t>
    </section>
    <section anchor="conventions-and-definitions-1">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="MoQTransport">
        <front>
          <title>Media over QUIC Transport</title>
          <author fullname="Luke Curley" initials="L." surname="Curley">
            <organization>Twitch</organization>
          </author>
          <author fullname="Kirill Pugin" initials="K." surname="Pugin">
            <organization>Meta</organization>
          </author>
          <author fullname="Suhas Nandakumar" initials="S." surname="Nandakumar">
            <organization>Cisco</organization>
          </author>
          <author fullname="Victor Vasiliev" initials="V." surname="Vasiliev">
            <organization>Google</organization>
          </author>
          <date day="26" month="May" year="2023"/>
          <abstract>
            <t>   This document defines the core behavior for Media over QUIC Transport
   (MOQT), a media transport protocol over QUIC.  MOQT allows a producer
   of media to publish data and have it consumed via subscription by a
   multiplicity of endpoints.  It supports intermediate content
   distribution networks and is designed for high scale and low latency
   distribution.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-lcurley-moq-transport-00"/>
      </reference>
      <reference anchor="ISOBMFF">
        <front>
          <title>Information technology -- Coding of audio-visual objects -- Part 12: ISO Base Media File Format</title>
          <author>
            <organization/>
          </author>
          <date year="2015" month="December"/>
        </front>
      </reference>
      <reference anchor="CMAF">
        <front>
          <title>Information technology -- Multimedia application format (MPEG-A) -- Part 19: Common media application format (CMAF) for segmented media</title>
          <author>
            <organization/>
          </author>
          <date year="2020" month="March"/>
        </front>
      </reference>
      <reference anchor="CENC">
        <front>
          <title>International Organization for Standardization - Information technology - MPEG systems technologies - Part 7: Common encryption in ISO base media file format files</title>
          <author>
            <organization/>
          </author>
          <date year="2020" month="December"/>
        </front>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <?line 135?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA7VY63IbtxX+v0+B0j8iZkzKlO3E5qSJKUqy1UqmLMmT8WQy
DbgLkoh2FwyAFc169C59lj5Zv3OAvVCW3c5k+kfcxZ775TsHGgwGidc+V2PR
m55PTsSFTG/kUpdLsTBWFOaPgbeydGtjfS9JpVdLY7djocuFSZLMpKUswJtZ
ufCDjc7lZkA8aSEX61rS4MmTxFXzQjunTem3azCcHl+fCPFIyNwZqNZlptYK
f0rfeyx6KtPeWC1zejmdHOIHxvROL69PeklZFXNlx0kGY8ZJakqnSle5sfC2
UsntWDxNpFUSUifrda5hM7Q6IctMXCqZD651oXrJxtibpTXVGnTn0CfF7FZZ
8e796bSX3KgtvmfjRAwoBPRDHiW3qqygU4gvcgoR/Ov9DPkUxddESeeF1DnO
Ie6VVn4xNHZJx9KmKxyvvF+78f4+UdGRvlXDmmyfDvbn1myc2gf/PvEttV9V
c3By0PfroA+aqBNRjhA53xHPxMPAO9TmAbb9r6ZyuPJF3ksSWfmVsRQfaBFi
UeV5KITezzrPxZnc9PgDrJel/iengBJyI+Fg+KRiQFjTK8lfhqkpeg8IPatu
lJhWNlfbHeYb/VGRj9mrJR0Qe5KUxhZQeMuJOjfvruv6RdUNjoZ5ynIGO6UN
ytOr2eH5ycmY5dctcYoyZ2mmFF6lq9LkZrkVg4GYmozSaxZCVpk2g1vtKpkL
M/9dpd4RxYW0XowOxiRZHEqnRKiWE50rccJigzNcyOLgyej5YHSAE+rD/9WM
8yr3qG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