<?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.7.18 (Ruby 3.3.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-wilaw-moq-cmafpackaging-01" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.22.0 -->
  <front>
    <title>CMAF Packaging for moq-transport</title>
    <seriesInfo name="Internet-Draft" value="draft-wilaw-moq-cmafpackaging-01"/>
    <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="2024" month="July" day="21"/>
    <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 <xref target="MoQTransport"/></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>
          <t><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.</t>
        </li>
        <li>
          <t><bcp14>MUST</bcp14> contain a single <xref target="ISOBMFF"/> track.</t>
        </li>
        <li>
          <t><bcp14>MUST</bcp14> contain media content encoded in decode order. This implies an increasing decoding time stamp (DTS).</t>
        </li>
        <li>
          <t><bcp14>MAY</bcp14> contain any number of frames/samples.</t>
        </li>
        <li>
          <t><bcp14>MAY</bcp14> have gaps between frames/samples.</t>
        </li>
        <li>
          <t><bcp14>MAY</bcp14> overlap with other objects. This means timestamps may be interleaved between objects.</t>
        </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>
            <t>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.</t>
          </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 encrypted then Common Encryption <xref target="CENC"/> <bcp14>MUST</bcp14> be used. CMAF Track encruption <bcp14>MUST</bcp14> be applied following <xref target="CENC"/> Section 8.2. using either CENC with 'cbcs' mode (AES 128-bit keys in Cipher-block chaining mode and pattern encruption) or 'cenc' mode (AES 128-bit keys in Counter Mode).</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>Discord</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>
          <author fullname="Ian Swett" initials="I." surname="Swett">
            <organization>Google</organization>
          </author>
          <date day="8" month="July" year="2024"/>
          <abstract>
            <t>   This document defines the core behavior for Media over QUIC Transport
   (MOQT), a media transport protocol designed to operate over QUIC and
   WebTransport, which have similar functionality.  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-ietf-moq-transport-05"/>
      </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:
H4sIAAAAAAAAA7VYbXPbNhL+zl+BUz7E6oRy5CRtoum1kWU78Z0dOZYznU6n
cwVJSEJNEioAWtF5/F/ut9wvu2cXfJFsJ3cznftikeAusC/PPrtwHMeR1z5X
I9GbnI9PxIVMr+VClwsxN1YU5o/YW1m6lbG+F6XSq4Wxm5HQ5dxEUWbSUhbQ
zayc+3itc7mOSSct5HzV7BQ/H0auSgrtnDal36ygcHp8dSLEEyFzZ3C0LjO1
UvhT+t4z0VOZ9sZqmdPL6fgQPzCmd3p5ddKLyqpIlB1FGYwZRakpnSpd5UbC
20pFNyPxIpJWSew6Xq1yDZtxqhOyzMSlknl8pQvVi9bGXi+sqVaQO8d5Ukxv
lBUfP51OetG12uB7NopETCGgH/IoulFlhTOF+KKmEMG/3k/Yn6L4jiRpvZA6
xzq2e6uVnw+MXdCytOkSy0vvV260v09StKRv1KAR26eF/cSatVP70N8nvYX2
yyqBJgd9vwl63EadhHKEyPmt7Vl4EHQH2jyitv/VVA6Wvsh7USQrvzSW4oNT
hJhXeR6A0PtJ57k4k+sef4D1stT/5BRQQq4lHAyfVB0QPumt5C+D1BS9RzY9
q66VmFQ2V5sd5Wv9WZGP2dsFLZB6F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